1 line
6.9 KiB
JavaScript
1 line
6.9 KiB
JavaScript
|
"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5580],{74791:(e,a,l)=>{l.d(a,{A:()=>n});var t=l(74848),c=l(96540),i=l(65113);function n(e){let{user:a,userImage:l,setUserImage:n,database:s,className:d}=e,r=c.useRef();return(0,t.jsxs)("div",{className:"card no-hover col"+(d?" "+d:""),children:[(0,t.jsx)("div",{className:"bg-white rounded-full overflow-hidden w-24 h-24",children:(0,t.jsx)("img",{src:l?"string"==typeof l?l:l.imageBase64Full:"/images/user-preset.png",alt:"Database Image",width:100,className:"w-full h-full object-cover",ref:r,"data-imagepreview":"image"})}),(0,t.jsxs)("div",{className:"w-full flex-col image-selector-wrapper",children:[(0,t.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,t.jsx)("input",{type:"file",accept:".png,.jpg,.jpeg,.webp",placeholder:"Choose Database Image",className:"hidden",onChange:async e=>{n(await (0,i.A)({imageInputFile:e.target.files[0],maxWidth:400}))}})]})]})}l(45165)},45165:(e,a,l)=>{l.d(a,{Ay:()=>n,PB:()=>s,fs:()=>d});var t=l(74848),c=l(76897),i=l(96540);function n(e){let{children:a,title:l,data:n,fullPage:s,wrapperClasses:r,closePopupDispatch:o,wrapperStyle:p,noContainer:h}=e;return s?(0,t.jsxs)("div",{className:"popup-bg overflow-hidden "+(r||""),"data-popupid":l||null,style:p,children:[h?(0,t.jsx)(i.Fragment,{children:a}):(0,t.jsx)("div",{className:"relative w-full h-full z-50","data-data":n?JSON.stringify(n):"",children:a}),(0,t.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:e=>{d(),o&&o()},children:(0,t.jsx)(c.A,{color:"white",size:20})}),(0,t.jsx)("div",{className:"popup-canceller",onClick:e=>{d(),o&&o()}})]}):(0,t.jsxs)("div",{className:"popup-bg","data-popupid":l||null,children:[h?(0,t.jsx)(i.Fragment,{children:a}):(0,t.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":n?JSON.stringify(n):"",children:[a,(0,t.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:e=>{d(),o&&o()},children:(0,t.jsx)("span",{className:"font-normal",children:"✖"})})]}),h&&(0,t.jsx)("button",{className:"gray popup-cancel-button",onClick:e=>{d(),o&&o()},children:(0,t.jsx)("span",{className:"font-normal",children:"✖"})}),(0,t.jsx)("div",{className:"popup-canceller",onClick:e=>{d(),o&&o()}})]})}function s(e,a){let l=document.querySelector("[data-popupid='".concat(e,"']"));l&&(l.style.display="flex",a&&a(l))}function d(e){document.querySelectorAll("[data-popupid]").forEach(e=>{e.style.display="none"}),e&&e()}},65113:(e,a,l)=>{l.d(a,{A:()=>t});async function t(e){let a,l,{imageInputFile:t,maxWidth:c}=e,i=document.querySelector("[data-imagepreview='image']"),n=t.name.replace(/\..*/,""),s=document.createElement("canvas"),d=t.type,r=c||null,o=URL.createObjectURL(t),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 l=s.toDataURL(d,.95);i&&document.querySelectorAll("[data-imagepreview='image']").forEach(e=>{e.src=l}),e(l)}}),l=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:l}}},86625:(e,a,l)=>{var t=l(24994);a.A=void 0;var c=t(l(44888)),i=l(74848);a.A=(0,c.default)((0,i.jsx)("path",{d:"M16.62 2.99c-.49-.49-1.28-.49-1.77 0L6.54 11.3c-.39.39-.39 1.02 0 1.41l8.31 8.31c.49.49 1.28.49 1.77 0s.49-1.28 0-1.77L9.38 12l7.25-7.25c.48-.48.48-1.28-.01-1.76"}),"ArrowBackIosRounded")},34181:(e,a,l)=>{var t=l(24994);a.A=void 0;var c=t(l(44888)),i=l(74848);a.A=(0,c.default)([(0,i.jsx)("path",{d:"M22 15c0-1.66-1.34-3-3-3h-1.5v-.5C17.5 8.46 15.04 6 12 6c-.77 0-1.49.17-2.16.46L20.79 17.
|