1 line
7.5 KiB
JavaScript
1 line
7.5 KiB
JavaScript
|
"use strict";exports.id=2332,exports.ids=[2332],exports.modules={30671:(e,a)=>{Object.defineProperty(a,"M",{enumerable:!0,get:function(){return function e(a,t){return t in a?a[t]:"then"in a&&"function"==typeof a.then?a.then(a=>e(a,t)):"function"==typeof a&&"default"===t?a:void 0}}})},77826:(e,a,t)=>{t.d(a,{A:()=>r});var l=t(8732),c=t(82015),i=t.n(c),n=t(79100);function r({user:e,userImage:a,setUserImage:t,database:c,className:r}){let d=i().useRef();return(0,l.jsxs)("div",{className:"card no-hover col"+(r?" "+r:""),children:[(0,l.jsx)("div",{className:"bg-white rounded-full overflow-hidden w-24 h-24",children:(0,l.jsx)("img",{src:a?"string"==typeof a?a:a.imageBase64Full:"/images/user-preset.png",alt:"Database Image",width:100,className:"w-full h-full object-cover",ref:d,"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=>{t(await (0,n.A)({imageInputFile:e.target.files[0],maxWidth:400}))}})]})]})}t(55158)},55158:(e,a,t)=>{t.d(a,{Ay:()=>r,PB:()=>d,fs:()=>s});var l=t(8732),c=t(58150),i=t(82015),n=t.n(i);function r({children:e,title:a,data:t,fullPage:i,wrapperClasses:r,closePopupDispatch:d,wrapperStyle:o,noContainer:p}){return i?(0,l.jsxs)("div",{className:"popup-bg overflow-hidden "+(r||""),"data-popupid":a||null,style:o,children:[p?(0,l.jsx)(n().Fragment,{children:e}):(0,l.jsx)("div",{className:"relative w-full h-full z-50","data-data":t?JSON.stringify(t):"",children:e}),(0,l.jsx)("button",{className:"popup-cancel-button fixed outlined gray",onClick:e=>{s(),d&&d()},children:(0,l.jsx)(c.A,{color:"white",size:20})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{s(),d&&d()}})]}):(0,l.jsxs)("div",{className:"popup-bg","data-popupid":a||null,children:[p?(0,l.jsx)(n().Fragment,{children:e}):(0,l.jsxs)("div",{className:"popup-content-container minimal-scrollbars","data-data":t?JSON.stringify(t):"",children:[e,(0,l.jsx)("button",{className:"outlined gray popup-cancel-button",onClick:e=>{s(),d&&d()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})})]}),p&&(0,l.jsx)("button",{className:"gray popup-cancel-button",onClick:e=>{s(),d&&d()},children:(0,l.jsx)("span",{className:"font-normal",children:"✖"})}),(0,l.jsx)("div",{className:"popup-canceller",onClick:e=>{s(),d&&d()}})]})}function d(e,a){let t=document.querySelector(`[data-popupid='${e}']`);t&&(t.style.display="flex",a&&a(t))}function s(e){document.querySelectorAll("[data-popupid]").forEach(e=>{e.style.display="none"}),e&&e()}},79100:(e,a,t)=>{t.d(a,{A:()=>l});async function l({imageInputFile:e,maxWidth:a}){let t,l,c=document.querySelector("[data-imagepreview='image']"),i=e.name.replace(/\..*/,""),n=document.createElement("canvas"),r=e.type,d=a||null,s=URL.createObjectURL(e),o=new Image;return o.src=s,t=await new Promise((e,a)=>{o.onerror=function(){URL.revokeObjectURL(this.src),console.log("Cannot load image")},o.onload=function(){if(URL.revokeObjectURL(this.src),d){let e=d/o.naturalWidth;n.width=o.naturalWidth<d?o.naturalWidth:d,n.height=o.naturalWidth<d?o.naturalHeight:o.naturalHeight*e}else n.width=o.naturalWidth,n.height=o.naturalHeight;let a=n.getContext("2d");a?.drawImage(o,0,0,n.width,n.height);let t=n.toDataURL(r,.95);c&&document.querySelectorAll("[data-imagepreview='image']").forEach(e=>{e.src=t}),e(t)}}),l=await new Promise((e,a)=>{n.toBlob(a=>{e(a?.size)},r,.95)}),{imageBase64:t.replace(/.*?base64,/,""),imageBase64Full:t,imageName:i,imageSize:l}}},42178:(e,a,t)=>{var l=t(24994);a.A=void 0;var c=l(t(30887)),i=t(8732);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")},26406:(e,a,t)=>{
|