dsql-admin/dsql-app/.local_dist/static/chunks/4565-e849d55f03e474f9.js

1 line
6.0 KiB
JavaScript
Raw Normal View History

2024-12-09 09:39:09 +00:00
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[4565],{4791:(e,a,t)=>{t.d(a,{A:()=>n});var l=t(4848),i=t(6540),c=t(5113);function n(e){let{user:a,userImage:t,setUserImage:n,database:s,className:d}=e,r=i.useRef();return(0,l.jsxs)("div",{className:"card no-hover col"+(d?" "+d:""),children:[(0,l.jsx)("div",{className:"bg-white rounded-full overflow-hidden w-24 h-24",children:(0,l.jsx)("img",{src:t?"string"==typeof t?t:t.imageBase64Full:"/images/user-preset.png",alt:"Database Image",width:100,className:"w-full h-full object-cover",ref:r,"data-imagepreview":"image"})}),(0,l.jsxs)("div",{className:"w-full flex-col image-selector-wrapper",children:[(0,l.jsx)("div",{className:"button outlined secondary w-full whitespace-normal",onClick:e=>{e.target.closest(".image-selector-wrapper").querySelector("input").click()},children:"Upload Image"}),(0,l.jsx)("input",{type:"file",accept:".png,.jpg,.jpeg,.webp",placeholder:"Choose Database Image",className:"hidden",onChange:async e=>{n(await (0,c.A)({imageInputFile:e.target.files[0],maxWidth:400}))}})]})]})}t(5165)},5165:(e,a,t)=>{t.d(a,{Ay:()=>n,PB:()=>s,fs:()=>d});var l=t(4848),i=t(6897),c=t(6540);function n(e){let{children:a,title:t,data:n,fullPage:s,wrapperClasses:r,closePopupDispatch:o,wrapperStyle:p,noContainer:h}=e;return s?(0,l.jsxs)("div",{className:"popup-bg overflow-hidden "+(r||""),"data-popupid":t||null,style:p,children:[h?(0,l.jsx)(c.Fragment,{children:a}):(0,l.jsx)("div",{className:"relative w-full h-full z-50","data-data":n?JSON.stringify(n):"",children:a}),(0,l.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:e=>{d(),o&&o()},children:(0,l.jsx)(i.A,{color:"white",size:20})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{d(),o&&o()}})]}):(0,l.jsxs)("div",{className:"popup-bg","data-popupid":t||null,children:[h?(0,l.jsx)(c.Fragment,{children:a}):(0,l.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":n?JSON.stringify(n):"",children:[a,(0,l.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:e=>{d(),o&&o()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})})]}),h&&(0,l.jsx)("button",{className:"gray popup-cancel-button",onClick:e=>{d(),o&&o()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{d(),o&&o()}})]})}function s(e,a){let t=document.querySelector("[data-popupid='".concat(e,"']"));t&&(t.style.display="flex",a&&a(t))}function d(e){document.querySelectorAll("[data-popupid]").forEach(e=>{e.style.display="none"}),e&&e()}},5113:(e,a,t)=>{t.d(a,{A:()=>l});async function l(e){let a,t,{imageInputFile:l,maxWidth:i}=e,c=document.querySelector("[data-imagepreview='image']"),n=l.name.replace(/\..*/,""),s=document.createElement("canvas"),d=l.type,r=i||null,o=URL.createObjectURL(l),p=new Image;return p.src=o,a=await new Promise((e,a)=>{p.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},p.onload=function(){if(URL.revokeObjectURL(this.src),r){let e=r/p.naturalWidth;s.width=p.naturalWidth<r?p.naturalWidth:r,s.height=p.naturalWidth<r?p.naturalHeight:p.naturalHeight*e}else s.width=p.naturalWidth,s.height=p.naturalHeight;let a=s.getContext("2d");null==a||a.drawImage(p,0,0,s.width,s.height);let t=s.toDataURL(d,.95);c&&document.querySelectorAll("[data-imagepreview='image']").forEach(e=>{e.src=t}),e(t)}}),t=await new Promise((e,a)=>{s.toBlob(a=>{e(null==a?void 0:a.size)},d,.95)}),{imageBase64:a.replace(/.*?base64,/,""),imageBase64Full:a,imageName:n,imageSize:t}}},7216:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(5737).A)("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]])},5014:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(5737).A)("BookText",[["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H20v20H6.5a2.5 2.5 0 0 1 0-5H20",key:"t4utmx"}],["path",{d:"M8 7h6",key:"1f0q6e"}],["path",{d:"M8 11h8",key:"vwpz6n"}]])},9140:(e,a,t)=>{t.d(a,{A:()=>l});let l=(0,t(5737).A)("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"