You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
topnotch_website/public/js/filament/forms/components/file-upload.js

124 lines
318 KiB
JavaScript

2 months ago
var Jl=Object.defineProperty;var er=(e,t)=>{for(var i in t)Jl(e,i,{get:t[i],enumerable:!0})};var na={};er(na,{FileOrigin:()=>zt,FileStatus:()=>Et,OptionTypes:()=>Gi,Status:()=>no,create:()=>ut,destroy:()=>ft,find:()=>Wi,getOptions:()=>Hi,parse:()=>Ui,registerPlugin:()=>Ie,setOptions:()=>Dt,supported:()=>Vi});var tr=e=>e instanceof HTMLElement,ir=(e,t=[],i=[])=>{let a={...e},n=[],o=[],l=()=>({...a}),r=()=>{let f=[...n];return n.length=0,f},s=()=>{let f=[...o];o.length=0,f.forEach(({type:h,data:g})=>{p(h,g)})},p=(f,h,g)=>{if(g&&!document.hidden){o.push({type:f,data:h});return}u[f]&&u[f](h),n.push({type:f,data:h})},c=(f,...h)=>m[f]?m[f](...h):null,d={getState:l,processActionQueue:r,processDispatchQueue:s,dispatch:p,query:c},m={};t.forEach(f=>{m={...f(a),...m}});let u={};return i.forEach(f=>{u={...f(p,c,a),...u}}),d},ar=(e,t,i)=>{if(typeof i=="function"){e[t]=i;return}Object.defineProperty(e,t,{...i})},te=(e,t)=>{for(let i in e)e.hasOwnProperty(i)&&t(i,e[i])},We=e=>{let t={};return te(e,i=>{ar(t,i,e[i])}),t},se=(e,t,i=null)=>{if(i===null)return e.getAttribute(t)||e.hasAttribute(t);e.setAttribute(t,i)},nr="http://www.w3.org/2000/svg",or=["svg","path"],Oa=e=>or.includes(e),ni=(e,t,i={})=>{typeof t=="object"&&(i=t,t=null);let a=Oa(e)?document.createElementNS(nr,e):document.createElement(e);return t&&(Oa(e)?se(a,"class",t):a.className=t),te(i,(n,o)=>{se(a,n,o)}),a},lr=e=>(t,i)=>{typeof i<"u"&&e.children[i]?e.insertBefore(t,e.children[i]):e.appendChild(t)},rr=(e,t)=>(i,a)=>(typeof a<"u"?t.splice(a,0,i):t.push(i),i),sr=(e,t)=>i=>(t.splice(t.indexOf(i),1),i.element.parentNode&&e.removeChild(i.element),i),cr=(()=>typeof window<"u"&&typeof window.document<"u")(),En=()=>cr,dr=En()?ni("svg"):{},pr="children"in dr?e=>e.children.length:e=>e.childNodes.length,bn=(e,t,i,a)=>{let n=i[0]||e.left,o=i[1]||e.top,l=n+e.width,r=o+e.height*(a[1]||1),s={element:{...e},inner:{left:e.left,top:e.top,right:e.right,bottom:e.bottom},outer:{left:n,top:o,right:l,bottom:r}};return t.filter(p=>!p.isRectIgnored()).map(p=>p.rect).forEach(p=>{Pa(s.inner,{...p.inner}),Pa(s.outer,{...p.outer})}),Da(s.inner),s.outer.bottom+=s.element.marginBottom,s.outer.right+=s.element.marginRight,Da(s.outer),s},Pa=(e,t)=>{t.top+=e.top,t.right+=e.left,t.bottom+=e.top,t.left+=e.left,t.bottom>e.bottom&&(e.bottom=t.bottom),t.right>e.right&&(e.right=t.right)},Da=e=>{e.width=e.right-e.left,e.height=e.bottom-e.top},$e=e=>typeof e=="number",mr=(e,t,i,a=.001)=>Math.abs(e-t)<a&&Math.abs(i)<a,ur=({stiffness:e=.5,damping:t=.75,mass:i=10}={})=>{let a=null,n=null,o=0,l=!1,p=We({interpolate:(c,d)=>{if(l)return;if(!($e(a)&&$e(n))){l=!0,o=0;return}let m=-(n-a)*e;o+=m/i,n+=o,o*=t,mr(n,a,o)||d?(n=a,o=0,l=!0,p.onupdate(n),p.oncomplete(n)):p.onupdate(n)},target:{set:c=>{if($e(c)&&!$e(n)&&(n=c),a===null&&(a=c,n=c),a=c,n===a||typeof a>"u"){l=!0,o=0,p.onupdate(n),p.oncomplete(n);return}l=!1},get:()=>a},resting:{get:()=>l},onupdate:c=>{},oncomplete:c=>{}});return p};var fr=e=>e<.5?2*e*e:-1+(4-2*e)*e,hr=({duration:e=500,easing:t=fr,delay:i=0}={})=>{let a=null,n,o,l=!0,r=!1,s=null,c=We({interpolate:(d,m)=>{l||s===null||(a===null&&(a=d),!(d-a<i)&&(n=d-a-i,n>=e||m?(n=1,o=r?0:1,c.onupdate(o*s),c.oncomplete(o*s),l=!0):(o=n/e,c.onupdate((n>=0?t(r?1-o:o):0)*s))))},target:{get:()=>r?0:s,set:d=>{if(s===null){s=d,c.onupdate(d),c.oncomplete(d);return}d<s?(s=1,r=!0):(r=!1,s=d),l=!1,a=null}},resting:{get:()=>l},onupdate:d=>{},oncomplete:d=>{}});return c},Fa={spring:ur,tween:hr},gr=(e,t,i)=>{let a=e[t]&&typeof e[t][i]=="object"?e[t][i]:e[t]||e,n=typeof a=="string"?a:a.type,o=typeof a=="object"?{...a}:{};return Fa[n]?Fa[n](o):null},ji=(e,t,i,a=!1)=>{t=Array.isArray(t)?t:[t],t.forEach(n=>{e.forEach(o=>{let l=o,r=()=>i[o],s=p=>i[o]=p;typeof o=="object"&&(l=o.key,r=o.getter||r,s=o.setter||s),!(n[l]&&!a)&&(n[l]={get:r,set:s})})})},Er=({mixinConfig:e,viewProps:t,viewInternalAPI:i,viewExternalAPI:a})=>{let n={...t},o=[];return te(e,(l,r)=>{let s=gr(r);if(!s)return;s.onupdate=c=>{t[l]=c},s.target=n[l],ji([{key:l,setter:c=>{s.target!==c&&(s.target=c)},getter:()=>t[l]}],[i,a],t,!0),o.push(s)}),{write:l=>{let r=document.hidden
`);for(let a of i){let n=gs(a);if(n){t.name=n;continue}let o=Es(a);if(o){t.size=o;continue}let l=bs(a);if(l){t.source=l;continue}}return t},Ts=e=>{let t={source:null,complete:!1,progress:0,size:null,timestamp:null,duration:0,request:null},i=()=>t.progress,a=()=>{t.request&&t.request.abort&&t.request.abort()},n=()=>{let r=t.source;l.fire("init",r),r instanceof File?l.fire("load",r):r instanceof Blob?l.fire("load",ht(r,r.name)):Di(r)?l.fire("load",hs(r)):o(r)},o=r=>{if(!e){l.fire("error",{type:"error",body:"Can't load URL",code:400});return}t.timestamp=Date.now(),t.request=e(r,s=>{t.duration=Date.now()-t.timestamp,t.complete=!0,s instanceof Blob&&(s=ht(s,s.name||Ft(r))),l.fire("load",s instanceof Blob?s:s?s.body:null)},s=>{l.fire("error",typeof s=="string"?{type:"error",code:0,body:s}:s)},(s,p,c)=>{if(c&&(t.size=c),t.duration=Date.now()-t.timestamp,!s){t.progress=null;return}t.progress=p/c,l.fire("progress",t.progress)},()=>{l.fire("abort")},s=>{let p=Xi(typeof s=="string"?s:s.headers);l.fire("meta",{size:t.size||p.size,filename:p.name,source:p.source})})},l={...pi(),setSource:r=>t.source=r,getProgress:i,abort:a,load:n};return l},Ua=e=>/GET|HEAD/.test(e),Ze=(e,t,i)=>{let a={onheaders:()=>{},onprogress:()=>{},onload:()=>{},ontimeout:()=>{},onerror:()=>{},onabort:()=>{},abort:()=>{n=!0,l.abort()}},n=!1,o=!1;i={method:"POST",headers:{},withCredentials:!1,...i},t=encodeURI(t),Ua(i.method)&&e&&(t=`${t}${encodeURIComponent(typeof e=="string"?e:JSON.stringify(e))}`);let l=new XMLHttpRequest,r=Ua(i.method)?l:l.upload;return r.onprogress=s=>{n||a.onprogress(s.lengthComputable,s.loaded,s.total)},l.onreadystatechange=()=>{l.readyState<2||l.readyState===4&&l.status===0||o||(o=!0,a.onheaders(l))},l.onload=()=>{l.status>=200&&l.status<300?a.onload(l):a.onerror(l)},l.onerror=()=>a.onerror(l),l.onabort=()=>{n=!0,a.onabort()},l.ontimeout=()=>a.ontimeout(l),l.open(i.method,t,!0),gt(i.timeout)&&(l.timeout=i.timeout),Object.keys(i.headers).forEach(s=>{let p=unescape(encodeURIComponent(i.headers[s]));l.setRequestHeader(s,p)}),i.responseType&&(l.responseType=i.responseType),i.withCredentials&&(l.withCredentials=!0),l.send(e),a},ie=(e,t,i,a)=>({type:e,code:t,body:i,headers:a}),Ke=e=>t=>{e(ie("error",0,"Timeout",t.getAllResponseHeaders()))},Wa=e=>/\?/.test(e),Pt=(...e)=>{let t="";return e.forEach(i=>{t+=Wa(t)&&Wa(i)?i.replace(/\?/,"&"):i}),t},wi=(e="",t)=>{if(typeof t=="function")return t;if(!t||!fe(t.url))return null;let i=t.onload||(n=>n),a=t.onerror||(n=>null);return(n,o,l,r,s,p)=>{let c=Ze(n,Pt(e,t.url),{...t,responseType:"blob"});return c.onload=d=>{let m=d.getAllResponseHeaders(),u=Xi(m).name||Ft(n);o(ie("load",d.status,t.method==="HEAD"?null:ht(i(d.response),u),m))},c.onerror=d=>{l(ie("error",d.status,a(d.response)||d.statusText,d.getAllResponseHeaders()))},c.onheaders=d=>{p(ie("headers",d.status,null,d.getAllResponseHeaders()))},c.ontimeout=Ke(l),c.onprogress=r,c.onabort=s,c}},xe={QUEUED:0,COMPLETE:1,PROCESSING:2,ERROR:3,WAITING:4},vs=(e,t,i,a,n,o,l,r,s,p,c)=>{let d=[],{chunkTransferId:m,chunkServer:u,chunkSize:f,chunkRetryDelays:h}=c,g={serverId:m,aborted:!1},v=t.ondata||(S=>S),E=t.onload||((S,F)=>F==="HEAD"?S.getResponseHeader("Upload-Offset"):S.response),T=t.onerror||(S=>null),I=S=>{let F=new FormData;ce(n)&&F.append(i,JSON.stringify(n));let R=typeof t.headers=="function"?t.headers(a,n):{...t.headers,"Upload-Length":a.size},L={...t,headers:R},z=Ze(v(F),Pt(e,t.url),L);z.onload=D=>S(E(D,L.method)),z.onerror=D=>l(ie("error",D.status,T(D.response)||D.statusText,D.getAllResponseHeaders())),z.ontimeout=Ke(l)},y=S=>{let F=Pt(e,u.url,g.serverId),L={headers:typeof t.headers=="function"?t.headers(g.serverId):{...t.headers},method:"HEAD"},z=Ze(null,F,L);z.onload=D=>S(E(D,L.method)),z.onerror=D=>l(ie("error",D.status,T(D.response)||D.statusText,D.getAllResponseHeaders())),z.ontimeout=Ke(l)},b=Math.floor(a.size/f);for(let S=0;S<=b;S++){let F=S*f,R=a.slice(F,F+f,"application/offset+octet-stream");d[S]={index:S,size:R.size,offset:F,data:R,file:a,progress:0,retries:[...h],status:xe.QUEUED,error:null,request:null,timeout:null}}let w=()=>o(g.serverId),
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var bi=typeof window<"u"&&typeof window.document<"u",Fe=bi?window:{},Ea=bi&&Fe.document.documentElement?"ontouchstart"in Fe.document.documentElement:!1,ba=bi?"PointerEvent"in Fe:!1,K="cropper",Ta="all",Ro="crop",wo="move",So="zoom",at="e",nt="w",bt="s",He="n",Ct="ne",Nt="nw",Bt="se",kt="sw",ca="".concat(K,"-crop"),ro="".concat(K,"-disabled"),be="".concat(K,"-hidden"),so="".concat(K,"-hide"),fp="".concat(K,"-invisible"),Ei="".concat(K,"-modal"),da="".concat(K,"-move"),Gt="".concat(K,"Action"),hi="".concat(K,"Preview"),va="crop",Lo="move",Ao="none",pa="crop",ma="cropend",ua="cropmove",fa="cropstart",co="dblclick",hp=Ea?"touchstart":"mousedown",gp=Ea?"touchmove":"mousemove",Ep=Ea?"touchend touchcancel":"mouseup",po=ba?"pointerdown":hp,mo=ba?"pointermove":gp,uo=ba?"pointerup pointercancel":Ep,fo="ready",ho="resize",go="wheel",ha="zoom",Eo="image/jpeg",bp=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Tp=/^data:/,vp=/^data:image\/jpeg;base64,/,Ip=/^img|canvas$/i,Mo=200,Oo=100,bo={viewMode:0,dragMode:va,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:Mo,minContainerHeight:Oo,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},xp='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>',yp=Number.isNaN||Fe.isNaN;function j(e){return typeof e=="number"&&!yp(e)}var To=function(t){return t>0&&t<1/0};function oa(e){return typeof e>"u"}function ot(e){return ra(e)==="object"&&e!==null}var _p=Object.prototype.hasOwnProperty;function Tt(e){if(!ot(e))return!1;try{var t=e.constructor,i=t.prototype;return t&&i&&_p.call(i,"isPrototypeOf")}catch{return!1}}function Ee(e){return typeof e=="function"}var Rp=Array.prototype.slice;function Po(e){return Array.from?Array.from(e):Rp.call(e)}function oe(e,t){return e&&Ee(t)&&(Array.isArray(e)||j(e.length)?Po(e).forEach(function(i,a){t.call(e,i,a,e)}):ot(e)&&Object.keys(e).forEach(function(i){t.call(e,e[i],i,e)})),e}var J=Object.assign||function(t){for(var i=arguments.length,a=new Array(i>1?i-1:0),n=1;n<i;n++)a[n-1]=arguments[n];return ot(t)&&a.length>0&&a.forEach(function(o){ot(o)&&Object.keys(o).forEach(function(l){t[l]=o[l]})}),t},wp=/\.\d*(?:0|9){12}\d*$/;function It(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return wp.test(e)?Math.round(e*t)/t:e}var Sp=/^width|height|left|top|marginLeft|marginTop$/;function je(e,t){var i=e.style;oe(t,function(a,n){Sp.test(n)&&j(a)&&(a="".concat(a,"px")),i[n]=a})}function Lp(e,t){return e.classList?e.classL
<defs>
<radialGradient id="gradient-__UID__" cx=".5" cy="1.25" r="1.15">
<stop offset='50%' stop-color='#000000'/>
<stop offset='56%' stop-color='#0a0a0a'/>
<stop offset='63%' stop-color='#262626'/>
<stop offset='69%' stop-color='#4f4f4f'/>
<stop offset='75%' stop-color='#808080'/>
<stop offset='81%' stop-color='#b1b1b1'/>
<stop offset='88%' stop-color='#dadada'/>
<stop offset='94%' stop-color='#f6f6f6'/>
<stop offset='100%' stop-color='#ffffff'/>
</radialGradient>
<mask id="mask-__UID__">
<rect x="0" y="0" width="500" height="200" fill="url(#gradient-__UID__)"></rect>
</mask>
</defs>
<rect x="0" width="500" height="200" fill="currentColor" mask="url(#mask-__UID__)"></rect>
</svg>`,ll=0,Gm=e=>e.utils.createView({name:"image-preview-overlay",tag:"div",ignoreRect:!0,create:({root:t,props:i})=>{let a=Vm;if(document.querySelector("base")){let n=new URL(window.location.href.replace(window.location.hash,"")).href;a=a.replace(/url\(\#/g,"url("+n+"#")}ll++,t.element.classList.add(`filepond--image-preview-overlay-${i.status}`),t.element.innerHTML=a.replace(/__UID__/g,ll)},mixins:{styles:["opacity"],animations:{opacity:{type:"spring",mass:25}}}}),Um=function(){self.onmessage=e=>{createImageBitmap(e.data.message.file).then(t=>{self.postMessage({id:e.data.id,message:t},[t])})}},Wm=function(){self.onmessage=e=>{let t=e.data.message.imageData,i=e.data.message.colorMatrix,a=t.data,n=a.length,o=i[0],l=i[1],r=i[2],s=i[3],p=i[4],c=i[5],d=i[6],m=i[7],u=i[8],f=i[9],h=i[10],g=i[11],v=i[12],E=i[13],T=i[14],I=i[15],y=i[16],b=i[17],w=i[18],x=i[19],_=0,P=0,O=0,M=0,C=0;for(;_<n;_+=4)P=a[_]/255,O=a[_+1]/255,M=a[_+2]/255,C=a[_+3]/255,a[_]=Math.max(0,Math.min((P*o+O*l+M*r+C*s+p)*255,255)),a[_+1]=Math.max(0,Math.min((P*c+O*d+M*m+C*u+f)*255,255)),a[_+2]=Math.max(0,Math.min((P*h+O*g+M*v+C*E+T)*255,255)),a[_+3]=Math.max(0,Math.min((P*I+O*y+M*b+C*w+x)*255,255));self.postMessage({id:e.data.id,message:t},[t.data.buffer])}},Hm=(e,t)=>{let i=new Image;i.onload=()=>{let a=i.naturalWidth,n=i.naturalHeight;i=null,t(a,n)},i.src=e},jm={1:()=>[1,0,0,1,0,0],2:e=>[-1,0,0,1,e,0],3:(e,t)=>[-1,0,0,-1,e,t],4:(e,t)=>[1,0,0,-1,0,t],5:()=>[0,1,1,0,0,0],6:(e,t)=>[0,1,-1,0,t,0],7:(e,t)=>[0,-1,-1,0,t,e],8:e=>[0,-1,1,0,0,e]},Ym=(e,t,i,a)=>{a!==-1&&e.transform.apply(e,jm[a](t,i))},qm=(e,t,i,a)=>{t=Math.round(t),i=Math.round(i);let n=document.createElement("canvas");n.width=t,n.height=i;let o=n.getContext("2d");return a>=5&&a<=8&&([t,i]=[i,t]),Ym(o,t,i,a),o.drawImage(e,0,0,t,i),n},cl=e=>/^image/.test(e.type)&&!/svg/.test(e.type),$m=10,Xm=10,Qm=e=>{let t=Math.min($m/e.width,Xm/e.height),i=document.createElement("canvas"),a=i.getContext("2d"),n=i.width=Math.ceil(e.width*t),o=i.height=Math.ceil(e.height*t);a.drawImage(e,0,0,n,o);let l=null;try{l=a.getImageData(0,0,n,o).data}catch{return null}let r=l.length,s=0,p=0,c=0,d=0;for(;d<r;d+=4)s+=l[d]*l[d],p+=l[d+1]*l[d+1],c+=l[d+2]*l[d+2];return s=wa(s,r),p=wa(p,r),c=wa(c,r),{r:s,g:p,b:c}},wa=(e,t)=>Math.floor(Math.sqrt(e/(t/4))),Zm=(e,t)=>(t=t||document.createElement("canvas"),t.width=e.width,t.height=e.height,t.getContext("2d").drawImage(e,0,0),t),Km=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(new Uint8ClampedArray(e.data)),t},Jm=e=>new Promise((t,i)=>{let a=new Image;a.crossOrigin="Anonymous",a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),eu=e=>{let t=Gm(e),i=km(e),{createWorker:a}=e.utils,n=(E,T,I)=>new Promise(y=>{E.ref.imageData||(E.ref.imageData=I.getContext("2d").getImageData(0,0,I.width,I.height));let b=Km(E.ref.imageData);if(!T||T.length!==20)return I.getContext("2d").putImageData(b,0,0),y();let w=a(Wm);w.post({imageData:b,colorMatrix:T},x=>{I.getContext("2d").putImageData(x,0,0),w.terminate(),y()},[b.data.buffer])}),o=(E,T)=>{E.removeChildView(T),T.image.width=1,T.image.height=1,T._destroy()},l=({root:E})=>{let T=E.ref.images.shift();return T.opacity=0,T.translateY=-15,E.ref.imageViewBin.push(T),T},r=({root:E,props:T,image:I})=>{let y=T.id,b=E.query("GET_ITEM",{id:y});if(!b)return;let w=b.getMetadata("crop")||{center:{x:.5,y:.5},flip:{horizontal:!1,vertical:!1},zoom:1,rotation:0,aspectRatio:null},x=E.query("GET_IMAGE_TRANSFORM_CANVAS_BACKGROUND_COLOR"),_,P,O=!1;E.query("GET_IMAGE_PREVIEW_MARKUP_SHOW")&&(_=b.getMetadata("markup")||[],P=b.getMetadata("resize"),O=!0);let M=E.appendChildView(E.createChildView(i,{id:y,image:I,crop:w,resize:P,markup:_,dirty:O,background:x,opacity:0,scaleX:1.15,scaleY:1.15,translateY:15}),E.childViews.length);E.ref.images.push(M),M.opacity=1,M.scaleX=1,M.scaleY=1,M.translateY=0,setTimeout(()=>{E.dispatch("DID_IMAGE_PREVIEW_SHOW",{id:y})},250)},s=({root:E,props:T})=>{let I=E.query("GET_ITEM",{id:T.id});if(!I)return;let y=E.ref.images[E.ref.images.length-1]
`+H.outerHTML+`
`},""),w=`
<g>${w.replace(/&nbsp;/g," ")}</g>
`}let x=t.aspectRatio||b/y,_=y,P=_*x,O=typeof t.scaleToFit>"u"||t.scaleToFit,M=t.center?t.center.x:.5,C=t.center?t.center.y:.5,S=Tl({width:y,height:b},vl({width:_,height:P},x),t.rotation,O?{x:M,y:C}:{x:.5,y:.5}),F=t.zoom*S,R=t.rotation*(180/Math.PI),L={x:_*.5,y:P*.5},z={x:L.x-y*M,y:L.y-b*C},D=[`rotate(${R} ${L.x} ${L.y})`,`translate(${L.x} ${L.y})`,`scale(${F})`,`translate(${-L.x} ${-L.y})`,`translate(${z.x} ${z.y})`],k=t.flip&&t.flip.horizontal,B=t.flip&&t.flip.vertical,X=[`scale(${k?-1:1} ${B?-1:1})`,`translate(${k?-y:0} ${B?-b:0})`],q=`<?xml version="1.0" encoding="UTF-8"?>
<svg width="${_}${v}" height="${P}${E}"
viewBox="0 0 ${_} ${P}" ${o?'style="background:'+o+'" ':""}
preserveAspectRatio="xMinYMin"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns="http://www.w3.org/2000/svg">
<!-- Generated by PQINA - https://pqina.nl/ -->
<title>${d?d.textContent:""}</title>
<g transform="${D.join(" ")}">
<g transform="${X.join(" ")}">
${p.outerHTML}${w}
</g>
</g>
</svg>`;n(q)},l.readAsText(e)}),Nu=e=>{let t;try{t=new ImageData(e.width,e.height)}catch{t=document.createElement("canvas").getContext("2d").createImageData(e.width,e.height)}return t.data.set(e.data),t},Bu=()=>{let e={resize:c,filter:p},t=(d,m)=>(d.forEach(u=>{m=e[u.type](m,u.data)}),m),i=(d,m)=>{let u=d.transforms,f=null;if(u.forEach(h=>{h.type==="filter"&&(f=h)}),f){let h=null;u.forEach(g=>{g.type==="resize"&&(h=g)}),h&&(h.data.matrix=f.data,u=u.filter(g=>g.type!=="filter"))}m(t(u,d.imageData))};self.onmessage=d=>{i(d.data.message,m=>{self.postMessage({id:d.data.id,message:m},[m.data.buffer])})};let a=1,n=1,o=1;function l(d,m,u){let f=m[d]/255,h=m[d+1]/255,g=m[d+2]/255,v=m[d+3]/255,E=f*u[0]+h*u[1]+g*u[2]+v*u[3]+u[4],T=f*u[5]+h*u[6]+g*u[7]+v*u[8]+u[9],I=f*u[10]+h*u[11]+g*u[12]+v*u[13]+u[14],y=f*u[15]+h*u[16]+g*u[17]+v*u[18]+u[19],b=Math.max(0,E*y)+a*(1-y),w=Math.max(0,T*y)+n*(1-y),x=Math.max(0,I*y)+o*(1-y);m[d]=Math.max(0,Math.min(1,b))*255,m[d+1]=Math.max(0,Math.min(1,w))*255,m[d+2]=Math.max(0,Math.min(1,x))*255}let r=self.JSON.stringify([1,0,0,0,0,0,1,0,0,0,0,0,1,0,0,0,0,0,1,0]);function s(d){return self.JSON.stringify(d||[])===r}function p(d,m){if(!m||s(m))return d;let u=d.data,f=u.length,h=m[0],g=m[1],v=m[2],E=m[3],T=m[4],I=m[5],y=m[6],b=m[7],w=m[8],x=m[9],_=m[10],P=m[11],O=m[12],M=m[13],C=m[14],S=m[15],F=m[16],R=m[17],L=m[18],z=m[19],D=0,k=0,B=0,X=0,q=0,Q=0,pe=0,G=0,H=0,Y=0,le=0,ee=0;for(;D<f;D+=4)k=u[D]/255,B=u[D+1]/255,X=u[D+2]/255,q=u[D+3]/255,Q=k*h+B*g+X*v+q*E+T,pe=k*I+B*y+X*b+q*w+x,G=k*_+B*P+X*O+q*M+C,H=k*S+B*F+X*R+q*L+z,Y=Math.max(0,Q*H)+a*(1-H),le=Math.max(0,pe*H)+n*(1-H),ee=Math.max(0,G*H)+o*(1-H),u[D]=Math.max(0,Math.min(1,Y))*255,u[D+1]=Math.max(0,Math.min(1,le))*255,u[D+2]=Math.max(0,Math.min(1,ee))*255;return d}function c(d,m){let{mode:u="contain",upscale:f=!1,width:h,height:g,matrix:v}=m;if(v=!v||s(v)?null:v,!h&&!g)return p(d,v);if(h===null?h=g:g===null&&(g=h),u!=="force"){let M=h/d.width,C=g/d.height,S=1;if(u==="cover"?S=Math.max(M,C):u==="contain"&&(S=Math.min(M,C)),S>1&&f===!1)return p(d,v);h=d.width*S,g=d.height*S}let E=d.width,T=d.height,I=Math.round(h),y=Math.round(g),b=d.data,w=new Uint8ClampedArray(I*y*4),x=E/I,_=T/y,P=Math.ceil(x*.5),O=Math.ceil(_*.5);for(let M=0;M<y;M++)for(let C=0;C<I;C++){let S=(C+M*I)*4,F=0,R=0,L=0,z=0,D=0,k=0,B=0,X=(M+.5)*_;for(let q=Math.floor(M*_);q<(M+1)*_;q++){let Q=Math.abs(X-(q+.5))/O,pe=(C+.5)*x,G=Q*Q;for(let H=Math.floor(C*x);H<(C+1)*x;H++){let Y=Math.abs(pe-(H+.5))/P,le=Math.sqrt(G+Y*Y);if(le>=-1&&le<=1&&(F=2*le*le*le-3*le*le+1,F>0)){Y=4*(H+q*E);let ee=b[Y+3];B+=F*ee,L+=F,ee<255&&(F=F*ee/250),z+=F*b[Y],D+=F*b[Y+1],k+=F*b[Y+2],R+=F}}}w[S]=z/R,w[S+1]=D/R,w[S+2]=k/R,w[S+3]=B/L,v&&l(S,w,v)}return{data:w,width:I,height:y}}},ku=(e,t)=>{if(e.getUint32(t+4,!1)!==1165519206)return;t+=4;let i=e.getUint16(t+=6,!1)===18761;t+=e.getUint32(t+4,i);let a=e.getUint16(t,i);t+=2;for(let n=0;n<a;n++)if(e.getUint16(t+n*12,i)===274)return e.setUint16(t+n*12+8,1,i),!0;return!1},Vu=e=>{let t=new DataView(e);if(t.getUint16(0)!==65496)return null;let i=2,a,n,o=!1;for(;i<t.byteLength&&(a=t.getUint16(i,!1),n=t.getUint16(i+2,!1)+2,!(!(a>=65504&&a<=65519||a===65534)||(o||(o=ku(t,i,n)),i+n>t.byteLength)));)i+=n;return e.slice(0,i)},Gu=e=>new Promise(t=>{let i=new FileReader;i.onload=()=>t(Vu(i.result)||null),i.readAsArrayBuffer(e.slice(0,256*1024))}),Uu=()=>window.BlobBuilder=window.BlobBuilder||window.WebKitBlobBuilder||window.MozBlobBuilder||window.MSBlobBuilder,Wu=(e,t)=>{let i=Uu();if(i){let a=new i;return a.append(e),a.getBlob(t)}return new Blob([e],{type:t})},Hu=()=>Math.random().toString(36).substr(2,9),ju=e=>{let t=new Blob(["(",e.toString(),")()"],{type:"application/javascript"}),i=URL.createObjectURL(t),a=new Worker(i),n=[];return{transfer:()=>{},post:(o,l,r)=>{let s=Hu();n[s]=l,a.onmessage=p=>{let c=n[p.data.id];c&&(c(p.data.message),delete n[p.data.id])},a.postMessage({id:s,message:o},r)},terminate:()=>{a.terminate(),URL.revokeObjectURL(i)}}},Yu=e=>new Promise((t,i)=>{let a=new Image;a.onload=()=>{t(a)},a.onerror=n=>{i(n)},a.src=e}),qu=e=>e.reduce((t,i)=>t.then(a=>i().then(Array.
/*! Bundled license information:
filepond/dist/filepond.esm.js:
(*!
* FilePond 4.31.4
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
cropperjs/dist/cropper.esm.js:
(*!
* Cropper.js v1.6.2
* https://fengyuanchen.github.io/cropperjs
*
* Copyright 2015-present Chen Fengyuan
* Released under the MIT license
*
* Date: 2024-04-21T07:43:05.335Z
*)
filepond-plugin-file-validate-size/dist/filepond-plugin-file-validate-size.esm.js:
(*!
* FilePondPluginFileValidateSize 2.2.8
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-file-validate-type/dist/filepond-plugin-file-validate-type.esm.js:
(*!
* FilePondPluginFileValidateType 1.2.9
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-crop/dist/filepond-plugin-image-crop.esm.js:
(*!
* FilePondPluginImageCrop 2.0.6
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-edit/dist/filepond-plugin-image-edit.esm.js:
(*!
* FilePondPluginImageEdit 1.6.3
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-exif-orientation/dist/filepond-plugin-image-exif-orientation.esm.js:
(*!
* FilePondPluginImageExifOrientation 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-preview/dist/filepond-plugin-image-preview.esm.js:
(*!
* FilePondPluginImagePreview 4.6.12
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-resize/dist/filepond-plugin-image-resize.esm.js:
(*!
* FilePondPluginImageResize 2.0.10
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-image-transform/dist/filepond-plugin-image-transform.esm.js:
(*!
* FilePondPluginImageTransform 3.8.7
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit https://pqina.nl/filepond/ for details.
*)
filepond-plugin-media-preview/dist/filepond-plugin-media-preview.esm.js:
(*!
* FilePondPluginMediaPreview 1.0.11
* Licensed under MIT, https://opensource.org/licenses/MIT/
* Please visit undefined for details.
*)
*/