@qratilabs/qrati-connect 2.5.2 → 2.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/element/{AuthLayout-IGFGeMq5.js → AuthLayout-dLrNjfTG.js} +1 -1
  3. package/element/{ContentsPage-Bu42OF-F.js → ContentsPage-D5N_Bxqd.js} +1 -1
  4. package/element/{CuratePage-CBMluidb.js → CuratePage-Bd-mjSun.js} +1 -1
  5. package/element/{Dialog-DVSvxBn8.js → Dialog-BCT4uBAd.js} +1 -1
  6. package/element/{DotLottiePlayer-DHVhIw5H.js → DotLottiePlayer-CAuE83oi.js} +1 -1
  7. package/element/{EventHeaderAdminButtons-zE3NbEUA.js → EventHeaderAdminButtons-CF3CCL_D.js} +1 -1
  8. package/element/{FolderBreadcrumb-1w72I1FP.js → FolderBreadcrumb-DNjgRkum.js} +1 -1
  9. package/element/{ForgotPasswordPage-CIw8RrkZ.js → ForgotPasswordPage-d4qE75sD.js} +1 -1
  10. package/element/{InputField-XP30segE.js → InputField-DzVZ8doF.js} +1 -1
  11. package/element/{LazyLoadImage-n94OUygV.js → LazyLoadImage-D3GY3Wjr.js} +1 -1
  12. package/element/{LeaderboardPage-CGuP207i.js → LeaderboardPage-C_VE9Ci4.js} +1 -1
  13. package/element/{LoginPage-B15CMpYe.js → LoginPage-Cg8pF-HK.js} +1 -1
  14. package/element/{NCMVHL6D-D_O5jdHL.js → NCMVHL6D-cxuYBLSe.js} +1 -1
  15. package/element/{PublicEvents-DOp9N4xU.js → PublicEvents-A6FN3YA_.js} +1 -1
  16. package/element/{RegisterPage-D-6uVKjj.js → RegisterPage-C3Zm2pLv.js} +1 -1
  17. package/element/{SocialLoginButton-BuZ03WV-.js → SocialLoginButton-B_JXlwJD.js} +1 -1
  18. package/element/{UploadPage-Dhjmh06j.js → UploadPage-BBNlsruc.js} +1 -1
  19. package/element/{VideoPlayer-cWSLl4fO.js → VideoPlayer-bxfQ_8-7.js} +1 -1
  20. package/element/element.es.js +1 -1
  21. package/element/{heic2any-Dui1sz1X.js → heic2any-DhrJ4jGE.js} +1 -1
  22. package/element/{index-jzNVBihK.js → index-B07nTRSZ.js} +1 -1
  23. package/element/{index-DsN-W6V_.js → index-B7W6Qazn.js} +1 -1
  24. package/element/{index.esm-CsbPHPGO.js → index.esm-nbz30aE_.js} +1 -1
  25. package/element/{photoswipe-5mcef1lI.js → photoswipe-uy_xfi0k.js} +1 -1
  26. package/element/{tslib.es6-Dp_1P0Dk.js → tslib.es6-D07ckMAp.js} +1 -1
  27. package/element/{useOrgAccess-B1cbGHT_.js → useOrgAccess-Bc4D_9qX.js} +1 -1
  28. package/element/web.es.js +1 -1
  29. package/package.json +1 -1
  30. package/react/{VOx0knsi.js → B4U_edoH.js} +1 -1
  31. package/react/{BZvhXg2G.js → BXUUE4i8.js} +1 -1
  32. package/react/{CE-MbwCB.js → BgO9hwgt.js} +1 -1
  33. package/react/{cWB0y40v.js → BjeC9muX.js} +1 -1
  34. package/react/{DS2UD7gV.js → BsbGC0mb.js} +1 -1
  35. package/react/{6xRxF6pz.js → BtS27Hrp.js} +1 -1
  36. package/react/{Dyk2_V8r.js → BvPG5WOQ.js} +1 -1
  37. package/react/{jM4FWKDA.js → CCcmkpg2.js} +1 -1
  38. package/react/{Bebe5T7J.js → CVCROaIm.js} +1 -1
  39. package/react/{CS7icy9d.js → DDKdRpJD.js} +1 -1
  40. package/react/{C565I04Q.js → DEeNislJ.js} +1 -1
  41. package/react/{LMErjmPc.js → DFu2hVZT.js} +1 -1
  42. package/react/{Cp86U6va.js → DIbZ1HTT.js} +1 -1
  43. package/react/{vmkon26e.js → DKIOd50z.js} +1 -1
  44. package/react/{D1emifDo.js → DR1lh2_F.js} +1 -1
  45. package/react/{W8TabW9M.js → Dc_aR8k5.js} +1 -1
  46. package/react/{DPtqYlwJ.js → DhHfT-f_.js} +1 -1
  47. package/react/{DjmC7CGh.js → Dso7YRKD.js} +1 -1
  48. package/react/{CIlaT7eJ.js → Dv6l17gK.js} +1 -1
  49. package/react/{BaA7RHRf.js → DzIjyaQc.js} +1 -1
  50. package/react/{DwNWOPAY.js → XORV3RdW.js} +1 -1
  51. package/react/{DZitaH5o.js → YDJF25E_.js} +1 -1
  52. package/react/index.es.js +1 -1
  53. package/react/{Cv7EiFQU.js → zaA1B6UI.js} +1 -1
  54. package/umd/web.umd.js +1 -1
package/umd/web.umd.js CHANGED
@@ -1755,7 +1755,7 @@ self.addEventListener('message', async (e) => {
1755
1755
  })
1756
1756
  `;let GD;function $Oe(e,r){return new Promise(((t,a)=>{GD||(GD=(function(s){const u=[];return u.push(s),URL.createObjectURL(new Blob(u))})(HOe));const n=new Worker(GD);n.addEventListener("message",(function(s){if(r.signal&&r.signal.aborted)n.terminate();else if(s.data.progress===void 0){if(s.data.error)return a(new Error(s.data.error)),void n.terminate();t(s.data.file),n.terminate()}else r.onProgress(s.data.progress)})),n.addEventListener("error",a),r.signal&&r.signal.addEventListener("abort",(()=>{a(r.signal.reason),n.terminate()})),n.postMessage({file:e,imageCompressionLibUrl:r.libURL,options:{...r,onProgress:void 0,signal:void 0}})}))}function $n(e,r){return new Promise((function(t,a){let n,i,s,u,c,A;if(n={...r},s=0,{onProgress:u}=n,n.maxSizeMB=n.maxSizeMB||Number.POSITIVE_INFINITY,c=typeof n.useWebWorker!="boolean"||n.useWebWorker,delete n.useWebWorker,n.onProgress=b=>{s=b,typeof u=="function"&&u(s)},!(e instanceof Blob||e instanceof XOe))return a(new Error("The file given is not an instance of Blob or File"));if(!/^image/.test(e.type))return a(new Error("The file given is not an image"));if(A=typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope,!c||typeof Worker!="function"||A)return Fee(e,n).then((function(b){try{return i=b,m.call(this)}catch(w){return a(w)}}).bind(this),a);var d=(function(){try{return m.call(this)}catch(b){return a(b)}}).bind(this),g=function(b){try{return Fee(e,n).then((function(w){try{return i=w,d()}catch(E){return a(E)}}),a)}catch(w){return a(w)}};try{return n.libURL=n.libURL||"https://cdn.jsdelivr.net/npm/browser-image-compression@2.0.2/dist/browser-image-compression.js",$Oe(e,n).then((function(b){try{return i=b,d()}catch{return g()}}),g)}catch{g()}function m(){try{i.name=e.name,i.lastModified=e.lastModified}catch{}try{n.preserveExif&&e.type==="image/jpeg"&&(!n.fileType||n.fileType&&n.fileType===e.type)&&(i=_ee(e,i))}catch{}return t(i)}}))}$n.getDataUrlFromFile=Iee,$n.getFilefromDataUrl=VD,$n.loadImage=Ree,$n.drawImageInCanvas=Oee,$n.drawFileInCanvas=Ix,$n.canvasToFile=Rx,$n.getExifOrientation=Dee,$n.handleMaxWidthOrHeight=Bee,$n.followExifOrientation=Nee,$n.cleanupCanvasMemory=Vu,$n.isAutoOrientationInBrowser=$6,$n.approximateBelowMaximumCanvasSizeOfBrowser=Mee,$n.copyExifWithoutOrientation=_ee,$n.getBrowserName=ud,$n.version="2.0.2";let Zee=class{constructor(r){if(YOe(r))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=r,this.byteLength=this.buffer.length}getUint8(r){return this.buffer.readUInt8(r)}getUint16(r,t){return t?this.buffer.readUInt16LE(r):this.buffer.readUInt16BE(r)}getUint32(r,t){return t?this.buffer.readUInt32LE(r):this.buffer.readUInt32BE(r)}getInt32(r,t){return t?this.buffer.readInt32LE(r):this.buffer.readInt32BE(r)}};function YOe(e){return typeof e!="object"||e.length===void 0||e.readUInt8===void 0||e.readUInt16LE===void 0||e.readUInt16BE===void 0||e.readUInt32LE===void 0||e.readUInt32BE===void 0||e.readInt32LE===void 0||e.readInt32BE===void 0}function Pee(e,r,t){try{return new DataView(e,r,t)}catch{return new Zee(e,r,t)}}function O0(e,r,t){const a=[];for(let n=0;n<t&&r+n<e.byteLength;n++)a.push(e.getUint8(r+n));return cd(a)}function Y6(e,r){const t=[];let a=0;for(;r+a<e.byteLength;){const n=e.getUint8(r+a);if(n===0)break;t.push(n),a++}return cd(t)}function QOe(e,r,t){const a=[];for(let n=0;n<t&&r+n<e.byteLength;n+=2)a.push(e.getUint16(r+n));return a[a.length-1]===0&&a.pop(),cd(a)}function jee(e,r){const t=e.getUint8(r),a=O0(e,r+1,t);return[t,a]}function cd(e){return e.map(r=>String.fromCharCode(r)).join("")}function z0(){for(let e=1;e<arguments.length;e++)for(const r in arguments[e])arguments[0][r]=arguments[e][r];return arguments[0]}function qee(e,r,t){let a=!1;Object.defineProperty(e,r,{get(){return a||(a=!0,Object.defineProperty(e,r,{configurable:!0,enumerable:!0,value:t.apply(e),writable:!0})),e[r]},configurable:!0,enumerable:!0})}function Lee(e){if(typeof btoa<"u")return btoa(typeof e=="string"?e:Array.prototype.reduce.call(new Uint8Array(e),(r,t)=>r+String.fromCharCode(t),""));if(!(typeof Buffer>"u"))return typeof Buffer.from<"u"?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64")}function JOe(e){const r=e.substring(e.indexOf(",")+1);if(e.indexOf(";base64")!==-1)return typeof atob<"u"?Uint8Array.from(atob(r),a=>a.charCodeAt(0)).buffer:typeof Buffer>"u"?void 0:typeof Buffer.from<"u"?Buffer.from(r,"base64"):new Buffer(r,"base64");const t=decodeURIComponent(r);return typeof Buffer<"u"?typeof Buffer.from<"u"?Buffer.from(t):new Buffer(t):Uint8Array.from(t,a=>a.charCodeAt(0)).buffer}function KOe(e,r,t){return Vee(t,r-e.length)+e}function eDe(e,r){return parseInt(e.replace(".",""),r)/Math.pow(r,(e.split(".")[1]||"").length)}function Vee(e,r){return new Array(r+1).join(e)}const Mx=void 0,Gee=0;function zee(e,r,t,a="string"){if(r===Gee&&typeof DecompressionStream=="function"){const n=new DecompressionStream("deflate"),i=new Blob([e]).stream().pipeThrough(n);return a==="dataview"?new Response(i).arrayBuffer().then(s=>new DataView(s)):new Response(i).arrayBuffer().then(s=>new TextDecoder(t).decode(s))}return r!==void 0?Promise.reject(`Unknown compression method ${r}.`):e}const Uee={USE_FILE:!0,USE_JFIF:!0,USE_PNG_FILE:!0,USE_EXIF:!0,USE_IPTC:!0,USE_XMP:!0,USE_ICC:!0,USE_MPF:!0,USE_PHOTOSHOP:!0,USE_THUMBNAIL:!0,USE_TIFF:!0,USE_JPEG:!0,USE_PNG:!0,USE_HEIC:!0,USE_AVIF:!0,USE_WEBP:!0,USE_GIF:!0,USE_MAKER_NOTES:!0};function ca(e){return e.map(r=>String.fromCharCode(r)).join("")}function zD(e){if(e.length>=8){const r=ca(e.slice(0,8));if(r==="ASCII\0\0\0")return ca(e.slice(8));if(r==="JIS\0\0\0\0\0")return"[JIS encoded text]";if(r==="UNICODE\0")return"[Unicode encoded text]";if(r==="\0\0\0\0\0\0\0\0")return"[Undefined encoding]"}return"Undefined"}function Ox(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}const UD=18761,WD=19789,Gu={BIG_ENDIAN:WD,LITTLE_ENDIAN:UD,getByteOrder:rDe};function rDe(e,r){if(e.getUint16(r)===UD)return UD;if(e.getUint16(r)===WD)return WD;throw new Error("Illegal byte order value. Faulty image.")}const Wee={isTiffFile:tDe,findTiffOffsets:nDe};function tDe(e){return!!e&&e.byteLength>=4&&aDe(e)}function aDe(e){const a=e.getUint16(0)===Gu.LITTLE_ENDIAN;return e.getUint16(2,a)===42}function nDe(){return{hasAppMarkers:!0,tiffHeaderOffset:0}}const Xee={isJpegFile:yDe,findJpegOffsets:wDe},iDe=2,oDe=65496,Hee=2,as=4,Yn=2,sDe=2,lDe=10,uDe=18,$ee=33,Yee=79,Qee=18,cDe=8,XD="ICC_PROFILE\0",Jee=as+XD.length,fDe=Jee+1,Kee="MPF\0",e1e=65472,r1e=65474,ADe=65476,dDe=65499,hDe=65501,pDe=65498,t1e=65504,HD=65505,a1e=65506,mDe=65517,gDe=65519,bDe=65534,vDe=65535,n1e="JFIF",i1e="Exif",o1e="http://ns.adobe.com/xap/1.0/\0",s1e="http://ns.adobe.com/xmp/extension/\0",l1e="Photoshop 3.0";function yDe(e){return!!e&&e.byteLength>=iDe&&e.getUint16(0)===oDe}function wDe(e){let r=Hee,t,a,n,i,s,u,c,A,d;for(;r+as+5<=e.byteLength;){if(EDe(e,r))t=e.getUint16(r+Yn),a=r+Yn;else if(xDe(e,r))t=e.getUint16(r+Yn),n=r+Yn;else if(CDe(e,r))t=e.getUint16(r+Yn),i=r+sDe;else if(SDe(e,r))t=e.getUint16(r+Yn),s=r+lDe;else if(TDe(e,r))c||(c=[]),t=e.getUint16(r+Yn),c.push(ODe(r,t));else if(RDe(e,r))c||(c=[]),t=e.getUint16(r+Yn),c.push(DDe(r,t));else if(BDe(e,r))t=e.getUint16(r+Yn),u=r+uDe;else if(kDe(e,r)){t=e.getUint16(r+Yn);const g=r+Qee,m=t-(Qee-Yn),b=e.getUint8(r+Jee),w=e.getUint8(r+fDe);A||(A=[]),A.push({offset:g,length:m,chunkNumber:b,chunksTotal:w})}else if(_De(e,r))t=e.getUint16(r+Yn),d=r+cDe;else if(NDe(e,r))t=e.getUint16(r+Yn);else if(FDe(e,r)){r++;continue}else break;r+=Yn+t}return{hasAppMarkers:r>Hee,fileDataOffset:a||n,jfifDataOffset:i,tiffHeaderOffset:s,iptcDataOffset:u,xmpChunks:c,iccChunks:A,mpfDataOffset:d}}function EDe(e,r){return e.getUint16(r)===e1e}function xDe(e,r){return e.getUint16(r)===r1e}function kDe(e,r){const t=XD.length;return e.getUint16(r)===a1e&&O0(e,r+as,t)===XD}function _De(e,r){const t=Kee.length;return e.getUint16(r)===a1e&&O0(e,r+as,t)===Kee}function CDe(e,r){const t=n1e.length;return e.getUint16(r)===t1e&&O0(e,r+as,t)===n1e&&e.getUint8(r+as+t)===0}function SDe(e,r){const t=i1e.length;return e.getUint16(r)===HD&&O0(e,r+as,t)===i1e&&e.getUint8(r+as+t)===0}function TDe(e,r){return e.getUint16(r)===HD&&IDe(e,r)}function IDe(e,r){const t=o1e.length;return O0(e,r+as,t)===o1e}function RDe(e,r){return e.getUint16(r)===HD&&MDe(e,r)}function MDe(e,r){const t=s1e.length;return O0(e,r+as,t)===s1e}function ODe(e,r){return{dataOffset:e+$ee,length:r-($ee-Yn)}}function DDe(e,r){return{dataOffset:e+Yee,length:r-(Yee-Yn)}}function BDe(e,r){const t=l1e.length;return e.getUint16(r)===mDe&&O0(e,r+as,t)===l1e&&e.getUint8(r+as+t)===0}function NDe(e,r){const t=e.getUint16(r);return t>=t1e&&t<=gDe||t===bDe||t===e1e||t===r1e||t===ADe||t===dDe||t===hDe||t===pDe}function FDe(e,r){return e.getUint16(r)===vDe}const u1e={isPngFile:jDe,findPngOffsets:qDe},$D=`‰PNG\r
1757
1757
  
1758
- `,Dx=4,Ol=4,Q6=0,nA=Dx,kn=Dx+Ol,YD="XML:com.adobe.xmp\0",QD="tEXt",fd="iTXt",Bx="zTXt",c1e="pHYs",f1e="tIME",ZDe="eXIf",PDe="iCCP";function jDe(e){return!!e&&O0(e,0,$D.length)===$D}function qDe(e,r){const a={hasAppMarkers:!1};let n=$D.length;for(;n+Dx+Ol<=e.byteLength;){if(LDe(e,n))a.hasAppMarkers=!0,a.pngHeaderOffset=n+kn;else if(VDe(e,n)){const i=XDe(e,n);i!==void 0&&(a.hasAppMarkers=!0,a.xmpChunks=[{dataOffset:i,length:e.getUint32(n+Q6)-(i-(n+kn))}])}else if(GDe(e,n,r)){a.hasAppMarkers=!0;const i=O0(e,n+nA,Ol);a.pngTextChunks||(a.pngTextChunks=[]),a.pngTextChunks.push({length:e.getUint32(n+Q6),type:i,offset:n+kn})}else if(zDe(e,n))a.hasAppMarkers=!0,a.tiffHeaderOffset=n+kn;else if(r&&UDe(e,n)){a.hasAppMarkers=!0;const i=e.getUint32(n+Q6),s=n+kn,{profileName:u,compressionMethod:c,compressedProfileOffset:A}=HDe(e,s);a.iccChunks||(a.iccChunks=[]),a.iccChunks.push({offset:A,length:i-(A-s),chunkNumber:1,chunksTotal:1,profileName:u,compressionMethod:c})}else WDe(e,n)&&(a.hasAppMarkers=!0,a.pngChunkOffsets||(a.pngChunkOffsets=[]),a.pngChunkOffsets.push(n+Q6));n+=e.getUint32(n+Q6)+Dx+Ol+4}return a}function LDe(e,r){return O0(e,r+nA,Ol)==="IHDR"}function VDe(e,r){return O0(e,r+nA,Ol)===fd&&O0(e,r+kn,YD.length)===YD}function GDe(e,r,t){const a=O0(e,r+nA,Ol);return a===QD||a===fd||a===Bx&&t}function zDe(e,r){return O0(e,r+nA,Ol)===ZDe}function UDe(e,r){return O0(e,r+nA,Ol)===PDe}function WDe(e,r){const t=[c1e,f1e],a=O0(e,r+nA,Ol);return t.includes(a)}function XDe(e,r){r+=kn+YD.length+1+1;let n=0;for(;n<2&&r<e.byteLength;)e.getUint8(r)===0&&n++,r++;if(!(n<2))return r}function HDe(e,r){const n=Y6(e,r);r+=n.length+1;const i=e.getUint8(r);return r+=1,{profileName:n,compressionMethod:i,compressedProfileOffset:r}}function $De(e,r){return e.getUint32(r+4)}function YDe(e,r,t,a){const{offsets:i,sizes:s}=QDe(r,t+3),u=e.getUint8(i.offsetSize)>>4;s.item.extent.extentOffset=u;const c=e.getUint8(i.lengthSize)&15;s.item.extent.extentLength=c;const A=e.getUint8(i.baseOffsetSize)>>4;s.item.baseOffset=A;const d=JDe(e,i.indexSize,r);s.item.extent.extentIndex=d!==void 0?d:0;const g=KDe(e,i.itemCount,r);return{type:"iloc",items:eBe(e,r,i,s,u,c,d,g),length:a}}function QDe(e,r){const t={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(t.itemCount=2,t.item.itemId=2):e===2&&(t.itemCount=4,t.item.itemId=4),e===1||e===2?t.item.constructionMethod=2:t.item.constructionMethod=0;const a={offsetSize:r,lengthSize:r,baseOffsetSize:r+1,indexSize:r+1};return a.itemCount=r+2,a.items=a.itemCount+t.itemCount,a.item={itemId:0},a.item.constructionMethod=a.item.itemId+t.item.itemId,a.item.dataReferenceIndex=a.item.constructionMethod+t.item.constructionMethod,{offsets:a,sizes:t}}function JDe(e,r,t){if(t===1||t===2)return e.getUint8(r)&15}function KDe(e,r,t){if(t<2)return e.getUint16(r);if(t===2)return e.getUint32(r)}function eBe(e,r,t,a,n,i,s,u){if(u===void 0)return[];const c=[];let A=t.items;for(let d=0;d<u;d++){const g={extents:[]};g.itemId=rBe(e,A,r),A+=a.item.itemId,g.constructionMethod=r===1||r===2?e.getUint16(A)&15:void 0,A+=a.item.constructionMethod,g.dataReferenceIndex=e.getUint16(A),A+=a.item.dataReferenceIndex,g.baseOffset=Nx(e,A,a.item.baseOffset),A+=a.item.baseOffset,g.extentCount=e.getUint16(A),A+=a.item.extentCount;for(let m=0;m<g.extentCount;m++){const b={};b.extentIndex=tBe(e,r,A,s),A+=a.item.extent.extentIndex,b.extentOffset=Nx(e,A,n),A+=a.item.extent.extentOffset,b.extentLength=Nx(e,A,i),A+=a.item.extent.extentLength,g.extents.push(b)}c.push(g)}return c}function rBe(e,r,t){if(t<2)return e.getUint16(r);if(t===2)return e.getUint32(r)}function tBe(e,r,t,a){if((r===1||r===2)&&a>0)return Nx(e,t,a)}function Nx(e,r,t){return t===4?e.getUint32(r):t===8?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),$De(e,r)):0}const aBe=1718909296,nBe=1768977008,iBe=1835365473,oBe=1768714083,sBe=1768517222,lBe=1768842853,uBe=1768973167,cBe=1668246642,A1e=1165519206,JD=1835625829,fBe=1970432288;function Fx(e,r){const{length:i,contentOffset:s}=ABe(e,r);if(i<8)return;const u=e.getUint32(r+4);if(u===aBe)return xBe(e,s,i);if(u===nBe)return kBe(e,r,s,i);if(u===uBe)return _Be(e,r,s,i);if(u===cBe)return CBe(e,s,i);const c=e.getUint8(s);return u===iBe?TBe(e,r,s+1,i):u===oBe?YDe(e,c,s+1,i):u===sBe?IBe(e,r,c,s+1,i):u===lBe?MBe(e,r,c,s+1,i):{type:void 0,length:i}}function ABe(e,r){const s=e.getUint32(r);return dBe(s)?{length:e.byteLength-r,contentOffset:r+4+4}:hBe(s)&&pBe(e,r)?{length:e.getUint32(r+12),contentOffset:r+4+4+8}:{length:s,contentOffset:r+4+4}}function dBe(e){return e===0}function hBe(e){return e===1}function pBe(e,r){return e.getUint32(r+8)===0}function d1e(e){{const r={},t=mBe(e);return t?(r.tiffHeaderOffset=gBe(e,t),r.xmpChunks=yBe(t),r.iccChunks=EBe(t),r.hasAppMarkers=r.tiffHeaderOffset!==void 0||r.xmpChunks!==void 0||r.iccChunks!==void 0,r):{hasAppMarkers:!1}}}function mBe(e){let a=0;for(;a+4+4<=e.byteLength;){const n=Fx(e,a);if(n===void 0)break;if(n.type==="meta")return n;a+=n.length}}function gBe(e,r){try{const t=bBe(r).itemId,a=KD(r,t),n=a.baseOffset+a.extents[0].extentOffset;return vBe(e,n)}catch{return}}function bBe(e){return e.subBoxes.find(r=>r.type==="iinf").itemInfos.find(r=>r.itemType===A1e)}function KD(e,r){return e.subBoxes.find(t=>t.type==="iloc").items.find(t=>t.itemId===r)}function vBe(e,r){return r+4+e.getUint32(r)}function yBe(e){try{const r=wBe(e).itemId,t=KD(e,r),a=KD(e,r).extents[0];return[{dataOffset:t.baseOffset+a.extentOffset,length:a.extentLength}]}catch{return}}function wBe(e){return e.subBoxes.find(r=>r.type==="iinf").itemInfos.find(r=>r.itemType===JD&&r.contentType==="application/rdf+xml")}function EBe(e){try{const r=e.subBoxes.find(t=>t.type==="iprp").subBoxes.find(t=>t.type==="ipco").properties.find(t=>t.type==="colr").icc;if(r)return[r]}catch{}}function xBe(e,r,t){return{type:"ftyp",majorBrand:O0(e,r,4),length:t}}function kBe(e,r,t,a){return{type:"iprp",subBoxes:Zx(e,t,a-(t-r)),length:a}}function _Be(e,r,t,a){return{type:"ipco",properties:Zx(e,t,a-(t-r)),length:a}}function CBe(e,r,t){return{type:"colr",icc:SBe(e,r),length:t}}function SBe(e,r){const a=O0(e,r,4);if(!(a!=="prof"&&a!=="rICC"))return{offset:r+4,length:e.getUint32(r+4),chunkNumber:1,chunksTotal:1}}function TBe(e,r,t,a){return{type:"meta",subBoxes:Zx(e,t+3,a-(t+3-r)),length:a}}function Zx(e,r,t){const a=[A1e,JD],n=[];let i=r;for(;i<r+t;){const s=Fx(e,i);if(s===void 0)break;s.type!==void 0&&(s.itemType===void 0||a.indexOf(s.itemType)!==-1)&&n.push(s),i+=s.length}return n}function IBe(e,r,t,a,n){const{offsets:i}=RBe(t,a);return{type:"iinf",itemInfos:Zx(e,i.itemInfos,n-(i.itemInfos-r)),length:n}}function RBe(e,r){const a={entryCount:r+3},n={};return e===0?n.entryCount=2:n.entryCount=4,a.itemInfos=a.entryCount+n.entryCount,{offsets:a}}function MBe(e,r,t,a,n){a+=3;const s={type:"infe",length:n};return(t===0||t===1)&&(s.itemId=e.getUint16(a),a+=2,s.itemProtectionIndex=e.getUint16(a),a+=2,s.itemName=Y6(e,a),a+=s.itemName.length+1),t>=2&&(t===2?(s.itemId=e.getUint16(a),a+=2):t===3&&(s.itemId=e.getUint32(a),a+=4),s.itemProtectionIndex=e.getUint16(a),a+=2,s.itemType=e.getUint32(a),a+=4,s.itemName=Y6(e,a),a+=s.itemName.length+1,s.itemType===JD?(s.contentType=Y6(e,a),a+=s.contentType.length+1,r+n>a&&(s.contentEncoding=Y6(e,a),a+=s.contentEncoding.length+1)):s.itemType===fBe&&(s.itemUri=Y6(e,a),a+=s.itemUri.length+1)),s}const h1e={isHeicFile:OBe,findHeicOffsets:DBe};function OBe(e){if(!e)return!1;const r=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const t=Fx(e,0);return t&&r.indexOf(t.majorBrand)!==-1}catch{return!1}}function DBe(e){return d1e(e)}const p1e={isAvifFile:BBe,findAvifOffsets:NBe};function BBe(e){if(!e)return!1;try{const r=Fx(e,0);return r&&r.majorBrand==="avif"}catch{return!1}}function NBe(e){return d1e(e)}const m1e={isWebpFile:FBe,findOffsets:ZBe};function FBe(e){const t="RIFF",n="WEBP";return!!e&&O0(e,0,t.length)===t&&O0(e,8,n.length)===n}function ZBe(e){const a="Exif\0\0";let i=12,s=!1,u,c,A,d;for(;i+8<e.byteLength;){const g=O0(e,i,4),m=e.getUint32(i+4,!0);g==="EXIF"?(s=!0,O0(e,i+8,a.length)===a?u=i+8+a.length:u=i+8):g==="XMP "?(s=!0,c=[{dataOffset:i+8,length:m}]):g==="ICCP"?(s=!0,A=[{offset:i+8,length:m,chunkNumber:1,chunksTotal:1}]):g==="VP8X"&&(s=!0,d=i+8),i+=8+(m%2===0?m:m+1)}return{hasAppMarkers:s,tiffHeaderOffset:u,xmpChunks:c,iccChunks:A,vp8xChunkOffset:d}}const g1e={isGifFile:qBe,findOffsets:LBe},PBe=6,jBe=["GIF87a","GIF89a"];function qBe(e){return!!e&&jBe.includes(O0(e,0,PBe))}function LBe(){return{gifHeaderOffset:0}}const b1e={isXMLFile:VBe,findOffsets:GBe},v1e=0,y1e="<?xpacket begin";function VBe(e){return!!e&&O0(e,v1e,y1e.length)===y1e}function GBe(e){const r=[];return r.push({dataOffset:v1e,length:e.byteLength}),{xmpChunks:r}}const zBe={parseAppMarkers:UBe};function UBe(e,r){if(Wee.isTiffFile(e))return iA(Wee.findTiffOffsets(),"tiff","TIFF");if(Xee.isJpegFile(e))return iA(Xee.findJpegOffsets(e),"jpeg","JPEG");if(u1e.isPngFile(e))return iA(u1e.findPngOffsets(e,r),"png","PNG");if(h1e.isHeicFile(e))return iA(h1e.findHeicOffsets(e),"heic","HEIC");if(p1e.isAvifFile(e))return iA(p1e.findAvifOffsets(e),"avif","AVIF");if(m1e.isWebpFile(e))return iA(m1e.findOffsets(e),"webp","WebP");if(g1e.isGifFile(e))return iA(g1e.findOffsets(e),"gif","GIF");if(b1e.isXMLFile(e))return iA(b1e.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}function iA(e,r,t){return z0({},e,{fileType:{value:r,description:t}})}const C0={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace(e){return e===1?"sRGB":e===65535?"Uncalibrated":"Unknown"},ComponentsConfiguration(e){return e.map(r=>{if(r===49)return"Y";if(r===50)return"Cb";if(r===51)return"Cr";if(r===52)return"R";if(r===53)return"G";if(r===54)return"B"}).join("")},Contrast(e){return e===0?"Normal":e===1?"Soft":e===2?"Hard":"Unknown"},CustomRendered(e){return e===0?"Normal process":e===1?"Custom process":"Unknown"},ExposureMode(e){return e===0?"Auto exposure":e===1?"Manual exposure":e===2?"Auto bracket":"Unknown"},ExposureProgram(e){return e===0?"Undefined":e===1?"Manual":e===2?"Normal program":e===3?"Aperture priority":e===4?"Shutter priority":e===5?"Creative program":e===6?"Action program":e===7?"Portrait mode":e===8?"Landscape mode":e===9?"Bulb":"Unknown"},ExposureTime(e){if(e[0]/e[1]>.25){const r=e[0]/e[1];return Number.isInteger(r)?""+r:r.toFixed(1)}return e[0]!==0?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>`f/${Number(e[0]/e[1]).toFixed(1)}`,FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit(e){return e===2?"inches":e===3?"centimeters":e===4?"millimeters":"Unknown"},LightSource:e=>e===1?"Daylight":e===2?"Fluorescent":e===3?"Tungsten (incandescent light)":e===4?"Flash":e===9?"Fine weather":e===10?"Cloudy weather":e===11?"Shade":e===12?"Daylight fluorescent (D 5700 – 7100K)":e===13?"Day white fluorescent (N 4600 – 5400K)":e===14?"Cool white fluorescent (W 3900 – 4500K)":e===15?"White fluorescent (WW 3200 – 3700K)":e===17?"Standard light A":e===18?"Standard light B":e===19?"Standard light C":e===20?"D55":e===21?"D65":e===22?"D75":e===23?"D50":e===24?"ISO studio tungsten":e===255?"Other light source":"Unknown",MeteringMode(e){return e===1?"Average":e===2?"CenterWeightedAverage":e===3?"Spot":e===4?"MultiSpot":e===5?"Pattern":e===6?"Partial":e===255?"Other":"Unknown"},ResolutionUnit(e){return e===2?"inches":e===3?"centimeters":"Unknown"},Saturation(e){return e===0?"Normal":e===1?"Low saturation":e===2?"High saturation":"Unknown"},FocalLengthIn35mmFilm(e){return e===0?"Unknown":e+" mm"},SceneCaptureType(e){return e===0?"Standard":e===1?"Landscape":e===2?"Portrait":e===3?"Night scene":"Unknown"},Sharpness(e){return e===0?"Normal":e===1?"Soft":e===2?"Hard":"Unknown"},ShutterSpeedValue(e){const r=Math.pow(2,e[0]/e[1]);return r<=1?`${Math.round(1/r)}`:`1/${Math.round(r)}`},WhiteBalance(e){return e===0?"Auto white balance":e===1?"Manual white balance":"Unknown"},XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},w1e={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"})[e]||"Unknown"},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"})[e]||"Unknown"},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"})[e]||"Unknown"},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"})[e]||"Unknown"},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>e===1?"top-left":e===2?"top-right":e===3?"bottom-right":e===4?"bottom-left":e===5?"left-top":e===6?"right-top":e===7?"right-bottom":e===8?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:C0.XResolution},283:{name:"YResolution",description:C0.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"})[e]||"Unknown"},296:{name:"ResolutionUnit",description:C0.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map(r=>`${r[0]}/${r[1]}`).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map(r=>`${r[0]}/${r[1]}`).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"})[e]||"Unknown"},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"})[e]||"Unknown"},339:{name:"SampleFormat",description:e=>{const r={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map(t=>r[t]||"Unknown").join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map(r=>""+r[0]/r[1]).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>e===1?"centered":e===2?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map(r=>""+r[0]/r[1]).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:Wg},40092:{name:"XPComment",description:Wg},40093:{name:"XPAuthor",description:Wg},40094:{name:"XPKeywords",description:Wg},40095:{name:"XPSubject",description:Wg},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"})[e]||"Unknown"},50778:{name:"CalibrationIlluminant1",description:C0.LightSource},50779:{name:"CalibrationIlluminant2",description:C0.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"})[e]||"Unknown"},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"})[e]||"Unknown"},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"})[e]||"Unknown"},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"})[e]||"Unknown"},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"})[e]||"Unknown"},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function Wg(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}const WBe={33434:{name:"ExposureTime",description:C0.ExposureTime},33437:{name:"FNumber",description:C0.FNumber},34850:{name:"ExposureProgram",description:C0.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"})[e]||"Unknown"},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>ca(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:C0.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:C0.ShutterSpeedValue},37378:{name:"ApertureValue",description:C0.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:C0.MeteringMode},37384:{name:"LightSource",description:C0.LightSource},37385:{name:"Flash",description:e=>e===0?"Flash did not fire":e===1?"Flash fired":e===5?"Strobe return light not detected":e===7?"Strobe return light detected":e===9?"Flash fired, compulsory flash mode":e===13?"Flash fired, compulsory flash mode, return light not detected":e===15?"Flash fired, compulsory flash mode, return light detected":e===16?"Flash did not fire, compulsory flash mode":e===24?"Flash did not fire, auto mode":e===25?"Flash fired, auto mode":e===29?"Flash fired, auto mode, return light not detected":e===31?"Flash fired, auto mode, return light detected":e===32?"No flash function":e===65?"Flash fired, red-eye reduction mode":e===69?"Flash fired, red-eye reduction mode, return light not detected":e===71?"Flash fired, red-eye reduction mode, return light detected":e===73?"Flash fired, compulsory flash mode, red-eye reduction mode":e===77?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":e===79?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":e===89?"Flash fired, auto mode, red-eye reduction mode":e===93?"Flash fired, auto mode, return light not detected, red-eye reduction mode":e===95?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:C0.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"})[e]||"Unknown"},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>e.length===2?`Location; X: ${e[0]}, Y: ${e[1]}`:e.length===3?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:e.length===4?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:zD},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map(r=>String.fromCharCode(r)).join("")},40961:{name:"ColorSpace",description:C0.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:C0.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,r])=>`X: ${e}, Y: ${r}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>e===1?"Undefined":e===2?"One-chip color area sensor":e===3?"Two-chip color area sensor":e===4?"Three-chip color area sensor":e===5?"Color sequential area sensor":e===7?"Trilinear sensor":e===8?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>e===3?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>e===1?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:C0.CustomRendered},41986:{name:"ExposureMode",description:C0.ExposureMode},41987:{name:"WhiteBalance",description:C0.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>e[0]===0?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:C0.FocalLengthIn35mmFilm},41990:{name:"SceneCaptureType",description:C0.SceneCaptureType},41991:{name:"GainControl",description:e=>e===0?"None":e===1?"Low gain up":e===2?"High gain up":e===3?"Low gain down":e===4?"High gain down":"Unknown"},41992:{name:"Contrast",description:C0.Contrast},41993:{name:"Saturation",description:C0.Saturation},41994:{name:"Sharpness",description:C0.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>e===1?"Macro":e===2?"Close view":e===3?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const r=parseFloat((e[0][0]/e[0][1]).toFixed(5)),t=parseFloat((e[1][0]/e[1][1]).toFixed(5)),a=`${r}-${t} mm`;if(e[3][1]===0)return`${a} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${a} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"})[e]||"Unknown"},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},XBe={0:{name:"GPSVersionID",description:e=>e[0]===2&&e[1]===2&&e[2]===0&&e[3]===0?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const r=e.join("");return r==="N"?"North latitude":r==="S"?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Ox},3:{name:"GPSLongitudeRef",description:e=>{const r=e.join("");return r==="E"?"East longitude":r==="W"?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Ox},5:{name:"GPSAltitudeRef",description:e=>e===0?"Sea level":e===1?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map(([r,t])=>{const a=r/t;return/^\d(\.|$)/.test(`${a}`)?`0${a}`:a}).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const r=e.join("");return r==="A"?"Measurement in progress":r==="V"?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const r=e.join("");return r==="2"?"2-dimensional measurement":r==="3"?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const r=e.join("");return r==="K"?"Kilometers per hour":r==="M"?"Miles per hour":r==="N"?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const r=e.join("");return r==="N"?"North latitude":r==="S"?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const r=e.join("");return r==="E"?"East longitude":r==="W"?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const r=e.join("");return r==="K"?"Kilometers":r==="M"?"Miles":r==="N"?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:zD},28:{name:"GPSAreaInformation",description:zD},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>e===0?"Measurement without differential correction":e===1?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},HBe={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>ca(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},$Be={45056:{name:"MPFVersion",description:e=>ca(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"},YBe={4:{name:"ShotInfo",description:e=>e}},QBe={0:{name:"PentaxVersion",description:e=>e.join(".")},5:"PentaxModelID",555:"LevelInfo"},E1e=z0({},w1e,WBe),eB="0th",x1e="1st",k1e="exif",_1e="gps",C1e="interoperability",S1e="mpf",T1e="canon",rB="pentax",oA={[eB]:E1e,[x1e]:w1e,[k1e]:E1e,[_1e]:XBe,[C1e]:HBe,[S1e]:$Be,[T1e]:YBe,[rB]:QBe},I1e={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},tB={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},B1={getAsciiValue:JBe,getByteAt:R1e,getAsciiAt:KBe,getShortAt:eNe,getLongAt:Px,getRationalAt:rNe,getUndefinedAt:tNe,getSlongAt:aB,getSrationalAt:aNe,getIfdPointerAt:nNe,typeSizes:I1e,tagTypes:tB,getTypeSize:iNe};function JBe(e){return e.map(r=>String.fromCharCode(r))}function R1e(e,r){return e.getUint8(r)}function KBe(e,r){return e.getUint8(r)}function eNe(e,r,t){return e.getUint16(r,t===Gu.LITTLE_ENDIAN)}function Px(e,r,t){return e.getUint32(r,t===Gu.LITTLE_ENDIAN)}function rNe(e,r,t){return[Px(e,r,t),Px(e,r+4,t)]}function tNe(e,r){return R1e(e,r)}function aB(e,r,t){return e.getInt32(r,t===Gu.LITTLE_ENDIAN)}function aNe(e,r,t){return[aB(e,r,t),aB(e,r+4,t)]}function nNe(e,r,t){return Px(e,r,t)}function iNe(e){if(tB[e]===void 0)throw new Error("No such type found.");return I1e[tB[e]]}const oNe={1:B1.getByteAt,2:B1.getAsciiAt,3:B1.getShortAt,4:B1.getLongAt,5:B1.getRationalAt,7:B1.getUndefinedAt,9:B1.getSlongAt,10:B1.getSrationalAt,13:B1.getIfdPointerAt};function M1e(e,r,t){return r+B1.getLongAt(e,r+4,t)}function sA(e,r,t,a,n,i){const s=B1.getTypeSize("SHORT"),u=12,c={},A=sNe(e,a,n);a+=s;for(let d=0;d<A&&!(a+u>e.byteLength);d++){const g=lNe(e,r,t,a,n,i);g!==void 0&&(c[g.name]={id:g.id,value:g.value,description:g.description},(g.name==="MakerNote"||r===rB&&g.name==="LevelInfo")&&(c[g.name].__offset=g.__offset)),a+=u}if(a<e.byteLength-B1.getTypeSize("LONG")){const d=B1.getLongAt(e,a,n);d!==0&&r===eB&&(c.Thumbnail=sA(e,x1e,t,t+d,n,i))}return c}function sNe(e,r,t){return r+B1.getTypeSize("SHORT")<=e.byteLength?B1.getShortAt(e,r,t):0}function lNe(e,r,t,a,n,i){const u=B1.getTypeSize("SHORT"),c=u+B1.getTypeSize("SHORT"),A=c+B1.getTypeSize("LONG"),d=B1.getShortAt(e,a,n),g=B1.getShortAt(e,a+u,n),m=B1.getLongAt(e,a+c,n);let b,w;if(B1.typeSizes[g]===void 0||!i&&oA[r][d]===void 0)return;if(uNe(g,m))w=a+A,b=O1e(e,w,g,m,n);else if(w=B1.getLongAt(e,a+A,n),cNe(e,t,w,g,m)){const _=d===33723;b=O1e(e,t+w,g,m,n,_)}else b="<faulty value>";g===B1.tagTypes.ASCII&&(b=fNe(b),b=ANe(b));let E=`undefined-${d}`,x=b;if(oA[r][d]!==void 0)if(oA[r][d].name!==void 0&&oA[r][d].description!==void 0){E=oA[r][d].name;try{x=oA[r][d].description(b)}catch{x=D1e(b)}}else g===B1.tagTypes.RATIONAL||g===B1.tagTypes.SRATIONAL?(E=oA[r][d],x=""+b[0]/b[1]):(E=oA[r][d],x=D1e(b));return{id:d,name:E,value:b,description:x,__offset:w}}function uNe(e,r){return B1.typeSizes[e]*r<=B1.getTypeSize("LONG")}function O1e(e,r,t,a,n,i=!1){let s=[];i&&(a=a*B1.typeSizes[t],t=B1.tagTypes.BYTE);for(let u=0;u<a;u++)s.push(oNe[t](e,r,n)),r+=B1.typeSizes[t];return t===B1.tagTypes.ASCII?s=B1.getAsciiValue(s):s.length===1&&(s=s[0]),s}function cNe(e,r,t,a,n){return r+t+B1.typeSizes[a]*n<=e.byteLength}function fNe(e){const r=[];let t=0;for(let a=0;a<e.length;a++){if(e[a]==="\0"){t++;continue}r[t]===void 0&&(r[t]=""),r[t]+=e[a]}return r}function ANe(e){try{return e.map(r=>decodeURIComponent(escape(r)))}catch{return e}}function D1e(e){return e instanceof Array?e.join(", "):e}const B1e="Exif IFD Pointer",N1e="GPS Info IFD Pointer",F1e="Interoperability IFD Pointer",Z1e={read:dNe};function dNe(e,r,t){const a=Gu.getByteOrder(e,r);let n=hNe(e,r,a,t);return n=pNe(n,e,r,a,t),n=mNe(n,e,r,a,t),n=gNe(n,e,r,a,t),{tags:n,byteOrder:a}}function hNe(e,r,t,a){return sA(e,eB,r,M1e(e,r,t),t,a)}function pNe(e,r,t,a,n){return e[B1e]!==void 0?z0(e,sA(r,k1e,t,t+e[B1e].value,a,n)):e}function mNe(e,r,t,a,n){return e[N1e]!==void 0?z0(e,sA(r,_1e,t,t+e[N1e].value,a,n)):e}function gNe(e,r,t,a,n){return e[F1e]!==void 0?z0(e,sA(r,C1e,t,t+e[F1e].value,a,n)):e}const bNe={read:vNe},J6=16;function vNe(e,r,t){const a=Gu.getByteOrder(e,r),n=sA(e,S1e,r,M1e(e,r,a),a,t);return yNe(e,r,n,a)}function yNe(e,r,t,a){if(!t.MPEntry)return t;const n=[];for(let i=0;i<Math.ceil(t.MPEntry.value.length/J6);i++){n[i]={};const s=Xg(t.MPEntry.value,i*J6,B1.getTypeSize("LONG"),a);n[i].ImageFlags=wNe(s),n[i].ImageFormat=ENe(s),n[i].ImageType=xNe(s);const u=Xg(t.MPEntry.value,i*J6+4,B1.getTypeSize("LONG"),a);n[i].ImageSize={value:u,description:""+u};const c=kNe(i,t.MPEntry,a,r);n[i].ImageOffset={value:c,description:""+c};const A=Xg(t.MPEntry.value,i*J6+12,B1.getTypeSize("SHORT"),a);n[i].DependentImage1EntryNumber={value:A,description:""+A};const d=Xg(t.MPEntry.value,i*J6+14,B1.getTypeSize("SHORT"),a);n[i].DependentImage2EntryNumber={value:d,description:""+d},n[i].image=e.buffer.slice(c,c+u),qee(n[i],"base64",function(){return Lee(this.image)})}return t.Images=n,t}function Xg(e,r,t,a){if(a===Gu.LITTLE_ENDIAN){let i=0;for(let s=0;s<t;s++)i+=e[r+s]<<8*s;return i}let n=0;for(let i=0;i<t;i++)n+=e[r+i]<<8*(t-1-i);return n}function wNe(e){const r=[e>>31&1,e>>30&1,e>>29&1],t=[];return r[0]&&t.push("Dependent Parent Image"),r[1]&&t.push("Dependent Child Image"),r[2]&&t.push("Representative Image"),{value:r,description:t.join(", ")||"None"}}function ENe(e){const r=e>>24&7;return{value:r,description:r===0?"JPEG":"Unknown"}}function xNe(e){const r=e&16777215;return{value:r,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[r]||"Unknown"}}function kNe(e,r,t,a){return _Ne(e)?0:Xg(r.value,e*J6+8,B1.getTypeSize("LONG"),t)+a}function _Ne(e){return e===0}const CNe={read:SNe};function SNe(e,r){const t=TNe(e,r),a=ONe(e,r,t);return{"Bits Per Sample":INe(e,r,t),"Image Height":RNe(e,r,t),"Image Width":MNe(e,r,t),"Color Components":a,Subsampling:a&&DNe(e,r,a.value,t)}}function TNe(e,r){return B1.getShortAt(e,r)}function INe(e,r,t){if(3>t)return;const i=B1.getByteAt(e,r+2);return{value:i,description:""+i}}function RNe(e,r,t){if(5>t)return;const i=B1.getShortAt(e,r+3);return{value:i,description:`${i}px`}}function MNe(e,r,t){if(7>t)return;const i=B1.getShortAt(e,r+5);return{value:i,description:`${i}px`}}function ONe(e,r,t){if(8>t)return;const i=B1.getByteAt(e,r+7);return{value:i,description:""+i}}function DNe(e,r,t,a){if(8+3*t>a)return;const s=[];for(let u=0;u<t;u++){const c=r+8+u*3;s.push([B1.getByteAt(e,c),B1.getByteAt(e,c+1),B1.getByteAt(e,c+2)])}return{value:s,description:s.length>1?BNe(s)+NNe(s):""}}function BNe(e){const r={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map(t=>r[t[0]]).join("")}function NNe(e){const r={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return e.length===0||e[0][1]===void 0||r[e[0][1]]===void 0?"":r[e[0][1]]}const FNe={read:ZNe};function ZNe(e,r){const t=PNe(e,r),a=zNe(e,r,t),n=UNe(e,r,t),i={"JFIF Version":jNe(e,r,t),"Resolution Unit":qNe(e,r,t),XResolution:VNe(e,r,t),YResolution:GNe(e,r,t),"JFIF Thumbnail Width":a,"JFIF Thumbnail Height":n};if(a!==void 0&&n!==void 0){const s=WNe(e,r,3*a.value*n.value,t);s&&(i["JFIF Thumbnail"]=s)}for(const s in i)i[s]===void 0&&delete i[s];return i}function PNe(e,r){return B1.getShortAt(e,r)}function jNe(e,r,t){if(9>t)return;const i=B1.getByteAt(e,r+7),s=B1.getByteAt(e,r+7+1);return{value:i*256+s,description:i+"."+s}}function qNe(e,r,t){if(10>t)return;const i=B1.getByteAt(e,r+9);return{value:i,description:LNe(i)}}function LNe(e){return e===0?"None":e===1?"inches":e===2?"cm":"Unknown"}function VNe(e,r,t){if(12>t)return;const i=B1.getShortAt(e,r+10);return{value:i,description:""+i}}function GNe(e,r,t){if(14>t)return;const i=B1.getShortAt(e,r+12);return{value:i,description:""+i}}function zNe(e,r,t){if(15>t)return;const i=B1.getByteAt(e,r+14);return{value:i,description:`${i}px`}}function UNe(e,r,t){if(16>t)return;const i=B1.getByteAt(e,r+15);return{value:i,description:`${i}px`}}function WNe(e,r,t,a){return t===0||16+t>a?void 0:{value:e.buffer.slice(r+16,r+16+t),description:"<24-bit RGB pixel data>"}}const lA={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:nB},336:{name:"Time Sent",description:iB},346:{name:"Coded Character Set",description:P1e,encoding_name:P1e},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>ca(e)==="01"?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const r=ca(e).split(":");return r[2]+(r[3]?"/"+r[3]:"")+(r[4]?"/"+r[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const r=ca(e);return r==="01"?"Object Kill":r==="02"?"Object Replace":r==="03"?"Object Append":r==="04"?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:nB},572:{name:"Time Created",description:iB},574:{name:"Digital Creation Date",description:nB},575:{name:"Digital Creation Time",description:iB},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const r=ca(e);return r==="a"?"morning":r==="p"?"evening":r==="b"?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const r=ca(e);return r==="P"?"Portrait":r==="L"?"Landscape":r==="S"?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const r=ca(e),t=r.charAt(0),a=r.charAt(1);let n="";return t==="1"?n+="Mono":t==="2"&&(n+="Stereo"),a==="A"?n+=", actuality":a==="C"?n+=", question and answer session":a==="M"?n+=", music, transmitted by itself":a==="Q"?n+=", response to a question":a==="R"?n+=", raw sound":a==="S"?n+=", scener":a==="V"?n+=", voicer":a==="W"&&(n+=", wrap"),n!==""?n:r}},663:{name:"Audio Sampling Rate",description:e=>parseInt(ca(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const r=parseInt(ca(e),10);return r+(r===1?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const r=ca(e);return r.length>=6?r.substr(0,2)+":"+r.substr(2,2)+":"+r.substr(4,2):r}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>e.length===2?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(e.length===2){const r=(e[0]<<8)+e[1];return r===0?"No ObjectData":r===1?"IPTC-NAA Digital Newsphoto Parameter Record":r===2?"IPTC7901 Recommended Message Format":r===3?"Tagged Image File Format (Adobe/Aldus Image data)":r===4?"Illustrator (Adobe Graphics data)":r===5?"AppleSingle (Apple Computer Inc)":r===6?"NAA 89-3 (ANPA 1312)":r===7?"MacBinary II":r===8?"IPTC Unstructured Character Oriented File Format (UCOFF)":r===9?"United Press International ANPA 1312 variant":r===10?"United Press International Down-Load Message":r===11?"JPEG File Interchange (JFIF)":r===12?"Photo-CD Image-Pac (Eastman Kodak)":r===13?"Microsoft Bit Mapped Graphics File [*.BMP]":r===14?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":r===15?"Audio plus Moving Video [*.AVI] (Microsoft)":r===16?"PC DOS/Windows Executable Files [*.COM][*.EXE]":r===17?"Compressed Binary File [*.ZIP] (PKWare Inc)":r===18?"Audio Interchange File Format AIFF (Apple Computer Inc)":r===19?"RIFF Wave (Microsoft Corporation)":r===20?"Freehand (Macromedia/Aldus)":r===21?'Hypertext Markup Language "HTML" (The Internet Society)':r===22?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":r===23?"MPEG 2 Audio Layer 3, ISO/IEC":r===24?"Portable Document File (*.PDF) Adobe":r===25?"News Industry Text Format (NITF)":r===26?"Tape Archive (*.TAR)":r===27?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":r===28?"Ritzaus Bureau NITF version (RBNITF DTD)":r===29?"Corel Draw [*.CDR]":`Unknown format ${r}`}return ca(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,r)=>{const t={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},a=ca(e);if(r["ObjectData Preview File Format"]){const n=ca(r["ObjectData Preview File Format"].value);if(t[n]&&t[n][a])return t[n][a]}return a}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}}}};function nB(e){const r=ca(e);return r.length>=8?r.substr(0,4)+"-"+r.substr(4,2)+"-"+r.substr(6,2):r}function iB(e){const r=ca(e);let t=r;return r.length>=6&&(t=r.substr(0,2)+":"+r.substr(2,2)+":"+r.substr(4,2),r.length===11&&(t+=r.substr(6,1)+r.substr(7,2)+":"+r.substr(9,2))),t}function P1e(e){const r=ca(e);return r==="\x1B%G"?"UTF-8":r==="\x1B%5"?"Windows-1252":r==="\x1B%/G"?"UTF-8 Level 1":r==="\x1B%/H"?"UTF-8 Level 2":r==="\x1B%/I"?"UTF-8 Level 3":r==="\x1B/A"?"ISO-8859-1":r==="\x1B/B"?"ISO-8859-2":r==="\x1B/C"?"ISO-8859-3":r==="\x1B/D"?"ISO-8859-4":r==="\x1B/@"?"ISO-8859-5":r==="\x1B/G"?"ISO-8859-6":r==="\x1B/F"?"ISO-8859-7":r==="\x1B/H"?"ISO-8859-8":"Unknown"}const XNe={get:HNe};function HNe(){if(typeof TextDecoder<"u")return TextDecoder}const j1e={decode:$Ne,TAG_HEADER_SIZE:5};function $Ne(e,r){const t=XNe.get();if(typeof t<"u"&&e!==void 0)try{return new t(e).decode(r instanceof DataView?r.buffer:Uint8Array.from(r))}catch{}const a=r.map(n=>String.fromCharCode(n)).join("");return YNe(a)}function YNe(e){try{return decodeURIComponent(escape(e))}catch{return e}}const QNe=943868237,Hg=4,jx=2,JNe=1,KNe=2,q1e=4,eFe=Hg+jx+KNe+q1e,rFe=1028,L1e=5,oB={read:tFe};function tFe(e,r,t){try{if(Array.isArray(e))return V1e(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,t);const{naaBlock:a,dataOffset:n}=aFe(e,r);return V1e(e,a,n,t)}catch{return{}}}function aFe(e,r){for(;r+eFe<=e.byteLength;){const t=nFe(e,r);if(iFe(t))return{naaBlock:t,dataOffset:r+t.headerSize};r+=t.headerSize+t.size+oFe(t)}throw new Error("No IPTC NAA resource block.")}function nFe(e,r){if(e.getUint32(r,!1)!==QNe)throw new Error("Not an IPTC resource block.");const t=e.getUint8(r+Hg+jx),a=(t%2===0?t+1:t)+JNe;return{headerSize:Hg+jx+a+q1e,type:e.getUint16(r+Hg),size:e.getUint32(r+Hg+jx+a)}}function iFe(e){return e.type===rFe}function oFe(e){return e.size%2!==0?1:0}function V1e(e,r,t,a){const n={};let i;const s=t+r.size;for(;t<s&&t<e.byteLength;){const{tag:u,tagSize:c}=sFe(e,t,n,i,a);if(u===null)break;u&&("encoding"in u&&(i=u.encoding),n[u.name]===void 0||u.repeatable===void 0?n[u.name]={id:u.id,value:u.value,description:u.description}:(n[u.name]instanceof Array||(n[u.name]=[{id:n[u.name].id,value:n[u.name].value,description:n[u.name].description}]),n[u.name].push({id:u.id,value:u.value,description:u.description}))),t+=L1e+c}return n}function sFe(e,r,t,a,n){if(lFe(e,r))return{tag:null,tagSize:0};const u=e.getUint16(r+1),c=e.getUint16(r+3);if(!n&&!lA.iptc[u])return{tag:void 0,tagSize:c};const A=uFe(e,r+L1e,c),d={id:u,name:cFe(lA.iptc[u],u,A),value:A,description:dFe(lA.iptc[u],A,t,a)};return mFe(u)&&(d.repeatable=!0),gFe(u)&&(d.encoding=lA.iptc[u].encoding_name(A)),{tag:d,tagSize:c}}function lFe(e,r){return e.getUint8(r)!==28}function uFe(e,r,t){const a=[];for(let n=0;n<t;n++)a.push(e.getUint8(r+n));return a}function cFe(e,r,t){return e?fFe(e)?e:AFe(e)?e.name(t):e.name:`undefined-${r}`}function fFe(e){return typeof e=="string"}function AFe(e){return typeof e.name=="function"}function dFe(e,r,t,a){if(pFe(e))try{return e.description(r,t)}catch{}return hFe(e,r)?j1e.decode(a,r):r}function hFe(e,r){return e&&r instanceof Array}function pFe(e){return e&&e.description!==void 0}function mFe(e){return lA.iptc[e]&&lA.iptc[e].repeatable}function gFe(e){return lA.iptc[e]&&lA.iptc[e].encoding_name!==void 0}const qx={"tiff:Orientation"(e){return e==="1"?"Horizontal (normal)":e==="2"?"Mirror horizontal":e==="3"?"Rotate 180":e==="4"?"Mirror vertical":e==="5"?"Mirror horizontal and rotate 270 CW":e==="6"?"Rotate 90 CW":e==="7"?"Mirror horizontal and rotate 90 CW":e==="8"?"Rotate 270 CW":e},"tiff:ResolutionUnit":e=>C0.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>K6(C0.XResolution,e),"tiff:YResolution":e=>K6(C0.YResolution,e),"exif:ApertureValue":e=>K6(C0.ApertureValue,e),"exif:GPSLatitude":z1e,"exif:GPSLongitude":z1e,"exif:FNumber":e=>K6(C0.FNumber,e),"exif:FocalLength":e=>K6(C0.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>C0.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>C0.ColorSpace(bFe(e)),"exif:ComponentsConfiguration"(e,r){if(/^\d, \d, \d, \d$/.test(r)){const t=r.split(", ").map(a=>a.charCodeAt(0));return C0.ComponentsConfiguration(t)}return r},"exif:Contrast":e=>C0.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>C0.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>C0.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>C0.ExposureProgram(parseInt(e,10)),"exif:ExposureTime"(e){return G1e(e)?C0.ExposureTime(e.split("/").map(r=>parseInt(r,10))):e},"exif:MeteringMode":e=>C0.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>C0.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>C0.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>C0.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>K6(C0.ShutterSpeedValue,e),"exif:WhiteBalance":e=>C0.WhiteBalance(parseInt(e,10))};function K6(e,r){return G1e(r)?e(r.split("/")):r}function bFe(e){return e.substring(0,2)==="0x"?parseInt(e.substring(2),16):parseInt(e,10)}function G1e(e){return/^-?\d+\/-?\d+$/.test(e)}function z1e(e){const[r,t]=e.split(",");if(r!==void 0&&t!==void 0){const a=parseFloat(r),n=parseFloat(t),i=t.charAt(t.length-1);if(!Number.isNaN(a)&&!Number.isNaN(n))return""+(a+n/60)+i}return e}const vFe={get:yFe};function yFe(e){if(e)return e;if(typeof DOMParser<"u")return new DOMParser;try{const{DOMParser:r,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new r({onError:t})}catch{return}}function wFe(e){const r=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let t=0;t<r.length;t++)if(new RegExp(r[t]).test(e.message))return!0;return!1}function EFe(e){const r=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!r)return e;const t=r[1],a=xFe(e),i=kFe(e).filter(u=>a.indexOf(u)===-1);if(i.length===0)return e;const s=CFe(i);return SFe(e,t,s)}function xFe(e){const r=[],t=/xmlns:([\w-]+)=["'][^"']+["']/g;let a;for(;(a=t.exec(e))!==null;)r.indexOf(a[1])===-1&&r.push(a[1]);return r}function kFe(e){const r=[],t=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let a;for(;(a=t.exec(e))!==null;){const n=a[1];n==="xmlns"||n==="xml"||r.indexOf(n)===-1&&r.push(n)}return r}const _Fe={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};function CFe(e){const r=[];for(let t=0;t<e.length;t++){const a=e[t],n=_Fe[a]||"http://fallback.namespace/"+a;r.push(" xmlns:"+a+'="'+n+'"')}return r.join("")}function SFe(e,r,t){const a=new RegExp("<"+r+"([^>]*)>");return e.replace(a,"<"+r+"$1"+t+">")}const U1e={read:IFe};class TFe extends Error{constructor(r){super(r),this.name="ParseError"}}function IFe(e,r,t){const a={};if(typeof e=="string")return Lx(a,e,t),a;const[n,i]=RFe(e,r),s=Lx(a,n,t);if(i){const u=Lx(a,i,t);!s&&!u&&(delete a._raw,Lx(a,sB(e,r),t))}return a}function RFe(e,r){if(r.length===0)return[];const t=[sB(e,r.slice(0,1))];return r.length>1&&t.push(sB(e,r.slice(1))),t}function sB(e,r){const t=r.reduce((i,s)=>i+s.length,0),a=new Uint8Array(t);let n=0;for(let i=0;i<r.length;i++){const s=r[i],u=e.buffer.slice(s.dataOffset,s.dataOffset+s.length);a.set(new Uint8Array(u),n),n+=s.length}return new DataView(a.buffer)}function Lx(e,r,t){try{const{doc:a,raw:n}=MFe(r,t);e._raw=(e._raw||"")+n;const i=X1e(a);return z0(e,$1e(H1e(i,!0))),!0}catch{return!1}}function MFe(e,r){const t=vFe.get(r);if(!t)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const a=typeof e=="string"?e:O0(e,0,e.byteLength);return{doc:W1e(t,OFe(a)),raw:a}}function OFe(e){return e.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")}function W1e(e,r,t=!1){try{const a=e.parseFromString(r,"application/xml"),n=a.getElementsByTagName("parsererror");if(n.length>0)throw new TFe(n[0].textContent);return a}catch(a){if(a.name==="ParseError"&&wFe(a)&&!t)return W1e(e,EFe(r),!0);throw a}}function X1e(e){for(let r=0;r<e.childNodes.length;r++){if(e.childNodes[r].tagName==="x:xmpmeta")return X1e(e.childNodes[r]);if(e.childNodes[r].tagName==="rdf:RDF")return e.childNodes[r]}throw new Error}function H1e(e,r=!1){const t=DFe(e);return BFe(t)?r?{}:NFe(t[0]):FFe(t)}function DFe(e){const r=[];for(let t=0;t<e.childNodes.length;t++)r.push(e.childNodes[t]);return r}function BFe(e){return e.length===1&&e[0].nodeName==="#text"}function NFe(e){return e.nodeValue}function FFe(e){const r={};return e.forEach(t=>{if(ZFe(t)){const a=PFe(t);r[t.nodeName]!==void 0?(Array.isArray(r[t.nodeName])||(r[t.nodeName]=[r[t.nodeName]]),r[t.nodeName].push(a)):r[t.nodeName]=a}}),r}function ZFe(e){return e.nodeName&&e.nodeName!=="#text"}function PFe(e){return{attributes:jFe(e),value:H1e(e)}}function jFe(e){const r={};for(let t=0;t<e.attributes.length;t++)r[e.attributes[t].nodeName]=decodeURIComponent(escape(e.attributes[t].value));return r}function $1e(e){const r={};if(typeof e=="string")return e;for(const t in e){let a=e[t];Array.isArray(a)||(a=[a]),a.forEach(n=>{z0(r,lB(n.attributes)),typeof n.value=="object"&&z0(r,Y1e(n.value))})}return r}function lB(e){const r={};for(const t in e)try{qFe(t)&&(r[Gx(t)]={value:e[t],attributes:{},description:uc(e[t],t)})}catch{}return r}function qFe(e){return e!=="rdf:parseType"&&!Vx(e)}function Vx(e){return e.split(":")[0]==="xmlns"}function Gx(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function uc(e,r=void 0){if(Array.isArray(e)){const t=LFe(e);return r&&typeof qx[r]=="function"?qx[r](e,t):t}if(typeof e=="object")return VFe(e);try{return r&&typeof qx[r]=="function"?qx[r](e):decodeURIComponent(escape(e))}catch{return e}}function LFe(e){return e.map(r=>r.value!==void 0?uc(r.value):uc(r)).join(", ")}function VFe(e){const r=[];for(const t in e)r.push(`${GFe(t)}: ${uc(e[t].value)}`);return r.join("; ")}function GFe(e){return e==="CiAdrCity"?"CreatorCity":e==="CiAdrCtry"?"CreatorCountry":e==="CiAdrExtadr"?"CreatorAddress":e==="CiAdrPcode"?"CreatorPostalCode":e==="CiAdrRegion"?"CreatorRegion":e==="CiEmailWork"?"CreatorWorkEmail":e==="CiTelWork"?"CreatorWorkPhone":e==="CiUrlWork"?"CreatorWorkUrl":e}function Y1e(e){const r={};for(const t in e)try{Vx(t)||(r[Gx(t)]=zFe(e[t],t))}catch{}return r}function zFe(e,r){return WFe(e)?XFe(e,r):UFe(e)?{value:"",attributes:{},description:""}:Q1e(e)?J1e(e,r):K1e(e)?e0e(e,r):r0e(e)?t0e(e,r):YFe(e)?QFe(e,r):uB(e,r)}function UFe(e){return e.attributes["rdf:parseType"]==="Resource"&&typeof e.value=="string"&&e.value.trim()===""}function WFe(e){return Array.isArray(e)}function XFe(e,r){return uB(e[e.length-1],r)}function Q1e(e){return e.attributes["rdf:parseType"]==="Resource"&&e.value["rdf:value"]!==void 0||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]!==void 0}function J1e(e,r){const t=$g(e);e.value["rdf:Description"]!==void 0&&(e=e.value["rdf:Description"]),z0(t,$g(e),HFe(e));const a=$Fe(e);return{value:a,attributes:t,description:uc(a,r)}}function $g(e){const r={};for(const t in e.attributes)t!=="rdf:parseType"&&t!=="rdf:resource"&&!Vx(t)&&(r[Gx(t)]=e.attributes[t]);return r}function HFe(e){const r={};for(const t in e.value)t!=="rdf:value"&&!Vx(t)&&(r[Gx(t)]=e.value[t].value);return r}function $Fe(e){return n0e(e.value["rdf:value"])||e.value["rdf:value"].value}function K1e(e){return e.attributes["rdf:parseType"]==="Resource"||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]===void 0}function e0e(e,r){const t={value:{},attributes:{}};return e.value["rdf:Description"]!==void 0&&(z0(t.value,lB(e.value["rdf:Description"].attributes)),z0(t.attributes,$g(e)),e=e.value["rdf:Description"]),z0(t.value,Y1e(e.value)),t.description=uc(t.value,r),t}function r0e(e){return Object.keys(e.value).length===0&&e.attributes["xml:lang"]===void 0&&e.attributes["rdf:resource"]===void 0}function t0e(e,r){const t=lB(e.attributes);return{value:t,attributes:{},description:uc(t,r)}}function YFe(e){return a0e(e.value)!==void 0}function a0e(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function QFe(e,r){let t=a0e(e.value).value["rdf:li"];const a=$g(e),n=[];return t===void 0?t=[]:Array.isArray(t)||(t=[t]),t.forEach(i=>{n.push(JFe(i))}),{value:n,attributes:a,description:uc(n,r)}}function JFe(e){return Q1e(e)?J1e(e):K1e(e)?e0e(e).value:r0e(e)?t0e(e).value:uB(e)}function uB(e,r){const t=n0e(e)||$1e(e.value);return{value:t,attributes:$g(e),description:uc(t,r)}}function n0e(e){return e.attributes&&e.attributes["rdf:resource"]}const cc={CLOSED_SUBPATH_LENGTH:0,CLOSED_SUBPATH_BEZIER_LINKED:1,CLOSED_SUBPATH_BEZIER_UNLINKED:2,OPEN_SUBPATH_LENGTH:3,OPEN_SUBPATH_BEZIER_LINKED:4,OPEN_SUBPATH_BEZIER_UNLINKED:5,FILL_RULE:6,CLIPBOARD:7,INITIAL_FILL_RULE:8},i0e=24,cB={2e3:{name:"PathInformation",description:KFe},2999:{name:"ClippingPathName",description(e){const[,r]=jee(e,0);return r}}};function KFe(e){const t={},a=[];for(let n=0;n<e.byteLength;n+=2+i0e){const i=B1.getShortAt(e,n);fB[i]&&(t[i]||(t[i]=fB[i].description),a.push({type:i,path:fB[i].path(e,n+2)}))}return JSON.stringify({types:t,paths:a})}const fB={[cc.CLOSED_SUBPATH_LENGTH]:{description:"Closed subpath length",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.CLOSED_SUBPATH_BEZIER_LINKED]:{description:"Closed subpath Bezier knot, linked",path:zx},[cc.CLOSED_SUBPATH_BEZIER_UNLINKED]:{description:"Closed subpath Bezier knot, unlinked",path:zx},[cc.OPEN_SUBPATH_LENGTH]:{description:"Open subpath length",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.OPEN_SUBPATH_BEZIER_LINKED]:{description:"Open subpath Bezier knot, linked",path:zx},[cc.OPEN_SUBPATH_BEZIER_UNLINKED]:{description:"Open subpath Bezier knot, unlinked",path:zx},[cc.FILL_RULE]:{description:"Path fill rule",path:()=>[]},[cc.INITIAL_FILL_RULE]:{description:"Initial fill rule",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.CLIPBOARD]:{description:"Clipboard",path:rZe}};function zx(e,r){const a=[];for(let n=0;n<i0e;n+=8)a.push(eZe(e,r+n));return a}function eZe(e,r){const t=Ad(e,r,8);return[Ad(e,r+4,8),t]}function rZe(e,r){return[[Ad(e,r,8),Ad(e,r+4,8),Ad(e,r+8,8),Ad(e,r+12,8)],Ad(e,r+16,8)]}function Ad(e,r,t){const a=B1.getLongAt(e,r),n=a>>>31?-1:1,i=(a&2130706432)>>>32-t,s=a&parseInt(Vee("1",32-t),2);return n*eDe(i.toString(2)+"."+KOe(s.toString(2),32-t,"0"),2)}const tZe={read:iZe},o0e="8BIM",aZe=2,nZe=4,s0e=o0e.length;function iZe(e,r){const t=Pee(new Uint8Array(e).buffer),a={};let n=0;for(;n<e.length;){const i=O0(t,n,s0e);n+=s0e;const s=B1.getShortAt(t,n);n+=aZe;const{tagName:u,tagNameSize:c}=oZe(t,n);n+=c;const A=B1.getLongAt(t,n);if(n+=nZe,i===o0e){const d=Pee(t.buffer,n,A),g={id:s,value:O0(d,0,A)};if(cB[s]){try{g.description=cB[s].description(d)}catch{g.description="<no description formatter>"}a[u||cB[s].name]=g}else r&&(a[`undefined-${s}`]=g)}n+=A+A%2}return a}function oZe(e,r){const[t,a]=jee(e,r);return{tagName:a,tagNameSize:1+t+(t%2===0?1:0)}}const l0e={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},u0e={4:{name:"Preferred CMM type",value:(e,r)=>O0(e,r,4),description:e=>e!==null?AB(e):""},8:{name:"Profile Version",value:(e,r)=>e.getUint8(r).toString(10)+"."+(e.getUint8(r+1)>>4).toString(10)+"."+(e.getUint8(r+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,r)=>O0(e,r,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,r)=>O0(e,r,4)},20:{name:"Connection Space",value:(e,r)=>O0(e,r,4)},24:{name:"ICC Profile Date",value:(e,r)=>sZe(e,r).toISOString()},36:{name:"ICC Signature",value:(e,r)=>lZe(e.buffer.slice(r,r+4))},40:{name:"Primary Platform",value:(e,r)=>O0(e,r,4),description:e=>AB(e)},48:{name:"Device Manufacturer",value:(e,r)=>O0(e,r,4),description:e=>AB(e)},52:{name:"Device Model Number",value:(e,r)=>O0(e,r,4)},64:{name:"Rendering Intent",value:(e,r)=>e.getUint32(r),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,r)=>O0(e,r,4)}};function sZe(e,r){const t=e.getUint16(r),a=e.getUint16(r+2)-1,n=e.getUint16(r+4),i=e.getUint16(r+6),s=e.getUint16(r+8),u=e.getUint16(r+10);return new Date(Date.UTC(t,a,n,i,s,u))}function lZe(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function AB(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}const c0e={read:gZe},uZe=84,cZe=128,fZe="acsp",AZe="desc",dZe="mluc",hZe="text",pZe="sig ",mZe=12;function gZe(e,r,t){return t&&r[0].compressionMethod!==Mx?bZe(e,r):yZe(e,r)}function bZe(e,r){if(!vZe(r[0].compressionMethod))return{};const t=new DataView(e.buffer.slice(r[0].offset,r[0].offset+r[0].length));return zee(t,r[0].compressionMethod,"utf-8","dataview").then(f0e).catch(()=>({}))}function vZe(e){return e===Gee}function yZe(e,r){try{const t=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t);let n=0;const i=wZe(e);for(let s=1;s<=r.length;s++){const u=r.find(d=>d.chunkNumber===s);if(!u)throw new Error(`ICC chunk ${s} not found`);const c=i.slice(u.offset,u.offset+u.length),A=new Uint8Array(c);a.set(A,n),n+=A.length}return f0e(new DataView(a.buffer))}catch{return{}}}function wZe(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}function EZe(e){return e.length<cZe+4}function xZe(e,r){return e.length<r+mZe}function f0e(e){const r=e.buffer,t=e.getUint32();if(e.byteLength!==t)throw new Error("ICC profile length not matching");if(e.byteLength<uZe)throw new Error("ICC profile too short");const a={},n=Object.keys(u0e);for(let c=0;c<n.length;c++){const A=n[c],d=u0e[A],g=d.value(e,parseInt(A,10));let m=g;d.description&&(m=d.description(g)),a[d.name]={value:g,description:m}}if(Ux(r.slice(36,40))!==fZe)throw new Error("ICC profile: missing signature");if(EZe(r))return a;const s=e.getUint32(128);let u=132;for(let c=0;c<s;c++){if(xZe(r,u))return a;const A=O0(e,u,4),d=e.getUint32(u+4),g=e.getUint32(u+8);if(d>r.length)return a;const m=O0(e,d,4);if(m===AZe){const b=e.getUint32(d+8);if(b>g)return a;const w=Ux(r.slice(d+12,d+b+11));Yg(a,A,w)}else if(m===dZe){const b=e.getUint32(d+8),w=e.getUint32(d+12);let E=d+16;const x=[];for(let _=0;_<b;_++){const I=O0(e,E+0,2),S=O0(e,E+2,2),R=e.getUint32(E+4),M=e.getUint32(E+8),N=QOe(e,d+M,R);x.push({languageCode:I,countryCode:S,text:N}),E+=w}if(b===1)Yg(a,A,x[0].text);else{const _={};for(let I=0;I<x.length;I++)_[`${x[I].languageCode}-${x[I].countryCode}`]=x[I].text;Yg(a,A,_)}}else if(m===hZe){const b=Ux(r.slice(d+8,d+g-7));Yg(a,A,b)}else if(m===pZe){const b=Ux(r.slice(d+8,d+12));Yg(a,A,b)}u=u+12}return a}function Ux(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Yg(e,r,t){l0e[r]?e[l0e[r].name]={value:t,description:t}:e[r]={value:t,description:t}}const Wx=27,kZe={read:_Ze,SHOT_INFO_AUTO_ROTATE:Wx};function _Ze(e,r,t,a,n){let i=sA(e,T1e,r,r+t,a,n);return i.ShotInfo&&(i=z0({},i,CZe(i.ShotInfo.value)),delete i.ShotInfo),i}function CZe(e){const r={};return e[Wx]!==void 0&&(r.AutoRotate={value:e[Wx],description:SZe(e[Wx])}),r}function SZe(e){return e===0?"None":e===1?"Rotate 90 CW":e===2?"Rotate 180":e===3?"Rotate 270 CW":"Unknown"}const A0e=8,d0e=A0e+2,h0e={K3_III:78420},Xx={CAMERA_ORIENTATION:1,ROLL_ANGLE:3,PITCH_ANGLE:5},TZe={read:IZe,PENTAX_IFD_OFFSET:d0e,MODEL_ID:h0e,LIK3III:Xx};function IZe(e,r,t,a){const n=Gu.getByteOrder(e,r+t+A0e),i=r+t;let s=sA(e,rB,i,i+d0e,n,a);return RZe(s)&&(s=z0({},s,MZe(e,i+s.LevelInfo.__offset,n)),delete s.LevelInfo),s}function RZe(e){return e.PentaxModelID&&e.PentaxModelID.value===h0e.K3_III&&e.LevelInfo}function MZe(e,r,t){const a={};if(r+7>e.byteLength)return a;const n=e.getInt8(r+Xx.CAMERA_ORIENTATION);a.CameraOrientation={value:n,description:OZe(n)};const i=e.getInt16(r+Xx.ROLL_ANGLE,t===Gu.LITTLE_ENDIAN);a.RollAngle={value:i,description:DZe(i)};const s=e.getInt16(r+Xx.PITCH_ANGLE,t===Gu.LITTLE_ENDIAN);return a.PitchAngle={value:s,description:BZe(s)},a}function OZe(e){return e===0?"Horizontal (normal)":e===1?"Rotate 270 CW":e===2?"Rotate 180":e===3?"Rotate 90 CW":e===4?"Upwards":e===5?"Downwards":"Unknown"}function DZe(e){return""+e*-.5}function BZe(e){return""+e*-.5}const NZe={read:FZe};function FZe(e,r){return{"Image Width":ZZe(e,r),"Image Height":PZe(e,r),"Bit Depth":jZe(e,r),"Color Type":qZe(e,r),Compression:LZe(e,r),Filter:VZe(e,r),Interlace:GZe(e,r)}}function ZZe(e,r){if(r+0+4>e.byteLength)return;const n=B1.getLongAt(e,r);return{value:n,description:`${n}px`}}function PZe(e,r){if(r+4+4>e.byteLength)return;const n=B1.getLongAt(e,r+4);return{value:n,description:`${n}px`}}function jZe(e,r){if(r+8+1>e.byteLength)return;const n=B1.getByteAt(e,r+8);return{value:n,description:`${n}`}}function qZe(e,r){const n={0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"};if(r+9+1>e.byteLength)return;const i=B1.getByteAt(e,r+9);return{value:i,description:n[i]||"Unknown"}}function LZe(e,r){if(r+10+1>e.byteLength)return;const n=B1.getByteAt(e,r+10);return{value:n,description:n===0?"Deflate/Inflate":"Unknown"}}function VZe(e,r){if(r+11+1>e.byteLength)return;const n=B1.getByteAt(e,r+11);return{value:n,description:n===0?"Adaptive":"Unknown"}}function GZe(e,r){const n={0:"Noninterlaced",1:"Adam7 Interlace"};if(r+12+1>e.byteLength)return;const i=B1.getByteAt(e,r+12);return{value:i,description:n[i]||"Unknown"}}const zZe={read:$Ze},dB="STATE_KEYWORD",hB="STATE_COMPRESSION",pB="STATE_LANG",UZe="STATE_TRANSLATED_KEYWORD",mB="STATE_TEXT",WZe=1,XZe=1,HZe=6;function $Ze(e,r,t,a){const n={},i=[];for(let s=0;s<r.length;s++){const{offset:u,length:c,type:A}=r[s],d=YZe(e,u,c,A,t);if(d instanceof Promise)i.push(d.then(({name:g,value:m,description:b})=>{try{if(Uee.USE_EXIF&&m0e(g,m))return{__exif:Z1e.read(b0e(m),HZe,a).tags};if(Uee.USE_IPTC&&g0e(g,m))return{__iptc:oB.read(b0e(m),0,a)};if(g&&!m0e(g,m)&&!g0e(g,m))return{[g]:{value:m,description:b}}}catch{}return{}}));else{const{name:g,value:m,description:b}=d;g&&(n[g]={value:m,description:b})}}return{readTags:n,readTagsPromise:i.length>0?Promise.all(i):void 0}}function YZe(e,r,t,a,n){const i=[],s=[];let u,c=dB,A=Mx;for(let g=0;g<t&&r+g<e.byteLength;g++){if(c===hB){A=QZe({type:a,dataView:e,offset:r+g}),a===fd&&(g+=WZe),c=p0e(a,c);continue}else if(c===mB){u=new DataView(e.buffer.slice(r+g,r+t));break}const m=e.getUint8(r+g);m===0?c=p0e(a,c):c===dB?i.push(m):c===pB&&s.push(m)}if(A!==Mx&&!n)return{};const d=zee(u,A,JZe(a));return d instanceof Promise?d.then(g=>gB(g,a,s,i)).catch(()=>gB("<text using unknown compression>".split(""),a,s,i)):gB(d,a,s,i)}function QZe({type:e,dataView:r,offset:t}){if(e===fd){if(r.getUint8(t)===XZe)return r.getUint8(t+1)}else if(e===Bx)return r.getUint8(t);return Mx}function p0e(e,r){return r===dB&&[fd,Bx].includes(e)?hB:r===hB?e===fd?pB:mB:r===pB?UZe:mB}function JZe(e){return e===QD||e===Bx?"latin1":"utf-8"}function gB(e,r,t,a){const n=ePe(e);return{name:KZe(r,t,a),value:n,description:r===fd?rPe(e):n}}function KZe(e,r,t){const a=cd(t);if(e===QD||r.length===0)return a;const n=cd(r);return`${a} (${n})`}function ePe(e){return e instanceof DataView?O0(e,0,e.byteLength):e}function rPe(e){return j1e.decode("UTF-8",e)}function m0e(e,r){return e.toLowerCase()==="raw profile type exif"&&r.substring(1,5)==="exif"}function g0e(e,r){return e.toLowerCase()==="raw profile type iptc"&&r.substring(1,5)==="iptc"}function b0e(e){const r=e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/);return tPe(r[2].replace(/\n/g,""))}function tPe(e){const r=new DataView(new ArrayBuffer(e.length/2));for(let t=0;t<e.length;t+=2)r.setUint8(t/2,parseInt(e.substring(t,t+2),16));return r}const aPe={read:nPe};function nPe(e,r){const t={};for(let a=0;a<r.length;a++){const n=B1.getLongAt(e,r[a]+Q6),i=O0(e,r[a]+nA,Ol);i===c1e?(t["Pixels Per Unit X"]=iPe(e,r[a],n),t["Pixels Per Unit Y"]=oPe(e,r[a],n),t["Pixel Units"]=sPe(e,r[a],n)):i===f1e&&(t["Modify Date"]=lPe(e,r[a],n))}return t}function iPe(e,r,t){if(!Hx(e,r,t,0,4))return;const i=B1.getLongAt(e,r+kn+0);return{value:i,description:""+i}}function oPe(e,r,t){if(!Hx(e,r,t,4,4))return;const i=B1.getLongAt(e,r+kn+4);return{value:i,description:""+i}}function sPe(e,r,t){if(!Hx(e,r,t,8,1))return;const i=B1.getByteAt(e,r+kn+8);return{value:i,description:i===1?"meters":"Unknown"}}function lPe(e,r,t){if(!Hx(e,r,t,0,7))return;const n=B1.getShortAt(e,r+kn),i=B1.getByteAt(e,r+kn+2),s=B1.getByteAt(e,r+kn+3),u=B1.getByteAt(e,r+kn+4),c=B1.getByteAt(e,r+kn+5),A=B1.getByteAt(e,r+kn+6);return{value:[n,i,s,u,c,A],description:`${e9(n,4)}-${e9(i,2)}-${e9(s,2)} ${e9(u,2)}:${e9(c,2)}:${e9(A,2)}`}}function Hx(e,r,t,a,n){return a+n<=t&&r+kn+a+n<=e.byteLength}function e9(e,r){return`${"0".repeat(r-(""+e).length)}${e}`}const uPe={read:APe},cPe=4,fPe=7;function APe(e,r){const t={},a=B1.getByteAt(e,r);return t.Alpha=dPe(a),t.Animation=hPe(a),t.ImageWidth=v0e(e,r+cPe),t.ImageHeight=v0e(e,r+fPe),t}function dPe(e){const r=e&16;return{value:r?1:0,description:r?"Yes":"No"}}function hPe(e){const r=e&2;return{value:r?1:0,description:r?"Yes":"No"}}function v0e(e,r){const t=B1.getByteAt(e,r)+256*B1.getByteAt(e,r+1)+65536*B1.getByteAt(e,r+2)+1;return{value:t,description:t+"px"}}const pPe={read:mPe};function mPe(e){return{"GIF Version":gPe(e),"Image Width":bPe(e),"Image Height":vPe(e),"Global Color Map":yPe(e),"Bits Per Pixel":EPe(e),"Color Resolution Depth":wPe(e)}}function gPe(e){if(6>e.byteLength)return;const a=O0(e,3,3);return{value:a,description:a}}function bPe(e){if(8>e.byteLength)return;const a=e.getUint16(6,!0);return{value:a,description:`${a}px`}}function vPe(e){if(10>e.byteLength)return;const a=e.getUint16(8,!0);return{value:a,description:`${a}px`}}function yPe(e){if(11>e.byteLength)return;const n=(e.getUint8(10)&128)>>>7;return{value:n,description:n===1?"Yes":"No"}}function wPe(e){if(11>e.byteLength)return;const n=((e.getUint8(10)&112)>>>4)+1;return{value:n,description:`${n} ${n===1?"bit":"bits"}`}}function EPe(e){if(11>e.byteLength)return;const n=(e.getUint8(10)&7)+1;return{value:n,description:`${n} ${n===1?"bit":"bits"}`}}const xPe=[6,7,99],kPe={get:_Pe};function _Pe(e,r,t){if(CPe(r)){r.type="image/jpeg";const a=t+r.JPEGInterchangeFormat.value;r.image=e.buffer.slice(a,a+r.JPEGInterchangeFormatLength.value),qee(r,"base64",function(){return Lee(this.image)})}return r}function CPe(e){return e&&(e.Compression===void 0||xPe.includes(e.Compression.value))&&e.JPEGInterchangeFormat&&e.JPEGInterchangeFormat.value&&e.JPEGInterchangeFormatLength&&e.JPEGInterchangeFormatLength.value}const bB={INCHES:2,CENTIMETERS:3,MILLIMETERS:4},vB={INCHES_TO_MM:25.4,CM_TO_MM:10,MM_TO_MM:1},SPe={get:TPe};function TPe(e,r){const t={};let a=!1;const n=dd(e,"exif","FocalLength",r),i=dd(e,"exif","FocalPlaneXResolution",r),s=dd(e,"exif","FocalPlaneYResolution",r),u=dd(e,"exif","FocalPlaneResolutionUnit",r),c=dd(e,"file","Image Width",r),A=dd(e,"file","Image Height",r),d=dd(e,"exif","FocalLengthIn35mmFilm",r)||IPe(i,s,u,c,A,n);d&&(t.FocalLength35efl={value:d,description:C0.FocalLengthIn35mmFilm(d)},a=!0);const g=RPe(n,d);g&&(t.ScaleFactorTo35mmEquivalent=g,a=!0);const m=MPe(d);if(m&&(t.FieldOfView=m,a=!0),a)return t}function dd(e,r,t,a){if(a&&e[r]&&e[r][t])return e[r][t].value;if(!a&&e[t])return e[t].value}function IPe(e,r,t,a,n,i){if(e&&r&&t&&a&&n&&i)try{let u;switch(t){case bB.INCHES:u=vB.INCHES_TO_MM;break;case bB.CENTIMETERS:u=vB.CM_TO_MM;break;case bB.MILLIMETERS:u=vB.MM_TO_MM;break;default:return}const c=e[0]/e[1]*u,A=r[0]/r[1]*u,d=a/c,g=n/A,m=Math.sqrt(d**2+g**2);return i[0]/i[1]*(43.27/m)}catch{}}function RPe(e,r){if(e&&r)try{const t=r/(e[0]/e[1]);return{value:t,description:t.toFixed(1)}}catch{}}function MPe(e){if(e)try{const t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+" deg"}}catch{}}function y0e(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=new Error().stack}y0e.prototype=new Error;const OPe={MetadataMissingError:y0e};function DPe(e,r={}){return BPe(e)?(r.async=!0,NPe(e,r).then(t=>yB(t,r))):VPe(e)?(r.async=!0,GPe(e).then(t=>yB(t,r))):yB(e,r)}function BPe(e){return typeof e=="string"}function NPe(e,r){return/^\w+:\/\//.test(e)?typeof fetch<"u"?FPe(e,r):ZPe(e,r):jPe(e)?Promise.resolve(JOe(e)):qPe(e,r)}function FPe(e,{length:r}={}){const t={method:"GET"};return Number.isInteger(r)&&r>=0&&(t.headers={range:`bytes=0-${r-1}`}),fetch(e,t).then(a=>a.arrayBuffer())}function ZPe(e,{length:r}={}){return new Promise((t,a)=>{const n={};Number.isInteger(r)&&r>=0&&(n.headers={range:`bytes=0-${r-1}`}),PPe(e)(e,n,s=>{if(s.statusCode>=200&&s.statusCode<=299){const u=[];s.on("data",c=>u.push(Buffer.from(c))),s.on("error",c=>a(c)),s.on("end",()=>t(Buffer.concat(u)))}else a(`Could not fetch file: ${s.statusCode} ${s.statusMessage}`),s.resume()}).on("error",s=>a(s))})}function PPe(e){return/^https:\/\//.test(e)?__non_webpack_require__("https").get:__non_webpack_require__("http").get}function jPe(e){return/^data:[^;,]*(;base64)?,/.test(e)}function qPe(e,{length:r}={}){return new Promise((t,a)=>{const n=LPe();n.open(e,(i,s)=>{i?a(i):n.stat(e,(u,c)=>{if(u)a(u);else{const A=Math.min(c.size,r!==void 0?r:c.size),d=Buffer.alloc(A),g={buffer:d,length:A};n.read(s,g,m=>{m?a(m):n.close(s,b=>{b&&console.warn(`Could not close file ${e}:`,b),t(d)})})}})})})}function LPe(){try{return __non_webpack_require__("fs")}catch{return}}function VPe(e){return typeof File<"u"&&e instanceof File}function GPe(e){return new Promise((r,t)=>{const a=new FileReader;a.onload=n=>r(n.target.result),a.onerror=()=>t(a.error),a.readAsArrayBuffer(e)})}function yB(e,r){return zPe(e)&&(e=new Uint8Array(e).buffer),WPe(UPe(e),r)}function zPe(e){try{return Buffer.isBuffer(e)}catch{return!1}}function UPe(e){try{return new DataView(e)}catch{return new Zee(e)}}function WPe(e,{expanded:r=!1,async:t=!1,includeUnknown:a=!1,domParser:n=void 0}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let i=!1,s={};const u=[],{fileType:c,fileDataOffset:A,jfifDataOffset:d,tiffHeaderOffset:g,iptcDataOffset:m,xmpChunks:b,iccChunks:w,mpfDataOffset:E,pngHeaderOffset:x,pngTextChunks:_,pngChunkOffsets:I,vp8xChunkOffset:S,gifHeaderOffset:R}=zBe.parseAppMarkers(e,t);if(XPe(A)){i=!0;const B=CNe.read(e,A);r?s.file=B:s=z0({},s,B)}if(HPe(d)){i=!0;const B=FNe.read(e,d);r?s.jfif=B:s=z0({},s,B)}if($Pe(g)){i=!0;const{tags:B,byteOrder:G}=Z1e.read(e,g,a);if(B.Thumbnail&&(s.Thumbnail=B.Thumbnail,delete B.Thumbnail),r?(s.exif=B,YPe(s)):s=z0({},s,B),B["IPTC-NAA"]&&!w0e(m)){const V=oB.read(B["IPTC-NAA"].value,0,a);r?s.iptc=V:s=z0({},s,V)}if(B.ApplicationNotes&&!E0e(b)){const V=U1e.read(cd(B.ApplicationNotes.value),void 0,n);r?s.xmp=V:(delete V._raw,s=z0({},s,V))}if(B.ImageSourceData&&B.PhotoshopSettings){const V=tZe.read(B.PhotoshopSettings.value,a);r?s.photoshop=V:s=z0({},s,V)}if(B.ICC_Profile&&!x0e(w)){const V=c0e.read(B.ICC_Profile.value,[{offset:0,length:B.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);r?s.icc=V:s=z0({},s,V)}if(B.MakerNote){if(QPe(B)){const V=kZe.read(e,g,B.MakerNote.__offset,G,a);r?s.makerNotes=V:s=z0({},s,V)}else if(JPe(B)){const V=TZe.read(e,g,B.MakerNote.__offset,a);r?s.makerNotes=V:s=z0({},s,V)}}B.MakerNote&&delete B.MakerNote.__offset}if(w0e(m)){i=!0;const B=oB.read(e,m,a);r?s.iptc=B:s=z0({},s,B)}if(E0e(b)){i=!0;const B=U1e.read(e,b,n);r?s.xmp=B:(delete B._raw,s=z0({},s,B))}if(x0e(w)){i=!0;const B=c0e.read(e,w,t);B instanceof Promise?u.push(B.then(L)):L(B)}if(KPe(E)){i=!0;const B=bNe.read(e,E,a);r?s.mpf=B:s=z0({},s,B)}if(eje(x)){i=!0;const B=NZe.read(e,x);r?(s.png=s.png?z0({},s.png,B):B,s.pngFile=B):s=z0({},s,B)}if(rje(_)){i=!0;const{readTags:B,readTagsPromise:G}=zZe.read(e,_,t,a);F(B),G&&u.push(G.then(V=>V.forEach(F)))}if(tje(I)){i=!0;const B=aPe.read(e,I);r?s.png=s.png?z0({},s.png,B):B:s=z0({},s,B)}if(aje(S)){i=!0;const B=uPe.read(e,S);r?s.riff=s.riff?z0({},s.riff,B):B:s=z0({},s,B)}if(nje(R)){i=!0;const B=pPe.read(e,R);r?s.gif=s.gif?z0({},s.gif,B):B:s=z0({},s,B)}const M=SPe.get(s,r);M&&(r?s.composite=M:s=z0({},s,M));const N=kPe.get(e,s.Thumbnail,g);if(N?(i=!0,s.Thumbnail=N):delete s.Thumbnail,c&&(r?(s.file||(s.file={}),s.file.FileType=c):s.FileType=c,i=!0),!i)throw new OPe.MetadataMissingError;if(t)return Promise.all(u).then(()=>s);return s;function L(B){r?s.icc=B:s=z0({},s,B)}function F(B){if(r){for(const G of["exif","iptc"]){const V=`__${G}`;B[V]&&(s[G]=s[G]?z0({},s.exif,B[V]):B[V],delete B[V])}s.png=s.png?z0({},s.png,B):B,s.pngText=s.pngText?z0({},s.png,B):B}else s=z0({},s,B.__exif?B.__exif:{},B.__iptc?B.__iptc:{},B),delete s.__exif,delete s.__iptc}}function XPe(e){return e!==void 0}function HPe(e){return e!==void 0}function $Pe(e){return e!==void 0}function YPe(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Ox(e.exif.GPSLatitude.value),e.exif.GPSLatitudeRef.value.join("")==="S"&&(e.gps.Latitude=-e.gps.Latitude)}catch{}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Ox(e.exif.GPSLongitude.value),e.exif.GPSLongitudeRef.value.join("")==="W"&&(e.gps.Longitude=-e.gps.Longitude)}catch{}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],e.exif.GPSAltitudeRef.value===1&&(e.gps.Altitude=-e.gps.Altitude)}catch{}}}function w0e(e){return e!==void 0}function E0e(e){return Array.isArray(e)&&e.length>0}function x0e(e){return Array.isArray(e)&&e.length>0}function QPe(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&e.Make.value[0]==="Canon"&&e.MakerNote&&e.MakerNote.__offset}function JPe(e){const r="PENTAX ";return e.MakerNote.value.length>r.length&&cd(e.MakerNote.value.slice(0,r.length))===r&&e.MakerNote.__offset}function KPe(e){return e!==void 0}function eje(e){return e!==void 0}function rje(e){return e!==void 0}function tje(e){return e!==void 0}function aje(e){return e!==void 0}function nje(e){return e!==void 0}const ije=2400,Qg=["jpg","jpeg","png","webp","heic","tiff","bmp"],$x=["mp4","webm","ogg","mov","avi","flv","wmv","mkv","3gp","m4v","mpg","mpeg"],oje=e=>{const r=e.name.split(".").pop()?.toLowerCase();return r&&Qg.includes(r)?Ua.IMAGE:r&&$x.includes(r)?Ua.VIDEO:"unknown"},sje=async(e,r)=>{const t=Date.now();let a=e.originalFile,n={};try{n=await DPe(a,{expanded:!1,includeUnknown:!0}),delete n.Images,delete n.Thumbnail}catch(c){console.error(c)}try{const c=e.originalFile?.name?.split(".").pop();if(["heic","heif"].includes(c?.toLowerCase())&&typeof window<"u"){const A=(await Promise.resolve().then(()=>jLe)).default;a=await A({blob:e.originalFile,toType:"image/jpeg"})}}catch(c){console.error(c)}let i=a;try{a.size/1024/1024>1&&(i=await $n(a,{maxSizeMB:2,maxWidthOrHeight:ije,useWebWorker:!0,preserveExif:!0,maxIteration:3,onProgress:r}))}catch(c){console.error(c)}const s={},u=Date.now();return{exif:n,compressedFile:i,colors:s,clientProcessingTime:u-t}},k0e=({src:e,thumbnailUrl:r,playing:t=!1,controls:a=!1,playsInline:n=!0,fit:i="cover",muted:s=!0,showFullscreen:u=!0,onClick:c,onPlay:A,onPause:d,onEnd:g})=>{const m=Z.useRef(null),b=Z.useRef(null),[w,E]=Z.useState(!0),x=Z.useRef(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),_=Z.useCallback(()=>{t?d?.():A?.()},[t,d,A]),I=Z.useCallback(()=>{if(!m.current)return;const S=m.current;S.requestFullscreen?S.requestFullscreen():S.mozRequestFullScreen?S.mozRequestFullScreen():S.webkitRequestFullscreen?S.webkitRequestFullscreen():S.msRequestFullscreen&&S.msRequestFullscreen()},[]);return Z.useEffect(()=>{const S=m.current;if(!S)return;const R=()=>{try{t&&S.play().catch(()=>{})}catch(M){console.error("Error handling video play:",M)}};return S.addEventListener("canplay",R),()=>S.removeEventListener("canplay",R)},[t]),Z.useEffect(()=>{const S=m.current;if(S){try{t?(S.play().catch(()=>{}),x.current||(b.current=setTimeout(()=>E(!1),1e3))):(S.pause(),E(!0))}catch(R){console.error("Error controlling video playback:",R)}return()=>{b.current&&(clearTimeout(b.current),b.current=null)}}},[t]),O.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:[O.jsx("video",{ref:m,className:y0("qc:size-full",`qc:object-${i}`),src:e,muted:s,poster:r,controls:a,playsInline:n,onEnded:g,onClick:c,children:"Your browser does not support the video tag."}),!a&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:w&&O.jsx("button",{onClick:_,className:"qc:text-white","aria-label":t?"Pause":"Play",children:t?O.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",O.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):O.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",O.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),w&&u&&O.jsx("button",{onClick:I,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",O.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})},lje=({enableCaption:e,ada:r,content:t,removeImage:a,caption:n,disabled:i,onCaptionChange:s,playingVideo:u,onPlay:c,onPause:A,onEnd:d,uploadStatus:g={status:"",progress:0}})=>{const m=Z.useMemo(()=>t.type===Ua.IMAGE?O.jsx("img",{alt:"Image not found",className:"qc:size-full qc:rounded-t qc:object-contain",src:t.compressedFile?URL.createObjectURL(t.compressedFile):""}):O.jsx(k0e,{fit:"contain",showFullscreen:!1,src:URL.createObjectURL(t.originalFile),playing:u,onPlay:c,onPause:A,onEnd:d}),[t.type,t.status,u]);return O.jsxs("div",{className:"qc:relative",children:[O.jsxs("div",{className:y0("qc:border-border qc:relative qc:h-44 qc:max-h-screen qc:overflow-hidden qc:rounded qc:border qc:sm:h-80",!e&&"qc:rounded-b"),children:[(t.status===z3.WAITING||t.status===z3.PROCESSING)&&O.jsx("div",{className:"qc:absolute qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:gap-2",children:O.jsx("span",{className:"qc:text-sm qc:text-gray-500",children:"Processing"})}),t.status===z3.DONE&&m,(g.status===qo.WAITING||g.status===qo.UPLOADING)&&O.jsxs("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:z-0 qc:h-full qc:bg-opacity-75",style:{width:`${g.progress}%`}}),O.jsx("h3",{className:"qc:text-foreground qc:z-10 qc:text-center qc:font-medium",children:g.status===qo.WAITING?"Waiting...":Math.round(g.progress)===100?"Finalizing...":`Uploading (${Math.round(g.progress)}%)`})]}),(g.status===qo.DONE||g.status===qo.ERROR)&&O.jsx("div",{className:"qc:bg-background qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:bg-opacity-75",children:g.status===qo.DONE?O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-foreground qc:text-success qc:size-12",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"})}):O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-foreground qc:text-destructive qc:size-12",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"})})})]}),O.jsx("button",{disabled:i,className:"qc:text-primary qc:bg-destructive qc:absolute qc:right-4 qc:top-4 qc:cursor-pointer qc:rounded-full qc:p-1 qc:transition-all qc:hover:bg-opacity-100 qc:sm:bg-opacity-50 qc:sm:p-2",onClick:()=>a(t.uid),children:O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-5 qc:text-white",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"})})}),(e||r)&&O.jsx("div",{className:"qc:mt-3 qc:w-full qc:space-y-3",children:O.jsx("textarea",{rows:2,value:n,className:y0("qc:border-primary qc:shadow-outer qc:placeholder:text-primary qc:block qc:w-full qc:rounded qc:border qc:px-3 qc:py-2.5 qc:font-bold qc:placeholder:opacity-50 qc:focus:border-primary-light qc:focus:outline-none qc:focus:ring-primary-light",i?"qc:text-muted qc:bg-transparent":"qc:text-foreground qc:bg-white qc:bg-opacity-75"),disabled:i,onChange:b=>s(b.target.value),placeholder:"Caption"})})]},t.uid)},Yx=100,wB=1024*1024*50,uje=new $Y({concurrency:1,autostart:!0}),cje=new $Y({concurrency:3,autostart:!0}),fje={hidden:{opacity:0,scale:.8},visible:e=>({opacity:1,scale:1,transition:{delay:e*.1,duration:.3}}),exit:{opacity:0,scale:.8,transition:{duration:.3}}},Aje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const{eventSlug:e}=q4(),r=Wa(),{props:{organizationId:t,loginUrl:a},loadingUser:n,user:i,organization:s}=G0(),{event:u}=o6({eventSlug:e}),{increment:c}=eX(u),[A,d]=Z.useState(!1),[g,m]=Z.useState([]),[b,w]=Z.useState({}),[E,x]=Z.useState(null),[_,I]=Z.useState(null),[S,R]=Z.useState({}),[M,N]=Z.useState(0),[L,F]=Z.useState(0),[B,G]=Z.useState({}),V=Z.useRef(0);Z.useEffect(()=>{i&&ee()},[i]);const ee=async()=>{d(!0);try{const Q=await at.get($r.GET_UPLOAD_COUNT,{searchParams:{eventSlug:e},headers:{"x-org-id":t,Authorization:i?`Bearer ${i.token}`:void 0}}).json();if(Q.error)throw new Error(Q.error);R(Q.data.uploadCount)}catch(Q){console.error(Q),x("Failed to fetch upload count")}d(!1)},K=async Q=>new Promise(ne=>{const pe=Q.originalFile;if(pe){const he=document?.createElement("video");he.onloadedmetadata=()=>{ne(he.duration)};const ye=URL.createObjectURL(pe);he.src=ye}else ne(0)}),$=async Q=>{if(Q.type===Ua.IMAGE){m(pe=>pe.map(he=>he.uid===Q.uid?{...he,status:z3.PROCESSING}:he));const ne=await sje(Q);m(pe=>pe.map(he=>he.uid===Q.uid?{...he,...ne,status:z3.DONE}:he))}else if(Q.type===Ua.VIDEO){m(pe=>pe.map(he=>he.uid===Q.uid?{...he,status:z3.PROCESSING}:he));const ne=await K(Q);m(pe=>pe.map(he=>he.uid===Q.uid?{...he,length:ne,status:z3.DONE}:he))}},re=Q=>{const ne=g.filter(pe=>pe.uid!==Q);m(ne)},z=Q=>{const ne=u?.uploadLimit-S[pl.APPROVED]-S[pl.IN_REVIEW]-S[pl.REJECTED],pe=[];Array.from(Q).forEach(he=>{if(!g.some(ye=>ye.originalFile.name===he.name)){const ye={uid:HY(),originalFile:he,type:oje(he),status:z3.WAITING};pe.push(ye)}}),!(g.length+pe.length>Yx)&&(pe.slice(0,Math.min(ne-g.length,Yx-g.length)).forEach(he=>uje.push(()=>$(he))),m([...g,...pe]))},U=async({uid:Q,groupId:ne,groupContentCount:pe,eventId:he,content:ye,contentData:Ee})=>{G(De=>({...De,[Q]:{status:qo.UPLOADING,progress:0}}));const Me=Math.ceil(ye.size/wB);for(let De=0;De<Me;De++){const ge=De*wB,Oe=Math.min(ye.size,ge+wB),Ke=ye.slice(ge,Oe);try{const Je=new FormData;Je.append("groupId",ne),Je.append("groupContentCount",pe),Je.append("eventId",he),Je.append("contentData",JSON.stringify(Ee)),Je.append("integrationUpload",!0),Je.append("uid",Q),Je.append("chunk",Ke),Je.append("chunkIndex",De),Je.append("totalChunks",Me),await at.post($r.SINGLE_UPLOAD,{body:Je,headers:{"x-org-id":t,Authorization:i?`Bearer ${i.token}`:void 0}})}catch(Je){console.error(Je),G(h1=>({...h1,[Q]:{status:qo.FAILED,progress:0}}));break}}R(De=>({...De,[u?.autoApprove?pl.APPROVED:pl.IN_REVIEW]:De[u?.autoApprove?pl.APPROVED:pl.IN_REVIEW]+1})),G(De=>({...De,[Q]:{status:qo.DONE,progress:100}})),V.current-=1,m(De=>De.filter(ge=>ge.uid!==Q)),u?.autoApprove||c(),V.current===0&&(w({}),m([]),N(0),F(0),G({}),Lr.success(u?.visibility===IV.PRIVATE&&u?.autoApprove?"Content uploaded":"Upload successful, waiting for approval"))},j=async(Q=!0)=>{x(null);let ne=!0;if(u?.ada){for(let ye=0;ye<g.length;ye++)if(!b[g[ye].uid]){ne=!1;break}}if(!ne){x("Caption are needed for each image");return}N(g.length),F(0),V.current=g.length;const pe=`upload-group-${HY()}`;g.forEach(ye=>{cje.push(()=>U({uid:ye.uid,groupId:pe,groupContentCount:g.length,eventId:u?._id,content:ye.compressedFile?ye.compressedFile:ye.originalFile,contentData:{type:ye.type,caption:b[ye.uid],colors:ye.colors,sizes:{original:ye.originalFile.size,clientCompressed:ye.compressedFile?.size},processingTimes:{client:ye.clientProcessingTime},location:{latitude:ye.exif?.GPSLatitude?.description,longitude:ye.exif?.GPSLongitude?.description},exif:ye.exif,capturedAt:ye.exif?.DateTimeOriginal?.description}}))});const he={};g.forEach(ye=>{he[ye.uid]={status:qo.WAITING,progress:0}}),G(he)},W=u?u?.uploadLimit-(S?S[pl.APPROVED]+S[pl.IN_REVIEW]+S[pl.REJECTED]:0):0,J=Z.useMemo(()=>Object.values(B).some(Q=>[qo.WAITING,qo.UPLOADING].includes(Q.status)),[B]);let X=!0;for(let Q=0;Q<g.length;Q++)if(g[Q].status!==z3.DONE){X=!1;break}const Y=A||!u||!i||u?.status!==Wi.OPEN||g.length>=Math.min(W,Yx)||J,se=u?u?.enableVideo?[...Qg,...$x]:Qg:[];if(n)return O.jsx(Kt,{className:"qc:mx-auto qc:mt-8 qc:h-6 qc:w-64"});if(!i)if(s.customAuth)if(a)window.history.pushState({},"",a);else return O.jsx(i6,{title:"Please login to upload content"});else return O.jsx(jf,{to:nr.LOGIN,state:{referrer:r.pathname}});return O.jsxs("div",{className:"qc:relative qc:min-h-[80vh] qc:w-full qc:space-y-8 qc:bg-background",children:[O.jsx("div",{className:"qc:flex qc:flex-row qc:justify-end",children:O.jsx(i$,{event:u})}),O.jsx(A0,{variant:"h3",align:"center",immutable:!0,children:u?.name}),A&&O.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:pb-8",children:[O.jsx(Kt,{className:"qc:mx-auto qc:h-7 qc:w-64"}),O.jsx(Kt,{className:"qc:mx-auto qc:h-56 qc:w-full qc:max-w-xl"})]}),!A&&i&&u?u?.status!==Wi.OPEN?O.jsxs("div",{className:"qc:mt-16 qc:flex qc:flex-col qc:items-center qc:gap-8",children:[O.jsx(i6,{title:"Event not open",description:"Please find some open event to upload content",iconSvg:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-full",viewBox:"0 0 885.86993 622.8043",xmlnsXlink:"http://www.w3.org/1999/xlink",role:"img",children:[O.jsx("title",{children:"through_the_park"}),O.jsx("polygon",{points:"461.601 348.37 400.416 348.37 400.416 350.344 409.958 350.344 409.958 369.094 411.932 369.094 411.932 350.344 449.098 350.344 449.098 369.094 451.072 369.094 451.072 350.344 461.601 350.344 461.601 348.37",fill:"#3f3d56"}),O.jsx("polygon",{points:"484.299 300.014 468.509 300.014 468.509 315.803 475.829 315.803 475.829 369.007 477.803 369.007 477.803 315.803 484.299 315.803 484.299 300.014",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"342.46486",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"337.53055",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"332.59625",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("path",{d:"M775.57723,513.38047h-1.97372c0-93.59519-76.14539-169.7401-169.7401-169.7401-93.59518,0-169.74009,76.14491-169.74009,169.7401H432.1496c0-94.68325,77.03057-171.71382,171.71381-171.71382C698.54714,341.66665,775.57723,418.69722,775.57723,513.38047Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"161.35177",cy:"161.35177",r:"161.35177",fill:"currentColor"}),O.jsx("path",{d:"M438.4403,192.17931a161.36436,161.36436,0,0,1-268.85975,170.77,161.36567,161.36567,0,1,0,268.85975-170.77Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"161.795 161.352 162.238 161.352 170.217 618.811 153.373 618.811 161.795 161.352",fill:"#3f3d56"}),O.jsx("rect",{x:"329.05538",y:"537.54454",width:"7.97893",height:"30.14264",transform:"translate(509.8146 -138.12101) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"755.27647",cy:"229.8063",r:"130.59346",fill:"currentColor"}),O.jsx("path",{d:"M1009.48506,281.178a130.60365,130.60365,0,0,1-217.60732,138.2163A130.60471,130.60471,0,1,0,1009.48506,281.178Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"755.635 229.806 755.994 229.806 762.452 600.06 748.819 600.06 755.635 229.806",fill:"#3f3d56"}),O.jsx("rect",{x:"920.95206",y:"560.70661",width:"6.45792",height:"24.39658",transform:"translate(843.51724 -650.35577) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"369.90725",cy:"321.70366",r:"20.55846",fill:"currentColor"}),O.jsx("path",{d:"M542.265,446.57008a20.56006,20.56006,0,0,1-34.25647,21.75847A20.56023,20.56023,0,1,0,542.265,446.57008Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"369.964 321.704 370.02 321.704 371.037 379.99 368.891 379.99 369.964 321.704",fill:"#3f3d56"}),O.jsx("rect",{x:"528.32779",y:"490.57441",width:"1.01663",height:"3.84059",transform:"translate(561.19589 -343.48173) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"559.878",cy:"255.44299",r:"52.63144",fill:"currentColor"}),O.jsx("path",{d:"M756.09357,358.88718A52.63554,52.63554,0,0,1,668.394,414.59075a52.636,52.636,0,1,0,87.69954-55.70357Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"560.023 255.443 560.167 255.443 562.77 404.662 557.275 404.662 560.023 255.443",fill:"#3f3d56"}),O.jsx("rect",{x:"720.41323",y:"471.54209",width:"2.60265",height:"9.83225",transform:"translate(650.03004 -522.71764) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("path",{d:"M354.5881,734.63564s.68149-14.27971,14.65205-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"193.57562",cy:"575.45671",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"192.43789",y:"587.23109",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M403.93115,702.06922s.68149-14.27971,14.652-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"242.91867",cy:"542.89029",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"241.78094",y:"554.66468",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M552.67,591.58462s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"392.46975",cy:"436.6403",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"391.56611",y:"445.99208",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M769.77945,556.05762s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"609.57917",cy:"401.1133",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"608.67553",y:"410.46508",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M562.53864,621.19045s.54127-11.34163,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"402.33836",cy:"466.24613",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"401.43472",y:"475.59791",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M538.854,642.90139s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"378.6537",cy:"487.95707",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"377.75006",y:"497.30885",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M803.33272,574.808s.54128-11.34162,11.63736-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"643.13244",cy:"419.86366",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"642.22881",y:"429.21544",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M483.58976,599.47951s.54127-11.34163,11.63735-10.02332",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"323.38948",cy:"444.53519",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"322.48584",y:"453.88696",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M740.17362,543.22843s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"579.97334",cy:"388.28411",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"579.0697",y:"397.63589",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M268.73119,737.59622s.68149-14.27971,14.652-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"107.71872",cy:"578.41729",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"106.58099",y:"590.19168",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M948.67842,733.64878s.68149-14.27971,14.65205-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"787.66594",cy:"574.46985",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"786.52822",y:"586.24423",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M891.44048,700.0955s.68149-14.27971,14.65205-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"730.42801",cy:"540.91657",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"729.29028",y:"552.69096",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M883.54559,750.42541s.6815-14.27971,14.65205-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"722.53312",cy:"591.24648",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"721.39539",y:"603.02087",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M280.09142,761.08258S590.95263,679.17311,587.992,595.28993c-5.42774-23.19124-42.92846-29.1124-42.92846-29.1124s-88.81749-11.84233-40.4613-40.4613,180.59557-21.71094,180.59557-21.71094-136.18682,21.71094-75.9883,33.55327c48.35619,2.96058,110.52843,15.78978,110.52843,15.78978S846.0562,579.99358,863.8197,645.12641s2.96058,115.46273,2.96058,115.46273Z",transform:"translate(-157.06503 -138.59785)",fill:"#e6e6e6"}),O.jsx("path",{d:"M618.67289,761.40215l-1.16407-1.627q2.4668-1.76367,4.85938-3.50781l1.17773,1.61719Q621.14359,759.63213,618.67289,761.40215Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M633.18265,750.72832l-1.207-1.59375c3.23144-2.44727,6.41406-4.90918,9.46-7.31738l1.24023,1.56836C639.61917,745.80254,636.42484,748.27324,633.18265,750.72832Zm18.82324-14.89941-1.27734-1.53907c3.12793-2.59863,6.18652-5.21,9.09082-7.76074l1.32031,1.502C658.22171,730.59453,655.14847,733.21855,652.00589,735.82891Zm18.03223-15.86914-1.36914-1.459c2.98535-2.7998,5.86328-5.60254,8.55469-8.332l1.42382,1.4043C675.93851,714.32012,673.04105,717.14238,670.03812,719.95977Zm16.8584-17.14063-1.48828-1.33594c2.74218-3.05468,5.33593-6.11426,7.709-9.09277l1.56445,1.24609C692.28421,696.64531,689.66507,699.73516,686.89652,702.81914ZM701.84964,683.952,700.1973,682.825c2.32519-3.40723,4.42285-6.80859,6.23437-10.10938l1.75391.9629C706.34281,677.035,704.211,680.492,701.84964,683.952Zm11.5-21.21386-1.86133-.73047a69.37031,69.37031,0,0,0,3.39551-11.29l1.959.40234A71.21576,71.21576,0,0,1,713.34964,662.73809Zm2.66992-23.69629a47.10965,47.10965,0,0,0-1.60839-11.50684l1.93164-.52148a49.17317,49.17317,0,0,1,1.67675,11.99511Zm-5.98339-22.30274a60.32109,60.32109,0,0,0-6.65625-9.66406l1.5332-1.2832a62.27891,62.27891,0,0,1,6.87695,9.98632Zm-14.91993-18.10449a108.36226,108.36226,0,0,0-9.32617-7.34766l1.1543-1.63281a110.07889,110.07889,0,0,1,9.498,7.48438Zm-19.34863-13.78418c-3.27148-1.92285-6.80078-3.8418-10.4873-5.70312l.90039-1.78516c3.72558,1.87988,7.292,3.81933,10.60058,5.76367Zm-21.29687-10.81445c-3.48145-1.54688-7.18946-3.10352-11.02149-4.62793l.74024-1.85742c3.85547,1.5332,7.58789,3.10058,11.09375,4.65722ZM632.23539,565.157c-3.56348-1.292-7.37305-2.61816-11.32129-3.94141l.63476-1.89648c3.96387,1.3291,7.78906,2.66016,11.36817,3.957Zm-22.73145-7.64648c-3.48535-1.09961-7.2373-2.25684-11.47119-3.53907l.58008-1.91406c4.24072,1.28418,8.00048,2.44434,11.49267,3.54492Zm-22.979-6.99317c-4.0459-1.21-7.90332-2.36621-11.51465-3.47851l.58886-1.91211c3.60645,1.1123,7.458,2.2666,11.499,3.47461Zm-22.98389-7.1875a95.0565,95.0565,0,0,1-11.26416-4.53418l.89941-1.78711a92.76387,92.76387,0,0,0,11.019,4.43067Zm-15.103-13.11035-1.42578-1.40234c1.82324-1.85254,5.42969-3.665,11.02539-5.542l.63574,1.89649C553.45658,526.9207,550.01273,528.61992,548.438,530.21953Zm21.67676-8.30566-.4834-1.94141c3.459-.86133,7.39942-1.76269,11.71192-2.67871l.415,1.957C577.46878,520.16094,573.5513,521.05742,570.11478,521.91387Zm23.36963-5.01856-.375-1.96484c3.68506-.7041,7.65381-1.4336,11.79687-2.168l.34961,1.96875C601.12113,515.46465,597.16117,516.19219,593.48441,516.89531ZM617.05374,512.7l-.33007-1.97266q5.65283-.94775,11.83105-1.93847l.31641,1.97461Q622.69827,511.75371,617.05374,512.7Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M640.9307,508.865l-.30664-1.97656q2.9165-.45119,5.93554-.91114l.30079,1.97657Q643.84281,508.41387,640.9307,508.865Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M685.194,305.71659l9.08474-7.26606c-7.05753-.77863-9.95734,3.07039-11.14411,6.11693-5.51363-2.28947-11.51587.711-11.51587.711l18.17688,6.59885A13.75483,13.75483,0,0,0,685.194,305.71659Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M516.44078,361.96766l9.08474-7.26605c-7.05753-.77864-9.95734,3.07039-11.14411,6.11692-5.51363-2.28946-11.51587.711-11.51587.711l18.17688,6.59885A13.75487,13.75487,0,0,0,516.44078,361.96766Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M560.84953,245.51807l9.08473-7.26606c-7.05753-.77863-9.95733,3.07039-11.14411,6.11693-5.51363-2.28947-11.51587.711-11.51587.711l18.17688,6.59885A13.75484,13.75484,0,0,0,560.84953,245.51807Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M659.609,569.03965s-7.86875,0-8.74306,4.80868-2.18577,57.267-1.31146,63.82431.87431,5.24584.87431,5.24584-1.743,12.4609,2.18858,13.00631S656.5489,641.607,656.5489,641.607l3.06008-53.33264Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M693.7069,569.03965s7.86875,0,8.74306,4.80868,2.18577,57.267,1.31146,63.82431-.8743,5.24584-.8743,5.24584,1.743,12.4609-2.18859,13.00631S696.767,641.607,696.767,641.607l-3.06008-53.33263Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M658.29752,751.76952h-3.49721a7.86866,7.86866,0,0,0-7.86875,7.86857v.00018H668.352V749.58375H658.29752Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("path",{d:"M691.95829,751.76952h3.49721a7.86867,7.86867,0,0,1,7.86875,7.86857v.00018H681.90377V749.58375h10.05452Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"516.09568",cy:"409.02131",r:"11.36598",fill:"#9e616a"}),O.jsx("path",{d:"M670.53781,553.73931s-1.31146,14.426-3.06008,15.73749,18.36042-.8743,18.36042-.8743-6.99444-10.49167-5.683-13.98889S670.53781,553.73931,670.53781,553.73931Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M696.32981,569.03965s-24.04341-10.05451-39.78091,0c0,0-3.93436,10.05451-.87431,15.7375s7.86875,19.23472,3.06008,28.41493.43716,5.24584.43716,5.24584-6.12014,24.48056-6.99445,43.71525,2.62293,88.30487,5.24583,88.742,10.92883,1.31146,11.80314,0,6.99444-92.67636,6.99444-92.67636,2.62292,93.55069,5.24582,93.55069,9.61737,0,10.92883-2.18577,12.24027-86.55625,8.30591-104.04235-6.55729-26.22917-6.55729-26.22917,4.80867-3.06007,3.49723-4.80869-7.86877-20.54616-4.80869-23.60625S696.32981,569.03965,696.32981,569.03965Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"523.30871",cy:"402.17104",r:"18.36042",fill:"#2f2e41"}),O.jsx("path",{d:"M691.83867,531.57749a12.36814,12.36814,0,0,1-9.33162-14.29294c-.05359.188-.104.37762-.14921.57a12.36847,12.36847,0,0,0,24.0811,5.65832c.0452-.19233.08448-.38459.12022-.57676A12.36815,12.36815,0,0,1,691.83867,531.57749Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"535.52108",cy:"386.38703",r:"8.98489",fill:"#2f2e41"})]})}),O.jsx(Jt,{to:nr.PUBLIC_EVENTS,state:{internalNavigation:!0},children:O.jsx(gt,{children:"All events"})})]}):O.jsxs(Z.Fragment,{children:[O.jsxs(A0,{variant:"h5",align:"center",children:["Available entries : ",O.jsx("span",{className:"qc:text-primary",children:W})]}),g.length<=0&&O.jsx("div",{className:"qc:flex qc:w-full qc:flex-auto qc:justify-center qc:mt-6",children:O.jsx(Ig,{accept:(()=>{const Q={},ne=se.filter(he=>Qg.includes(he)),pe=se.filter(he=>$x.includes(he));return ne.length>0&&(Q["image/*"]=ne.map(he=>`.${he}`)),pe.length>0&&(Q["video/*"]=pe.map(he=>`.${he}`)),Q})(),multiple:!0,disabled:Y,onDrop:z,children:({getRootProps:Q,getInputProps:ne,isDragActive:pe})=>O.jsxs("div",{...Q(),className:y0("qc:bg-background qc:w-auto qc:max-w-2xl qc:rounded qc:border-2 qc:border-dashed qc:px-4 qc:py-12 qc:text-center",g.length>=W?"qc:border-border":"",Y?"qc:border-border qc:hover:cursor-not-allowed":"qc:border-primary qc:hover:cursor-pointer"),children:[O.jsx("input",{...ne()}),O.jsxs("svg",{className:y0(Y?"qc:text-gray-500":"qc:text-primary","qc:mx-auto qc:size-12"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[O.jsx("rect",{x:"0",y:"0",width:"24",height:"24",fill:"none",stroke:"none"}),O.jsx("path",{fill:"currentColor",d:"M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5l5 5h-3z"})]}),O.jsx("span",{className:y0(Y?"qc:text-muted":"qc:text-foreground","qc:mt-2 qc:block qc:font-medium"),children:pe?"Drop files here...":`Select Images ${u?.enableVideo?"or Videos (60s)":""} to upload (${g.length}/${Math.min(W,Yx)})`}),!J&&O.jsx("div",{className:"qc:text-muted-foreground qc:mt-6 qc:w-full qc:text-center qc:text-xs qc:italic",children:"* Only your new, original photos will be eligible for upload. Our team will review them before publication."})]})})}),O.jsx("div",{className:"qc:grid qc:grid-cols-2 qc:gap-6 qc:sm:pt-3 qc:lg:grid-cols-3 qc:xl:grid-cols-4",children:O.jsxs(uRe,{children:[g.map((Q,ne)=>O.jsx(kee.div,{layout:!0,variants:fje,initial:"hidden",animate:"visible",exit:"exit",custom:ne,className:"qc:relative",children:O.jsx(lje,{enableCaption:u?.enableCaption,enableAICaption:u?.enableAICaption,ada:u?.ada,content:Q,disabled:J,removeImage:re,caption:b[Q.uid],onCaptionChange:pe=>{w(he=>({...he,[Q.uid]:pe}))},playingVideo:_===Q.uid,onPlay:()=>I(Q.uid),onPause:()=>I(null),onEnd:()=>I(null),uploadStatus:B[Q.uid]})},Q.uid)),g.length>0&&W>0&&O.jsx(Ig,{accept:(()=>{const Q={},ne=se.filter(he=>Qg.includes(he)),pe=se.filter(he=>$x.includes(he));return ne.length>0&&(Q["image/*"]=ne.map(he=>`.${he}`)),pe.length>0&&(Q["video/*"]=pe.map(he=>`.${he}`)),Q})(),multiple:!0,disabled:Y,onDrop:z,children:({getRootProps:Q,getInputProps:ne,isDragActive:pe})=>O.jsxs("div",{...Q(),children:[O.jsx("input",{...ne()}),O.jsxs(kee.button,{type:"button",layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.3},className:y0("qc:border-primary qc:bg-background qc:hover:border-primary qc:text-foreground qc:hover:text-primary qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:gap-3 qc:rounded qc:border-2 qc:border-dashed qc:p-12 qc:hover:border-2 qc:focus:outline-none qc:sm:min-h-72",pe?"qc:bg-primary qc:bg-opacity-15":"qc:bg-background qc:bg-opacity-100"),children:[O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-14",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h6.5q.212 0 .356.144t.144.357t-.144.356t-.356.143h-6.5q-.27 0-.443.173T5 5.616v12.769q0 .269.173.442t.443.173h12.769q.269 0 .442-.173t.173-.443v-6.5q0-.212.144-.356t.357-.144t.356.144t.143.356v6.5q0 .691-.462 1.153T18.384 20zm1.153-3.616h10.462L14 12.077l-3 3.789l-2-2.404zM17 7h-1.5q-.213 0-.356-.144T15 6.499t.144-.356T15.5 6H17V4.5q0-.213.144-.356T17.501 4t.356.144T18 4.5V6h1.5q.213 0 .356.144t.144.357t-.144.356T19.5 7H18v1.5q0 .213-.144.356T17.499 9t-.356-.144T17 8.5z"})}),O.jsx(A0,{variant:"h5",children:pe?"Drop files here...":"Add Image"})]})]})})]})}),g.length>0&&O.jsx(gt,{fullWidth:!0,loading:J,onClick:j,icon:"material-symbols:upload-rounded",disabled:!u||J||!X,children:J?`Uploading (${L}/${M})`:"Upload"})]}):null,g.length<=0&&O.jsx(Jt,{to:nr.GALLERY(e),state:{internalNavigation:!0},children:O.jsx(A0,{variant:"h5",align:"center",children:"Goto gallery"})})]})}},Symbol.toStringTag,{value:"Module"})),EB=({title:e,entries:r=[],showFloatingPoint:t=!1,hidePictures:a=!0})=>{const n=e.replace(/\s+/g,"-").toLowerCase(),i=s=>{if(!s)return"";const u=s.trim().split(" ");return u.length===1?u[0]:`${u[0]} ${u[1][0]}.`};return O.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[O.jsx(A0,{variant:"h4",align:"center",color:"primary",children:e}),r.length===0?O.jsx(A0,{variant:"h5",align:"center",color:"error",children:"Not available"}):O.jsxs("div",{className:"",children:[O.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[r.length>1&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[1].name)}),O.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[1].totalPoint===void 0?r[1].maxScore?.toFixed(t?2:0):r[1].totalPoint?.toFixed(t?2:0)})]}),r.length>0&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[0].name)}),O.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[0].totalPoint===void 0?r[0].maxScore?.toFixed(t?2:0):r[0].totalPoint?.toFixed(t?2:0)})]}),r.length>2&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[2].name)}),O.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[2].totalPoint===void 0?r[2].maxScore?.toFixed(t?2:0):r[2].totalPoint?.toFixed(t?2:0)})]})]}),O.jsx("div",{className:"qc:mt-6",children:O.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:O.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:O.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:O.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:O.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:r.slice(3).map((s,u)=>O.jsxs("tr",{children:[O.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:O.jsx("span",{className:"qc:px-2",children:u+4})}),O.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:O.jsxs("div",{className:"qc:flex qc:items-center",children:[!a&&O.jsx("div",{className:"qc:size-8 qc:shrink-0"}),O.jsx("div",{className:"qc-ml-4",children:O.jsx("div",{className:"qc-text-primary qc-font-medium",children:i(s.name)})})]})}),O.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:s.totalPoint===void 0?s.maxScore?.toFixed(t?2:0):s.totalPoint?.toFixed(t?2:0)})]},`${n}-${u}`))})})})})})})]})]})},dje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const{eventSlug:e}=q4(),{props:{organizationId:r}}=G0(),{event:t}=o6({eventSlug:e}),{isLoading:a,data:n}=Gh({queryKey:[`leaderboard-${r}-${t?._id}`],queryFn:async()=>(await at.get($r.GET_LEADERBOARD,{headers:{"x-org-id":r},searchParams:{eventId:t?._id}}).json()).data,enabled:!!t});return a?O.jsxs("div",{className:y0("qc:mt-4 qc:flex qc:bg-background qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",t?.engagementStyle===qn.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[O.jsxs("div",{className:"qc:flex-1",children:[O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:rounded"}),O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:rounded"})]}),O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:t?.engagementStyle===qn.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:t?.engagementStyle===qn.CONTEST,entries:n?.leaderboardByScore?.topRankers||[],pointName:t?.pointName})})]}):O.jsxs("div",{className:y0("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",t?.engagementStyle===qn.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:"Point Leaders",entries:n?.leaderboardByPoint?.topRankers||[],pointName:t?.pointName})}),O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:t?.engagementStyle===qn.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:t?.engagementStyle===qn.CONTEST,entries:n?.leaderboardByScore?.topRankers||[],pointName:t?.pointName})})]})}},Symbol.toStringTag,{value:"Module"})),_0e=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,C0e=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},hje=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},S0e=({position:e,maxPosition:r=4,content:t,isOverlapping:a,colorclsx:n,borderColorclsx:i})=>{const s=e/r*100;let u="qc:transform qc:-translate-x-1/2 qc:left-1/2";e<2?u="qc:left-0":e>3&&(u="qc:right-0 qc:transform qc:-translate-x-full");const c=a?"qc:-top-1.5":"qc:bottom-full";return O.jsxs("div",{className:"qc:relative",children:[O.jsx("div",{style:{left:`${s}%`},className:`qc:absolute ${c} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${u} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`,children:t}),O.jsx("div",{style:{left:`${s}%`},className:`qc:absolute ${c} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${u} qc:transition-all qc:duration-500 qc:ease-in-out ${i}`})]})},pje=e=>{const{crowdScore:r,userScore:t}=e,a=1,[n,i]=Z.useState(0);Z.useEffect(()=>{setTimeout(()=>{i(t-1)},300)},[t]);const s=r-1,u=t-1,c=Math.abs(s-u)<a;return O.jsxs("div",{className:y0("qc:relative qc:h-4",c?"qc:mb-3":"qc:mb-0"),children:[O.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),O.jsx("div",{style:{left:`${(s<n?s:n)/4*100}%`,right:`calc(100% - ${(s<n?n:s)/4*100}%)`},className:y0("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",C0e(s,u))}),O.jsx(S0e,{position:s,content:`crowd · ${_0e(r,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),O.jsx(S0e,{position:n,content:`you · ${_0e(t,1)}`,isOverlapping:c,colorclsx:C0e(s,u),borderColorclsx:hje(s,u)})]})},mje=Z.lazy(()=>Promise.resolve().then(()=>Ir1)),gje=Z.lazy(()=>Promise.resolve().then(()=>Sue)),bje=({feedback:e})=>{const r="#374151",[t,a]=Z.useState(10);return Z.useEffect(()=>{const n=(e?.parameters||[]).reduce((i,s)=>i+Math.abs(parseFloat(s.crowdRating)-parseFloat(s.userRating)),0);a(n.toFixed?n.toFixed(2):0)},[e]),e?O.jsxs("div",{className:"qc:w-full",children:[e.rateCount<=0&&O.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[O.jsx(gje,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),O.jsx(A0,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),e.rateCount>0&&O.jsxs("div",{className:"qc:mt-4",children:[(e.parameters||[]).map(n=>O.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[O.jsx(A0,{variant:"h5",children:n.name}),O.jsx(pje,{crowdScore:parseFloat(n.crowdRating),userScore:parseFloat(n.userRating)})]},n.name)),O.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[O.jsx(mje,{nrOfLevels:10,percent:(10-t)/10,colors:["#ef4444","#22c55e"],textColor:r,needleColor:r,needleBaseColor:r}),O.jsx(A0,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},vje=Z.lazy(()=>Promise.resolve().then(()=>Sue)),yje=({parameter:e,selected:r,onChange:t,showValues:a=!0})=>O.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[O.jsx(A0,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:e.name}),O.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(e.tooltips||[]).map(n=>{const i=`${e._id}-option-${n.value}`;return O.jsxs("div",{children:[O.jsxs("button",{type:"button",className:y0("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",r===n.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{r!==n.value&&t?.(n.value)},children:[e.mode===oI.TEXT&&O.jsx("div",{className:y0("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",r===n.value?"qc:text-primary-foreground":"qc:text-foreground"),children:n.label}),e.mode===oI.IMAGE&&O.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:n.imageUrl,alt:n.value}),e.mode===oI.LOTTIE&&O.jsx(vje,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:n.imageUrl,autoplay:!0,loop:!0})]}),a&&O.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:O.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:n.value})})]},i)})})]});var T0e=function(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var a=t.call(e),n,i=[],s;try{for(;(r===void 0||r-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(u){s={error:u}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(s)throw s.error}}return i};function wje(e,r,t){for(var a=e.length,n=r.length,i=a+n,s={1:0},u=0;u<=i;++u)for(var c=-u;c<=u;c+=2){var A=void 0;c===-u||c!==u&&s[c-1]+1<s[c+1]?A=s[c+1]:A=s[c-1]+1;for(var d=A-c;A<a&&d<n&&t(e[A],r[d]);)A++,d++;if(A===a&&d===n)return u;s[c]=A}return-1}var Nr;(function(e){e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.diagonal=4]="diagonal",e[e.all=7]="all"})(Nr||(Nr={}));function xB(e,r,t,a,n,i,s,u,c,A,d){var g,m,b,w;if(s===0){d("same",e,r,t,a,n,i);return}else if(s===t-r+(i-n)){var E=(u&Nr.horizontal?1:0)+(c&Nr.vertical?1:0),x=(u&Nr.vertical?1:0)+(c&Nr.horizontal?1:0);E>=x?(r!==t&&d("remove",e,r,t,a,n,n),n!==i&&d("add",e,t,t,a,n,i)):(n!==i&&d("add",e,r,r,a,n,i),r!==t&&d("remove",e,r,t,a,i,i));return}for(var _=t-r,I=i-n,S=Math.floor(I/2),R={},M=-s-1;M<=s+1;++M)R[M]={d:1/0,segments:0,direct:Nr.none};for(var N=(g={},g[-s-1]={d:1/0,segments:0,direct:Nr.none},g[s+1]={d:1/0,segments:0,direct:Nr.none},g),L=0;L<=S;++L){m=T0e([N,R],2),R=m[0],N=m[1];for(var F=function(re){var z=L+re;if(L===0&&z===0)return R[re]={d:0,segments:0,direct:u},"continue";var U=[{direct:Nr.horizontal,d:R[re-1].d+1,segments:R[re-1].segments+(R[re-1].direct&Nr.horizontal?0:1)},{direct:Nr.vertical,d:N[re+1].d+1,segments:N[re+1].segments+(N[re+1].direct&Nr.vertical?0:1)}];z>0&&z<=_&&L>0&&L<=I&&A(e[r+z-1],a[n+L-1])&&U.push({direct:Nr.diagonal,d:N[re].d,segments:N[re].segments+(N[re].direct&Nr.diagonal?0:1)});var j=U.reduce(function(W,J){return W.d>J.d||W.d===J.d&&W.segments>J.segments?J:W});U.forEach(function(W){j.d===W.d&&j.segments===W.segments&&(j.direct|=W.direct)}),R[re]=j},M=-s;M<=s;++M)F(M)}for(var B={},M=-s-1;M<=s+1;++M)B[M]={d:1/0,segments:0,direct:Nr.none};for(var G=(b={},b[-s-1]={d:1/0,segments:0,direct:Nr.none},b[s+1]={d:1/0,segments:0,direct:Nr.none},b),L=I;L>=S;--L){w=T0e([G,B],2),B=w[0],G=w[1];for(var V=function(z){var U=L+z;if(L===I&&U===_)return B[z]={d:0,segments:0,direct:c},"continue";var j=[{direct:Nr.horizontal,d:B[z+1].d+1,segments:B[z+1].segments+(B[z+1].direct&Nr.horizontal?0:1)},{direct:Nr.vertical,d:G[z-1].d+1,segments:G[z-1].segments+(G[z-1].direct&Nr.vertical?0:1)}];U>=0&&U<_&&L>=0&&L<I&&A(e[r+U],a[n+L])&&j.push({direct:Nr.diagonal,d:G[z].d,segments:G[z].segments+(G[z].direct&Nr.diagonal?0:1)});var W=j.reduce(function(J,X){return J.d>X.d||J.d===X.d&&J.segments>X.segments?X:J});j.forEach(function(J){W.d===J.d&&W.segments===J.segments&&(W.direct|=J.direct)}),B[z]=W},M=s;M>=-s;--M)V(M)}for(var ee={k:-1,d:1/0,segments:0,direct:Nr.none},M=-s;M<=s;++M){var K=R[M].d+B[M].d;if(K<ee.d)ee.k=M,ee.d=K,ee.segments=R[M].segments+B[M].segments+(R[M].segments&B[M].segments?0:1),ee.direct=B[M].direct;else if(K===ee.d){var $=R[M].segments+B[M].segments+(R[M].segments&B[M].segments?0:1);($<ee.segments||$===ee.segments&&!(ee.direct&Nr.diagonal)&&B[M].direct&Nr.diagonal)&&(ee.k=M,ee.d=K,ee.segments=$,ee.direct=B[M].direct)}}S+ee.k===0&&S===0&&(S++,R[ee.k].direct=B[ee.k].direct,B[ee.k].direct=G[ee.k].direct),xB(e,r,r+S+ee.k,a,n,n+S,R[ee.k].d,u,B[ee.k].direct,A,d),xB(e,r+S+ee.k,t,a,n+S,i,B[ee.k].d,R[ee.k].direct,c,A,d)}function Eje(e,r,t,a){var n=wje(e,r,t);xB(e,0,e.length,r,0,r.length,n,Nr.diagonal,Nr.all,t,a)}function xje(e,r,t){t===void 0&&(t=function(n,i){return n===i});var a={removed:[],added:[]};return Eje(e,r,t,function(n,i,s,u,c,A,d){if(n==="add")for(var g=A;g<d;++g)a.added.push(c[g]);else if(n==="remove")for(var g=s;g<u;++g)a.removed.push(i[g])}),a}const kje=()=>{const e=Wa(),{eventSlug:r,contentId:t}=q4(),{props:{organizationId:a,loginUrl:n},user:i,loadingUser:s,organization:u}=G0(),[c,A]=Z.useState(!1),[d,g]=Z.useState(null),[m,b]=Z.useState([]),[w,E]=Z.useState(null),[x,_]=Z.useState("contain"),[I,S]=Z.useState({}),[R,M]=Z.useState(null),[N,L]=Z.useState(!1),[F,B]=Z.useState(!0),[G,V]=Z.useState(null),{loading:ee,event:K,parameters:$}=o6({eventSlug:r});Z.useEffect(()=>{K&&i&&z(K._id)},[K,i]);const re=u?.navigationSettings?.showAIDescription,z=async J=>{A(!0);try{const X=await at.get($r.CONTENT_FOR_CURATION,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:J,page:1,limit:10,includeDescription:re}}).json();if(X.error)throw new Error(X.error);const Y=t?X.data.filter(pe=>pe._id!==t):X.data;let se=Y,Q;if(t){const pe=await at.get($r.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{contentId:t,includeDescription:re}}).json();if(pe.error)throw new Error(pe.error);const he=pe.data;se=he?[he,...Y]:Y||[],Q=he&&he.userId===i?._id?"Sorry, you cannot rate your own content":he&&he.ratingStatus===M4e.CURATED?"Sorry, you have already rated this photo.":null}const ne=await at.get($r.GET_EVENT_POINTS,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:J}}).json();if(ne.error)throw new Error(ne.error);E(ne.data),b(se),g(Q)}catch(X){console.error("Failed to fetch contents",X)}A(!1)},U=async J=>{try{const X=await at.get($r.CONTENT_FOR_CURATION,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:K?._id,page:1,limit:10,includeDescription:re}});if(X.error)throw new Error(X.error);if(X?.data?.length>0){const Y=xje(J,X.data,(Q,ne)=>Q._id===ne._id),se=[...J,...Y.added];b(se)}}catch(X){console.error(X)}},j=async()=>{if($.length<1){V("no parameters found");return}if(Object.keys(I).length<$.length){V("please select your ratings");return}V(null),L(!0);const J=await at.post($r.CURATE_CONTENT,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},json:{eventId:K._id,contentId:m[0]._id,parameterCount:$.length,userRatings:$.map(X=>({parameterId:X._id,weight:X.weight,rate:I[X._id]})),inappropriate:""}}).json();if(J.error)V(J.error);else{const X=J.data,Y=X.crowdRatings||{},se={parameters:$.map(ne=>({name:ne.name,crowdRating:Y[ne._id],userRating:X.ratings?.find(pe=>pe.parameterId===ne._id)?.rate})),similarity:X.similarity||null,points:X.points||0,rateCount:X.rateCount||0};M(se);const Q={...w};Q.curate+=K.activityScores.curate,E(Q)}L(!1)},W=()=>{const J=m.slice(1);g(null),M(null),S({}),J.length===I4e?U(J):b(J),B(!0)};if(s)return O.jsx(Kt,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!i)if(u.customAuth)if(n)window.history.pushState({},"",n);else return O.jsx(i6,{title:"Please login to upload content"});else return O.jsx(jf,{to:nr.LOGIN,state:{referrer:e.pathname}});return O.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:c||ee?O.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),O.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((J,X)=>O.jsxs("div",{className:"qc:space-y-4",children:[O.jsx(Kt,{className:"qc:h-8 qc:w-36"}),O.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((Y,se)=>O.jsx(Kt,{className:"qc:h-24 qc:w-full qc:sm:h-32"},se))})]},X))})]}):O.jsxs("div",{className:"qc:lg:mt-8",children:[K?.status===Wi.CLOSED&&O.jsx(A0,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),K?.status===Wi.OPEN&&m.length<=0&&O.jsx(A0,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),K?.status===Wi.OPEN&&m.length>0&&O.jsxs("div",{children:[!($?.length<=0&&re)&&O.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[O.jsxs(A0,{variant:"h4",children:["Rate this ",m[0].type===Ua.IMAGE?"image":"video"]}),O.jsxs(A0,{variant:"h4",children:[K?.pointName,":"," ",O.jsx("span",{className:"qc:text-primary",children:w.upload+w.curate})]})]}),O.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[O.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[m[0].type===Ua.IMAGE&&O.jsx(Z.Fragment,{children:O.jsx(BR,{sizeMode:x,src:m[0].url,alt:m[0].caption,blurhash:m[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),m[0].type===Ua.VIDEO&&O.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:O.jsx(k0e,{fit:x,src:m[0].url,loop:!0,playing:F,volume:0,muted:!0,onPlay:()=>B(!0),onPause:()=>B(!1),onEnd:()=>B(!1)})}),m[0].caption&&m[0].caption.length>0&&O.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:O.jsx(A0,{variant:"body3",lines:"2",children:m[0].caption})}),m.length>1&&O.jsx("img",{style:{display:"none"},src:m[1].url,alt:"Next image"})]}),O.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!d&&$&&$.map(J=>O.jsx(yje,{parameter:J,selected:I[J._id],onChange:X=>S({...I,[J._id]:X})},J._id)),G&&$?.length>0&&O.jsx(A0,{variant:"h5",color:"error",children:G}),d&&$?.length>0&&O.jsx("div",{className:"qc:sm:pt-16",children:O.jsx(A0,{variant:"h5",color:"error",align:"center",children:d})}),$?.length>0&&O.jsx(gt,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:N,loading:N,icon:"material-symbols:check-rounded",onClick:d?W:j,children:d?"Rate Next Image":N?"Rating...":"Submit"}),m?.length>0&&re&&O.jsx(_je,{summary:m[0].contentSummary,url:m[0].url})]})]}),O.jsx("div",{className:"qc:mt-16",children:O.jsx(Jt,{to:nr.GALLERY(r),state:{internalNavigation:!0},children:O.jsx(A0,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),O.jsx(AY,{open:!!R,onOpenChange:J=>!J&&W(),children:O.jsxs(dY,{children:[O.jsxs(hY,{children:[O.jsxs(pY,{className:"qc:hidden",children:[K?.pointName,": ",w?.upload+w?.curate]}),O.jsx(mY,{className:"qc:hidden",children:"We are here to help you"})]}),O.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[O.jsx(bje,{feedback:R}),O.jsx(gt,{fullWidth:!0,color:"primary",onClick:W,children:"Next"})]})]})})]})})},_je=({summary:e,url:r})=>O.jsxs("div",{className:"qc:w-full",children:[e?.subject&&O.jsx(A0,{variant:"h3",className:"qc:mb-4",align:"center",children:e?.subject}),e?.labels&&O.jsx("div",{className:"qc:space-y-2",children:Object.entries(e?.labels).filter(([t,a])=>Array.isArray(a)&&a.length>0).map(([t,a])=>O.jsxs("div",{className:"",children:[O.jsx(A0,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:t.replace("_"," ")}),O.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((n,i)=>O.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[O.jsx(Xa,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),O.jsx(A0,{variant:"body1",children:n}),O.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(n)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:O.jsx(gt,{variant:"outlined",icon:"flat-color-icons:google",children:O.jsx(Xa,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},i))})]},t))}),e?.description&&O.jsxs(Z.Fragment,{children:[O.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),O.jsx(A0,{variant:"body2",children:e?.description})]}),O.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:O.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${r}&idpbck=1&selectedindex=0&id=${r}&mediaurl=${r}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:O.jsx(gt,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),e&&O.jsx(A0,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]}),Cje=Object.freeze(Object.defineProperty({__proto__:null,default:kje},Symbol.toStringTag,{value:"Module"})),Sje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const e=Wa(),{initializing:r,organization:t,user:a}=G0();return r?O.jsxs("div",{className:"qc:mx-auto qc:max-w-lg qc:space-y-8 qc:py-8",children:[O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"})]}):!t||t?.customAuth?null:a?O.jsx(jf,{replace:!0,to:e?.state?.referrer||"/"}):O.jsxs("div",{className:"qc:bg-background qc:mx-auto qc:mt-24 qc:min-h-[80vh] qc:max-w-md",children:[O.jsxs("div",{className:"qc:my-8 qc:flex qc:w-full qc:justify-around",children:[O.jsx(Jt,{to:nr.LOGIN,state:e?.state,className:y0(e.pathname===nr.LOGIN?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:O.jsx(A0,{variant:"h5",align:"center",children:"Login"})}),O.jsx(Jt,{to:nr.REGISTER,state:e?.state,className:y0(e.pathname===nr.REGISTER?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:O.jsx(A0,{variant:"h5",align:"center",children:"Register"})})]}),O.jsx(lG,{}),O.jsx("div",{className:"qc:mt-12",children:O.jsx(WG,{})})]})}},Symbol.toStringTag,{value:"Module"})),Qx=({disabled:e,provider:r,onClick:t,loading:a})=>{const n=(s,u=!1)=>{switch(s){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}},i=async()=>{if(!(e||a))try{await t()}catch(s){console.error(`${MV(r)} login error:`,s)}};return O.jsx("button",{disabled:e||a,onClick:i,className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:a?O.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:O.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):O.jsx("img",{className:"qc:h-auto qc:w-full",src:n(r,e),alt:`sign in with ${MV(r)}`})})};var Jg=e=>e.type==="checkbox",hd=e=>e instanceof Date,bi=e=>e==null;const I0e=e=>typeof e=="object";var fa=e=>!bi(e)&&!Array.isArray(e)&&I0e(e)&&!hd(e),R0e=e=>fa(e)&&e.target?Jg(e.target)?e.target.checked:e.target.value:e,Tje=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,M0e=(e,r)=>e.has(Tje(r)),Ije=e=>{const r=e.constructor&&e.constructor.prototype;return fa(r)&&r.hasOwnProperty("isPrototypeOf")},kB=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Sa(e){let r;const t=Array.isArray(e),a=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(kB&&(e instanceof Blob||a))&&(t||fa(e)))if(r=t?[]:Object.create(Object.getPrototypeOf(e)),!t&&!Ije(e))r=e;else for(const n in e)e.hasOwnProperty(n)&&(r[n]=Sa(e[n]));else return e;return r}var Jx=e=>/^\w*$/.test(e),Ut=e=>e===void 0,_B=e=>Array.isArray(e)?e.filter(Boolean):[],CB=e=>_B(e.replace(/["|']|\]/g,"").split(/\.|\[/)),j1=(e,r,t)=>{if(!r||!fa(e))return t;const a=(Jx(r)?[r]:CB(r)).reduce((n,i)=>bi(n)?n:n[i],e);return Ut(a)||a===e?Ut(e[r])?t:e[r]:a},to=e=>typeof e=="boolean",Fr=(e,r,t)=>{let a=-1;const n=Jx(r)?[r]:CB(r),i=n.length,s=i-1;for(;++a<i;){const u=n[a];let c=t;if(a!==s){const A=e[u];c=fa(A)||Array.isArray(A)?A:isNaN(+n[a+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=c,e=e[u]}};const Kx={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Dl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},O0e=A1.createContext(null);O0e.displayName="HookFormContext";const SB=()=>A1.useContext(O0e);var D0e=(e,r,t,a=!0)=>{const n={defaultValues:r._defaultValues};for(const i in e)Object.defineProperty(n,i,{get:()=>{const s=i;return r._proxyFormState[s]!==Dl.all&&(r._proxyFormState[s]=!a||Dl.all),t&&(t[s]=!0),e[s]}});return n};const TB=typeof window<"u"?A1.useLayoutEffect:A1.useEffect;function Rje(e){const r=SB(),{control:t=r.control,disabled:a,name:n,exact:i}=e||{},[s,u]=A1.useState(t._formState),c=A1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return TB(()=>t._subscribe({name:n,formState:c.current,exact:i,callback:A=>{!a&&u({...t._formState,...A})}}),[n,a,i]),A1.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),A1.useMemo(()=>D0e(s,t,c.current,!1),[s,t])}var ao=e=>typeof e=="string",IB=(e,r,t,a,n)=>ao(e)?(a&&r.watch.add(e),j1(t,e,n)):Array.isArray(e)?e.map(i=>(a&&r.watch.add(i),j1(t,i))):(a&&(r.watchAll=!0),t),RB=e=>bi(e)||!I0e(e);function Bl(e,r,t=new WeakSet){if(RB(e)||RB(r))return e===r;if(hd(e)&&hd(r))return e.getTime()===r.getTime();const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const i of a){const s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const u=r[i];if(hd(s)&&hd(u)||fa(s)&&fa(u)||Array.isArray(s)&&Array.isArray(u)?!Bl(s,u,t):s!==u)return!1}}return!0}function Mje(e){const r=SB(),{control:t=r.control,name:a,defaultValue:n,disabled:i,exact:s,compute:u}=e||{},c=A1.useRef(n),A=A1.useRef(u),d=A1.useRef(void 0),g=A1.useRef(t),m=A1.useRef(a);A.current=u;const[b,w]=A1.useState(()=>{const R=t._getWatch(a,c.current);return A.current?A.current(R):R}),E=A1.useCallback(R=>{const M=IB(a,t._names,R||t._formValues,!1,c.current);return A.current?A.current(M):M},[t._formValues,t._names,a]),x=A1.useCallback(R=>{if(!i){const M=IB(a,t._names,R||t._formValues,!1,c.current);if(A.current){const N=A.current(M);Bl(N,d.current)||(w(N),d.current=N)}else w(M)}},[t._formValues,t._names,i,a]);TB(()=>((g.current!==t||!Bl(m.current,a))&&(g.current=t,m.current=a,x()),t._subscribe({name:a,formState:{values:!0},exact:s,callback:R=>{x(R.values)}})),[t,s,a,x]),A1.useEffect(()=>t._removeUnmounted());const _=g.current!==t,I=m.current,S=A1.useMemo(()=>{if(i)return null;const R=!_&&!Bl(I,a);return _||R?E():null},[i,_,a,I,E]);return S!==null?S:b}function Oje(e){const r=SB(),{name:t,disabled:a,control:n=r.control,shouldUnregister:i,defaultValue:s}=e,u=M0e(n._names.array,t),c=A1.useMemo(()=>j1(n._formValues,t,j1(n._defaultValues,t,s)),[n,t,s]),A=Mje({control:n,name:t,defaultValue:c,exact:!0}),d=Rje({control:n,name:t,exact:!0}),g=A1.useRef(e),m=A1.useRef(void 0),b=A1.useRef(n.register(t,{...e.rules,value:A,...to(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const w=A1.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!j1(d.errors,t)},isDirty:{enumerable:!0,get:()=>!!j1(d.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!j1(d.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!j1(d.validatingFields,t)},error:{enumerable:!0,get:()=>j1(d.errors,t)}}),[d,t]),E=A1.useCallback(S=>b.current.onChange({target:{value:R0e(S),name:t},type:Kx.CHANGE}),[t]),x=A1.useCallback(()=>b.current.onBlur({target:{value:j1(n._formValues,t),name:t},type:Kx.BLUR}),[t,n._formValues]),_=A1.useCallback(S=>{const R=j1(n._fields,t);R&&S&&(R._f.ref={focus:()=>S.focus&&S.focus(),select:()=>S.select&&S.select(),setCustomValidity:M=>S.setCustomValidity(M),reportValidity:()=>S.reportValidity()})},[n._fields,t]),I=A1.useMemo(()=>({name:t,value:A,...to(a)||d.disabled?{disabled:d.disabled||a}:{},onChange:E,onBlur:x,ref:_}),[t,a,d.disabled,E,x,_,A]);return A1.useEffect(()=>{const S=n._options.shouldUnregister||i,R=m.current;R&&R!==t&&!u&&n.unregister(R),n.register(t,{...g.current.rules,...to(g.current.disabled)?{disabled:g.current.disabled}:{}});const M=(N,L)=>{const F=j1(n._fields,N);F&&F._f&&(F._f.mount=L)};if(M(t,!0),S){const N=Sa(j1(n._options.defaultValues,t,g.current.defaultValue));Fr(n._defaultValues,t,N),Ut(j1(n._formValues,t))&&Fr(n._formValues,t,N)}return!u&&n.register(t),m.current=t,()=>{(u?S&&!n._state.action:S)?n.unregister(t):M(t,!1)}},[t,n,u,i]),A1.useEffect(()=>{n._setDisabledField({disabled:a,name:t})},[a,t,n]),A1.useMemo(()=>({field:I,formState:d,fieldState:w}),[I,d,w])}const Nl=e=>e.render(Oje(e));var B0e=(e,r,t,a,n)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:n||!0}}:{},Kg=e=>Array.isArray(e)?e:[e],N0e=()=>{let e=[];return{get observers(){return e},next:n=>{for(const i of e)i.next&&i.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(i=>i!==n)}}),unsubscribe:()=>{e=[]}}};function F0e(e,r){const t={};for(const a in e)if(e.hasOwnProperty(a)){const n=e[a],i=r[a];if(n&&fa(n)&&i){const s=F0e(n,i);fa(s)&&(t[a]=s)}else e[a]&&(t[a]=i)}return t}var I2=e=>fa(e)&&!Object.keys(e).length,MB=e=>e.type==="file",Fl=e=>typeof e=="function",ek=e=>{if(!kB)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Z0e=e=>e.type==="select-multiple",OB=e=>e.type==="radio",Dje=e=>OB(e)||Jg(e),DB=e=>ek(e)&&e.isConnected;function Bje(e,r){const t=r.slice(0,-1).length;let a=0;for(;a<t;)e=Ut(e)?a++:e[r[a++]];return e}function Nje(e){for(const r in e)if(e.hasOwnProperty(r)&&!Ut(e[r]))return!1;return!0}function Aa(e,r){const t=Array.isArray(r)?r:Jx(r)?[r]:CB(r),a=t.length===1?e:Bje(e,t),n=t.length-1,i=t[n];return a&&delete a[i],n!==0&&(fa(a)&&I2(a)||Array.isArray(a)&&Nje(a))&&Aa(e,t.slice(0,-1)),e}var Fje=e=>{for(const r in e)if(Fl(e[r]))return!0;return!1};function P0e(e){return Array.isArray(e)||fa(e)&&!Fje(e)}function BB(e,r={}){for(const t in e)P0e(e[t])?(r[t]=Array.isArray(e[t])?[]:{},BB(e[t],r[t])):Ut(e[t])||(r[t]=!0);return r}function r9(e,r,t){t||(t=BB(r));for(const a in e)P0e(e[a])?Ut(r)||RB(t[a])?t[a]=BB(e[a],Array.isArray(e[a])?[]:{}):r9(e[a],bi(r)?{}:r[a],t[a]):t[a]=!Bl(e[a],r[a]);return t}const j0e={value:!1,isValid:!1},q0e={value:!0,isValid:!0};var L0e=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ut(e[0].attributes.value)?Ut(e[0].value)||e[0].value===""?q0e:{value:e[0].value,isValid:!0}:q0e:j0e}return j0e},V0e=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:a})=>Ut(e)?e:r?e===""?NaN:e&&+e:t&&ao(e)?new Date(e):a?a(e):e;const G0e={isValid:!1,value:null};var z0e=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,G0e):G0e;function U0e(e){const r=e.ref;return MB(r)?r.files:OB(r)?z0e(e.refs).value:Z0e(r)?[...r.selectedOptions].map(({value:t})=>t):Jg(r)?L0e(e.refs).value:V0e(Ut(r.value)?e.ref.value:r.value,e)}var Zje=(e,r,t,a)=>{const n={};for(const i of e){const s=j1(r,i);s&&Fr(n,i,s._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:a}},rk=e=>e instanceof RegExp,e7=e=>Ut(e)?e:rk(e)?e.source:fa(e)?rk(e.value)?e.value.source:e.value:e,W0e=e=>({isOnSubmit:!e||e===Dl.onSubmit,isOnBlur:e===Dl.onBlur,isOnChange:e===Dl.onChange,isOnAll:e===Dl.all,isOnTouch:e===Dl.onTouched});const X0e="AsyncFunction";var Pje=e=>!!e&&!!e.validate&&!!(Fl(e.validate)&&e.validate.constructor.name===X0e||fa(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===X0e)),jje=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),H0e=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(a=>e.startsWith(a)&&/^\.\w+/.test(e.slice(a.length))));const r7=(e,r,t,a)=>{for(const n of t||Object.keys(e)){const i=j1(e,n);if(i){const{_f:s,...u}=i;if(s){if(s.refs&&s.refs[0]&&r(s.refs[0],n)&&!a)return!0;if(s.ref&&r(s.ref,s.name)&&!a)return!0;if(r7(u,r))break}else if(fa(u)&&r7(u,r))break}}};function $0e(e,r,t){const a=j1(e,t);if(a||Jx(t))return{error:a,name:t};const n=t.split(".");for(;n.length;){const i=n.join("."),s=j1(r,i),u=j1(e,i);if(s&&!Array.isArray(s)&&t!==i)return{name:t};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};n.pop()}return{name:t}}var qje=(e,r,t,a)=>{t(e);const{name:n,...i}=e;return I2(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(s=>r[s]===(!a||Dl.all))},Lje=(e,r,t)=>!e||!r||e===r||Kg(e).some(a=>a&&(t?a===r:a.startsWith(r)||r.startsWith(a))),Vje=(e,r,t,a,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?a.isOnBlur:n.isOnBlur)?!e:(t?a.isOnChange:n.isOnChange)?e:!0,Gje=(e,r)=>!_B(j1(e,r)).length&&Aa(e,r),zje=(e,r,t)=>{const a=Kg(j1(e,t));return Fr(a,"root",r[t]),Fr(e,t,a),e};function Y0e(e,r,t="validate"){if(ao(e)||Array.isArray(e)&&e.every(ao)||to(e)&&!e)return{type:t,message:ao(e)?e:"",ref:r}}var t9=e=>fa(e)&&!rk(e)?e:{value:e,message:""},Q0e=async(e,r,t,a,n,i)=>{const{ref:s,refs:u,required:c,maxLength:A,minLength:d,min:g,max:m,pattern:b,validate:w,name:E,valueAsNumber:x,mount:_}=e._f,I=j1(t,E);if(!_||r.has(E))return{};const S=u?u[0]:s,R=ee=>{n&&S.reportValidity&&(S.setCustomValidity(to(ee)?"":ee||""),S.reportValidity())},M={},N=OB(s),L=Jg(s),F=N||L,B=(x||MB(s))&&Ut(s.value)&&Ut(I)||ek(s)&&s.value===""||I===""||Array.isArray(I)&&!I.length,G=B0e.bind(null,E,a,M),V=(ee,K,$,re=fc.maxLength,z=fc.minLength)=>{const U=ee?K:$;M[E]={type:ee?re:z,message:U,ref:s,...G(ee?re:z,U)}};if(i?!Array.isArray(I)||!I.length:c&&(!F&&(B||bi(I))||to(I)&&!I||L&&!L0e(u).isValid||N&&!z0e(u).isValid)){const{value:ee,message:K}=ao(c)?{value:!!c,message:c}:t9(c);if(ee&&(M[E]={type:fc.required,message:K,ref:S,...G(fc.required,K)},!a))return R(K),M}if(!B&&(!bi(g)||!bi(m))){let ee,K;const $=t9(m),re=t9(g);if(!bi(I)&&!isNaN(I)){const z=s.valueAsNumber||I&&+I;bi($.value)||(ee=z>$.value),bi(re.value)||(K=z<re.value)}else{const z=s.valueAsDate||new Date(I),U=J=>new Date(new Date().toDateString()+" "+J),j=s.type=="time",W=s.type=="week";ao($.value)&&I&&(ee=j?U(I)>U($.value):W?I>$.value:z>new Date($.value)),ao(re.value)&&I&&(K=j?U(I)<U(re.value):W?I<re.value:z<new Date(re.value))}if((ee||K)&&(V(!!ee,$.message,re.message,fc.max,fc.min),!a))return R(M[E].message),M}if((A||d)&&!B&&(ao(I)||i&&Array.isArray(I))){const ee=t9(A),K=t9(d),$=!bi(ee.value)&&I.length>+ee.value,re=!bi(K.value)&&I.length<+K.value;if(($||re)&&(V($,ee.message,K.message),!a))return R(M[E].message),M}if(b&&!B&&ao(I)){const{value:ee,message:K}=t9(b);if(rk(ee)&&!I.match(ee)&&(M[E]={type:fc.pattern,message:K,ref:s,...G(fc.pattern,K)},!a))return R(K),M}if(w){if(Fl(w)){const ee=await w(I,t),K=Y0e(ee,S);if(K&&(M[E]={...K,...G(fc.validate,K.message)},!a))return R(K.message),M}else if(fa(w)){let ee={};for(const K in w){if(!I2(ee)&&!a)break;const $=Y0e(await w[K](I,t),S,K);$&&(ee={...$,...G(K,$.message)},R($.message),a&&(M[E]=ee))}if(!I2(ee)&&(M[E]={ref:S,...ee},!a))return M}}return R(!0),M};const Uje={mode:Dl.onSubmit,reValidateMode:Dl.onChange,shouldFocusError:!0};function Wje(e={}){let r={...Uje,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},n=fa(r.defaultValues)||fa(r.values)?Sa(r.defaultValues||r.values)||{}:{},i=r.shouldUnregister?{}:Sa(n),s={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,A=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...d};const m={array:N0e(),state:N0e()},b=r.criteriaMode===Dl.all,w=ve=>be=>{clearTimeout(A),A=setTimeout(ve,be)},E=async ve=>{if(!r.disabled&&(d.isValid||g.isValid||ve)){const be=r.resolver?I2((await L()).errors):await B(a,!0);be!==t.isValid&&m.state.next({isValid:be})}},x=(ve,be)=>{!r.disabled&&(d.isValidating||d.validatingFields||g.isValidating||g.validatingFields)&&((ve||Array.from(u.mount)).forEach(Ce=>{Ce&&(be?Fr(t.validatingFields,Ce,be):Aa(t.validatingFields,Ce))}),m.state.next({validatingFields:t.validatingFields,isValidating:!I2(t.validatingFields)}))},_=(ve,be=[],Ce,Ge,xe=!0,Ne=!0)=>{if(Ge&&Ce&&!r.disabled){if(s.action=!0,Ne&&Array.isArray(j1(a,ve))){const r1=Ce(j1(a,ve),Ge.argA,Ge.argB);xe&&Fr(a,ve,r1)}if(Ne&&Array.isArray(j1(t.errors,ve))){const r1=Ce(j1(t.errors,ve),Ge.argA,Ge.argB);xe&&Fr(t.errors,ve,r1),Gje(t.errors,ve)}if((d.touchedFields||g.touchedFields)&&Ne&&Array.isArray(j1(t.touchedFields,ve))){const r1=Ce(j1(t.touchedFields,ve),Ge.argA,Ge.argB);xe&&Fr(t.touchedFields,ve,r1)}(d.dirtyFields||g.dirtyFields)&&(t.dirtyFields=r9(n,i)),m.state.next({name:ve,isDirty:V(ve,be),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else Fr(i,ve,be)},I=(ve,be)=>{Fr(t.errors,ve,be),m.state.next({errors:t.errors})},S=ve=>{t.errors=ve,m.state.next({errors:t.errors,isValid:!1})},R=(ve,be,Ce,Ge)=>{const xe=j1(a,ve);if(xe){const Ne=j1(i,ve,Ut(Ce)?j1(n,ve):Ce);Ut(Ne)||Ge&&Ge.defaultChecked||be?Fr(i,ve,be?Ne:U0e(xe._f)):$(ve,Ne),s.mount&&E()}},M=(ve,be,Ce,Ge,xe)=>{let Ne=!1,r1=!1;const C1={name:ve};if(!r.disabled){if(!Ce||Ge){(d.isDirty||g.isDirty)&&(r1=t.isDirty,t.isDirty=C1.isDirty=V(),Ne=r1!==C1.isDirty);const d1=Bl(j1(n,ve),be);r1=!!j1(t.dirtyFields,ve),d1?Aa(t.dirtyFields,ve):Fr(t.dirtyFields,ve,!0),C1.dirtyFields=t.dirtyFields,Ne=Ne||(d.dirtyFields||g.dirtyFields)&&r1!==!d1}if(Ce){const d1=j1(t.touchedFields,ve);d1||(Fr(t.touchedFields,ve,Ce),C1.touchedFields=t.touchedFields,Ne=Ne||(d.touchedFields||g.touchedFields)&&d1!==Ce)}Ne&&xe&&m.state.next(C1)}return Ne?C1:{}},N=(ve,be,Ce,Ge)=>{const xe=j1(t.errors,ve),Ne=(d.isValid||g.isValid)&&to(be)&&t.isValid!==be;if(r.delayError&&Ce?(c=w(()=>I(ve,Ce)),c(r.delayError)):(clearTimeout(A),c=null,Ce?Fr(t.errors,ve,Ce):Aa(t.errors,ve)),(Ce?!Bl(xe,Ce):xe)||!I2(Ge)||Ne){const r1={...Ge,...Ne&&to(be)?{isValid:be}:{},errors:t.errors,name:ve};t={...t,...r1},m.state.next(r1)}},L=async ve=>{x(ve,!0);const be=await r.resolver(i,r.context,Zje(ve||u.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return x(ve),be},F=async ve=>{const{errors:be}=await L(ve);if(ve)for(const Ce of ve){const Ge=j1(be,Ce);Ge?Fr(t.errors,Ce,Ge):Aa(t.errors,Ce)}else t.errors=be;return be},B=async(ve,be,Ce={valid:!0})=>{for(const Ge in ve){const xe=ve[Ge];if(xe){const{_f:Ne,...r1}=xe;if(Ne){const C1=u.array.has(Ne.name),d1=xe._f&&Pje(xe._f);d1&&d.validatingFields&&x([Ne.name],!0);const U1=await Q0e(xe,u.disabled,i,b,r.shouldUseNativeValidation&&!be,C1);if(d1&&d.validatingFields&&x([Ne.name]),U1[Ne.name]&&(Ce.valid=!1,be))break;!be&&(j1(U1,Ne.name)?C1?zje(t.errors,U1,Ne.name):Fr(t.errors,Ne.name,U1[Ne.name]):Aa(t.errors,Ne.name))}!I2(r1)&&await B(r1,be,Ce)}}return Ce.valid},G=()=>{for(const ve of u.unMount){const be=j1(a,ve);be&&(be._f.refs?be._f.refs.every(Ce=>!DB(Ce)):!DB(be._f.ref))&&he(ve)}u.unMount=new Set},V=(ve,be)=>!r.disabled&&(ve&&be&&Fr(i,ve,be),!Bl(J(),n)),ee=(ve,be,Ce)=>IB(ve,u,{...s.mount?i:Ut(be)?n:ao(ve)?{[ve]:be}:be},Ce,be),K=ve=>_B(j1(s.mount?i:n,ve,r.shouldUnregister?j1(n,ve,[]):[])),$=(ve,be,Ce={})=>{const Ge=j1(a,ve);let xe=be;if(Ge){const Ne=Ge._f;Ne&&(!Ne.disabled&&Fr(i,ve,V0e(be,Ne)),xe=ek(Ne.ref)&&bi(be)?"":be,Z0e(Ne.ref)?[...Ne.ref.options].forEach(r1=>r1.selected=xe.includes(r1.value)):Ne.refs?Jg(Ne.ref)?Ne.refs.forEach(r1=>{(!r1.defaultChecked||!r1.disabled)&&(Array.isArray(xe)?r1.checked=!!xe.find(C1=>C1===r1.value):r1.checked=xe===r1.value||!!xe)}):Ne.refs.forEach(r1=>r1.checked=r1.value===xe):MB(Ne.ref)?Ne.ref.value="":(Ne.ref.value=xe,Ne.ref.type||m.state.next({name:ve,values:Sa(i)})))}(Ce.shouldDirty||Ce.shouldTouch)&&M(ve,xe,Ce.shouldTouch,Ce.shouldDirty,!0),Ce.shouldValidate&&W(ve)},re=(ve,be,Ce)=>{for(const Ge in be){if(!be.hasOwnProperty(Ge))return;const xe=be[Ge],Ne=ve+"."+Ge,r1=j1(a,Ne);(u.array.has(ve)||fa(xe)||r1&&!r1._f)&&!hd(xe)?re(Ne,xe,Ce):$(Ne,xe,Ce)}},z=(ve,be,Ce={})=>{const Ge=j1(a,ve),xe=u.array.has(ve),Ne=Sa(be);Fr(i,ve,Ne),xe?(m.array.next({name:ve,values:Sa(i)}),(d.isDirty||d.dirtyFields||g.isDirty||g.dirtyFields)&&Ce.shouldDirty&&m.state.next({name:ve,dirtyFields:r9(n,i),isDirty:V(ve,Ne)})):Ge&&!Ge._f&&!bi(Ne)?re(ve,Ne,Ce):$(ve,Ne,Ce),H0e(ve,u)&&m.state.next({...t,name:ve}),m.state.next({name:s.mount?ve:void 0,values:Sa(i)})},U=async ve=>{s.mount=!0;const be=ve.target;let Ce=be.name,Ge=!0;const xe=j1(a,Ce),Ne=d1=>{Ge=Number.isNaN(d1)||hd(d1)&&isNaN(d1.getTime())||Bl(d1,j1(i,Ce,d1))},r1=W0e(r.mode),C1=W0e(r.reValidateMode);if(xe){let d1,U1;const Y1=be.type?U0e(xe._f):R0e(ve),x1=ve.type===Kx.BLUR||ve.type===Kx.FOCUS_OUT,R1=!jje(xe._f)&&!r.resolver&&!j1(t.errors,Ce)&&!xe._f.deps||Vje(x1,j1(t.touchedFields,Ce),t.isSubmitted,C1,r1),v1=H0e(Ce,u,x1);Fr(i,Ce,Y1),x1?(!be||!be.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(ve),c&&c(0)):xe._f.onChange&&xe._f.onChange(ve);const I1=M(Ce,Y1,x1),e0=!I2(I1)||v1;if(!x1&&m.state.next({name:Ce,type:ve.type,values:Sa(i)}),R1)return(d.isValid||g.isValid)&&(r.mode==="onBlur"?x1&&E():x1||E()),e0&&m.state.next({name:Ce,...v1?{}:I1});if(!x1&&v1&&m.state.next({...t}),r.resolver){const{errors:r0}=await L([Ce]);if(Ne(Y1),Ge){const W1=$0e(t.errors,a,Ce),T1=$0e(r0,a,W1.name||Ce);d1=T1.error,Ce=T1.name,U1=I2(r0)}}else x([Ce],!0),d1=(await Q0e(xe,u.disabled,i,b,r.shouldUseNativeValidation))[Ce],x([Ce]),Ne(Y1),Ge&&(d1?U1=!1:(d.isValid||g.isValid)&&(U1=await B(a,!0)));Ge&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&W(xe._f.deps),N(Ce,U1,d1,I1))}},j=(ve,be)=>{if(j1(t.errors,be)&&ve.focus)return ve.focus(),1},W=async(ve,be={})=>{let Ce,Ge;const xe=Kg(ve);if(r.resolver){const Ne=await F(Ut(ve)?ve:xe);Ce=I2(Ne),Ge=ve?!xe.some(r1=>j1(Ne,r1)):Ce}else ve?(Ge=(await Promise.all(xe.map(async Ne=>{const r1=j1(a,Ne);return await B(r1&&r1._f?{[Ne]:r1}:r1)}))).every(Boolean),!(!Ge&&!t.isValid)&&E()):Ge=Ce=await B(a);return m.state.next({...!ao(ve)||(d.isValid||g.isValid)&&Ce!==t.isValid?{}:{name:ve},...r.resolver||!ve?{isValid:Ce}:{},errors:t.errors}),be.shouldFocus&&!Ge&&r7(a,j,ve?xe:u.mount),Ge},J=(ve,be)=>{let Ce={...s.mount?i:n};return be&&(Ce=F0e(be.dirtyFields?t.dirtyFields:t.touchedFields,Ce)),Ut(ve)?Ce:ao(ve)?j1(Ce,ve):ve.map(Ge=>j1(Ce,Ge))},X=(ve,be)=>({invalid:!!j1((be||t).errors,ve),isDirty:!!j1((be||t).dirtyFields,ve),error:j1((be||t).errors,ve),isValidating:!!j1(t.validatingFields,ve),isTouched:!!j1((be||t).touchedFields,ve)}),Y=ve=>{ve&&Kg(ve).forEach(be=>Aa(t.errors,be)),m.state.next({errors:ve?t.errors:{}})},se=(ve,be,Ce)=>{const Ge=(j1(a,ve,{_f:{}})._f||{}).ref,xe=j1(t.errors,ve)||{},{ref:Ne,message:r1,type:C1,...d1}=xe;Fr(t.errors,ve,{...d1,...be,ref:Ge}),m.state.next({name:ve,errors:t.errors,isValid:!1}),Ce&&Ce.shouldFocus&&Ge&&Ge.focus&&Ge.focus()},Q=(ve,be)=>Fl(ve)?m.state.subscribe({next:Ce=>"values"in Ce&&ve(ee(void 0,be),Ce)}):ee(ve,be,!0),ne=ve=>m.state.subscribe({next:be=>{Lje(ve.name,be.name,ve.exact)&&qje(be,ve.formState||d,Ve,ve.reRenderRoot)&&ve.callback({values:{...i},...t,...be,defaultValues:n})}}).unsubscribe,pe=ve=>(s.mount=!0,g={...g,...ve.formState},ne({...ve,formState:g})),he=(ve,be={})=>{for(const Ce of ve?Kg(ve):u.mount)u.mount.delete(Ce),u.array.delete(Ce),be.keepValue||(Aa(a,Ce),Aa(i,Ce)),!be.keepError&&Aa(t.errors,Ce),!be.keepDirty&&Aa(t.dirtyFields,Ce),!be.keepTouched&&Aa(t.touchedFields,Ce),!be.keepIsValidating&&Aa(t.validatingFields,Ce),!r.shouldUnregister&&!be.keepDefaultValue&&Aa(n,Ce);m.state.next({values:Sa(i)}),m.state.next({...t,...be.keepDirty?{isDirty:V()}:{}}),!be.keepIsValid&&E()},ye=({disabled:ve,name:be})=>{(to(ve)&&s.mount||ve||u.disabled.has(be))&&(ve?u.disabled.add(be):u.disabled.delete(be))},Ee=(ve,be={})=>{let Ce=j1(a,ve);const Ge=to(be.disabled)||to(r.disabled);return Fr(a,ve,{...Ce||{},_f:{...Ce&&Ce._f?Ce._f:{ref:{name:ve}},name:ve,mount:!0,...be}}),u.mount.add(ve),Ce?ye({disabled:to(be.disabled)?be.disabled:r.disabled,name:ve}):R(ve,!0,be.value),{...Ge?{disabled:be.disabled||r.disabled}:{},...r.progressive?{required:!!be.required,min:e7(be.min),max:e7(be.max),minLength:e7(be.minLength),maxLength:e7(be.maxLength),pattern:e7(be.pattern)}:{},name:ve,onChange:U,onBlur:U,ref:xe=>{if(xe){Ee(ve,be),Ce=j1(a,ve);const Ne=Ut(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,r1=Dje(Ne),C1=Ce._f.refs||[];if(r1?C1.find(d1=>d1===Ne):Ne===Ce._f.ref)return;Fr(a,ve,{_f:{...Ce._f,...r1?{refs:[...C1.filter(DB),Ne,...Array.isArray(j1(n,ve))?[{}]:[]],ref:{type:Ne.type,name:ve}}:{ref:Ne}}}),R(ve,!1,void 0,Ne)}else Ce=j1(a,ve,{}),Ce._f&&(Ce._f.mount=!1),(r.shouldUnregister||be.shouldUnregister)&&!(M0e(u.array,ve)&&s.action)&&u.unMount.add(ve)}}},Me=()=>r.shouldFocusError&&r7(a,j,u.mount),De=ve=>{to(ve)&&(m.state.next({disabled:ve}),r7(a,(be,Ce)=>{const Ge=j1(a,Ce);Ge&&(be.disabled=Ge._f.disabled||ve,Array.isArray(Ge._f.refs)&&Ge._f.refs.forEach(xe=>{xe.disabled=Ge._f.disabled||ve}))},0,!1))},ge=(ve,be)=>async Ce=>{let Ge;Ce&&(Ce.preventDefault&&Ce.preventDefault(),Ce.persist&&Ce.persist());let xe=Sa(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:Ne,values:r1}=await L();t.errors=Ne,xe=Sa(r1)}else await B(a);if(u.disabled.size)for(const Ne of u.disabled)Aa(xe,Ne);if(Aa(t.errors,"root"),I2(t.errors)){m.state.next({errors:{}});try{await ve(xe,Ce)}catch(Ne){Ge=Ne}}else be&&await be({...t.errors},Ce),Me(),setTimeout(Me);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:I2(t.errors)&&!Ge,submitCount:t.submitCount+1,errors:t.errors}),Ge)throw Ge},Oe=(ve,be={})=>{j1(a,ve)&&(Ut(be.defaultValue)?z(ve,Sa(j1(n,ve))):(z(ve,be.defaultValue),Fr(n,ve,Sa(be.defaultValue))),be.keepTouched||Aa(t.touchedFields,ve),be.keepDirty||(Aa(t.dirtyFields,ve),t.isDirty=be.defaultValue?V(ve,Sa(j1(n,ve))):V()),be.keepError||(Aa(t.errors,ve),d.isValid&&E()),m.state.next({...t}))},Ke=(ve,be={})=>{const Ce=ve?Sa(ve):n,Ge=Sa(Ce),xe=I2(ve),Ne=xe?n:Ge;if(be.keepDefaultValues||(n=Ce),!be.keepValues){if(be.keepDirtyValues){const r1=new Set([...u.mount,...Object.keys(r9(n,i))]);for(const C1 of Array.from(r1))j1(t.dirtyFields,C1)?Fr(Ne,C1,j1(i,C1)):z(C1,j1(Ne,C1))}else{if(kB&&Ut(ve))for(const r1 of u.mount){const C1=j1(a,r1);if(C1&&C1._f){const d1=Array.isArray(C1._f.refs)?C1._f.refs[0]:C1._f.ref;if(ek(d1)){const U1=d1.closest("form");if(U1){U1.reset();break}}}}if(be.keepFieldsRef)for(const r1 of u.mount)z(r1,j1(Ne,r1));else a={}}i=r.shouldUnregister?be.keepDefaultValues?Sa(n):{}:Sa(Ne),m.array.next({values:{...Ne}}),m.state.next({values:{...Ne}})}u={mount:be.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!be.keepIsValid||!!be.keepDirtyValues||!r.shouldUnregister&&!I2(Ne),s.watch=!!r.shouldUnregister,m.state.next({submitCount:be.keepSubmitCount?t.submitCount:0,isDirty:xe?!1:be.keepDirty?t.isDirty:!!(be.keepDefaultValues&&!Bl(ve,n)),isSubmitted:be.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:xe?{}:be.keepDirtyValues?be.keepDefaultValues&&i?r9(n,i):t.dirtyFields:be.keepDefaultValues&&ve?r9(n,ve):be.keepDirty?t.dirtyFields:{},touchedFields:be.keepTouched?t.touchedFields:{},errors:be.keepErrors?t.errors:{},isSubmitSuccessful:be.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},Je=(ve,be)=>Ke(Fl(ve)?ve(i):ve,be),h1=(ve,be={})=>{const Ce=j1(a,ve),Ge=Ce&&Ce._f;if(Ge){const xe=Ge.refs?Ge.refs[0]:Ge.ref;xe.focus&&(xe.focus(),be.shouldSelect&&Fl(xe.select)&&xe.select())}},Ve=ve=>{t={...t,...ve}},p1={control:{register:Ee,unregister:he,getFieldState:X,handleSubmit:ge,setError:se,_subscribe:ne,_runSchema:L,_focusError:Me,_getWatch:ee,_getDirty:V,_setValid:E,_setFieldArray:_,_setDisabledField:ye,_setErrors:S,_getFieldArray:K,_reset:Ke,_resetDefaultValues:()=>Fl(r.defaultValues)&&r.defaultValues().then(ve=>{Je(ve,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:De,_subjects:m,_proxyFormState:d,get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(ve){s=ve},get _defaultValues(){return n},get _names(){return u},set _names(ve){u=ve},get _formState(){return t},get _options(){return r},set _options(ve){r={...r,...ve}}},subscribe:pe,trigger:W,register:Ee,handleSubmit:ge,watch:Q,setValue:z,getValues:J,reset:Je,resetField:Oe,clearErrors:Y,unregister:he,setError:se,setFocus:h1,getFieldState:X};return{...p1,formControl:p1}}function t7(e={}){const r=A1.useRef(void 0),t=A1.useRef(void 0),[a,n]=A1.useState({isDirty:!1,isValidating:!1,isLoading:Fl(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Fl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...u}=Wje(e);r.current={...u,formState:a}}const i=r.current.control;return i._options=e,TB(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>n({...i._formState}),reRenderRoot:!0});return n(u=>({...u,isReady:!0})),i._formState.isReady=!0,s},[i]),A1.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),A1.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),A1.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),A1.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),A1.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==a.isDirty&&i._subjects.state.next({isDirty:s})}},[i,a.isDirty]),A1.useEffect(()=>{e.values&&!Bl(e.values,t.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),t.current=e.values,n(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),A1.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=D0e(a,i),r.current}const J0e=(e,r,t)=>{if(e&&"reportValidity"in e){const a=j1(t,r);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},K0e=(e,r)=>{for(const t in r.fields){const a=r.fields[t];a&&a.ref&&"reportValidity"in a.ref?J0e(a.ref,t,e):a&&a.refs&&a.refs.forEach(n=>J0e(n,t,e))}},Xje=(e,r)=>{r.shouldUseNativeValidation&&K0e(e,r);const t={};for(const a in e){const n=j1(r.fields,a),i=Object.assign(e[a]||{},{ref:n&&n.ref});if(Hje(r.names||Object.keys(e),a)){const s=Object.assign({},j1(t,a));Fr(s,"root",i),Fr(t,a,s)}else Fr(t,a,i)}return t},Hje=(e,r)=>{const t=ere(r);return e.some(a=>ere(a).match(`^${t}\\.\\d+`))};function ere(e){return e.replace(/\]|\[/g,"")}var $je={};function a7(e,r,t){return t===void 0&&(t={}),function(a,n,i){try{return Promise.resolve((function(s,u){try{var c=(r!=null&&r.context&&$je.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[t.mode==="sync"?"validateSync":"validate"](a,Object.assign({abortEarly:!1},r,{context:n}))).then(function(A){return i.shouldUseNativeValidation&&K0e({},i),{values:t.raw?Object.assign({},a):A,errors:{}}}))}catch(A){return u(A)}return c&&c.then?c.then(void 0,u):c})(0,function(s){if(!s.inner)throw s;return{values:{},errors:Xje((u=s,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(u.inner||[]).reduce(function(A,d){if(A[d.path]||(A[d.path]={message:d.message,type:d.type}),c){var g=A[d.path].types,m=g&&g[d.type];A[d.path]=B0e(d.path,c,A,d.type,m?[].concat(m,d.message):d.message)}return A},{})),i)};var u,c}))}catch(s){return Promise.reject(s)}}}var NB,rre;function Yje(){if(rre)return NB;rre=1;function e(_){this._maxSize=_,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(_){return this._values[_]},e.prototype.set=function(_,I){return this._size>=this._maxSize&&this.clear(),_ in this._values||this._size++,this._values[_]=I};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,a=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,u=new e(s),c=new e(s),A=new e(s);NB={Cache:e,split:g,normalizePath:d,setter:function(_){var I=d(_);return c.get(_)||c.set(_,function(R,M){for(var N=0,L=I.length,F=R;N<L-1;){var B=I[N];if(B==="__proto__"||B==="constructor"||B==="prototype")return R;F=F[I[N++]]}F[I[N]]=M})},getter:function(_,I){var S=d(_);return A.get(_)||A.set(_,function(M){for(var N=0,L=S.length;N<L;)if(M!=null||!I)M=M[S[N++]];else return;return M})},join:function(_){return _.reduce(function(I,S){return I+(b(S)||t.test(S)?"["+S+"]":(I?".":"")+S)},"")},forEach:function(_,I,S){m(Array.isArray(_)?_:g(_),I,S)}};function d(_){return u.get(_)||u.set(_,g(_).map(function(I){return I.replace(i,"$2")}))}function g(_){return _.match(r)||[""]}function m(_,I,S){var R=_.length,M,N,L,F;for(N=0;N<R;N++)M=_[N],M&&(x(M)&&(M='"'+M+'"'),F=b(M),L=!F&&/^\d+$/.test(M),I.call(S,M,F,L,N,_))}function b(_){return typeof _=="string"&&_&&["'",'"'].indexOf(_.charAt(0))!==-1}function w(_){return _.match(a)&&!_.match(t)}function E(_){return n.test(_)}function x(_){return!b(_)&&(w(_)||E(_))}return NB}var pd=Yje(),FB,tre;function Qje(){if(tre)return FB;tre=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=d=>d.match(e)||[],t=d=>d[0].toUpperCase()+d.slice(1),a=(d,g)=>r(d).join(g).toLowerCase(),n=d=>r(d).reduce((g,m)=>`${g}${g?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return FB={words:r,upperFirst:t,camelCase:n,pascalCase:d=>t(n(d)),snakeCase:d=>a(d,"_"),kebabCase:d=>a(d,"-"),sentenceCase:d=>t(a(d," ")),titleCase:d=>r(d).map(t).join(" ")},FB}var ZB=Qje(),tk={exports:{}},are;function Jje(){if(are)return tk.exports;are=1,tk.exports=function(n){return e(r(n),n)},tk.exports.array=e;function e(n,i){var s=n.length,u=new Array(s),c={},A=s,d=t(i),g=a(n);for(i.forEach(function(b){if(!g.has(b[0])||!g.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});A--;)c[A]||m(n[A],A,new Set);return u;function m(b,w,E){if(E.has(b)){var x;try{x=", node was:"+JSON.stringify(b)}catch{x=""}throw new Error("Cyclic dependency"+x)}if(!g.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[w]){c[w]=!0;var _=d.get(b)||new Set;if(_=Array.from(_),w=_.length){E.add(b);do{var I=_[--w];m(I,g.get(I),E)}while(w);E.delete(b)}u[--s]=b}}}function r(n){for(var i=new Set,s=0,u=n.length;s<u;s++){var c=n[s];i.add(c[0]),i.add(c[1])}return Array.from(i)}function t(n){for(var i=new Map,s=0,u=n.length;s<u;s++){var c=n[s];i.has(c[0])||i.set(c[0],new Set),i.has(c[1])||i.set(c[1],new Set),i.get(c[0]).add(c[1])}return i}function a(n){for(var i=new Map,s=0,u=n.length;s<u;s++)i.set(n[s],s);return i}return tk.exports}var Kje=Jje();const eqe=Of(Kje),rqe=Object.prototype.toString,tqe=Error.prototype.toString,aqe=RegExp.prototype.toString,nqe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",iqe=/^Symbol\((.*)\)(.*)$/;function oqe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function nre(e,r=!1){if(e==null||e===!0||e===!1)return""+e;const t=typeof e;if(t==="number")return oqe(e);if(t==="string")return r?`"${e}"`:e;if(t==="function")return"[Function "+(e.name||"anonymous")+"]";if(t==="symbol")return nqe.call(e).replace(iqe,"Symbol($1)");const a=rqe.call(e).slice(8,-1);return a==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):a==="Error"||e instanceof Error?"["+tqe.call(e)+"]":a==="RegExp"?aqe.call(e):null}function uA(e,r){let t=nre(e,r);return t!==null?t:JSON.stringify(e,function(a,n){let i=nre(this[a],r);return i!==null?i:n},2)}function ire(e){return e==null?[]:[].concat(e)}let ore,sre,lre,sqe=/\$\{\s*(\w+)\s*\}/g;ore=Symbol.toStringTag;class ure{constructor(r,t,a,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[ore]="Error",this.name="ValidationError",this.value=t,this.path=a,this.type=n,this.errors=[],this.inner=[],ire(r).forEach(i=>{if(R2.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}sre=Symbol.hasInstance,lre=Symbol.toStringTag;class R2 extends Error{static formatError(r,t){const a=t.label||t.path||"this";return t=Object.assign({},t,{path:a,originalPath:t.path}),typeof r=="string"?r.replace(sqe,(n,i)=>uA(t[i])):typeof r=="function"?r(t):r}static isError(r){return r&&r.name==="ValidationError"}constructor(r,t,a,n,i){const s=new ure(r,t,a,n);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[lre]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,R2)}static[sre](r){return ure[Symbol.hasInstance](r)||super[Symbol.hasInstance](r)}}let zu={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:r,value:t,originalValue:a})=>{const n=a!=null&&a!==t?` (cast from the value \`${uA(a,!0)}\`).`:".";return r!=="mixed"?`${e} must be a \`${r}\` type, but the final value was: \`${uA(t,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${uA(t,!0)}\``+n}},vi={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},lqe={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},PB={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},uqe={isValue:"${path} field must be ${value}"},ak={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:zu,string:vi,number:lqe,date:PB,object:ak,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:uqe,tuple:{notType:e=>{const{path:r,value:t,spec:a}=e,n=a.types.length;if(Array.isArray(t)){if(t.length<n)return`${r} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${uA(t,!0)}\``;if(t.length>n)return`${r} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${uA(t,!0)}\``}return R2.formatError(zu.notType,e)}}});const jB=e=>e&&e.__isYupSchema__;class nk{static fromOptions(r,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:a,then:n,otherwise:i}=t,s=typeof a=="function"?a:(...u)=>u.every(c=>c===a);return new nk(r,(u,c)=>{var A;let d=s(...u)?n:i;return(A=d?.(c))!=null?A:c})}constructor(r,t){this.fn=void 0,this.refs=r,this.refs=r,this.fn=t}resolve(r,t){let a=this.refs.map(i=>i.getValue(t?.value,t?.parent,t?.context)),n=this.fn(a,r,t);if(n===void 0||n===r)return r;if(!jB(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const ik={context:"$",value:"."};function cre(e,r){return new cA(e,r)}class cA{constructor(r,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof r!="string")throw new TypeError("ref must be a string, got: "+r);if(this.key=r.trim(),r==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ik.context,this.isValue=this.key[0]===ik.value,this.isSibling=!this.isContext&&!this.isValue;let a=this.isContext?ik.context:this.isValue?ik.value:"";this.path=this.key.slice(a.length),this.getter=this.path&&pd.getter(this.path,!0),this.map=t.map}getValue(r,t,a){let n=this.isContext?a:this.isValue?r:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(r,t){return this.getValue(r,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(r){return r&&r.__isYupRef}}cA.prototype.__isYupRef=!0;const md=e=>e==null;function a9(e){function r({value:t,path:a="",options:n,originalValue:i,schema:s},u,c){const{name:A,test:d,params:g,message:m,skipAbsent:b}=e;let{parent:w,context:E,abortEarly:x=s.spec.abortEarly,disableStackTrace:_=s.spec.disableStackTrace}=n;const I={value:t,parent:w,context:E};function S(V={}){const ee=fre(Object.assign({value:t,originalValue:i,label:s.spec.label,path:V.path||a,spec:s.spec,disableStackTrace:V.disableStackTrace||_},g,V.params),I),K=new R2(R2.formatError(V.message||m,ee),t,ee.path,V.type||A,ee.disableStackTrace);return K.params=ee,K}const R=x?u:c;let M={path:a,parent:w,type:A,from:n.from,createError:S,resolve(V){return Are(V,I)},options:n,originalValue:i,schema:s};const N=V=>{R2.isError(V)?R(V):V?c(null):R(S())},L=V=>{R2.isError(V)?R(V):u(V)};if(b&&md(t))return N(!0);let B;try{var G;if(B=d.call(M,t,M),typeof((G=B)==null?void 0:G.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${M.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(B).then(N,L)}}catch(V){L(V);return}N(B)}return r.OPTIONS=e,r}function fre(e,r){if(!e)return e;for(const t of Object.keys(e))e[t]=Are(e[t],r);return e}function Are(e,r){return cA.isRef(e)?e.getValue(r.value,r.parent,r.context):e}function cqe(e,r,t,a=t){let n,i,s;return r?(pd.forEach(r,(u,c,A)=>{let d=c?u.slice(1,u.length-1):u;e=e.resolve({context:a,parent:n,value:t});let g=e.type==="tuple",m=A?parseInt(d,10):0;if(e.innerType||g){if(g&&!A)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(t&&m>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${r}. because there is no value at that index. `);n=t,t=t&&t[m],e=g?e.spec.types[m]:e.innerType}if(!A){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${r}. (failed at: ${s} which is a type: "${e.type}")`);n=t,t=t&&t[d],e=e.fields[d]}i=d,s=c?"["+u+"]":"."+u}),{schema:e,parent:n,parentPath:i}):{parent:n,parentPath:r,schema:e}}class ok extends Set{describe(){const r=[];for(const t of this.values())r.push(cA.isRef(t)?t.describe():t);return r}resolveAll(r){let t=[];for(const a of this.values())t.push(r(a));return t}clone(){return new ok(this.values())}merge(r,t){const a=this.clone();return r.forEach(n=>a.add(n)),t.forEach(n=>a.delete(n)),a}}function n9(e,r=new Map){if(jB(e)||!e||typeof e!="object")return e;if(r.has(e))return r.get(e);let t;if(e instanceof Date)t=new Date(e.getTime()),r.set(e,t);else if(e instanceof RegExp)t=new RegExp(e),r.set(e,t);else if(Array.isArray(e)){t=new Array(e.length),r.set(e,t);for(let a=0;a<e.length;a++)t[a]=n9(e[a],r)}else if(e instanceof Map){t=new Map,r.set(e,t);for(const[a,n]of e.entries())t.set(a,n9(n,r))}else if(e instanceof Set){t=new Set,r.set(e,t);for(const a of e)t.add(n9(a,r))}else if(e instanceof Object){t={},r.set(e,t);for(const[a,n]of Object.entries(e))t[a]=n9(n,r)}else throw Error(`Unable to clone ${e}`);return t}function fqe(e){if(!(e!=null&&e.length))return;const r=[];let t="",a=!1,n=!1;for(let i=0;i<e.length;i++){const s=e[i];if(s==="["&&!n){t&&(r.push(...t.split(".").filter(Boolean)),t=""),a=!0;continue}if(s==="]"&&!n){t&&(/^\d+$/.test(t)?r.push(t):r.push(t.replace(/^"|"$/g,"")),t=""),a=!1;continue}if(s==='"'){n=!n;continue}if(s==="."&&!a&&!n){t&&(r.push(t),t="");continue}t+=s}return t&&r.push(...t.split(".").filter(Boolean)),r}function Aqe(e,r){const t=r?`${r}.${e.path}`:e.path;return e.errors.map(a=>({message:a,path:fqe(t)}))}function dre(e,r){var t;if(!((t=e.inner)!=null&&t.length)&&e.errors.length)return Aqe(e,r);const a=r?`${r}.${e.path}`:e.path;return e.inner.flatMap(n=>dre(n,a))}class Uu{constructor(r){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ok,this._blacklist=new ok,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(zu.notType)}),this.type=r.type,this._typeCheck=r.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},r?.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(r){if(this._mutate)return r&&Object.assign(this.spec,r),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=n9(Object.assign({},this.spec,r)),t}label(r){let t=this.clone();return t.spec.label=r,t}meta(...r){if(r.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},r[0]),t}withMutation(r){let t=this._mutate;this._mutate=!0;let a=r(this);return this._mutate=t,a}concat(r){if(!r||r===this)return this;if(r.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${r.type}`);let t=this,a=r.clone();const n=Object.assign({},t.spec,a.spec);return a.spec=n,a.internalTests=Object.assign({},t.internalTests,a.internalTests),a._whitelist=t._whitelist.merge(r._whitelist,r._blacklist),a._blacklist=t._blacklist.merge(r._blacklist,r._whitelist),a.tests=t.tests,a.exclusiveTests=t.exclusiveTests,a.withMutation(i=>{r.tests.forEach(s=>{i.test(s.OPTIONS)})}),a.transforms=[...t.transforms,...a.transforms],a}isType(r){return r==null?!!(this.spec.nullable&&r===null||this.spec.optional&&r===void 0):this._typeCheck(r)}resolve(r){let t=this;if(t.conditions.length){let a=t.conditions;t=t.clone(),t.conditions=[],t=a.reduce((n,i)=>i.resolve(n,r),t),t=t.resolve(r)}return t}resolveOptions(r){var t,a,n,i;return Object.assign({},r,{from:r.from||[],strict:(t=r.strict)!=null?t:this.spec.strict,abortEarly:(a=r.abortEarly)!=null?a:this.spec.abortEarly,recursive:(n=r.recursive)!=null?n:this.spec.recursive,disableStackTrace:(i=r.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(r,t={}){let a=this.resolve(Object.assign({},t,{value:r})),n=t.assert==="ignore-optionality",i=a._cast(r,t);if(t.assert!==!1&&!a.isType(i)){if(n&&md(i))return i;let s=uA(r),u=uA(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${a.type}".
1758
+ `,Dx=4,Ol=4,Q6=0,nA=Dx,kn=Dx+Ol,YD="XML:com.adobe.xmp\0",QD="tEXt",fd="iTXt",Bx="zTXt",c1e="pHYs",f1e="tIME",ZDe="eXIf",PDe="iCCP";function jDe(e){return!!e&&O0(e,0,$D.length)===$D}function qDe(e,r){const a={hasAppMarkers:!1};let n=$D.length;for(;n+Dx+Ol<=e.byteLength;){if(LDe(e,n))a.hasAppMarkers=!0,a.pngHeaderOffset=n+kn;else if(VDe(e,n)){const i=XDe(e,n);i!==void 0&&(a.hasAppMarkers=!0,a.xmpChunks=[{dataOffset:i,length:e.getUint32(n+Q6)-(i-(n+kn))}])}else if(GDe(e,n,r)){a.hasAppMarkers=!0;const i=O0(e,n+nA,Ol);a.pngTextChunks||(a.pngTextChunks=[]),a.pngTextChunks.push({length:e.getUint32(n+Q6),type:i,offset:n+kn})}else if(zDe(e,n))a.hasAppMarkers=!0,a.tiffHeaderOffset=n+kn;else if(r&&UDe(e,n)){a.hasAppMarkers=!0;const i=e.getUint32(n+Q6),s=n+kn,{profileName:u,compressionMethod:c,compressedProfileOffset:A}=HDe(e,s);a.iccChunks||(a.iccChunks=[]),a.iccChunks.push({offset:A,length:i-(A-s),chunkNumber:1,chunksTotal:1,profileName:u,compressionMethod:c})}else WDe(e,n)&&(a.hasAppMarkers=!0,a.pngChunkOffsets||(a.pngChunkOffsets=[]),a.pngChunkOffsets.push(n+Q6));n+=e.getUint32(n+Q6)+Dx+Ol+4}return a}function LDe(e,r){return O0(e,r+nA,Ol)==="IHDR"}function VDe(e,r){return O0(e,r+nA,Ol)===fd&&O0(e,r+kn,YD.length)===YD}function GDe(e,r,t){const a=O0(e,r+nA,Ol);return a===QD||a===fd||a===Bx&&t}function zDe(e,r){return O0(e,r+nA,Ol)===ZDe}function UDe(e,r){return O0(e,r+nA,Ol)===PDe}function WDe(e,r){const t=[c1e,f1e],a=O0(e,r+nA,Ol);return t.includes(a)}function XDe(e,r){r+=kn+YD.length+1+1;let n=0;for(;n<2&&r<e.byteLength;)e.getUint8(r)===0&&n++,r++;if(!(n<2))return r}function HDe(e,r){const n=Y6(e,r);r+=n.length+1;const i=e.getUint8(r);return r+=1,{profileName:n,compressionMethod:i,compressedProfileOffset:r}}function $De(e,r){return e.getUint32(r+4)}function YDe(e,r,t,a){const{offsets:i,sizes:s}=QDe(r,t+3),u=e.getUint8(i.offsetSize)>>4;s.item.extent.extentOffset=u;const c=e.getUint8(i.lengthSize)&15;s.item.extent.extentLength=c;const A=e.getUint8(i.baseOffsetSize)>>4;s.item.baseOffset=A;const d=JDe(e,i.indexSize,r);s.item.extent.extentIndex=d!==void 0?d:0;const g=KDe(e,i.itemCount,r);return{type:"iloc",items:eBe(e,r,i,s,u,c,d,g),length:a}}function QDe(e,r){const t={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(t.itemCount=2,t.item.itemId=2):e===2&&(t.itemCount=4,t.item.itemId=4),e===1||e===2?t.item.constructionMethod=2:t.item.constructionMethod=0;const a={offsetSize:r,lengthSize:r,baseOffsetSize:r+1,indexSize:r+1};return a.itemCount=r+2,a.items=a.itemCount+t.itemCount,a.item={itemId:0},a.item.constructionMethod=a.item.itemId+t.item.itemId,a.item.dataReferenceIndex=a.item.constructionMethod+t.item.constructionMethod,{offsets:a,sizes:t}}function JDe(e,r,t){if(t===1||t===2)return e.getUint8(r)&15}function KDe(e,r,t){if(t<2)return e.getUint16(r);if(t===2)return e.getUint32(r)}function eBe(e,r,t,a,n,i,s,u){if(u===void 0)return[];const c=[];let A=t.items;for(let d=0;d<u;d++){const g={extents:[]};g.itemId=rBe(e,A,r),A+=a.item.itemId,g.constructionMethod=r===1||r===2?e.getUint16(A)&15:void 0,A+=a.item.constructionMethod,g.dataReferenceIndex=e.getUint16(A),A+=a.item.dataReferenceIndex,g.baseOffset=Nx(e,A,a.item.baseOffset),A+=a.item.baseOffset,g.extentCount=e.getUint16(A),A+=a.item.extentCount;for(let m=0;m<g.extentCount;m++){const b={};b.extentIndex=tBe(e,r,A,s),A+=a.item.extent.extentIndex,b.extentOffset=Nx(e,A,n),A+=a.item.extent.extentOffset,b.extentLength=Nx(e,A,i),A+=a.item.extent.extentLength,g.extents.push(b)}c.push(g)}return c}function rBe(e,r,t){if(t<2)return e.getUint16(r);if(t===2)return e.getUint32(r)}function tBe(e,r,t,a){if((r===1||r===2)&&a>0)return Nx(e,t,a)}function Nx(e,r,t){return t===4?e.getUint32(r):t===8?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),$De(e,r)):0}const aBe=1718909296,nBe=1768977008,iBe=1835365473,oBe=1768714083,sBe=1768517222,lBe=1768842853,uBe=1768973167,cBe=1668246642,A1e=1165519206,JD=1835625829,fBe=1970432288;function Fx(e,r){const{length:i,contentOffset:s}=ABe(e,r);if(i<8)return;const u=e.getUint32(r+4);if(u===aBe)return xBe(e,s,i);if(u===nBe)return kBe(e,r,s,i);if(u===uBe)return _Be(e,r,s,i);if(u===cBe)return CBe(e,s,i);const c=e.getUint8(s);return u===iBe?TBe(e,r,s+1,i):u===oBe?YDe(e,c,s+1,i):u===sBe?IBe(e,r,c,s+1,i):u===lBe?MBe(e,r,c,s+1,i):{type:void 0,length:i}}function ABe(e,r){const s=e.getUint32(r);return dBe(s)?{length:e.byteLength-r,contentOffset:r+4+4}:hBe(s)&&pBe(e,r)?{length:e.getUint32(r+12),contentOffset:r+4+4+8}:{length:s,contentOffset:r+4+4}}function dBe(e){return e===0}function hBe(e){return e===1}function pBe(e,r){return e.getUint32(r+8)===0}function d1e(e){{const r={},t=mBe(e);return t?(r.tiffHeaderOffset=gBe(e,t),r.xmpChunks=yBe(t),r.iccChunks=EBe(t),r.hasAppMarkers=r.tiffHeaderOffset!==void 0||r.xmpChunks!==void 0||r.iccChunks!==void 0,r):{hasAppMarkers:!1}}}function mBe(e){let a=0;for(;a+4+4<=e.byteLength;){const n=Fx(e,a);if(n===void 0)break;if(n.type==="meta")return n;a+=n.length}}function gBe(e,r){try{const t=bBe(r).itemId,a=KD(r,t),n=a.baseOffset+a.extents[0].extentOffset;return vBe(e,n)}catch{return}}function bBe(e){return e.subBoxes.find(r=>r.type==="iinf").itemInfos.find(r=>r.itemType===A1e)}function KD(e,r){return e.subBoxes.find(t=>t.type==="iloc").items.find(t=>t.itemId===r)}function vBe(e,r){return r+4+e.getUint32(r)}function yBe(e){try{const r=wBe(e).itemId,t=KD(e,r),a=KD(e,r).extents[0];return[{dataOffset:t.baseOffset+a.extentOffset,length:a.extentLength}]}catch{return}}function wBe(e){return e.subBoxes.find(r=>r.type==="iinf").itemInfos.find(r=>r.itemType===JD&&r.contentType==="application/rdf+xml")}function EBe(e){try{const r=e.subBoxes.find(t=>t.type==="iprp").subBoxes.find(t=>t.type==="ipco").properties.find(t=>t.type==="colr").icc;if(r)return[r]}catch{}}function xBe(e,r,t){return{type:"ftyp",majorBrand:O0(e,r,4),length:t}}function kBe(e,r,t,a){return{type:"iprp",subBoxes:Zx(e,t,a-(t-r)),length:a}}function _Be(e,r,t,a){return{type:"ipco",properties:Zx(e,t,a-(t-r)),length:a}}function CBe(e,r,t){return{type:"colr",icc:SBe(e,r),length:t}}function SBe(e,r){const a=O0(e,r,4);if(!(a!=="prof"&&a!=="rICC"))return{offset:r+4,length:e.getUint32(r+4),chunkNumber:1,chunksTotal:1}}function TBe(e,r,t,a){return{type:"meta",subBoxes:Zx(e,t+3,a-(t+3-r)),length:a}}function Zx(e,r,t){const a=[A1e,JD],n=[];let i=r;for(;i<r+t;){const s=Fx(e,i);if(s===void 0)break;s.type!==void 0&&(s.itemType===void 0||a.indexOf(s.itemType)!==-1)&&n.push(s),i+=s.length}return n}function IBe(e,r,t,a,n){const{offsets:i}=RBe(t,a);return{type:"iinf",itemInfos:Zx(e,i.itemInfos,n-(i.itemInfos-r)),length:n}}function RBe(e,r){const a={entryCount:r+3},n={};return e===0?n.entryCount=2:n.entryCount=4,a.itemInfos=a.entryCount+n.entryCount,{offsets:a}}function MBe(e,r,t,a,n){a+=3;const s={type:"infe",length:n};return(t===0||t===1)&&(s.itemId=e.getUint16(a),a+=2,s.itemProtectionIndex=e.getUint16(a),a+=2,s.itemName=Y6(e,a),a+=s.itemName.length+1),t>=2&&(t===2?(s.itemId=e.getUint16(a),a+=2):t===3&&(s.itemId=e.getUint32(a),a+=4),s.itemProtectionIndex=e.getUint16(a),a+=2,s.itemType=e.getUint32(a),a+=4,s.itemName=Y6(e,a),a+=s.itemName.length+1,s.itemType===JD?(s.contentType=Y6(e,a),a+=s.contentType.length+1,r+n>a&&(s.contentEncoding=Y6(e,a),a+=s.contentEncoding.length+1)):s.itemType===fBe&&(s.itemUri=Y6(e,a),a+=s.itemUri.length+1)),s}const h1e={isHeicFile:OBe,findHeicOffsets:DBe};function OBe(e){if(!e)return!1;const r=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const t=Fx(e,0);return t&&r.indexOf(t.majorBrand)!==-1}catch{return!1}}function DBe(e){return d1e(e)}const p1e={isAvifFile:BBe,findAvifOffsets:NBe};function BBe(e){if(!e)return!1;try{const r=Fx(e,0);return r&&r.majorBrand==="avif"}catch{return!1}}function NBe(e){return d1e(e)}const m1e={isWebpFile:FBe,findOffsets:ZBe};function FBe(e){const t="RIFF",n="WEBP";return!!e&&O0(e,0,t.length)===t&&O0(e,8,n.length)===n}function ZBe(e){const a="Exif\0\0";let i=12,s=!1,u,c,A,d;for(;i+8<e.byteLength;){const g=O0(e,i,4),m=e.getUint32(i+4,!0);g==="EXIF"?(s=!0,O0(e,i+8,a.length)===a?u=i+8+a.length:u=i+8):g==="XMP "?(s=!0,c=[{dataOffset:i+8,length:m}]):g==="ICCP"?(s=!0,A=[{offset:i+8,length:m,chunkNumber:1,chunksTotal:1}]):g==="VP8X"&&(s=!0,d=i+8),i+=8+(m%2===0?m:m+1)}return{hasAppMarkers:s,tiffHeaderOffset:u,xmpChunks:c,iccChunks:A,vp8xChunkOffset:d}}const g1e={isGifFile:qBe,findOffsets:LBe},PBe=6,jBe=["GIF87a","GIF89a"];function qBe(e){return!!e&&jBe.includes(O0(e,0,PBe))}function LBe(){return{gifHeaderOffset:0}}const b1e={isXMLFile:VBe,findOffsets:GBe},v1e=0,y1e="<?xpacket begin";function VBe(e){return!!e&&O0(e,v1e,y1e.length)===y1e}function GBe(e){const r=[];return r.push({dataOffset:v1e,length:e.byteLength}),{xmpChunks:r}}const zBe={parseAppMarkers:UBe};function UBe(e,r){if(Wee.isTiffFile(e))return iA(Wee.findTiffOffsets(),"tiff","TIFF");if(Xee.isJpegFile(e))return iA(Xee.findJpegOffsets(e),"jpeg","JPEG");if(u1e.isPngFile(e))return iA(u1e.findPngOffsets(e,r),"png","PNG");if(h1e.isHeicFile(e))return iA(h1e.findHeicOffsets(e),"heic","HEIC");if(p1e.isAvifFile(e))return iA(p1e.findAvifOffsets(e),"avif","AVIF");if(m1e.isWebpFile(e))return iA(m1e.findOffsets(e),"webp","WebP");if(g1e.isGifFile(e))return iA(g1e.findOffsets(e),"gif","GIF");if(b1e.isXMLFile(e))return iA(b1e.findOffsets(e),"xml","XML");throw new Error("Invalid image format")}function iA(e,r,t){return z0({},e,{fileType:{value:r,description:t}})}const C0={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace(e){return e===1?"sRGB":e===65535?"Uncalibrated":"Unknown"},ComponentsConfiguration(e){return e.map(r=>{if(r===49)return"Y";if(r===50)return"Cb";if(r===51)return"Cr";if(r===52)return"R";if(r===53)return"G";if(r===54)return"B"}).join("")},Contrast(e){return e===0?"Normal":e===1?"Soft":e===2?"Hard":"Unknown"},CustomRendered(e){return e===0?"Normal process":e===1?"Custom process":"Unknown"},ExposureMode(e){return e===0?"Auto exposure":e===1?"Manual exposure":e===2?"Auto bracket":"Unknown"},ExposureProgram(e){return e===0?"Undefined":e===1?"Manual":e===2?"Normal program":e===3?"Aperture priority":e===4?"Shutter priority":e===5?"Creative program":e===6?"Action program":e===7?"Portrait mode":e===8?"Landscape mode":e===9?"Bulb":"Unknown"},ExposureTime(e){if(e[0]/e[1]>.25){const r=e[0]/e[1];return Number.isInteger(r)?""+r:r.toFixed(1)}return e[0]!==0?`1/${Math.round(e[1]/e[0])}`:`0/${e[1]}`},FNumber:e=>`f/${Number(e[0]/e[1]).toFixed(1)}`,FocalLength:e=>e[0]/e[1]+" mm",FocalPlaneResolutionUnit(e){return e===2?"inches":e===3?"centimeters":e===4?"millimeters":"Unknown"},LightSource:e=>e===1?"Daylight":e===2?"Fluorescent":e===3?"Tungsten (incandescent light)":e===4?"Flash":e===9?"Fine weather":e===10?"Cloudy weather":e===11?"Shade":e===12?"Daylight fluorescent (D 5700 – 7100K)":e===13?"Day white fluorescent (N 4600 – 5400K)":e===14?"Cool white fluorescent (W 3900 – 4500K)":e===15?"White fluorescent (WW 3200 – 3700K)":e===17?"Standard light A":e===18?"Standard light B":e===19?"Standard light C":e===20?"D55":e===21?"D65":e===22?"D75":e===23?"D50":e===24?"ISO studio tungsten":e===255?"Other light source":"Unknown",MeteringMode(e){return e===1?"Average":e===2?"CenterWeightedAverage":e===3?"Spot":e===4?"MultiSpot":e===5?"Pattern":e===6?"Partial":e===255?"Other":"Unknown"},ResolutionUnit(e){return e===2?"inches":e===3?"centimeters":"Unknown"},Saturation(e){return e===0?"Normal":e===1?"Low saturation":e===2?"High saturation":"Unknown"},FocalLengthIn35mmFilm(e){return e===0?"Unknown":e+" mm"},SceneCaptureType(e){return e===0?"Standard":e===1?"Landscape":e===2?"Portrait":e===3?"Night scene":"Unknown"},Sharpness(e){return e===0?"Normal":e===1?"Soft":e===2?"Hard":"Unknown"},ShutterSpeedValue(e){const r=Math.pow(2,e[0]/e[1]);return r<=1?`${Math.round(1/r)}`:`1/${Math.round(r)}`},WhiteBalance(e){return e===0?"Auto white balance":e===1?"Manual white balance":"Unknown"},XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},w1e={11:"ProcessingSoftware",254:{name:"SubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image",3:"Single page of multi-page reduced-resolution image",4:"Transparency mask",5:"Transparency mask of reduced-resolution image",6:"Transparency mask of multi-page image",7:"Transparency mask of reduced-resolution multi-page image",65537:"Alternate reduced-resolution image",4294967295:"Invalid"})[e]||"Unknown"},255:{name:"OldSubfileType",description:e=>({0:"Full-resolution image",1:"Reduced-resolution image",2:"Single page of multi-page image"})[e]||"Unknown"},256:"ImageWidth",257:"ImageLength",258:"BitsPerSample",259:"Compression",262:"PhotometricInterpretation",263:{name:"Thresholding",description:e=>({1:"No dithering or halftoning",2:"Ordered dither or halfton",3:"Randomized dither"})[e]||"Unknown"},264:"CellWidth",265:"CellLength",266:{name:"FillOrder",description:e=>({1:"Normal",2:"Reversed"})[e]||"Unknown"},269:"DocumentName",270:"ImageDescription",271:"Make",272:"Model",273:"StripOffsets",274:{name:"Orientation",description:e=>e===1?"top-left":e===2?"top-right":e===3?"bottom-right":e===4?"bottom-left":e===5?"left-top":e===6?"right-top":e===7?"right-bottom":e===8?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:C0.XResolution},283:{name:"YResolution",description:C0.YResolution},284:"PlanarConfiguration",285:"PageName",286:{name:"XPosition",description:e=>""+Math.round(e[0]/e[1])},287:{name:"YPosition",description:e=>""+Math.round(e[0]/e[1])},290:{name:"GrayResponseUnit",description:e=>({1:"0.1",2:"0.001",3:"0.0001",4:"1e-05",5:"1e-06"})[e]||"Unknown"},296:{name:"ResolutionUnit",description:C0.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map(r=>`${r[0]}/${r[1]}`).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map(r=>`${r[0]}/${r[1]}`).join(", ")},321:"HalftoneHints",322:"TileWidth",323:"TileLength",330:"A100DataOffset",332:{name:"InkSet",description:e=>({1:"CMYK",2:"Not CMYK"})[e]||"Unknown"},337:"TargetPrinter",338:{name:"ExtraSamples",description:e=>({0:"Unspecified",1:"Associated Alpha",2:"Unassociated Alpha"})[e]||"Unknown"},339:{name:"SampleFormat",description:e=>{const r={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map(t=>r[t]||"Unknown").join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map(r=>""+r[0]/r[1]).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>e===1?"centered":e===2?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map(r=>""+r[0]/r[1]).join(", ")},700:"ApplicationNotes",18246:"Rating",18249:"RatingPercent",33432:{name:"Copyright",description:e=>e.join("; ")},33550:"PixelScale",33723:"IPTC-NAA",33920:"IntergraphMatrix",33922:"ModelTiePoint",34118:"SEMInfo",34264:"ModelTransform",34377:"PhotoshopSettings",34665:"Exif IFD Pointer",34675:"ICC_Profile",34735:"GeoTiffDirectory",34736:"GeoTiffDoubleParams",34737:"GeoTiffAsciiParams",34853:"GPS Info IFD Pointer",40091:{name:"XPTitle",description:Wg},40092:{name:"XPComment",description:Wg},40093:{name:"XPAuthor",description:Wg},40094:{name:"XPKeywords",description:Wg},40095:{name:"XPSubject",description:Wg},42112:"GDALMetadata",42113:"GDALNoData",50341:"PrintIM",50707:"DNGBackwardVersion",50708:"UniqueCameraModel",50709:"LocalizedCameraModel",50721:"ColorMatrix1",50722:"ColorMatrix2",50723:"CameraCalibration1",50724:"CameraCalibration2",50725:"ReductionMatrix1",50726:"ReductionMatrix2",50727:"AnalogBalance",50728:"AsShotNeutral",50729:"AsShotWhiteXY",50730:"BaselineExposure",50731:"BaselineNoise",50732:"BaselineSharpness",50734:"LinearResponseLimit",50735:"CameraSerialNumber",50736:"DNGLensInfo",50739:"ShadowScale",50741:{name:"MakerNoteSafety",description:e=>({0:"Unsafe",1:"Safe"})[e]||"Unknown"},50778:{name:"CalibrationIlluminant1",description:C0.LightSource},50779:{name:"CalibrationIlluminant2",description:C0.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"ColorimetricReference",50885:"SRawType",50898:"PanasonicTitle",50899:"PanasonicTitle2",50931:"CameraCalibrationSig",50932:"ProfileCalibrationSig",50933:"ProfileIFD",50934:"AsShotProfileName",50936:"ProfileName",50937:"ProfileHueSatMapDims",50938:"ProfileHueSatMapData1",50939:"ProfileHueSatMapData2",50940:"ProfileToneCurve",50941:{name:"ProfileEmbedPolicy",description:e=>({0:"Allow Copying",1:"Embed if Used",2:"Never Embed",3:"No Restrictions"})[e]||"Unknown"},50942:"ProfileCopyright",50964:"ForwardMatrix1",50965:"ForwardMatrix2",50966:"PreviewApplicationName",50967:"PreviewApplicationVersion",50968:"PreviewSettingsName",50969:"PreviewSettingsDigest",50970:{name:"PreviewColorSpace",description:e=>({1:"Gray Gamma 2.2",2:"sRGB",3:"Adobe RGB",4:"ProPhoto RGB"})[e]||"Unknown"},50971:"PreviewDateTime",50972:"RawImageDigest",50973:"OriginalRawFileDigest",50981:"ProfileLookTableDims",50982:"ProfileLookTableData",51043:"TimeCodes",51044:"FrameRate",51058:"TStop",51081:"ReelName",51089:"OriginalDefaultFinalSize",51090:"OriginalBestQualitySize",51091:"OriginalDefaultCropSize",51105:"CameraLabel",51107:{name:"ProfileHueSatMapEncoding",description:e=>({0:"Linear",1:"sRGB"})[e]||"Unknown"},51108:{name:"ProfileLookTableEncoding",description:e=>({0:"Linear",1:"sRGB"})[e]||"Unknown"},51109:"BaselineExposureOffset",51110:{name:"DefaultBlackRender",description:e=>({0:"Auto",1:"None"})[e]||"Unknown"},51111:"NewRawImageDigest",51112:"RawToPreviewGain"};function Wg(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}const WBe={33434:{name:"ExposureTime",description:C0.ExposureTime},33437:{name:"FNumber",description:C0.FNumber},34850:{name:"ExposureProgram",description:C0.ExposureProgram},34852:"SpectralSensitivity",34855:"ISOSpeedRatings",34856:{name:"OECF",description:()=>"[Raw OECF table data]"},34858:"TimeZoneOffset",34859:"SelfTimerMode",34864:{name:"SensitivityType",description:e=>({1:"Standard Output Sensitivity",2:"Recommended Exposure Index",3:"ISO Speed",4:"Standard Output Sensitivity and Recommended Exposure Index",5:"Standard Output Sensitivity and ISO Speed",6:"Recommended Exposure Index and ISO Speed",7:"Standard Output Sensitivity, Recommended Exposure Index and ISO Speed"})[e]||"Unknown"},34865:"StandardOutputSensitivity",34866:"RecommendedExposureIndex",34867:"ISOSpeed",34868:"ISOSpeedLatitudeyyy",34869:"ISOSpeedLatitudezzz",36864:{name:"ExifVersion",description:e=>ca(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:C0.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:C0.ShutterSpeedValue},37378:{name:"ApertureValue",description:C0.ApertureValue},37379:"BrightnessValue",37380:"ExposureBiasValue",37381:{name:"MaxApertureValue",description:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2)},37382:{name:"SubjectDistance",description:e=>e[0]/e[1]+" m"},37383:{name:"MeteringMode",description:C0.MeteringMode},37384:{name:"LightSource",description:C0.LightSource},37385:{name:"Flash",description:e=>e===0?"Flash did not fire":e===1?"Flash fired":e===5?"Strobe return light not detected":e===7?"Strobe return light detected":e===9?"Flash fired, compulsory flash mode":e===13?"Flash fired, compulsory flash mode, return light not detected":e===15?"Flash fired, compulsory flash mode, return light detected":e===16?"Flash did not fire, compulsory flash mode":e===24?"Flash did not fire, auto mode":e===25?"Flash fired, auto mode":e===29?"Flash fired, auto mode, return light not detected":e===31?"Flash fired, auto mode, return light detected":e===32?"No flash function":e===65?"Flash fired, red-eye reduction mode":e===69?"Flash fired, red-eye reduction mode, return light not detected":e===71?"Flash fired, red-eye reduction mode, return light detected":e===73?"Flash fired, compulsory flash mode, red-eye reduction mode":e===77?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":e===79?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":e===89?"Flash fired, auto mode, red-eye reduction mode":e===93?"Flash fired, auto mode, return light not detected, red-eye reduction mode":e===95?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:C0.FocalLength},37393:"ImageNumber",37394:{name:"SecurityClassification",description:e=>({C:"Confidential",R:"Restricted",S:"Secret",T:"Top Secret",U:"Unclassified"})[e]||"Unknown"},37395:"ImageHistory",37396:{name:"SubjectArea",description:e=>e.length===2?`Location; X: ${e[0]}, Y: ${e[1]}`:e.length===3?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:e.length===4?`Rectangle; X: ${e[0]}, Y: ${e[1]}, width: ${e[2]}, height: ${e[3]}`:"Unknown"},37500:{name:"MakerNote",description:()=>"[Raw maker note data]"},37510:{name:"UserComment",description:zD},37520:"SubSecTime",37521:"SubSecTimeOriginal",37522:"SubSecTimeDigitized",37724:"ImageSourceData",37888:{name:"AmbientTemperature",description:e=>e[0]/e[1]+" °C"},37889:{name:"Humidity",description:e=>e[0]/e[1]+" %"},37890:{name:"Pressure",description:e=>e[0]/e[1]+" hPa"},37891:{name:"WaterDepth",description:e=>e[0]/e[1]+" m"},37892:{name:"Acceleration",description:e=>e[0]/e[1]+" mGal"},37893:{name:"CameraElevationAngle",description:e=>e[0]/e[1]+" °"},40960:{name:"FlashpixVersion",description:e=>e.map(r=>String.fromCharCode(r)).join("")},40961:{name:"ColorSpace",description:C0.ColorSpace},40962:"PixelXDimension",40963:"PixelYDimension",40964:"RelatedSoundFile",40965:"Interoperability IFD Pointer",41483:"FlashEnergy",41484:{name:"SpatialFrequencyResponse",description:()=>"[Raw SFR table data]"},41486:"FocalPlaneXResolution",41487:"FocalPlaneYResolution",41488:{name:"FocalPlaneResolutionUnit",description:C0.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,r])=>`X: ${e}, Y: ${r}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>e===1?"Undefined":e===2?"One-chip color area sensor":e===3?"Two-chip color area sensor":e===4?"Three-chip color area sensor":e===5?"Color sequential area sensor":e===7?"Trilinear sensor":e===8?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>e===3?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>e===1?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:C0.CustomRendered},41986:{name:"ExposureMode",description:C0.ExposureMode},41987:{name:"WhiteBalance",description:C0.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>e[0]===0?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:C0.FocalLengthIn35mmFilm},41990:{name:"SceneCaptureType",description:C0.SceneCaptureType},41991:{name:"GainControl",description:e=>e===0?"None":e===1?"Low gain up":e===2?"High gain up":e===3?"Low gain down":e===4?"High gain down":"Unknown"},41992:{name:"Contrast",description:C0.Contrast},41993:{name:"Saturation",description:C0.Saturation},41994:{name:"Sharpness",description:C0.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>e===1?"Macro":e===2?"Close view":e===3?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const r=parseFloat((e[0][0]/e[0][1]).toFixed(5)),t=parseFloat((e[1][0]/e[1][1]).toFixed(5)),a=`${r}-${t} mm`;if(e[3][1]===0)return`${a} f/?`;const n=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${a} f/${parseFloat(n.toFixed(5))}`}},42035:"LensMake",42036:"LensModel",42037:"LensSerialNumber",42080:{name:"CompositeImage",description:e=>({1:"Not a Composite Image",2:"General Composite Image",3:"Composite Image Captured While Shooting"})[e]||"Unknown"},42081:"SourceImageNumberOfCompositeImage",42082:"SourceExposureTimesOfCompositeImage",42240:"Gamma",59932:"Padding",59933:"OffsetSchema",65e3:"OwnerName",65001:"SerialNumber",65002:"Lens",65100:"RawFile",65101:"Converter",65102:"WhiteBalance",65105:"Exposure",65106:"Shadows",65107:"Brightness",65108:"Contrast",65109:"Saturation",65110:"Sharpness",65111:"Smoothness",65112:"MoireFilter"},XBe={0:{name:"GPSVersionID",description:e=>e[0]===2&&e[1]===2&&e[2]===0&&e[3]===0?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const r=e.join("");return r==="N"?"North latitude":r==="S"?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:Ox},3:{name:"GPSLongitudeRef",description:e=>{const r=e.join("");return r==="E"?"East longitude":r==="W"?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:Ox},5:{name:"GPSAltitudeRef",description:e=>e===0?"Sea level":e===1?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map(([r,t])=>{const a=r/t;return/^\d(\.|$)/.test(`${a}`)?`0${a}`:a}).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const r=e.join("");return r==="A"?"Measurement in progress":r==="V"?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const r=e.join("");return r==="2"?"2-dimensional measurement":r==="3"?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const r=e.join("");return r==="K"?"Kilometers per hour":r==="M"?"Miles per hour":r==="N"?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const r=e.join("");return r==="N"?"North latitude":r==="S"?"South latitude":"Unknown"}},20:{name:"GPSDestLatitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},21:{name:"GPSDestLongitudeRef",description:e=>{const r=e.join("");return r==="E"?"East longitude":r==="W"?"West longitude":"Unknown"}},22:{name:"GPSDestLongitude",description:e=>e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600},23:{name:"GPSDestBearingRef",description:e=>{const r=e.join("");return r==="T"?"True direction":r==="M"?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const r=e.join("");return r==="K"?"Kilometers":r==="M"?"Miles":r==="N"?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:zD},28:{name:"GPSAreaInformation",description:zD},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>e===0?"Measurement without differential correction":e===1?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},HBe={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>ca(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},$Be={45056:{name:"MPFVersion",description:e=>ca(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"},YBe={4:{name:"ShotInfo",description:e=>e}},QBe={0:{name:"PentaxVersion",description:e=>e.join(".")},5:"PentaxModelID",555:"LevelInfo"},E1e=z0({},w1e,WBe),eB="0th",x1e="1st",k1e="exif",_1e="gps",C1e="interoperability",S1e="mpf",T1e="canon",rB="pentax",oA={[eB]:E1e,[x1e]:w1e,[k1e]:E1e,[_1e]:XBe,[C1e]:HBe,[S1e]:$Be,[T1e]:YBe,[rB]:QBe},I1e={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},tB={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},B1={getAsciiValue:JBe,getByteAt:R1e,getAsciiAt:KBe,getShortAt:eNe,getLongAt:Px,getRationalAt:rNe,getUndefinedAt:tNe,getSlongAt:aB,getSrationalAt:aNe,getIfdPointerAt:nNe,typeSizes:I1e,tagTypes:tB,getTypeSize:iNe};function JBe(e){return e.map(r=>String.fromCharCode(r))}function R1e(e,r){return e.getUint8(r)}function KBe(e,r){return e.getUint8(r)}function eNe(e,r,t){return e.getUint16(r,t===Gu.LITTLE_ENDIAN)}function Px(e,r,t){return e.getUint32(r,t===Gu.LITTLE_ENDIAN)}function rNe(e,r,t){return[Px(e,r,t),Px(e,r+4,t)]}function tNe(e,r){return R1e(e,r)}function aB(e,r,t){return e.getInt32(r,t===Gu.LITTLE_ENDIAN)}function aNe(e,r,t){return[aB(e,r,t),aB(e,r+4,t)]}function nNe(e,r,t){return Px(e,r,t)}function iNe(e){if(tB[e]===void 0)throw new Error("No such type found.");return I1e[tB[e]]}const oNe={1:B1.getByteAt,2:B1.getAsciiAt,3:B1.getShortAt,4:B1.getLongAt,5:B1.getRationalAt,7:B1.getUndefinedAt,9:B1.getSlongAt,10:B1.getSrationalAt,13:B1.getIfdPointerAt};function M1e(e,r,t){return r+B1.getLongAt(e,r+4,t)}function sA(e,r,t,a,n,i){const s=B1.getTypeSize("SHORT"),u=12,c={},A=sNe(e,a,n);a+=s;for(let d=0;d<A&&!(a+u>e.byteLength);d++){const g=lNe(e,r,t,a,n,i);g!==void 0&&(c[g.name]={id:g.id,value:g.value,description:g.description},(g.name==="MakerNote"||r===rB&&g.name==="LevelInfo")&&(c[g.name].__offset=g.__offset)),a+=u}if(a<e.byteLength-B1.getTypeSize("LONG")){const d=B1.getLongAt(e,a,n);d!==0&&r===eB&&(c.Thumbnail=sA(e,x1e,t,t+d,n,i))}return c}function sNe(e,r,t){return r+B1.getTypeSize("SHORT")<=e.byteLength?B1.getShortAt(e,r,t):0}function lNe(e,r,t,a,n,i){const u=B1.getTypeSize("SHORT"),c=u+B1.getTypeSize("SHORT"),A=c+B1.getTypeSize("LONG"),d=B1.getShortAt(e,a,n),g=B1.getShortAt(e,a+u,n),m=B1.getLongAt(e,a+c,n);let b,w;if(B1.typeSizes[g]===void 0||!i&&oA[r][d]===void 0)return;if(uNe(g,m))w=a+A,b=O1e(e,w,g,m,n);else if(w=B1.getLongAt(e,a+A,n),cNe(e,t,w,g,m)){const _=d===33723;b=O1e(e,t+w,g,m,n,_)}else b="<faulty value>";g===B1.tagTypes.ASCII&&(b=fNe(b),b=ANe(b));let E=`undefined-${d}`,x=b;if(oA[r][d]!==void 0)if(oA[r][d].name!==void 0&&oA[r][d].description!==void 0){E=oA[r][d].name;try{x=oA[r][d].description(b)}catch{x=D1e(b)}}else g===B1.tagTypes.RATIONAL||g===B1.tagTypes.SRATIONAL?(E=oA[r][d],x=""+b[0]/b[1]):(E=oA[r][d],x=D1e(b));return{id:d,name:E,value:b,description:x,__offset:w}}function uNe(e,r){return B1.typeSizes[e]*r<=B1.getTypeSize("LONG")}function O1e(e,r,t,a,n,i=!1){let s=[];i&&(a=a*B1.typeSizes[t],t=B1.tagTypes.BYTE);for(let u=0;u<a;u++)s.push(oNe[t](e,r,n)),r+=B1.typeSizes[t];return t===B1.tagTypes.ASCII?s=B1.getAsciiValue(s):s.length===1&&(s=s[0]),s}function cNe(e,r,t,a,n){return r+t+B1.typeSizes[a]*n<=e.byteLength}function fNe(e){const r=[];let t=0;for(let a=0;a<e.length;a++){if(e[a]==="\0"){t++;continue}r[t]===void 0&&(r[t]=""),r[t]+=e[a]}return r}function ANe(e){try{return e.map(r=>decodeURIComponent(escape(r)))}catch{return e}}function D1e(e){return e instanceof Array?e.join(", "):e}const B1e="Exif IFD Pointer",N1e="GPS Info IFD Pointer",F1e="Interoperability IFD Pointer",Z1e={read:dNe};function dNe(e,r,t){const a=Gu.getByteOrder(e,r);let n=hNe(e,r,a,t);return n=pNe(n,e,r,a,t),n=mNe(n,e,r,a,t),n=gNe(n,e,r,a,t),{tags:n,byteOrder:a}}function hNe(e,r,t,a){return sA(e,eB,r,M1e(e,r,t),t,a)}function pNe(e,r,t,a,n){return e[B1e]!==void 0?z0(e,sA(r,k1e,t,t+e[B1e].value,a,n)):e}function mNe(e,r,t,a,n){return e[N1e]!==void 0?z0(e,sA(r,_1e,t,t+e[N1e].value,a,n)):e}function gNe(e,r,t,a,n){return e[F1e]!==void 0?z0(e,sA(r,C1e,t,t+e[F1e].value,a,n)):e}const bNe={read:vNe},J6=16;function vNe(e,r,t){const a=Gu.getByteOrder(e,r),n=sA(e,S1e,r,M1e(e,r,a),a,t);return yNe(e,r,n,a)}function yNe(e,r,t,a){if(!t.MPEntry)return t;const n=[];for(let i=0;i<Math.ceil(t.MPEntry.value.length/J6);i++){n[i]={};const s=Xg(t.MPEntry.value,i*J6,B1.getTypeSize("LONG"),a);n[i].ImageFlags=wNe(s),n[i].ImageFormat=ENe(s),n[i].ImageType=xNe(s);const u=Xg(t.MPEntry.value,i*J6+4,B1.getTypeSize("LONG"),a);n[i].ImageSize={value:u,description:""+u};const c=kNe(i,t.MPEntry,a,r);n[i].ImageOffset={value:c,description:""+c};const A=Xg(t.MPEntry.value,i*J6+12,B1.getTypeSize("SHORT"),a);n[i].DependentImage1EntryNumber={value:A,description:""+A};const d=Xg(t.MPEntry.value,i*J6+14,B1.getTypeSize("SHORT"),a);n[i].DependentImage2EntryNumber={value:d,description:""+d},n[i].image=e.buffer.slice(c,c+u),qee(n[i],"base64",function(){return Lee(this.image)})}return t.Images=n,t}function Xg(e,r,t,a){if(a===Gu.LITTLE_ENDIAN){let i=0;for(let s=0;s<t;s++)i+=e[r+s]<<8*s;return i}let n=0;for(let i=0;i<t;i++)n+=e[r+i]<<8*(t-1-i);return n}function wNe(e){const r=[e>>31&1,e>>30&1,e>>29&1],t=[];return r[0]&&t.push("Dependent Parent Image"),r[1]&&t.push("Dependent Child Image"),r[2]&&t.push("Representative Image"),{value:r,description:t.join(", ")||"None"}}function ENe(e){const r=e>>24&7;return{value:r,description:r===0?"JPEG":"Unknown"}}function xNe(e){const r=e&16777215;return{value:r,description:{196608:"Baseline MP Primary Image",65537:"Large Thumbnail (VGA equivalent)",65538:"Large Thumbnail (Full HD equivalent)",131073:"Multi-Frame Image (Panorama)",131074:"Multi-Frame Image (Disparity)",131075:"Multi-Frame Image (Multi-Angle)",0:"Undefined"}[r]||"Unknown"}}function kNe(e,r,t,a){return _Ne(e)?0:Xg(r.value,e*J6+8,B1.getTypeSize("LONG"),t)+a}function _Ne(e){return e===0}const CNe={read:SNe};function SNe(e,r){const t=TNe(e,r),a=ONe(e,r,t);return{"Bits Per Sample":INe(e,r,t),"Image Height":RNe(e,r,t),"Image Width":MNe(e,r,t),"Color Components":a,Subsampling:a&&DNe(e,r,a.value,t)}}function TNe(e,r){return B1.getShortAt(e,r)}function INe(e,r,t){if(3>t)return;const i=B1.getByteAt(e,r+2);return{value:i,description:""+i}}function RNe(e,r,t){if(5>t)return;const i=B1.getShortAt(e,r+3);return{value:i,description:`${i}px`}}function MNe(e,r,t){if(7>t)return;const i=B1.getShortAt(e,r+5);return{value:i,description:`${i}px`}}function ONe(e,r,t){if(8>t)return;const i=B1.getByteAt(e,r+7);return{value:i,description:""+i}}function DNe(e,r,t,a){if(8+3*t>a)return;const s=[];for(let u=0;u<t;u++){const c=r+8+u*3;s.push([B1.getByteAt(e,c),B1.getByteAt(e,c+1),B1.getByteAt(e,c+2)])}return{value:s,description:s.length>1?BNe(s)+NNe(s):""}}function BNe(e){const r={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map(t=>r[t[0]]).join("")}function NNe(e){const r={17:"4:4:4 (1 1)",18:"4:4:0 (1 2)",20:"4:4:1 (1 4)",33:"4:2:2 (2 1)",34:"4:2:0 (2 2)",36:"4:2:1 (2 4)",65:"4:1:1 (4 1)",66:"4:1:0 (4 2)"};return e.length===0||e[0][1]===void 0||r[e[0][1]]===void 0?"":r[e[0][1]]}const FNe={read:ZNe};function ZNe(e,r){const t=PNe(e,r),a=zNe(e,r,t),n=UNe(e,r,t),i={"JFIF Version":jNe(e,r,t),"Resolution Unit":qNe(e,r,t),XResolution:VNe(e,r,t),YResolution:GNe(e,r,t),"JFIF Thumbnail Width":a,"JFIF Thumbnail Height":n};if(a!==void 0&&n!==void 0){const s=WNe(e,r,3*a.value*n.value,t);s&&(i["JFIF Thumbnail"]=s)}for(const s in i)i[s]===void 0&&delete i[s];return i}function PNe(e,r){return B1.getShortAt(e,r)}function jNe(e,r,t){if(9>t)return;const i=B1.getByteAt(e,r+7),s=B1.getByteAt(e,r+7+1);return{value:i*256+s,description:i+"."+s}}function qNe(e,r,t){if(10>t)return;const i=B1.getByteAt(e,r+9);return{value:i,description:LNe(i)}}function LNe(e){return e===0?"None":e===1?"inches":e===2?"cm":"Unknown"}function VNe(e,r,t){if(12>t)return;const i=B1.getShortAt(e,r+10);return{value:i,description:""+i}}function GNe(e,r,t){if(14>t)return;const i=B1.getShortAt(e,r+12);return{value:i,description:""+i}}function zNe(e,r,t){if(15>t)return;const i=B1.getByteAt(e,r+14);return{value:i,description:`${i}px`}}function UNe(e,r,t){if(16>t)return;const i=B1.getByteAt(e,r+15);return{value:i,description:`${i}px`}}function WNe(e,r,t,a){return t===0||16+t>a?void 0:{value:e.buffer.slice(r+16,r+16+t),description:"<24-bit RGB pixel data>"}}const lA={iptc:{256:{name:"Model Version",description:e=>((e[0]<<8)+e[1]).toString()},261:{name:"Destination",repeatable:!0},276:{name:"File Format",description:e=>((e[0]<<8)+e[1]).toString()},278:{name:"File Format Version",description:e=>((e[0]<<8)+e[1]).toString()},286:"Service Identifier",296:"Envelope Number",306:"Product ID",316:"Envelope Priority",326:{name:"Date Sent",description:nB},336:{name:"Time Sent",description:iB},346:{name:"Coded Character Set",description:P1e,encoding_name:P1e},356:"UNO",376:{name:"ARM Identifier",description:e=>((e[0]<<8)+e[1]).toString()},378:{name:"ARM Version",description:e=>((e[0]<<8)+e[1]).toString()},512:{name:"Record Version",description:e=>((e[0]<<8)+e[1]).toString()},515:"Object Type Reference",516:"Object Attribute Reference",517:"Object Name",519:"Edit Status",520:{name:"Editorial Update",description:e=>ca(e)==="01"?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const r=ca(e).split(":");return r[2]+(r[3]?"/"+r[3]:"")+(r[4]?"/"+r[4]:"")}},527:"Category",532:{name:"Supplemental Category",repeatable:!0},534:"Fixture Identifier",537:{name:"Keywords",repeatable:!0},538:{name:"Content Location Code",repeatable:!0},539:{name:"Content Location Name",repeatable:!0},542:"Release Date",547:"Release Time",549:"Expiration Date",550:"Expiration Time",552:"Special Instructions",554:{name:"Action Advised",description:e=>{const r=ca(e);return r==="01"?"Object Kill":r==="02"?"Object Replace":r==="03"?"Object Append":r==="04"?"Object Reference":"Unknown"}},557:{name:"Reference Service",repeatable:!0},559:{name:"Reference Date",repeatable:!0},562:{name:"Reference Number",repeatable:!0},567:{name:"Date Created",description:nB},572:{name:"Time Created",description:iB},574:{name:"Digital Creation Date",description:nB},575:{name:"Digital Creation Time",description:iB},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const r=ca(e);return r==="a"?"morning":r==="p"?"evening":r==="b"?"both":"Unknown"}},592:{name:"By-line",repeatable:!0},597:{name:"By-line Title",repeatable:!0},602:"City",604:"Sub-location",607:"Province/State",612:"Country/Primary Location Code",613:"Country/Primary Location Name",615:"Original Transmission Reference",617:"Headline",622:"Credit",627:"Source",628:"Copyright Notice",630:{name:"Contact",repeatable:!0},632:"Caption/Abstract",634:{name:"Writer/Editor",repeatable:!0},637:{name:"Rasterized Caption",description:e=>e},642:"Image Type",643:{name:"Image Orientation",description:e=>{const r=ca(e);return r==="P"?"Portrait":r==="L"?"Landscape":r==="S"?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const r=ca(e),t=r.charAt(0),a=r.charAt(1);let n="";return t==="1"?n+="Mono":t==="2"&&(n+="Stereo"),a==="A"?n+=", actuality":a==="C"?n+=", question and answer session":a==="M"?n+=", music, transmitted by itself":a==="Q"?n+=", response to a question":a==="R"?n+=", raw sound":a==="S"?n+=", scener":a==="V"?n+=", voicer":a==="W"&&(n+=", wrap"),n!==""?n:r}},663:{name:"Audio Sampling Rate",description:e=>parseInt(ca(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const r=parseInt(ca(e),10);return r+(r===1?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const r=ca(e);return r.length>=6?r.substr(0,2)+":"+r.substr(2,2)+":"+r.substr(4,2):r}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>e.length===2?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(e.length===2){const r=(e[0]<<8)+e[1];return r===0?"No ObjectData":r===1?"IPTC-NAA Digital Newsphoto Parameter Record":r===2?"IPTC7901 Recommended Message Format":r===3?"Tagged Image File Format (Adobe/Aldus Image data)":r===4?"Illustrator (Adobe Graphics data)":r===5?"AppleSingle (Apple Computer Inc)":r===6?"NAA 89-3 (ANPA 1312)":r===7?"MacBinary II":r===8?"IPTC Unstructured Character Oriented File Format (UCOFF)":r===9?"United Press International ANPA 1312 variant":r===10?"United Press International Down-Load Message":r===11?"JPEG File Interchange (JFIF)":r===12?"Photo-CD Image-Pac (Eastman Kodak)":r===13?"Microsoft Bit Mapped Graphics File [*.BMP]":r===14?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":r===15?"Audio plus Moving Video [*.AVI] (Microsoft)":r===16?"PC DOS/Windows Executable Files [*.COM][*.EXE]":r===17?"Compressed Binary File [*.ZIP] (PKWare Inc)":r===18?"Audio Interchange File Format AIFF (Apple Computer Inc)":r===19?"RIFF Wave (Microsoft Corporation)":r===20?"Freehand (Macromedia/Aldus)":r===21?'Hypertext Markup Language "HTML" (The Internet Society)':r===22?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":r===23?"MPEG 2 Audio Layer 3, ISO/IEC":r===24?"Portable Document File (*.PDF) Adobe":r===25?"News Industry Text Format (NITF)":r===26?"Tape Archive (*.TAR)":r===27?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":r===28?"Ritzaus Bureau NITF version (RBNITF DTD)":r===29?"Corel Draw [*.CDR]":`Unknown format ${r}`}return ca(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,r)=>{const t={"00":{"00":"1"},"01":{"01":"1","02":"2","03":"3","04":"4"},"02":{"04":"4"},"03":{"01":"5.0","02":"6.0"},"04":{"01":"1.40"},"05":{"01":"2"},"06":{"01":"1"},11:{"01":"1.02"},20:{"01":"3.1","02":"4.0","03":"5.0","04":"5.5"},21:{"02":"2.0"}},a=ca(e);if(r["ObjectData Preview File Format"]){const n=ca(r["ObjectData Preview File Format"].value);if(t[n]&&t[n][a])return t[n][a]}return a}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let r=0;for(let t=0;t<e.length;t++)r=(r<<8)+e[t];return r.toString()}}}};function nB(e){const r=ca(e);return r.length>=8?r.substr(0,4)+"-"+r.substr(4,2)+"-"+r.substr(6,2):r}function iB(e){const r=ca(e);let t=r;return r.length>=6&&(t=r.substr(0,2)+":"+r.substr(2,2)+":"+r.substr(4,2),r.length===11&&(t+=r.substr(6,1)+r.substr(7,2)+":"+r.substr(9,2))),t}function P1e(e){const r=ca(e);return r==="\x1B%G"?"UTF-8":r==="\x1B%5"?"Windows-1252":r==="\x1B%/G"?"UTF-8 Level 1":r==="\x1B%/H"?"UTF-8 Level 2":r==="\x1B%/I"?"UTF-8 Level 3":r==="\x1B/A"?"ISO-8859-1":r==="\x1B/B"?"ISO-8859-2":r==="\x1B/C"?"ISO-8859-3":r==="\x1B/D"?"ISO-8859-4":r==="\x1B/@"?"ISO-8859-5":r==="\x1B/G"?"ISO-8859-6":r==="\x1B/F"?"ISO-8859-7":r==="\x1B/H"?"ISO-8859-8":"Unknown"}const XNe={get:HNe};function HNe(){if(typeof TextDecoder<"u")return TextDecoder}const j1e={decode:$Ne,TAG_HEADER_SIZE:5};function $Ne(e,r){const t=XNe.get();if(typeof t<"u"&&e!==void 0)try{return new t(e).decode(r instanceof DataView?r.buffer:Uint8Array.from(r))}catch{}const a=r.map(n=>String.fromCharCode(n)).join("");return YNe(a)}function YNe(e){try{return decodeURIComponent(escape(e))}catch{return e}}const QNe=943868237,Hg=4,jx=2,JNe=1,KNe=2,q1e=4,eFe=Hg+jx+KNe+q1e,rFe=1028,L1e=5,oB={read:tFe};function tFe(e,r,t){try{if(Array.isArray(e))return V1e(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,t);const{naaBlock:a,dataOffset:n}=aFe(e,r);return V1e(e,a,n,t)}catch{return{}}}function aFe(e,r){for(;r+eFe<=e.byteLength;){const t=nFe(e,r);if(iFe(t))return{naaBlock:t,dataOffset:r+t.headerSize};r+=t.headerSize+t.size+oFe(t)}throw new Error("No IPTC NAA resource block.")}function nFe(e,r){if(e.getUint32(r,!1)!==QNe)throw new Error("Not an IPTC resource block.");const t=e.getUint8(r+Hg+jx),a=(t%2===0?t+1:t)+JNe;return{headerSize:Hg+jx+a+q1e,type:e.getUint16(r+Hg),size:e.getUint32(r+Hg+jx+a)}}function iFe(e){return e.type===rFe}function oFe(e){return e.size%2!==0?1:0}function V1e(e,r,t,a){const n={};let i;const s=t+r.size;for(;t<s&&t<e.byteLength;){const{tag:u,tagSize:c}=sFe(e,t,n,i,a);if(u===null)break;u&&("encoding"in u&&(i=u.encoding),n[u.name]===void 0||u.repeatable===void 0?n[u.name]={id:u.id,value:u.value,description:u.description}:(n[u.name]instanceof Array||(n[u.name]=[{id:n[u.name].id,value:n[u.name].value,description:n[u.name].description}]),n[u.name].push({id:u.id,value:u.value,description:u.description}))),t+=L1e+c}return n}function sFe(e,r,t,a,n){if(lFe(e,r))return{tag:null,tagSize:0};const u=e.getUint16(r+1),c=e.getUint16(r+3);if(!n&&!lA.iptc[u])return{tag:void 0,tagSize:c};const A=uFe(e,r+L1e,c),d={id:u,name:cFe(lA.iptc[u],u,A),value:A,description:dFe(lA.iptc[u],A,t,a)};return mFe(u)&&(d.repeatable=!0),gFe(u)&&(d.encoding=lA.iptc[u].encoding_name(A)),{tag:d,tagSize:c}}function lFe(e,r){return e.getUint8(r)!==28}function uFe(e,r,t){const a=[];for(let n=0;n<t;n++)a.push(e.getUint8(r+n));return a}function cFe(e,r,t){return e?fFe(e)?e:AFe(e)?e.name(t):e.name:`undefined-${r}`}function fFe(e){return typeof e=="string"}function AFe(e){return typeof e.name=="function"}function dFe(e,r,t,a){if(pFe(e))try{return e.description(r,t)}catch{}return hFe(e,r)?j1e.decode(a,r):r}function hFe(e,r){return e&&r instanceof Array}function pFe(e){return e&&e.description!==void 0}function mFe(e){return lA.iptc[e]&&lA.iptc[e].repeatable}function gFe(e){return lA.iptc[e]&&lA.iptc[e].encoding_name!==void 0}const qx={"tiff:Orientation"(e){return e==="1"?"Horizontal (normal)":e==="2"?"Mirror horizontal":e==="3"?"Rotate 180":e==="4"?"Mirror vertical":e==="5"?"Mirror horizontal and rotate 270 CW":e==="6"?"Rotate 90 CW":e==="7"?"Mirror horizontal and rotate 90 CW":e==="8"?"Rotate 270 CW":e},"tiff:ResolutionUnit":e=>C0.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>K6(C0.XResolution,e),"tiff:YResolution":e=>K6(C0.YResolution,e),"exif:ApertureValue":e=>K6(C0.ApertureValue,e),"exif:GPSLatitude":z1e,"exif:GPSLongitude":z1e,"exif:FNumber":e=>K6(C0.FNumber,e),"exif:FocalLength":e=>K6(C0.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>C0.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>C0.ColorSpace(bFe(e)),"exif:ComponentsConfiguration"(e,r){if(/^\d, \d, \d, \d$/.test(r)){const t=r.split(", ").map(a=>a.charCodeAt(0));return C0.ComponentsConfiguration(t)}return r},"exif:Contrast":e=>C0.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>C0.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>C0.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>C0.ExposureProgram(parseInt(e,10)),"exif:ExposureTime"(e){return G1e(e)?C0.ExposureTime(e.split("/").map(r=>parseInt(r,10))):e},"exif:MeteringMode":e=>C0.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>C0.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>C0.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>C0.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>K6(C0.ShutterSpeedValue,e),"exif:WhiteBalance":e=>C0.WhiteBalance(parseInt(e,10))};function K6(e,r){return G1e(r)?e(r.split("/")):r}function bFe(e){return e.substring(0,2)==="0x"?parseInt(e.substring(2),16):parseInt(e,10)}function G1e(e){return/^-?\d+\/-?\d+$/.test(e)}function z1e(e){const[r,t]=e.split(",");if(r!==void 0&&t!==void 0){const a=parseFloat(r),n=parseFloat(t),i=t.charAt(t.length-1);if(!Number.isNaN(a)&&!Number.isNaN(n))return""+(a+n/60)+i}return e}const vFe={get:yFe};function yFe(e){if(e)return e;if(typeof DOMParser<"u")return new DOMParser;try{const{DOMParser:r,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new r({onError:t})}catch{return}}function wFe(e){const r=["prefix is non-null and namespace is null","prefix not bound to a namespace","prefix inte bundet till en namnrymd",/Namespace prefix .+ is not defined/];for(let t=0;t<r.length;t++)if(new RegExp(r[t]).test(e.message))return!0;return!1}function EFe(e){const r=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!r)return e;const t=r[1],a=xFe(e),i=kFe(e).filter(u=>a.indexOf(u)===-1);if(i.length===0)return e;const s=CFe(i);return SFe(e,t,s)}function xFe(e){const r=[],t=/xmlns:([\w-]+)=["'][^"']+["']/g;let a;for(;(a=t.exec(e))!==null;)r.indexOf(a[1])===-1&&r.push(a[1]);return r}function kFe(e){const r=[],t=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let a;for(;(a=t.exec(e))!==null;){const n=a[1];n==="xmlns"||n==="xml"||r.indexOf(n)===-1&&r.push(n)}return r}const _Fe={xmp:"http://ns.adobe.com/xap/1.0/",tiff:"http://ns.adobe.com/tiff/1.0/",exif:"http://ns.adobe.com/exif/1.0/",dc:"http://purl.org/dc/elements/1.1/",xmpMM:"http://ns.adobe.com/xap/1.0/mm/",stEvt:"http://ns.adobe.com/xap/1.0/sType/ResourceEvent#",stRef:"http://ns.adobe.com/xap/1.0/sType/ResourceRef#",photoshop:"http://ns.adobe.com/photoshop/1.0/"};function CFe(e){const r=[];for(let t=0;t<e.length;t++){const a=e[t],n=_Fe[a]||"http://fallback.namespace/"+a;r.push(" xmlns:"+a+'="'+n+'"')}return r.join("")}function SFe(e,r,t){const a=new RegExp("<"+r+"([^>]*)>");return e.replace(a,"<"+r+"$1"+t+">")}const U1e={read:IFe};class TFe extends Error{constructor(r){super(r),this.name="ParseError"}}function IFe(e,r,t){const a={};if(typeof e=="string")return Lx(a,e,t),a;const[n,i]=RFe(e,r),s=Lx(a,n,t);if(i){const u=Lx(a,i,t);!s&&!u&&(delete a._raw,Lx(a,sB(e,r),t))}return a}function RFe(e,r){if(r.length===0)return[];const t=[sB(e,r.slice(0,1))];return r.length>1&&t.push(sB(e,r.slice(1))),t}function sB(e,r){const t=r.reduce((i,s)=>i+s.length,0),a=new Uint8Array(t);let n=0;for(let i=0;i<r.length;i++){const s=r[i],u=e.buffer.slice(s.dataOffset,s.dataOffset+s.length);a.set(new Uint8Array(u),n),n+=s.length}return new DataView(a.buffer)}function Lx(e,r,t){try{const{doc:a,raw:n}=MFe(r,t);e._raw=(e._raw||"")+n;const i=X1e(a);return z0(e,$1e(H1e(i,!0))),!0}catch{return!1}}function MFe(e,r){const t=vFe.get(r);if(!t)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const a=typeof e=="string"?e:O0(e,0,e.byteLength);return{doc:W1e(t,OFe(a)),raw:a}}function OFe(e){return e.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")}function W1e(e,r,t=!1){try{const a=e.parseFromString(r,"application/xml"),n=a.getElementsByTagName("parsererror");if(n.length>0)throw new TFe(n[0].textContent);return a}catch(a){if(a.name==="ParseError"&&wFe(a)&&!t)return W1e(e,EFe(r),!0);throw a}}function X1e(e){for(let r=0;r<e.childNodes.length;r++){if(e.childNodes[r].tagName==="x:xmpmeta")return X1e(e.childNodes[r]);if(e.childNodes[r].tagName==="rdf:RDF")return e.childNodes[r]}throw new Error}function H1e(e,r=!1){const t=DFe(e);return BFe(t)?r?{}:NFe(t[0]):FFe(t)}function DFe(e){const r=[];for(let t=0;t<e.childNodes.length;t++)r.push(e.childNodes[t]);return r}function BFe(e){return e.length===1&&e[0].nodeName==="#text"}function NFe(e){return e.nodeValue}function FFe(e){const r={};return e.forEach(t=>{if(ZFe(t)){const a=PFe(t);r[t.nodeName]!==void 0?(Array.isArray(r[t.nodeName])||(r[t.nodeName]=[r[t.nodeName]]),r[t.nodeName].push(a)):r[t.nodeName]=a}}),r}function ZFe(e){return e.nodeName&&e.nodeName!=="#text"}function PFe(e){return{attributes:jFe(e),value:H1e(e)}}function jFe(e){const r={};for(let t=0;t<e.attributes.length;t++)r[e.attributes[t].nodeName]=decodeURIComponent(escape(e.attributes[t].value));return r}function $1e(e){const r={};if(typeof e=="string")return e;for(const t in e){let a=e[t];Array.isArray(a)||(a=[a]),a.forEach(n=>{z0(r,lB(n.attributes)),typeof n.value=="object"&&z0(r,Y1e(n.value))})}return r}function lB(e){const r={};for(const t in e)try{qFe(t)&&(r[Gx(t)]={value:e[t],attributes:{},description:uc(e[t],t)})}catch{}return r}function qFe(e){return e!=="rdf:parseType"&&!Vx(e)}function Vx(e){return e.split(":")[0]==="xmlns"}function Gx(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function uc(e,r=void 0){if(Array.isArray(e)){const t=LFe(e);return r&&typeof qx[r]=="function"?qx[r](e,t):t}if(typeof e=="object")return VFe(e);try{return r&&typeof qx[r]=="function"?qx[r](e):decodeURIComponent(escape(e))}catch{return e}}function LFe(e){return e.map(r=>r.value!==void 0?uc(r.value):uc(r)).join(", ")}function VFe(e){const r=[];for(const t in e)r.push(`${GFe(t)}: ${uc(e[t].value)}`);return r.join("; ")}function GFe(e){return e==="CiAdrCity"?"CreatorCity":e==="CiAdrCtry"?"CreatorCountry":e==="CiAdrExtadr"?"CreatorAddress":e==="CiAdrPcode"?"CreatorPostalCode":e==="CiAdrRegion"?"CreatorRegion":e==="CiEmailWork"?"CreatorWorkEmail":e==="CiTelWork"?"CreatorWorkPhone":e==="CiUrlWork"?"CreatorWorkUrl":e}function Y1e(e){const r={};for(const t in e)try{Vx(t)||(r[Gx(t)]=zFe(e[t],t))}catch{}return r}function zFe(e,r){return WFe(e)?XFe(e,r):UFe(e)?{value:"",attributes:{},description:""}:Q1e(e)?J1e(e,r):K1e(e)?e0e(e,r):r0e(e)?t0e(e,r):YFe(e)?QFe(e,r):uB(e,r)}function UFe(e){return e.attributes["rdf:parseType"]==="Resource"&&typeof e.value=="string"&&e.value.trim()===""}function WFe(e){return Array.isArray(e)}function XFe(e,r){return uB(e[e.length-1],r)}function Q1e(e){return e.attributes["rdf:parseType"]==="Resource"&&e.value["rdf:value"]!==void 0||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]!==void 0}function J1e(e,r){const t=$g(e);e.value["rdf:Description"]!==void 0&&(e=e.value["rdf:Description"]),z0(t,$g(e),HFe(e));const a=$Fe(e);return{value:a,attributes:t,description:uc(a,r)}}function $g(e){const r={};for(const t in e.attributes)t!=="rdf:parseType"&&t!=="rdf:resource"&&!Vx(t)&&(r[Gx(t)]=e.attributes[t]);return r}function HFe(e){const r={};for(const t in e.value)t!=="rdf:value"&&!Vx(t)&&(r[Gx(t)]=e.value[t].value);return r}function $Fe(e){return n0e(e.value["rdf:value"])||e.value["rdf:value"].value}function K1e(e){return e.attributes["rdf:parseType"]==="Resource"||e.value["rdf:Description"]!==void 0&&e.value["rdf:Description"].value["rdf:value"]===void 0}function e0e(e,r){const t={value:{},attributes:{}};return e.value["rdf:Description"]!==void 0&&(z0(t.value,lB(e.value["rdf:Description"].attributes)),z0(t.attributes,$g(e)),e=e.value["rdf:Description"]),z0(t.value,Y1e(e.value)),t.description=uc(t.value,r),t}function r0e(e){return Object.keys(e.value).length===0&&e.attributes["xml:lang"]===void 0&&e.attributes["rdf:resource"]===void 0}function t0e(e,r){const t=lB(e.attributes);return{value:t,attributes:{},description:uc(t,r)}}function YFe(e){return a0e(e.value)!==void 0}function a0e(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function QFe(e,r){let t=a0e(e.value).value["rdf:li"];const a=$g(e),n=[];return t===void 0?t=[]:Array.isArray(t)||(t=[t]),t.forEach(i=>{n.push(JFe(i))}),{value:n,attributes:a,description:uc(n,r)}}function JFe(e){return Q1e(e)?J1e(e):K1e(e)?e0e(e).value:r0e(e)?t0e(e).value:uB(e)}function uB(e,r){const t=n0e(e)||$1e(e.value);return{value:t,attributes:$g(e),description:uc(t,r)}}function n0e(e){return e.attributes&&e.attributes["rdf:resource"]}const cc={CLOSED_SUBPATH_LENGTH:0,CLOSED_SUBPATH_BEZIER_LINKED:1,CLOSED_SUBPATH_BEZIER_UNLINKED:2,OPEN_SUBPATH_LENGTH:3,OPEN_SUBPATH_BEZIER_LINKED:4,OPEN_SUBPATH_BEZIER_UNLINKED:5,FILL_RULE:6,CLIPBOARD:7,INITIAL_FILL_RULE:8},i0e=24,cB={2e3:{name:"PathInformation",description:KFe},2999:{name:"ClippingPathName",description(e){const[,r]=jee(e,0);return r}}};function KFe(e){const t={},a=[];for(let n=0;n<e.byteLength;n+=2+i0e){const i=B1.getShortAt(e,n);fB[i]&&(t[i]||(t[i]=fB[i].description),a.push({type:i,path:fB[i].path(e,n+2)}))}return JSON.stringify({types:t,paths:a})}const fB={[cc.CLOSED_SUBPATH_LENGTH]:{description:"Closed subpath length",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.CLOSED_SUBPATH_BEZIER_LINKED]:{description:"Closed subpath Bezier knot, linked",path:zx},[cc.CLOSED_SUBPATH_BEZIER_UNLINKED]:{description:"Closed subpath Bezier knot, unlinked",path:zx},[cc.OPEN_SUBPATH_LENGTH]:{description:"Open subpath length",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.OPEN_SUBPATH_BEZIER_LINKED]:{description:"Open subpath Bezier knot, linked",path:zx},[cc.OPEN_SUBPATH_BEZIER_UNLINKED]:{description:"Open subpath Bezier knot, unlinked",path:zx},[cc.FILL_RULE]:{description:"Path fill rule",path:()=>[]},[cc.INITIAL_FILL_RULE]:{description:"Initial fill rule",path:(e,r)=>[B1.getShortAt(e,r)]},[cc.CLIPBOARD]:{description:"Clipboard",path:rZe}};function zx(e,r){const a=[];for(let n=0;n<i0e;n+=8)a.push(eZe(e,r+n));return a}function eZe(e,r){const t=Ad(e,r,8);return[Ad(e,r+4,8),t]}function rZe(e,r){return[[Ad(e,r,8),Ad(e,r+4,8),Ad(e,r+8,8),Ad(e,r+12,8)],Ad(e,r+16,8)]}function Ad(e,r,t){const a=B1.getLongAt(e,r),n=a>>>31?-1:1,i=(a&2130706432)>>>32-t,s=a&parseInt(Vee("1",32-t),2);return n*eDe(i.toString(2)+"."+KOe(s.toString(2),32-t,"0"),2)}const tZe={read:iZe},o0e="8BIM",aZe=2,nZe=4,s0e=o0e.length;function iZe(e,r){const t=Pee(new Uint8Array(e).buffer),a={};let n=0;for(;n<e.length;){const i=O0(t,n,s0e);n+=s0e;const s=B1.getShortAt(t,n);n+=aZe;const{tagName:u,tagNameSize:c}=oZe(t,n);n+=c;const A=B1.getLongAt(t,n);if(n+=nZe,i===o0e){const d=Pee(t.buffer,n,A),g={id:s,value:O0(d,0,A)};if(cB[s]){try{g.description=cB[s].description(d)}catch{g.description="<no description formatter>"}a[u||cB[s].name]=g}else r&&(a[`undefined-${s}`]=g)}n+=A+A%2}return a}function oZe(e,r){const[t,a]=jee(e,r);return{tagName:a,tagNameSize:1+t+(t%2===0?1:0)}}const l0e={desc:{name:"ICC Description"},cprt:{name:"ICC Copyright"},dmdd:{name:"ICC Device Model Description"},vued:{name:"ICC Viewing Conditions Description"},dmnd:{name:"ICC Device Manufacturer for Display"},tech:{name:"Technology"}},u0e={4:{name:"Preferred CMM type",value:(e,r)=>O0(e,r,4),description:e=>e!==null?AB(e):""},8:{name:"Profile Version",value:(e,r)=>e.getUint8(r).toString(10)+"."+(e.getUint8(r+1)>>4).toString(10)+"."+(e.getUint8(r+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,r)=>O0(e,r,4),description:e=>{switch(e.toLowerCase()){case"scnr":return"Input Device profile";case"mntr":return"Display Device profile";case"prtr":return"Output Device profile";case"link":return"DeviceLink profile";case"abst":return"Abstract profile";case"spac":return"ColorSpace profile";case"nmcl":return"NamedColor profile";case"cenc":return"ColorEncodingSpace profile";case"mid ":return"MultiplexIdentification profile";case"mlnk":return"MultiplexLink profile";case"mvis":return"MultiplexVisualization profile";default:return e}}},16:{name:"Color Space",value:(e,r)=>O0(e,r,4)},20:{name:"Connection Space",value:(e,r)=>O0(e,r,4)},24:{name:"ICC Profile Date",value:(e,r)=>sZe(e,r).toISOString()},36:{name:"ICC Signature",value:(e,r)=>lZe(e.buffer.slice(r,r+4))},40:{name:"Primary Platform",value:(e,r)=>O0(e,r,4),description:e=>AB(e)},48:{name:"Device Manufacturer",value:(e,r)=>O0(e,r,4),description:e=>AB(e)},52:{name:"Device Model Number",value:(e,r)=>O0(e,r,4)},64:{name:"Rendering Intent",value:(e,r)=>e.getUint32(r),description:e=>{switch(e){case 0:return"Perceptual";case 1:return"Relative Colorimetric";case 2:return"Saturation";case 3:return"Absolute Colorimetric";default:return e}}},80:{name:"Profile Creator",value:(e,r)=>O0(e,r,4)}};function sZe(e,r){const t=e.getUint16(r),a=e.getUint16(r+2)-1,n=e.getUint16(r+4),i=e.getUint16(r+6),s=e.getUint16(r+8),u=e.getUint16(r+10);return new Date(Date.UTC(t,a,n,i,s,u))}function lZe(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function AB(e){switch(e.toLowerCase()){case"appl":return"Apple";case"adbe":return"Adobe";case"msft":return"Microsoft";case"sunw":return"Sun Microsystems";case"sgi":return"Silicon Graphics";case"tgnt":return"Taligent";default:return e}}const c0e={read:gZe},uZe=84,cZe=128,fZe="acsp",AZe="desc",dZe="mluc",hZe="text",pZe="sig ",mZe=12;function gZe(e,r,t){return t&&r[0].compressionMethod!==Mx?bZe(e,r):yZe(e,r)}function bZe(e,r){if(!vZe(r[0].compressionMethod))return{};const t=new DataView(e.buffer.slice(r[0].offset,r[0].offset+r[0].length));return zee(t,r[0].compressionMethod,"utf-8","dataview").then(f0e).catch(()=>({}))}function vZe(e){return e===Gee}function yZe(e,r){try{const t=r.reduce((s,u)=>s+u.length,0),a=new Uint8Array(t);let n=0;const i=wZe(e);for(let s=1;s<=r.length;s++){const u=r.find(d=>d.chunkNumber===s);if(!u)throw new Error(`ICC chunk ${s} not found`);const c=i.slice(u.offset,u.offset+u.length),A=new Uint8Array(c);a.set(A,n),n+=A.length}return f0e(new DataView(a.buffer))}catch{return{}}}function wZe(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}function EZe(e){return e.length<cZe+4}function xZe(e,r){return e.length<r+mZe}function f0e(e){const r=e.buffer,t=e.getUint32();if(e.byteLength!==t)throw new Error("ICC profile length not matching");if(e.byteLength<uZe)throw new Error("ICC profile too short");const a={},n=Object.keys(u0e);for(let c=0;c<n.length;c++){const A=n[c],d=u0e[A],g=d.value(e,parseInt(A,10));let m=g;d.description&&(m=d.description(g)),a[d.name]={value:g,description:m}}if(Ux(r.slice(36,40))!==fZe)throw new Error("ICC profile: missing signature");if(EZe(r))return a;const s=e.getUint32(128);let u=132;for(let c=0;c<s;c++){if(xZe(r,u))return a;const A=O0(e,u,4),d=e.getUint32(u+4),g=e.getUint32(u+8);if(d>r.length)return a;const m=O0(e,d,4);if(m===AZe){const b=e.getUint32(d+8);if(b>g)return a;const w=Ux(r.slice(d+12,d+b+11));Yg(a,A,w)}else if(m===dZe){const b=e.getUint32(d+8),w=e.getUint32(d+12);let E=d+16;const x=[];for(let _=0;_<b;_++){const I=O0(e,E+0,2),S=O0(e,E+2,2),R=e.getUint32(E+4),M=e.getUint32(E+8),N=QOe(e,d+M,R);x.push({languageCode:I,countryCode:S,text:N}),E+=w}if(b===1)Yg(a,A,x[0].text);else{const _={};for(let I=0;I<x.length;I++)_[`${x[I].languageCode}-${x[I].countryCode}`]=x[I].text;Yg(a,A,_)}}else if(m===hZe){const b=Ux(r.slice(d+8,d+g-7));Yg(a,A,b)}else if(m===pZe){const b=Ux(r.slice(d+8,d+12));Yg(a,A,b)}u=u+12}return a}function Ux(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function Yg(e,r,t){l0e[r]?e[l0e[r].name]={value:t,description:t}:e[r]={value:t,description:t}}const Wx=27,kZe={read:_Ze,SHOT_INFO_AUTO_ROTATE:Wx};function _Ze(e,r,t,a,n){let i=sA(e,T1e,r,r+t,a,n);return i.ShotInfo&&(i=z0({},i,CZe(i.ShotInfo.value)),delete i.ShotInfo),i}function CZe(e){const r={};return e[Wx]!==void 0&&(r.AutoRotate={value:e[Wx],description:SZe(e[Wx])}),r}function SZe(e){return e===0?"None":e===1?"Rotate 90 CW":e===2?"Rotate 180":e===3?"Rotate 270 CW":"Unknown"}const A0e=8,d0e=A0e+2,h0e={K3_III:78420},Xx={CAMERA_ORIENTATION:1,ROLL_ANGLE:3,PITCH_ANGLE:5},TZe={read:IZe,PENTAX_IFD_OFFSET:d0e,MODEL_ID:h0e,LIK3III:Xx};function IZe(e,r,t,a){const n=Gu.getByteOrder(e,r+t+A0e),i=r+t;let s=sA(e,rB,i,i+d0e,n,a);return RZe(s)&&(s=z0({},s,MZe(e,i+s.LevelInfo.__offset,n)),delete s.LevelInfo),s}function RZe(e){return e.PentaxModelID&&e.PentaxModelID.value===h0e.K3_III&&e.LevelInfo}function MZe(e,r,t){const a={};if(r+7>e.byteLength)return a;const n=e.getInt8(r+Xx.CAMERA_ORIENTATION);a.CameraOrientation={value:n,description:OZe(n)};const i=e.getInt16(r+Xx.ROLL_ANGLE,t===Gu.LITTLE_ENDIAN);a.RollAngle={value:i,description:DZe(i)};const s=e.getInt16(r+Xx.PITCH_ANGLE,t===Gu.LITTLE_ENDIAN);return a.PitchAngle={value:s,description:BZe(s)},a}function OZe(e){return e===0?"Horizontal (normal)":e===1?"Rotate 270 CW":e===2?"Rotate 180":e===3?"Rotate 90 CW":e===4?"Upwards":e===5?"Downwards":"Unknown"}function DZe(e){return""+e*-.5}function BZe(e){return""+e*-.5}const NZe={read:FZe};function FZe(e,r){return{"Image Width":ZZe(e,r),"Image Height":PZe(e,r),"Bit Depth":jZe(e,r),"Color Type":qZe(e,r),Compression:LZe(e,r),Filter:VZe(e,r),Interlace:GZe(e,r)}}function ZZe(e,r){if(r+0+4>e.byteLength)return;const n=B1.getLongAt(e,r);return{value:n,description:`${n}px`}}function PZe(e,r){if(r+4+4>e.byteLength)return;const n=B1.getLongAt(e,r+4);return{value:n,description:`${n}px`}}function jZe(e,r){if(r+8+1>e.byteLength)return;const n=B1.getByteAt(e,r+8);return{value:n,description:`${n}`}}function qZe(e,r){const n={0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"};if(r+9+1>e.byteLength)return;const i=B1.getByteAt(e,r+9);return{value:i,description:n[i]||"Unknown"}}function LZe(e,r){if(r+10+1>e.byteLength)return;const n=B1.getByteAt(e,r+10);return{value:n,description:n===0?"Deflate/Inflate":"Unknown"}}function VZe(e,r){if(r+11+1>e.byteLength)return;const n=B1.getByteAt(e,r+11);return{value:n,description:n===0?"Adaptive":"Unknown"}}function GZe(e,r){const n={0:"Noninterlaced",1:"Adam7 Interlace"};if(r+12+1>e.byteLength)return;const i=B1.getByteAt(e,r+12);return{value:i,description:n[i]||"Unknown"}}const zZe={read:$Ze},dB="STATE_KEYWORD",hB="STATE_COMPRESSION",pB="STATE_LANG",UZe="STATE_TRANSLATED_KEYWORD",mB="STATE_TEXT",WZe=1,XZe=1,HZe=6;function $Ze(e,r,t,a){const n={},i=[];for(let s=0;s<r.length;s++){const{offset:u,length:c,type:A}=r[s],d=YZe(e,u,c,A,t);if(d instanceof Promise)i.push(d.then(({name:g,value:m,description:b})=>{try{if(Uee.USE_EXIF&&m0e(g,m))return{__exif:Z1e.read(b0e(m),HZe,a).tags};if(Uee.USE_IPTC&&g0e(g,m))return{__iptc:oB.read(b0e(m),0,a)};if(g&&!m0e(g,m)&&!g0e(g,m))return{[g]:{value:m,description:b}}}catch{}return{}}));else{const{name:g,value:m,description:b}=d;g&&(n[g]={value:m,description:b})}}return{readTags:n,readTagsPromise:i.length>0?Promise.all(i):void 0}}function YZe(e,r,t,a,n){const i=[],s=[];let u,c=dB,A=Mx;for(let g=0;g<t&&r+g<e.byteLength;g++){if(c===hB){A=QZe({type:a,dataView:e,offset:r+g}),a===fd&&(g+=WZe),c=p0e(a,c);continue}else if(c===mB){u=new DataView(e.buffer.slice(r+g,r+t));break}const m=e.getUint8(r+g);m===0?c=p0e(a,c):c===dB?i.push(m):c===pB&&s.push(m)}if(A!==Mx&&!n)return{};const d=zee(u,A,JZe(a));return d instanceof Promise?d.then(g=>gB(g,a,s,i)).catch(()=>gB("<text using unknown compression>".split(""),a,s,i)):gB(d,a,s,i)}function QZe({type:e,dataView:r,offset:t}){if(e===fd){if(r.getUint8(t)===XZe)return r.getUint8(t+1)}else if(e===Bx)return r.getUint8(t);return Mx}function p0e(e,r){return r===dB&&[fd,Bx].includes(e)?hB:r===hB?e===fd?pB:mB:r===pB?UZe:mB}function JZe(e){return e===QD||e===Bx?"latin1":"utf-8"}function gB(e,r,t,a){const n=ePe(e);return{name:KZe(r,t,a),value:n,description:r===fd?rPe(e):n}}function KZe(e,r,t){const a=cd(t);if(e===QD||r.length===0)return a;const n=cd(r);return`${a} (${n})`}function ePe(e){return e instanceof DataView?O0(e,0,e.byteLength):e}function rPe(e){return j1e.decode("UTF-8",e)}function m0e(e,r){return e.toLowerCase()==="raw profile type exif"&&r.substring(1,5)==="exif"}function g0e(e,r){return e.toLowerCase()==="raw profile type iptc"&&r.substring(1,5)==="iptc"}function b0e(e){const r=e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/);return tPe(r[2].replace(/\n/g,""))}function tPe(e){const r=new DataView(new ArrayBuffer(e.length/2));for(let t=0;t<e.length;t+=2)r.setUint8(t/2,parseInt(e.substring(t,t+2),16));return r}const aPe={read:nPe};function nPe(e,r){const t={};for(let a=0;a<r.length;a++){const n=B1.getLongAt(e,r[a]+Q6),i=O0(e,r[a]+nA,Ol);i===c1e?(t["Pixels Per Unit X"]=iPe(e,r[a],n),t["Pixels Per Unit Y"]=oPe(e,r[a],n),t["Pixel Units"]=sPe(e,r[a],n)):i===f1e&&(t["Modify Date"]=lPe(e,r[a],n))}return t}function iPe(e,r,t){if(!Hx(e,r,t,0,4))return;const i=B1.getLongAt(e,r+kn+0);return{value:i,description:""+i}}function oPe(e,r,t){if(!Hx(e,r,t,4,4))return;const i=B1.getLongAt(e,r+kn+4);return{value:i,description:""+i}}function sPe(e,r,t){if(!Hx(e,r,t,8,1))return;const i=B1.getByteAt(e,r+kn+8);return{value:i,description:i===1?"meters":"Unknown"}}function lPe(e,r,t){if(!Hx(e,r,t,0,7))return;const n=B1.getShortAt(e,r+kn),i=B1.getByteAt(e,r+kn+2),s=B1.getByteAt(e,r+kn+3),u=B1.getByteAt(e,r+kn+4),c=B1.getByteAt(e,r+kn+5),A=B1.getByteAt(e,r+kn+6);return{value:[n,i,s,u,c,A],description:`${e9(n,4)}-${e9(i,2)}-${e9(s,2)} ${e9(u,2)}:${e9(c,2)}:${e9(A,2)}`}}function Hx(e,r,t,a,n){return a+n<=t&&r+kn+a+n<=e.byteLength}function e9(e,r){return`${"0".repeat(r-(""+e).length)}${e}`}const uPe={read:APe},cPe=4,fPe=7;function APe(e,r){const t={},a=B1.getByteAt(e,r);return t.Alpha=dPe(a),t.Animation=hPe(a),t.ImageWidth=v0e(e,r+cPe),t.ImageHeight=v0e(e,r+fPe),t}function dPe(e){const r=e&16;return{value:r?1:0,description:r?"Yes":"No"}}function hPe(e){const r=e&2;return{value:r?1:0,description:r?"Yes":"No"}}function v0e(e,r){const t=B1.getByteAt(e,r)+256*B1.getByteAt(e,r+1)+65536*B1.getByteAt(e,r+2)+1;return{value:t,description:t+"px"}}const pPe={read:mPe};function mPe(e){return{"GIF Version":gPe(e),"Image Width":bPe(e),"Image Height":vPe(e),"Global Color Map":yPe(e),"Bits Per Pixel":EPe(e),"Color Resolution Depth":wPe(e)}}function gPe(e){if(6>e.byteLength)return;const a=O0(e,3,3);return{value:a,description:a}}function bPe(e){if(8>e.byteLength)return;const a=e.getUint16(6,!0);return{value:a,description:`${a}px`}}function vPe(e){if(10>e.byteLength)return;const a=e.getUint16(8,!0);return{value:a,description:`${a}px`}}function yPe(e){if(11>e.byteLength)return;const n=(e.getUint8(10)&128)>>>7;return{value:n,description:n===1?"Yes":"No"}}function wPe(e){if(11>e.byteLength)return;const n=((e.getUint8(10)&112)>>>4)+1;return{value:n,description:`${n} ${n===1?"bit":"bits"}`}}function EPe(e){if(11>e.byteLength)return;const n=(e.getUint8(10)&7)+1;return{value:n,description:`${n} ${n===1?"bit":"bits"}`}}const xPe=[6,7,99],kPe={get:_Pe};function _Pe(e,r,t){if(CPe(r)){r.type="image/jpeg";const a=t+r.JPEGInterchangeFormat.value;r.image=e.buffer.slice(a,a+r.JPEGInterchangeFormatLength.value),qee(r,"base64",function(){return Lee(this.image)})}return r}function CPe(e){return e&&(e.Compression===void 0||xPe.includes(e.Compression.value))&&e.JPEGInterchangeFormat&&e.JPEGInterchangeFormat.value&&e.JPEGInterchangeFormatLength&&e.JPEGInterchangeFormatLength.value}const bB={INCHES:2,CENTIMETERS:3,MILLIMETERS:4},vB={INCHES_TO_MM:25.4,CM_TO_MM:10,MM_TO_MM:1},SPe={get:TPe};function TPe(e,r){const t={};let a=!1;const n=dd(e,"exif","FocalLength",r),i=dd(e,"exif","FocalPlaneXResolution",r),s=dd(e,"exif","FocalPlaneYResolution",r),u=dd(e,"exif","FocalPlaneResolutionUnit",r),c=dd(e,"file","Image Width",r),A=dd(e,"file","Image Height",r),d=dd(e,"exif","FocalLengthIn35mmFilm",r)||IPe(i,s,u,c,A,n);d&&(t.FocalLength35efl={value:d,description:C0.FocalLengthIn35mmFilm(d)},a=!0);const g=RPe(n,d);g&&(t.ScaleFactorTo35mmEquivalent=g,a=!0);const m=MPe(d);if(m&&(t.FieldOfView=m,a=!0),a)return t}function dd(e,r,t,a){if(a&&e[r]&&e[r][t])return e[r][t].value;if(!a&&e[t])return e[t].value}function IPe(e,r,t,a,n,i){if(e&&r&&t&&a&&n&&i)try{let u;switch(t){case bB.INCHES:u=vB.INCHES_TO_MM;break;case bB.CENTIMETERS:u=vB.CM_TO_MM;break;case bB.MILLIMETERS:u=vB.MM_TO_MM;break;default:return}const c=e[0]/e[1]*u,A=r[0]/r[1]*u,d=a/c,g=n/A,m=Math.sqrt(d**2+g**2);return i[0]/i[1]*(43.27/m)}catch{}}function RPe(e,r){if(e&&r)try{const t=r/(e[0]/e[1]);return{value:t,description:t.toFixed(1)}}catch{}}function MPe(e){if(e)try{const t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+" deg"}}catch{}}function y0e(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=new Error().stack}y0e.prototype=new Error;const OPe={MetadataMissingError:y0e};function DPe(e,r={}){return BPe(e)?(r.async=!0,NPe(e,r).then(t=>yB(t,r))):VPe(e)?(r.async=!0,GPe(e).then(t=>yB(t,r))):yB(e,r)}function BPe(e){return typeof e=="string"}function NPe(e,r){return/^\w+:\/\//.test(e)?typeof fetch<"u"?FPe(e,r):ZPe(e,r):jPe(e)?Promise.resolve(JOe(e)):qPe(e,r)}function FPe(e,{length:r}={}){const t={method:"GET"};return Number.isInteger(r)&&r>=0&&(t.headers={range:`bytes=0-${r-1}`}),fetch(e,t).then(a=>a.arrayBuffer())}function ZPe(e,{length:r}={}){return new Promise((t,a)=>{const n={};Number.isInteger(r)&&r>=0&&(n.headers={range:`bytes=0-${r-1}`}),PPe(e)(e,n,s=>{if(s.statusCode>=200&&s.statusCode<=299){const u=[];s.on("data",c=>u.push(Buffer.from(c))),s.on("error",c=>a(c)),s.on("end",()=>t(Buffer.concat(u)))}else a(`Could not fetch file: ${s.statusCode} ${s.statusMessage}`),s.resume()}).on("error",s=>a(s))})}function PPe(e){return/^https:\/\//.test(e)?__non_webpack_require__("https").get:__non_webpack_require__("http").get}function jPe(e){return/^data:[^;,]*(;base64)?,/.test(e)}function qPe(e,{length:r}={}){return new Promise((t,a)=>{const n=LPe();n.open(e,(i,s)=>{i?a(i):n.stat(e,(u,c)=>{if(u)a(u);else{const A=Math.min(c.size,r!==void 0?r:c.size),d=Buffer.alloc(A),g={buffer:d,length:A};n.read(s,g,m=>{m?a(m):n.close(s,b=>{b&&console.warn(`Could not close file ${e}:`,b),t(d)})})}})})})}function LPe(){try{return __non_webpack_require__("fs")}catch{return}}function VPe(e){return typeof File<"u"&&e instanceof File}function GPe(e){return new Promise((r,t)=>{const a=new FileReader;a.onload=n=>r(n.target.result),a.onerror=()=>t(a.error),a.readAsArrayBuffer(e)})}function yB(e,r){return zPe(e)&&(e=new Uint8Array(e).buffer),WPe(UPe(e),r)}function zPe(e){try{return Buffer.isBuffer(e)}catch{return!1}}function UPe(e){try{return new DataView(e)}catch{return new Zee(e)}}function WPe(e,{expanded:r=!1,async:t=!1,includeUnknown:a=!1,domParser:n=void 0}={expanded:!1,async:!1,includeUnknown:!1,domParser:void 0}){let i=!1,s={};const u=[],{fileType:c,fileDataOffset:A,jfifDataOffset:d,tiffHeaderOffset:g,iptcDataOffset:m,xmpChunks:b,iccChunks:w,mpfDataOffset:E,pngHeaderOffset:x,pngTextChunks:_,pngChunkOffsets:I,vp8xChunkOffset:S,gifHeaderOffset:R}=zBe.parseAppMarkers(e,t);if(XPe(A)){i=!0;const B=CNe.read(e,A);r?s.file=B:s=z0({},s,B)}if(HPe(d)){i=!0;const B=FNe.read(e,d);r?s.jfif=B:s=z0({},s,B)}if($Pe(g)){i=!0;const{tags:B,byteOrder:G}=Z1e.read(e,g,a);if(B.Thumbnail&&(s.Thumbnail=B.Thumbnail,delete B.Thumbnail),r?(s.exif=B,YPe(s)):s=z0({},s,B),B["IPTC-NAA"]&&!w0e(m)){const V=oB.read(B["IPTC-NAA"].value,0,a);r?s.iptc=V:s=z0({},s,V)}if(B.ApplicationNotes&&!E0e(b)){const V=U1e.read(cd(B.ApplicationNotes.value),void 0,n);r?s.xmp=V:(delete V._raw,s=z0({},s,V))}if(B.ImageSourceData&&B.PhotoshopSettings){const V=tZe.read(B.PhotoshopSettings.value,a);r?s.photoshop=V:s=z0({},s,V)}if(B.ICC_Profile&&!x0e(w)){const V=c0e.read(B.ICC_Profile.value,[{offset:0,length:B.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]);r?s.icc=V:s=z0({},s,V)}if(B.MakerNote){if(QPe(B)){const V=kZe.read(e,g,B.MakerNote.__offset,G,a);r?s.makerNotes=V:s=z0({},s,V)}else if(JPe(B)){const V=TZe.read(e,g,B.MakerNote.__offset,a);r?s.makerNotes=V:s=z0({},s,V)}}B.MakerNote&&delete B.MakerNote.__offset}if(w0e(m)){i=!0;const B=oB.read(e,m,a);r?s.iptc=B:s=z0({},s,B)}if(E0e(b)){i=!0;const B=U1e.read(e,b,n);r?s.xmp=B:(delete B._raw,s=z0({},s,B))}if(x0e(w)){i=!0;const B=c0e.read(e,w,t);B instanceof Promise?u.push(B.then(L)):L(B)}if(KPe(E)){i=!0;const B=bNe.read(e,E,a);r?s.mpf=B:s=z0({},s,B)}if(eje(x)){i=!0;const B=NZe.read(e,x);r?(s.png=s.png?z0({},s.png,B):B,s.pngFile=B):s=z0({},s,B)}if(rje(_)){i=!0;const{readTags:B,readTagsPromise:G}=zZe.read(e,_,t,a);F(B),G&&u.push(G.then(V=>V.forEach(F)))}if(tje(I)){i=!0;const B=aPe.read(e,I);r?s.png=s.png?z0({},s.png,B):B:s=z0({},s,B)}if(aje(S)){i=!0;const B=uPe.read(e,S);r?s.riff=s.riff?z0({},s.riff,B):B:s=z0({},s,B)}if(nje(R)){i=!0;const B=pPe.read(e,R);r?s.gif=s.gif?z0({},s.gif,B):B:s=z0({},s,B)}const M=SPe.get(s,r);M&&(r?s.composite=M:s=z0({},s,M));const N=kPe.get(e,s.Thumbnail,g);if(N?(i=!0,s.Thumbnail=N):delete s.Thumbnail,c&&(r?(s.file||(s.file={}),s.file.FileType=c):s.FileType=c,i=!0),!i)throw new OPe.MetadataMissingError;if(t)return Promise.all(u).then(()=>s);return s;function L(B){r?s.icc=B:s=z0({},s,B)}function F(B){if(r){for(const G of["exif","iptc"]){const V=`__${G}`;B[V]&&(s[G]=s[G]?z0({},s.exif,B[V]):B[V],delete B[V])}s.png=s.png?z0({},s.png,B):B,s.pngText=s.pngText?z0({},s.png,B):B}else s=z0({},s,B.__exif?B.__exif:{},B.__iptc?B.__iptc:{},B),delete s.__exif,delete s.__iptc}}function XPe(e){return e!==void 0}function HPe(e){return e!==void 0}function $Pe(e){return e!==void 0}function YPe(e){if(e.exif){if(e.exif.GPSLatitude&&e.exif.GPSLatitudeRef)try{e.gps=e.gps||{},e.gps.Latitude=Ox(e.exif.GPSLatitude.value),e.exif.GPSLatitudeRef.value.join("")==="S"&&(e.gps.Latitude=-e.gps.Latitude)}catch{}if(e.exif.GPSLongitude&&e.exif.GPSLongitudeRef)try{e.gps=e.gps||{},e.gps.Longitude=Ox(e.exif.GPSLongitude.value),e.exif.GPSLongitudeRef.value.join("")==="W"&&(e.gps.Longitude=-e.gps.Longitude)}catch{}if(e.exif.GPSAltitude&&e.exif.GPSAltitudeRef)try{e.gps=e.gps||{},e.gps.Altitude=e.exif.GPSAltitude.value[0]/e.exif.GPSAltitude.value[1],e.exif.GPSAltitudeRef.value===1&&(e.gps.Altitude=-e.gps.Altitude)}catch{}}}function w0e(e){return e!==void 0}function E0e(e){return Array.isArray(e)&&e.length>0}function x0e(e){return Array.isArray(e)&&e.length>0}function QPe(e){return e.Make&&e.Make.value&&Array.isArray(e.Make.value)&&e.Make.value[0]==="Canon"&&e.MakerNote&&e.MakerNote.__offset}function JPe(e){const r="PENTAX ";return e.MakerNote.value.length>r.length&&cd(e.MakerNote.value.slice(0,r.length))===r&&e.MakerNote.__offset}function KPe(e){return e!==void 0}function eje(e){return e!==void 0}function rje(e){return e!==void 0}function tje(e){return e!==void 0}function aje(e){return e!==void 0}function nje(e){return e!==void 0}const ije=2400,Qg=["jpg","jpeg","png","webp","heic","tiff","bmp"],$x=["mp4","webm","ogg","mov","avi","flv","wmv","mkv","3gp","m4v","mpg","mpeg"],oje=e=>{const r=e.name.split(".").pop()?.toLowerCase();return r&&Qg.includes(r)?Ua.IMAGE:r&&$x.includes(r)?Ua.VIDEO:"unknown"},sje=async(e,r)=>{const t=Date.now();let a=e.originalFile,n={};try{n=await DPe(a,{expanded:!1,includeUnknown:!0}),delete n.Images,delete n.Thumbnail}catch(c){console.error(c)}try{const c=e.originalFile?.name?.split(".").pop();if(["heic","heif"].includes(c?.toLowerCase())&&typeof window<"u"){const A=(await Promise.resolve().then(()=>jLe)).default;a=await A({blob:e.originalFile,toType:"image/jpeg"})}}catch(c){console.error(c)}let i=a;try{a.size/1024/1024>1&&(i=await $n(a,{maxSizeMB:2,maxWidthOrHeight:ije,useWebWorker:!0,preserveExif:!0,maxIteration:3,onProgress:r}))}catch(c){console.error(c)}const s={},u=Date.now();return{exif:n,compressedFile:i,colors:s,clientProcessingTime:u-t}},k0e=({src:e,thumbnailUrl:r,playing:t=!1,controls:a=!1,playsInline:n=!0,fit:i="cover",muted:s=!0,showFullscreen:u=!0,onClick:c,onPlay:A,onPause:d,onEnd:g})=>{const m=Z.useRef(null),b=Z.useRef(null),[w,E]=Z.useState(!0),x=Z.useRef(typeof window<"u"&&window.matchMedia("(hover: hover)").matches),_=Z.useCallback(()=>{t?d?.():A?.()},[t,d,A]),I=Z.useCallback(()=>{if(!m.current)return;const S=m.current;S.requestFullscreen?S.requestFullscreen():S.mozRequestFullScreen?S.mozRequestFullScreen():S.webkitRequestFullscreen?S.webkitRequestFullscreen():S.msRequestFullscreen&&S.msRequestFullscreen()},[]);return Z.useEffect(()=>{const S=m.current;if(!S)return;const R=()=>{try{t&&S.play().catch(()=>{})}catch(M){console.error("Error handling video play:",M)}};return S.addEventListener("canplay",R),()=>S.removeEventListener("canplay",R)},[t]),Z.useEffect(()=>{const S=m.current;if(S){try{t?(S.play().catch(()=>{}),x.current||(b.current=setTimeout(()=>E(!1),1e3))):(S.pause(),E(!0))}catch(R){console.error("Error controlling video playback:",R)}return()=>{b.current&&(clearTimeout(b.current),b.current=null)}}},[t]),O.jsxs("div",{className:"qc:hover:cursor-pointer qc:relative qc:size-full",onMouseEnter:()=>E(!0),onMouseLeave:()=>E(!1),children:[O.jsx("video",{ref:m,className:y0("qc:size-full",`qc:object-${i}`),src:e,muted:s,poster:r,controls:a,playsInline:n,onEnded:g,onClick:c,children:"Your browser does not support the video tag."}),!a&&O.jsxs(O.Fragment,{children:[O.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:items-center qc:justify-center",children:w&&O.jsx("button",{onClick:_,className:"qc:text-white","aria-label":t?"Pause":"Play",children:t?O.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",O.jsx("path",{fill:"white",d:"M16 19q-.825 0-1.412-.587T14 17V7q0-.825.588-1.412T16 5t1.413.588T18 7v10q0 .825-.587 1.413T16 19m-8 0q-.825 0-1.412-.587T6 17V7q0-.825.588-1.412T8 5t1.413.588T10 7v10q0 .825-.587 1.413T8 19"})]}):O.jsxs("svg",{className:"qc:absolute qc:inset-0 qc:m-auto qc:size-12",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",children:[" ",O.jsx("path",{fill:"white",d:"M8 17.175V6.825q0-.425.3-.713t.7-.287q.125 0 .263.037t.262.113l8.15 5.175q.225.15.338.375t.112.475t-.112.475t-.338.375l-8.15 5.175q-.125.075-.262.113T9 18.175q-.4 0-.7-.288t-.3-.712"})," "]})})}),w&&u&&O.jsx("button",{onClick:I,className:"qc:absolute qc:right-3 qc:top-3 qc:size-8 qc:rounded-lg qc:p-2 qc:text-white","aria-label":"Enter fullscreen",children:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",className:"qc:size-6",children:[" ",O.jsx("path",{fill:"currentColor",d:"M5 19h2q.425 0 .713.288T8 20t-.288.713T7 21H4q-.425 0-.712-.288T3 20v-3q0-.425.288-.712T4 16t.713.288T5 17zm14 0v-2q0-.425.288-.712T20 16t.713.288T21 17v3q0 .425-.288.713T20 21h-3q-.425 0-.712-.288T16 20t.288-.712T17 19zM5 5v2q0 .425-.288.713T4 8t-.712-.288T3 7V4q0-.425.288-.712T4 3h3q.425 0 .713.288T8 4t-.288.713T7 5zm14 0h-2q-.425 0-.712-.288T16 4t.288-.712T17 3h3q.425 0 .713.288T21 4v3q0 .425-.288.713T20 8t-.712-.288T19 7z"})," "]})})]})]})},lje=({enableCaption:e,ada:r,content:t,removeImage:a,caption:n,disabled:i,onCaptionChange:s,playingVideo:u,onPlay:c,onPause:A,onEnd:d,uploadStatus:g={status:"",progress:0}})=>{const m=Z.useMemo(()=>t.type===Ua.IMAGE?O.jsx("img",{alt:"Image not found",className:"qc:size-full qc:rounded-t qc:object-contain",src:t.compressedFile?URL.createObjectURL(t.compressedFile):""}):O.jsx(k0e,{fit:"contain",showFullscreen:!1,src:URL.createObjectURL(t.originalFile),playing:u,onPlay:c,onPause:A,onEnd:d}),[t.type,t.status,u]);return O.jsxs("div",{className:"qc:relative",children:[O.jsxs("div",{className:y0("qc:border-border qc:relative qc:h-44 qc:max-h-screen qc:overflow-hidden qc:rounded qc:border qc:sm:h-80",!e&&"qc:rounded-b"),children:[(t.status===z3.WAITING||t.status===z3.PROCESSING)&&O.jsx("div",{className:"qc:absolute qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:gap-2",children:O.jsx("span",{className:"qc:text-sm qc:text-gray-500",children:"Processing"})}),t.status===z3.DONE&&m,(g.status===qo.WAITING||g.status===qo.UPLOADING)&&O.jsxs("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:absolute qc:left-0 qc:top-0 qc:z-0 qc:h-full qc:bg-opacity-75",style:{width:`${g.progress}%`}}),O.jsx("h3",{className:"qc:text-foreground qc:z-10 qc:text-center qc:font-medium",children:g.status===qo.WAITING?"Waiting...":Math.round(g.progress)===100?"Finalizing...":`Uploading (${Math.round(g.progress)}%)`})]}),(g.status===qo.DONE||g.status===qo.ERROR)&&O.jsx("div",{className:"qc:bg-background qc:absolute qc:left-0 qc:top-0 qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:bg-opacity-75",children:g.status===qo.DONE?O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-foreground qc:text-success qc:size-12",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m9.55 15.15l8.475-8.475q.3-.3.7-.3t.7.3t.3.713t-.3.712l-9.175 9.2q-.3.3-.7.3t-.7-.3L4.55 13q-.3-.3-.288-.712t.313-.713t.713-.3t.712.3z"})}):O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:text-foreground qc:text-destructive qc:size-12",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"})})})]}),O.jsx("button",{disabled:i,className:"qc:text-primary qc:bg-destructive qc:absolute qc:right-4 qc:top-4 qc:cursor-pointer qc:rounded-full qc:p-1 qc:transition-all qc:hover:bg-opacity-100 qc:sm:bg-opacity-50 qc:sm:p-2",onClick:()=>a(t.uid),children:O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-5 qc:text-white",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"m12 13.4l-4.9 4.9q-.275.275-.7.275t-.7-.275t-.275-.7t.275-.7l4.9-4.9l-4.9-4.9q-.275-.275-.275-.7t.275-.7t.7-.275t.7.275l4.9 4.9l4.9-4.9q.275-.275.7-.275t.7.275t.275.7t-.275.7L13.4 12l4.9 4.9q.275.275.275.7t-.275.7t-.7.275t-.7-.275z"})})}),(e||r)&&O.jsx("div",{className:"qc:mt-3 qc:w-full qc:space-y-3",children:O.jsx("textarea",{rows:2,value:n,className:y0("qc:border-primary qc:shadow-outer qc:placeholder:text-primary qc:block qc:w-full qc:rounded qc:border qc:px-3 qc:py-2.5 qc:font-bold qc:placeholder:opacity-50 qc:focus:border-primary-light qc:focus:outline-none qc:focus:ring-primary-light",i?"qc:text-muted qc:bg-transparent":"qc:text-foreground qc:bg-white qc:bg-opacity-75"),disabled:i,onChange:b=>s(b.target.value),placeholder:"Caption"})})]},t.uid)},Yx=100,wB=1024*1024*5,uje=new $Y({concurrency:1,autostart:!0}),cje=new $Y({concurrency:3,autostart:!0}),fje={hidden:{opacity:0,scale:.8},visible:e=>({opacity:1,scale:1,transition:{delay:e*.1,duration:.3}}),exit:{opacity:0,scale:.8,transition:{duration:.3}}},Aje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const{eventSlug:e}=q4(),r=Wa(),{props:{organizationId:t,loginUrl:a},loadingUser:n,user:i,organization:s}=G0(),{event:u}=o6({eventSlug:e}),{increment:c}=eX(u),[A,d]=Z.useState(!1),[g,m]=Z.useState([]),[b,w]=Z.useState({}),[E,x]=Z.useState(null),[_,I]=Z.useState(null),[S,R]=Z.useState({}),[M,N]=Z.useState(0),[L,F]=Z.useState(0),[B,G]=Z.useState({}),V=Z.useRef(0);Z.useEffect(()=>{i&&ee()},[i]);const ee=async()=>{d(!0);try{const Q=await at.get($r.GET_UPLOAD_COUNT,{searchParams:{eventSlug:e},headers:{"x-org-id":t,Authorization:i?`Bearer ${i.token}`:void 0}}).json();if(Q.error)throw new Error(Q.error);R(Q.data.uploadCount)}catch(Q){console.error(Q),x("Failed to fetch upload count")}d(!1)},K=async Q=>new Promise(ne=>{const pe=Q.originalFile;if(pe){const he=document?.createElement("video");he.onloadedmetadata=()=>{ne(he.duration)};const ye=URL.createObjectURL(pe);he.src=ye}else ne(0)}),$=async Q=>{if(Q.type===Ua.IMAGE){m(pe=>pe.map(he=>he.uid===Q.uid?{...he,status:z3.PROCESSING}:he));const ne=await sje(Q);m(pe=>pe.map(he=>he.uid===Q.uid?{...he,...ne,status:z3.DONE}:he))}else if(Q.type===Ua.VIDEO){m(pe=>pe.map(he=>he.uid===Q.uid?{...he,status:z3.PROCESSING}:he));const ne=await K(Q);m(pe=>pe.map(he=>he.uid===Q.uid?{...he,length:ne,status:z3.DONE}:he))}},re=Q=>{const ne=g.filter(pe=>pe.uid!==Q);m(ne)},z=Q=>{const ne=u?.uploadLimit-S[pl.APPROVED]-S[pl.IN_REVIEW]-S[pl.REJECTED],pe=[];Array.from(Q).forEach(he=>{if(!g.some(ye=>ye.originalFile.name===he.name)){const ye={uid:HY(),originalFile:he,type:oje(he),status:z3.WAITING};pe.push(ye)}}),!(g.length+pe.length>Yx)&&(pe.slice(0,Math.min(ne-g.length,Yx-g.length)).forEach(he=>uje.push(()=>$(he))),m([...g,...pe]))},U=async({uid:Q,groupId:ne,groupContentCount:pe,eventId:he,content:ye,contentData:Ee})=>{G(De=>({...De,[Q]:{status:qo.UPLOADING,progress:0}}));const Me=Math.ceil(ye.size/wB);for(let De=0;De<Me;De++){const ge=De*wB,Oe=Math.min(ye.size,ge+wB),Ke=ye.slice(ge,Oe);try{const Je=new FormData;Je.append("groupId",ne),Je.append("groupContentCount",pe),Je.append("eventId",he),Je.append("contentData",JSON.stringify(Ee)),Je.append("integrationUpload",!0),Je.append("uid",Q),Je.append("chunk",Ke),Je.append("chunkIndex",De),Je.append("totalChunks",Me),await at.post($r.SINGLE_UPLOAD,{body:Je,headers:{"x-org-id":t,Authorization:i?`Bearer ${i.token}`:void 0}})}catch(Je){console.error(Je),G(h1=>({...h1,[Q]:{status:qo.FAILED,progress:0}}));break}}R(De=>({...De,[u?.autoApprove?pl.APPROVED:pl.IN_REVIEW]:De[u?.autoApprove?pl.APPROVED:pl.IN_REVIEW]+1})),G(De=>({...De,[Q]:{status:qo.DONE,progress:100}})),V.current-=1,m(De=>De.filter(ge=>ge.uid!==Q)),u?.autoApprove||c(),V.current===0&&(w({}),m([]),N(0),F(0),G({}),Lr.success(u?.visibility===IV.PRIVATE&&u?.autoApprove?"Content uploaded":"Upload successful, waiting for approval"))},j=async(Q=!0)=>{x(null);let ne=!0;if(u?.ada){for(let ye=0;ye<g.length;ye++)if(!b[g[ye].uid]){ne=!1;break}}if(!ne){x("Caption are needed for each image");return}N(g.length),F(0),V.current=g.length;const pe=`upload-group-${HY()}`;g.forEach(ye=>{cje.push(()=>U({uid:ye.uid,groupId:pe,groupContentCount:g.length,eventId:u?._id,content:ye.compressedFile?ye.compressedFile:ye.originalFile,contentData:{type:ye.type,caption:b[ye.uid],colors:ye.colors,sizes:{original:ye.originalFile.size,clientCompressed:ye.compressedFile?.size},processingTimes:{client:ye.clientProcessingTime},location:{latitude:ye.exif?.GPSLatitude?.description,longitude:ye.exif?.GPSLongitude?.description},exif:ye.exif,capturedAt:ye.exif?.DateTimeOriginal?.description}}))});const he={};g.forEach(ye=>{he[ye.uid]={status:qo.WAITING,progress:0}}),G(he)},W=u?u?.uploadLimit-(S?S[pl.APPROVED]+S[pl.IN_REVIEW]+S[pl.REJECTED]:0):0,J=Z.useMemo(()=>Object.values(B).some(Q=>[qo.WAITING,qo.UPLOADING].includes(Q.status)),[B]);let X=!0;for(let Q=0;Q<g.length;Q++)if(g[Q].status!==z3.DONE){X=!1;break}const Y=A||!u||!i||u?.status!==Wi.OPEN||g.length>=Math.min(W,Yx)||J,se=u?u?.enableVideo?[...Qg,...$x]:Qg:[];if(n)return O.jsx(Kt,{className:"qc:mx-auto qc:mt-8 qc:h-6 qc:w-64"});if(!i)if(s.customAuth)if(a)window.history.pushState({},"",a);else return O.jsx(i6,{title:"Please login to upload content"});else return O.jsx(jf,{to:nr.LOGIN,state:{referrer:r.pathname}});return O.jsxs("div",{className:"qc:relative qc:min-h-[80vh] qc:w-full qc:space-y-8 qc:bg-background",children:[O.jsx("div",{className:"qc:flex qc:flex-row qc:justify-end",children:O.jsx(i$,{event:u})}),O.jsx(A0,{variant:"h3",align:"center",immutable:!0,children:u?.name}),A&&O.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:pb-8",children:[O.jsx(Kt,{className:"qc:mx-auto qc:h-7 qc:w-64"}),O.jsx(Kt,{className:"qc:mx-auto qc:h-56 qc:w-full qc:max-w-xl"})]}),!A&&i&&u?u?.status!==Wi.OPEN?O.jsxs("div",{className:"qc:mt-16 qc:flex qc:flex-col qc:items-center qc:gap-8",children:[O.jsx(i6,{title:"Event not open",description:"Please find some open event to upload content",iconSvg:O.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-full",viewBox:"0 0 885.86993 622.8043",xmlnsXlink:"http://www.w3.org/1999/xlink",role:"img",children:[O.jsx("title",{children:"through_the_park"}),O.jsx("polygon",{points:"461.601 348.37 400.416 348.37 400.416 350.344 409.958 350.344 409.958 369.094 411.932 369.094 411.932 350.344 449.098 350.344 449.098 369.094 451.072 369.094 451.072 350.344 461.601 350.344 461.601 348.37",fill:"#3f3d56"}),O.jsx("polygon",{points:"484.299 300.014 468.509 300.014 468.509 315.803 475.829 315.803 475.829 369.007 477.803 369.007 477.803 315.803 484.299 315.803 484.299 300.014",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"342.46486",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"337.53055",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("rect",{x:"400.53636",y:"332.59625",width:"61.18538",height:"1.97372",fill:"#3f3d56"}),O.jsx("path",{d:"M775.57723,513.38047h-1.97372c0-93.59519-76.14539-169.7401-169.7401-169.7401-93.59518,0-169.74009,76.14491-169.74009,169.7401H432.1496c0-94.68325,77.03057-171.71382,171.71381-171.71382C698.54714,341.66665,775.57723,418.69722,775.57723,513.38047Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"161.35177",cy:"161.35177",r:"161.35177",fill:"currentColor"}),O.jsx("path",{d:"M438.4403,192.17931a161.36436,161.36436,0,0,1-268.85975,170.77,161.36567,161.36567,0,1,0,268.85975-170.77Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"161.795 161.352 162.238 161.352 170.217 618.811 153.373 618.811 161.795 161.352",fill:"#3f3d56"}),O.jsx("rect",{x:"329.05538",y:"537.54454",width:"7.97893",height:"30.14264",transform:"translate(509.8146 -138.12101) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"755.27647",cy:"229.8063",r:"130.59346",fill:"currentColor"}),O.jsx("path",{d:"M1009.48506,281.178a130.60365,130.60365,0,0,1-217.60732,138.2163A130.60471,130.60471,0,1,0,1009.48506,281.178Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"755.635 229.806 755.994 229.806 762.452 600.06 748.819 600.06 755.635 229.806",fill:"#3f3d56"}),O.jsx("rect",{x:"920.95206",y:"560.70661",width:"6.45792",height:"24.39658",transform:"translate(843.51724 -650.35577) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"369.90725",cy:"321.70366",r:"20.55846",fill:"currentColor"}),O.jsx("path",{d:"M542.265,446.57008a20.56006,20.56006,0,0,1-34.25647,21.75847A20.56023,20.56023,0,1,0,542.265,446.57008Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"369.964 321.704 370.02 321.704 371.037 379.99 368.891 379.99 369.964 321.704",fill:"#3f3d56"}),O.jsx("rect",{x:"528.32779",y:"490.57441",width:"1.01663",height:"3.84059",transform:"translate(561.19589 -343.48173) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("circle",{cx:"559.878",cy:"255.44299",r:"52.63144",fill:"currentColor"}),O.jsx("path",{d:"M756.09357,358.88718A52.63554,52.63554,0,0,1,668.394,414.59075a52.636,52.636,0,1,0,87.69954-55.70357Z",transform:"translate(-157.06503 -138.59785)",opacity:"0.2"}),O.jsx("polygon",{points:"560.023 255.443 560.167 255.443 562.77 404.662 557.275 404.662 560.023 255.443",fill:"#3f3d56"}),O.jsx("rect",{x:"720.41323",y:"471.54209",width:"2.60265",height:"9.83225",transform:"translate(650.03004 -522.71764) rotate(62.23413)",fill:"#3f3d56"}),O.jsx("path",{d:"M354.5881,734.63564s.68149-14.27971,14.65205-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"193.57562",cy:"575.45671",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"192.43789",y:"587.23109",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M403.93115,702.06922s.68149-14.27971,14.652-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"242.91867",cy:"542.89029",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"241.78094",y:"554.66468",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M552.67,591.58462s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"392.46975",cy:"436.6403",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"391.56611",y:"445.99208",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M769.77945,556.05762s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"609.57917",cy:"401.1133",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"608.67553",y:"410.46508",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M562.53864,621.19045s.54127-11.34163,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"402.33836",cy:"466.24613",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"401.43472",y:"475.59791",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M538.854,642.90139s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"378.6537",cy:"487.95707",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"377.75006",y:"497.30885",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M803.33272,574.808s.54128-11.34162,11.63736-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"643.13244",cy:"419.86366",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"642.22881",y:"429.21544",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M483.58976,599.47951s.54127-11.34163,11.63735-10.02332",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"323.38948",cy:"444.53519",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"322.48584",y:"453.88696",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M740.17362,543.22843s.54127-11.34162,11.63735-10.02331",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"579.97334",cy:"388.28411",r:"5.55351",fill:"currentColor"}),O.jsx("rect",{x:"579.0697",y:"397.63589",width:"1.56762",height:"10.97337",fill:"#3f3d56"}),O.jsx("path",{d:"M268.73119,737.59622s.68149-14.27971,14.652-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"107.71872",cy:"578.41729",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"106.58099",y:"590.19168",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M948.67842,733.64878s.68149-14.27971,14.65205-12.61989",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"787.66594",cy:"574.46985",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"786.52822",y:"586.24423",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M891.44048,700.0955s.68149-14.27971,14.65205-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"730.42801",cy:"540.91657",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"729.29028",y:"552.69096",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M883.54559,750.42541s.6815-14.27971,14.65205-12.61988",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("circle",{cx:"722.53312",cy:"591.24648",r:"6.99217",fill:"currentColor"}),O.jsx("rect",{x:"721.39539",y:"603.02087",width:"1.97372",height:"13.81605",fill:"#3f3d56"}),O.jsx("path",{d:"M280.09142,761.08258S590.95263,679.17311,587.992,595.28993c-5.42774-23.19124-42.92846-29.1124-42.92846-29.1124s-88.81749-11.84233-40.4613-40.4613,180.59557-21.71094,180.59557-21.71094-136.18682,21.71094-75.9883,33.55327c48.35619,2.96058,110.52843,15.78978,110.52843,15.78978S846.0562,579.99358,863.8197,645.12641s2.96058,115.46273,2.96058,115.46273Z",transform:"translate(-157.06503 -138.59785)",fill:"#e6e6e6"}),O.jsx("path",{d:"M618.67289,761.40215l-1.16407-1.627q2.4668-1.76367,4.85938-3.50781l1.17773,1.61719Q621.14359,759.63213,618.67289,761.40215Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M633.18265,750.72832l-1.207-1.59375c3.23144-2.44727,6.41406-4.90918,9.46-7.31738l1.24023,1.56836C639.61917,745.80254,636.42484,748.27324,633.18265,750.72832Zm18.82324-14.89941-1.27734-1.53907c3.12793-2.59863,6.18652-5.21,9.09082-7.76074l1.32031,1.502C658.22171,730.59453,655.14847,733.21855,652.00589,735.82891Zm18.03223-15.86914-1.36914-1.459c2.98535-2.7998,5.86328-5.60254,8.55469-8.332l1.42382,1.4043C675.93851,714.32012,673.04105,717.14238,670.03812,719.95977Zm16.8584-17.14063-1.48828-1.33594c2.74218-3.05468,5.33593-6.11426,7.709-9.09277l1.56445,1.24609C692.28421,696.64531,689.66507,699.73516,686.89652,702.81914ZM701.84964,683.952,700.1973,682.825c2.32519-3.40723,4.42285-6.80859,6.23437-10.10938l1.75391.9629C706.34281,677.035,704.211,680.492,701.84964,683.952Zm11.5-21.21386-1.86133-.73047a69.37031,69.37031,0,0,0,3.39551-11.29l1.959.40234A71.21576,71.21576,0,0,1,713.34964,662.73809Zm2.66992-23.69629a47.10965,47.10965,0,0,0-1.60839-11.50684l1.93164-.52148a49.17317,49.17317,0,0,1,1.67675,11.99511Zm-5.98339-22.30274a60.32109,60.32109,0,0,0-6.65625-9.66406l1.5332-1.2832a62.27891,62.27891,0,0,1,6.87695,9.98632Zm-14.91993-18.10449a108.36226,108.36226,0,0,0-9.32617-7.34766l1.1543-1.63281a110.07889,110.07889,0,0,1,9.498,7.48438Zm-19.34863-13.78418c-3.27148-1.92285-6.80078-3.8418-10.4873-5.70312l.90039-1.78516c3.72558,1.87988,7.292,3.81933,10.60058,5.76367Zm-21.29687-10.81445c-3.48145-1.54688-7.18946-3.10352-11.02149-4.62793l.74024-1.85742c3.85547,1.5332,7.58789,3.10058,11.09375,4.65722ZM632.23539,565.157c-3.56348-1.292-7.37305-2.61816-11.32129-3.94141l.63476-1.89648c3.96387,1.3291,7.78906,2.66016,11.36817,3.957Zm-22.73145-7.64648c-3.48535-1.09961-7.2373-2.25684-11.47119-3.53907l.58008-1.91406c4.24072,1.28418,8.00048,2.44434,11.49267,3.54492Zm-22.979-6.99317c-4.0459-1.21-7.90332-2.36621-11.51465-3.47851l.58886-1.91211c3.60645,1.1123,7.458,2.2666,11.499,3.47461Zm-22.98389-7.1875a95.0565,95.0565,0,0,1-11.26416-4.53418l.89941-1.78711a92.76387,92.76387,0,0,0,11.019,4.43067Zm-15.103-13.11035-1.42578-1.40234c1.82324-1.85254,5.42969-3.665,11.02539-5.542l.63574,1.89649C553.45658,526.9207,550.01273,528.61992,548.438,530.21953Zm21.67676-8.30566-.4834-1.94141c3.459-.86133,7.39942-1.76269,11.71192-2.67871l.415,1.957C577.46878,520.16094,573.5513,521.05742,570.11478,521.91387Zm23.36963-5.01856-.375-1.96484c3.68506-.7041,7.65381-1.4336,11.79687-2.168l.34961,1.96875C601.12113,515.46465,597.16117,516.19219,593.48441,516.89531ZM617.05374,512.7l-.33007-1.97266q5.65283-.94775,11.83105-1.93847l.31641,1.97461Q622.69827,511.75371,617.05374,512.7Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M640.9307,508.865l-.30664-1.97656q2.9165-.45119,5.93554-.91114l.30079,1.97657Q643.84281,508.41387,640.9307,508.865Z",transform:"translate(-157.06503 -138.59785)",fill:"#fff"}),O.jsx("path",{d:"M685.194,305.71659l9.08474-7.26606c-7.05753-.77863-9.95734,3.07039-11.14411,6.11693-5.51363-2.28947-11.51587.711-11.51587.711l18.17688,6.59885A13.75483,13.75483,0,0,0,685.194,305.71659Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M516.44078,361.96766l9.08474-7.26605c-7.05753-.77864-9.95734,3.07039-11.14411,6.11692-5.51363-2.28946-11.51587.711-11.51587.711l18.17688,6.59885A13.75487,13.75487,0,0,0,516.44078,361.96766Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M560.84953,245.51807l9.08473-7.26606c-7.05753-.77863-9.95733,3.07039-11.14411,6.11693-5.51363-2.28947-11.51587.711-11.51587.711l18.17688,6.59885A13.75484,13.75484,0,0,0,560.84953,245.51807Z",transform:"translate(-157.06503 -138.59785)",fill:"#3f3d56"}),O.jsx("path",{d:"M659.609,569.03965s-7.86875,0-8.74306,4.80868-2.18577,57.267-1.31146,63.82431.87431,5.24584.87431,5.24584-1.743,12.4609,2.18858,13.00631S656.5489,641.607,656.5489,641.607l3.06008-53.33264Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M693.7069,569.03965s7.86875,0,8.74306,4.80868,2.18577,57.267,1.31146,63.82431-.8743,5.24584-.8743,5.24584,1.743,12.4609-2.18859,13.00631S696.767,641.607,696.767,641.607l-3.06008-53.33263Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M658.29752,751.76952h-3.49721a7.86866,7.86866,0,0,0-7.86875,7.86857v.00018H668.352V749.58375H658.29752Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("path",{d:"M691.95829,751.76952h3.49721a7.86867,7.86867,0,0,1,7.86875,7.86857v.00018H681.90377V749.58375h10.05452Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"516.09568",cy:"409.02131",r:"11.36598",fill:"#9e616a"}),O.jsx("path",{d:"M670.53781,553.73931s-1.31146,14.426-3.06008,15.73749,18.36042-.8743,18.36042-.8743-6.99444-10.49167-5.683-13.98889S670.53781,553.73931,670.53781,553.73931Z",transform:"translate(-157.06503 -138.59785)",fill:"#9e616a"}),O.jsx("path",{d:"M696.32981,569.03965s-24.04341-10.05451-39.78091,0c0,0-3.93436,10.05451-.87431,15.7375s7.86875,19.23472,3.06008,28.41493.43716,5.24584.43716,5.24584-6.12014,24.48056-6.99445,43.71525,2.62293,88.30487,5.24583,88.742,10.92883,1.31146,11.80314,0,6.99444-92.67636,6.99444-92.67636,2.62292,93.55069,5.24582,93.55069,9.61737,0,10.92883-2.18577,12.24027-86.55625,8.30591-104.04235-6.55729-26.22917-6.55729-26.22917,4.80867-3.06007,3.49723-4.80869-7.86877-20.54616-4.80869-23.60625S696.32981,569.03965,696.32981,569.03965Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"523.30871",cy:"402.17104",r:"18.36042",fill:"#2f2e41"}),O.jsx("path",{d:"M691.83867,531.57749a12.36814,12.36814,0,0,1-9.33162-14.29294c-.05359.188-.104.37762-.14921.57a12.36847,12.36847,0,0,0,24.0811,5.65832c.0452-.19233.08448-.38459.12022-.57676A12.36815,12.36815,0,0,1,691.83867,531.57749Z",transform:"translate(-157.06503 -138.59785)",fill:"#2f2e41"}),O.jsx("circle",{cx:"535.52108",cy:"386.38703",r:"8.98489",fill:"#2f2e41"})]})}),O.jsx(Jt,{to:nr.PUBLIC_EVENTS,state:{internalNavigation:!0},children:O.jsx(gt,{children:"All events"})})]}):O.jsxs(Z.Fragment,{children:[O.jsxs(A0,{variant:"h5",align:"center",children:["Available entries : ",O.jsx("span",{className:"qc:text-primary",children:W})]}),g.length<=0&&O.jsx("div",{className:"qc:flex qc:w-full qc:flex-auto qc:justify-center qc:mt-6",children:O.jsx(Ig,{accept:(()=>{const Q={},ne=se.filter(he=>Qg.includes(he)),pe=se.filter(he=>$x.includes(he));return ne.length>0&&(Q["image/*"]=ne.map(he=>`.${he}`)),pe.length>0&&(Q["video/*"]=pe.map(he=>`.${he}`)),Q})(),multiple:!0,disabled:Y,onDrop:z,children:({getRootProps:Q,getInputProps:ne,isDragActive:pe})=>O.jsxs("div",{...Q(),className:y0("qc:bg-background qc:w-auto qc:max-w-2xl qc:rounded qc:border-2 qc:border-dashed qc:px-4 qc:py-12 qc:text-center",g.length>=W?"qc:border-border":"",Y?"qc:border-border qc:hover:cursor-not-allowed":"qc:border-primary qc:hover:cursor-pointer"),children:[O.jsx("input",{...ne()}),O.jsxs("svg",{className:y0(Y?"qc:text-gray-500":"qc:text-primary","qc:mx-auto qc:size-12"),xmlns:"http://www.w3.org/2000/svg",width:"24",height:"24",viewBox:"0 0 24 24",children:[O.jsx("rect",{x:"0",y:"0",width:"24",height:"24",fill:"none",stroke:"none"}),O.jsx("path",{fill:"currentColor",d:"M19.35 10.04A7.49 7.49 0 0 0 12 4C9.11 4 6.6 5.64 5.35 8.04A5.994 5.994 0 0 0 0 14c0 3.31 2.69 6 6 6h13c2.76 0 5-2.24 5-5c0-2.64-2.05-4.78-4.65-4.96zM14 13v4h-4v-4H7l5-5l5 5h-3z"})]}),O.jsx("span",{className:y0(Y?"qc:text-muted":"qc:text-foreground","qc:mt-2 qc:block qc:font-medium"),children:pe?"Drop files here...":`Select Images ${u?.enableVideo?"or Videos (60s)":""} to upload (${g.length}/${Math.min(W,Yx)})`}),!J&&O.jsx("div",{className:"qc:text-muted-foreground qc:mt-6 qc:w-full qc:text-center qc:text-xs qc:italic",children:"* Only your new, original photos will be eligible for upload. Our team will review them before publication."})]})})}),O.jsx("div",{className:"qc:grid qc:grid-cols-2 qc:gap-6 qc:sm:pt-3 qc:lg:grid-cols-3 qc:xl:grid-cols-4",children:O.jsxs(uRe,{children:[g.map((Q,ne)=>O.jsx(kee.div,{layout:!0,variants:fje,initial:"hidden",animate:"visible",exit:"exit",custom:ne,className:"qc:relative",children:O.jsx(lje,{enableCaption:u?.enableCaption,enableAICaption:u?.enableAICaption,ada:u?.ada,content:Q,disabled:J,removeImage:re,caption:b[Q.uid],onCaptionChange:pe=>{w(he=>({...he,[Q.uid]:pe}))},playingVideo:_===Q.uid,onPlay:()=>I(Q.uid),onPause:()=>I(null),onEnd:()=>I(null),uploadStatus:B[Q.uid]})},Q.uid)),g.length>0&&W>0&&O.jsx(Ig,{accept:(()=>{const Q={},ne=se.filter(he=>Qg.includes(he)),pe=se.filter(he=>$x.includes(he));return ne.length>0&&(Q["image/*"]=ne.map(he=>`.${he}`)),pe.length>0&&(Q["video/*"]=pe.map(he=>`.${he}`)),Q})(),multiple:!0,disabled:Y,onDrop:z,children:({getRootProps:Q,getInputProps:ne,isDragActive:pe})=>O.jsxs("div",{...Q(),children:[O.jsx("input",{...ne()}),O.jsxs(kee.button,{type:"button",layout:!0,initial:{opacity:0,scale:.8},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.8},transition:{duration:.3},className:y0("qc:border-primary qc:bg-background qc:hover:border-primary qc:text-foreground qc:hover:text-primary qc:flex qc:size-full qc:flex-col qc:items-center qc:justify-center qc:gap-3 qc:rounded qc:border-2 qc:border-dashed qc:p-12 qc:hover:border-2 qc:focus:outline-none qc:sm:min-h-72",pe?"qc:bg-primary qc:bg-opacity-15":"qc:bg-background qc:bg-opacity-100"),children:[O.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",className:"qc:size-14",viewBox:"0 0 24 24",children:O.jsx("path",{fill:"currentColor",d:"M5.616 20q-.691 0-1.153-.462T4 18.384V5.616q0-.691.463-1.153T5.616 4h6.5q.212 0 .356.144t.144.357t-.144.356t-.356.143h-6.5q-.27 0-.443.173T5 5.616v12.769q0 .269.173.442t.443.173h12.769q.269 0 .442-.173t.173-.443v-6.5q0-.212.144-.356t.357-.144t.356.144t.143.356v6.5q0 .691-.462 1.153T18.384 20zm1.153-3.616h10.462L14 12.077l-3 3.789l-2-2.404zM17 7h-1.5q-.213 0-.356-.144T15 6.499t.144-.356T15.5 6H17V4.5q0-.213.144-.356T17.501 4t.356.144T18 4.5V6h1.5q.213 0 .356.144t.144.357t-.144.356T19.5 7H18v1.5q0 .213-.144.356T17.499 9t-.356-.144T17 8.5z"})}),O.jsx(A0,{variant:"h5",children:pe?"Drop files here...":"Add Image"})]})]})})]})}),g.length>0&&O.jsx(gt,{fullWidth:!0,loading:J,onClick:j,icon:"material-symbols:upload-rounded",disabled:!u||J||!X,children:J?`Uploading (${L}/${M})`:"Upload"})]}):null,g.length<=0&&O.jsx(Jt,{to:nr.GALLERY(e),state:{internalNavigation:!0},children:O.jsx(A0,{variant:"h5",align:"center",children:"Goto gallery"})})]})}},Symbol.toStringTag,{value:"Module"})),EB=({title:e,entries:r=[],showFloatingPoint:t=!1,hidePictures:a=!0})=>{const n=e.replace(/\s+/g,"-").toLowerCase(),i=s=>{if(!s)return"";const u=s.trim().split(" ");return u.length===1?u[0]:`${u[0]} ${u[1][0]}.`};return O.jsxs("div",{className:"qc:border-border qc:mx-auto qc:flex qc:max-w-lg qc:flex-col qc:space-y-4 qc:rounded qc:border qc:p-4 qc:lg:space-y-8",children:[O.jsx(A0,{variant:"h4",align:"center",color:"primary",children:e}),r.length===0?O.jsx(A0,{variant:"h5",align:"center",color:"error",children:"Not available"}):O.jsxs("div",{className:"",children:[O.jsxs("div",{className:"qc:flex qc:w-full qc:items-end qc:justify-center qc:gap-4 qc:lg:gap-24",children:[r.length>1&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-warning qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"2"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[1].name)}),O.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[1].totalPoint===void 0?r[1].maxScore?.toFixed(t?2:0):r[1].totalPoint?.toFixed(t?2:0)})]}),r.length>0&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-destructive qc:text-primary-foreground qc:flex qc:size-24 qc:items-center qc:justify-center qc:rounded-full qc:text-4xl",children:"1"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[0].name)}),O.jsx("div",{className:"qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[0].totalPoint===void 0?r[0].maxScore?.toFixed(t?2:0):r[0].totalPoint?.toFixed(t?2:0)})]}),r.length>2&&O.jsxs("div",{className:"qc:flex qc:flex-col qc:items-center qc:justify-center",children:[O.jsx("div",{className:"qc:bg-success qc:text-primary-foreground qc:flex qc:size-16 qc:items-center qc:justify-center qc:rounded-full qc:text-2xl",children:"3"}),O.jsx("div",{className:"qc-text-primary qc-mt-3 qc-text-center qc-font-semibold",children:i(r[2].name)}),O.jsx("div",{className:"qc:text-foreground qc:text-primary qc:mt-1 qc:text-center qc:font-semibold",children:r[2].totalPoint===void 0?r[2].maxScore?.toFixed(t?2:0):r[2].totalPoint?.toFixed(t?2:0)})]})]}),O.jsx("div",{className:"qc:mt-6",children:O.jsx("div",{className:"qc:-my-2 qc:overflow-x-auto qc:sm:-mx-6 qc:lg:-mx-8",children:O.jsx("div",{className:"qc:inline-block qc:min-w-full qc:py-2 qc:align-middle qc:md:px-6 qc:lg:px-8",children:O.jsx("div",{className:"qc:shadow-outer qc:overflow-hidden qc:ring-1 qc:ring-black qc:ring-opacity-5 qc:md:rounded",children:O.jsx("table",{className:"qc:w-full qc:divide-y qc:divide-gray-300",children:O.jsx("tbody",{className:"qc:bg-background qc:bg-opacity-50",children:r.slice(3).map((s,u)=>O.jsxs("tr",{children:[O.jsx("td",{className:"qc:text-muted qc:whitespace-nowrap qc:py-4 qc:pl-4 qc:text-sm qc:font-medium",children:O.jsx("span",{className:"qc:px-2",children:u+4})}),O.jsx("td",{className:"qc:whitespace-nowrap qc:py-4",children:O.jsxs("div",{className:"qc:flex qc:items-center",children:[!a&&O.jsx("div",{className:"qc:size-8 qc:shrink-0"}),O.jsx("div",{className:"qc-ml-4",children:O.jsx("div",{className:"qc-text-primary qc-font-medium",children:i(s.name)})})]})}),O.jsx("td",{className:"qc:text-foreground qc:whitespace-nowrap qc:py-4 qc:pr-4 qc:text-right qc:text-base qc:font-medium qc:italic",children:s.totalPoint===void 0?s.maxScore?.toFixed(t?2:0):s.totalPoint?.toFixed(t?2:0)})]},`${n}-${u}`))})})})})})})]})]})},dje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const{eventSlug:e}=q4(),{props:{organizationId:r}}=G0(),{event:t}=o6({eventSlug:e}),{isLoading:a,data:n}=Gh({queryKey:[`leaderboard-${r}-${t?._id}`],queryFn:async()=>(await at.get($r.GET_LEADERBOARD,{headers:{"x-org-id":r},searchParams:{eventId:t?._id}}).json()).data,enabled:!!t});return a?O.jsxs("div",{className:y0("qc:mt-4 qc:flex qc:bg-background qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",t?.engagementStyle===qn.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[O.jsxs("div",{className:"qc:flex-1",children:[O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:rounded"}),O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:rounded"})]}),O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:t?.engagementStyle===qn.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:t?.engagementStyle===qn.CONTEST,entries:n?.leaderboardByScore?.topRankers||[],pointName:t?.pointName})})]}):O.jsxs("div",{className:y0("qc:mt-4 qc:flex qc:min-h-[80vh] qc:w-full qc:gap-8 qc:px-2 qc:py-4 qc:sm:px-0 qc:lg:gap-0 qc:lg:py-8",t?.engagementStyle===qn.REACTION?"qc:flex-col-reverse qc:md:flex-row-reverse qc:md:justify-between":"qc:flex-col qc:md:flex-row"),children:[O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:"Point Leaders",entries:n?.leaderboardByPoint?.topRankers||[],pointName:t?.pointName})}),O.jsx("div",{className:"qc:flex-1",children:O.jsx(EB,{title:t?.engagementStyle===qn.REACTION?"Reaction Counts":"Top Rated Photos",showFloatingPoint:t?.engagementStyle===qn.CONTEST,entries:n?.leaderboardByScore?.topRankers||[],pointName:t?.pointName})})]})}},Symbol.toStringTag,{value:"Module"})),_0e=(e,r)=>`${Number.parseFloat(e?.toFixed(r)??0)}`,C0e=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:bg-green-500";case 1:return"qc:bg-lime-500";case 2:return"qc:bg-yellow-500";case 3:return"qc:bg-orange-500";case 4:return"qc:bg-red-500";default:return"qc:bg-background-500"}},hje=(e,r)=>{switch(Math.floor(Math.abs(e-r))){case 0:return"qc:border-t-green-500";case 1:return"qc:border-t-lime-500";case 2:return"qc:border-t-yellow-500";case 3:return"qc:border-t-orange-500";case 4:return"qc:border-t-red-500";default:return"qc:border-t-color-500"}},S0e=({position:e,maxPosition:r=4,content:t,isOverlapping:a,colorclsx:n,borderColorclsx:i})=>{const s=e/r*100;let u="qc:transform qc:-translate-x-1/2 qc:left-1/2";e<2?u="qc:left-0":e>3&&(u="qc:right-0 qc:transform qc:-translate-x-full");const c=a?"qc:-top-1.5":"qc:bottom-full";return O.jsxs("div",{className:"qc:relative",children:[O.jsx("div",{style:{left:`${s}%`},className:`qc:absolute ${c} qc:text-primary-foreground qc:mb-0.5 qc:w-fit qc:whitespace-nowrap qc:rounded-md qc:px-2 qc:py-1 qc:text-sm qc:md:mb-1 ${u} qc:transition-all qc:duration-500 qc:ease-in-out ${n}`,children:t}),O.jsx("div",{style:{left:`${s}%`},className:`qc:absolute ${c} qc:-mb-1.5 qc:size-0 qc:border-x-4 qc:border-t-[1rem] qc:border-transparent ${u} qc:transition-all qc:duration-500 qc:ease-in-out ${i}`})]})},pje=e=>{const{crowdScore:r,userScore:t}=e,a=1,[n,i]=Z.useState(0);Z.useEffect(()=>{setTimeout(()=>{i(t-1)},300)},[t]);const s=r-1,u=t-1,c=Math.abs(s-u)<a;return O.jsxs("div",{className:y0("qc:relative qc:h-4",c?"qc:mb-3":"qc:mb-0"),children:[O.jsx("div",{className:"qc:absolute qc:top-1/2 qc:h-0.5 qc:w-full qc:bg-border-primary-light"}),O.jsx("div",{style:{left:`${(s<n?s:n)/4*100}%`,right:`calc(100% - ${(s<n?n:s)/4*100}%)`},className:y0("qc:absolute qc:top-1/2 qc:h-1 qc:rounded",C0e(s,u))}),O.jsx(S0e,{position:s,content:`crowd · ${_0e(r,1)}`,isOverlapping:!1,colorclsx:"qc:bg-primary",borderColorclsx:"qc:border-t-primary"}),O.jsx(S0e,{position:n,content:`you · ${_0e(t,1)}`,isOverlapping:c,colorclsx:C0e(s,u),borderColorclsx:hje(s,u)})]})},mje=Z.lazy(()=>Promise.resolve().then(()=>Ir1)),gje=Z.lazy(()=>Promise.resolve().then(()=>Sue)),bje=({feedback:e})=>{const r="#374151",[t,a]=Z.useState(10);return Z.useEffect(()=>{const n=(e?.parameters||[]).reduce((i,s)=>i+Math.abs(parseFloat(s.crowdRating)-parseFloat(s.userRating)),0);a(n.toFixed?n.toFixed(2):0)},[e]),e?O.jsxs("div",{className:"qc:w-full",children:[e.rateCount<=0&&O.jsxs("div",{className:"qc:-mt-4 qc:mb-4 qc:flex qc:flex-col qc:items-center",children:[O.jsx(gje,{className:"qc:h-auto qc:w-72 qc:sm:h-72 qc:sm:w-auto",src:"https://res.cloudinary.com/dxtjlcra0/raw/upload/v1740374960/star-explode_h2nytb.lottie",autoplay:!0,loop:!0}),O.jsx(A0,{variant:"h5",align:"center",children:"Congratulations! You are the first to rate"})]}),e.rateCount>0&&O.jsxs("div",{className:"qc:mt-4",children:[(e.parameters||[]).map(n=>O.jsxs("div",{className:"qc:mt-4 qc:space-y-4",children:[O.jsx(A0,{variant:"h5",children:n.name}),O.jsx(pje,{crowdScore:parseFloat(n.crowdRating),userScore:parseFloat(n.userRating)})]},n.name)),O.jsxs("div",{className:"qc:mt-4 qc:flex qc:w-full qc:flex-col qc:items-center",children:[O.jsx(mje,{nrOfLevels:10,percent:(10-t)/10,colors:["#ef4444","#22c55e"],textColor:r,needleColor:r,needleBaseColor:r}),O.jsx(A0,{variant:"h6",children:"Alignment with crowd"})]})]})]}):null},vje=Z.lazy(()=>Promise.resolve().then(()=>Sue)),yje=({parameter:e,selected:r,onChange:t,showValues:a=!0})=>O.jsxs("div",{className:"qc:mb-8 qc:flex qc:w-full qc:flex-col qc:gap-2 qc:lg:mb-12 qc:lg:gap-4",children:[O.jsx(A0,{variant:"h4",className:"qc:text-center qc:font-semibold qc:text-primary-light qc:md:text-left",children:e.name}),O.jsx("div",{className:"qc:grid qc:w-full qc:grid-cols-5 qc:gap-1 qc:lg:gap-2",children:(e.tooltips||[]).map(n=>{const i=`${e._id}-option-${n.value}`;return O.jsxs("div",{children:[O.jsxs("button",{type:"button",className:y0("qc:border-primary qc:shadow-outer qc:flex qc:size-full qc:min-h-12 qc:items-center qc:justify-center qc:rounded qc:border qc:transition-all qc:duration-100 qc:active:scale-90",r===n.value?"qc:bg-primary":"qc:bg-background"),onClick:()=>{r!==n.value&&t?.(n.value)},children:[e.mode===oI.TEXT&&O.jsx("div",{className:y0("qc:p-1 qc:text-center qc:text-xs qc:font-semibold qc:md:p-2 qc:md:text-base",r===n.value?"qc:text-primary-foreground":"qc:text-foreground"),children:n.label}),e.mode===oI.IMAGE&&O.jsx("img",{className:"qc:h-12 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-16",src:n.imageUrl,alt:n.value}),e.mode===oI.LOTTIE&&O.jsx(vje,{className:"qc:h-16 qc:w-auto qc:rounded-md qc:object-contain qc:lg:h-24",src:n.imageUrl,autoplay:!0,loop:!0})]}),a&&O.jsx("div",{className:"qc:mt-1 qc:w-full qc:text-center",children:O.jsx("span",{className:"qc:text-foreground qc:inline-flex qc:items-center qc:px-2 qc:py-[0.0625] qc:text-xs qc:font-medium qc:md:px-3 qc:md:py-0.5",children:n.value})})]},i)})})]});var T0e=function(e,r){var t=typeof Symbol=="function"&&e[Symbol.iterator];if(!t)return e;var a=t.call(e),n,i=[],s;try{for(;(r===void 0||r-- >0)&&!(n=a.next()).done;)i.push(n.value)}catch(u){s={error:u}}finally{try{n&&!n.done&&(t=a.return)&&t.call(a)}finally{if(s)throw s.error}}return i};function wje(e,r,t){for(var a=e.length,n=r.length,i=a+n,s={1:0},u=0;u<=i;++u)for(var c=-u;c<=u;c+=2){var A=void 0;c===-u||c!==u&&s[c-1]+1<s[c+1]?A=s[c+1]:A=s[c-1]+1;for(var d=A-c;A<a&&d<n&&t(e[A],r[d]);)A++,d++;if(A===a&&d===n)return u;s[c]=A}return-1}var Nr;(function(e){e[e.none=0]="none",e[e.horizontal=1]="horizontal",e[e.vertical=2]="vertical",e[e.diagonal=4]="diagonal",e[e.all=7]="all"})(Nr||(Nr={}));function xB(e,r,t,a,n,i,s,u,c,A,d){var g,m,b,w;if(s===0){d("same",e,r,t,a,n,i);return}else if(s===t-r+(i-n)){var E=(u&Nr.horizontal?1:0)+(c&Nr.vertical?1:0),x=(u&Nr.vertical?1:0)+(c&Nr.horizontal?1:0);E>=x?(r!==t&&d("remove",e,r,t,a,n,n),n!==i&&d("add",e,t,t,a,n,i)):(n!==i&&d("add",e,r,r,a,n,i),r!==t&&d("remove",e,r,t,a,i,i));return}for(var _=t-r,I=i-n,S=Math.floor(I/2),R={},M=-s-1;M<=s+1;++M)R[M]={d:1/0,segments:0,direct:Nr.none};for(var N=(g={},g[-s-1]={d:1/0,segments:0,direct:Nr.none},g[s+1]={d:1/0,segments:0,direct:Nr.none},g),L=0;L<=S;++L){m=T0e([N,R],2),R=m[0],N=m[1];for(var F=function(re){var z=L+re;if(L===0&&z===0)return R[re]={d:0,segments:0,direct:u},"continue";var U=[{direct:Nr.horizontal,d:R[re-1].d+1,segments:R[re-1].segments+(R[re-1].direct&Nr.horizontal?0:1)},{direct:Nr.vertical,d:N[re+1].d+1,segments:N[re+1].segments+(N[re+1].direct&Nr.vertical?0:1)}];z>0&&z<=_&&L>0&&L<=I&&A(e[r+z-1],a[n+L-1])&&U.push({direct:Nr.diagonal,d:N[re].d,segments:N[re].segments+(N[re].direct&Nr.diagonal?0:1)});var j=U.reduce(function(W,J){return W.d>J.d||W.d===J.d&&W.segments>J.segments?J:W});U.forEach(function(W){j.d===W.d&&j.segments===W.segments&&(j.direct|=W.direct)}),R[re]=j},M=-s;M<=s;++M)F(M)}for(var B={},M=-s-1;M<=s+1;++M)B[M]={d:1/0,segments:0,direct:Nr.none};for(var G=(b={},b[-s-1]={d:1/0,segments:0,direct:Nr.none},b[s+1]={d:1/0,segments:0,direct:Nr.none},b),L=I;L>=S;--L){w=T0e([G,B],2),B=w[0],G=w[1];for(var V=function(z){var U=L+z;if(L===I&&U===_)return B[z]={d:0,segments:0,direct:c},"continue";var j=[{direct:Nr.horizontal,d:B[z+1].d+1,segments:B[z+1].segments+(B[z+1].direct&Nr.horizontal?0:1)},{direct:Nr.vertical,d:G[z-1].d+1,segments:G[z-1].segments+(G[z-1].direct&Nr.vertical?0:1)}];U>=0&&U<_&&L>=0&&L<I&&A(e[r+U],a[n+L])&&j.push({direct:Nr.diagonal,d:G[z].d,segments:G[z].segments+(G[z].direct&Nr.diagonal?0:1)});var W=j.reduce(function(J,X){return J.d>X.d||J.d===X.d&&J.segments>X.segments?X:J});j.forEach(function(J){W.d===J.d&&W.segments===J.segments&&(W.direct|=J.direct)}),B[z]=W},M=s;M>=-s;--M)V(M)}for(var ee={k:-1,d:1/0,segments:0,direct:Nr.none},M=-s;M<=s;++M){var K=R[M].d+B[M].d;if(K<ee.d)ee.k=M,ee.d=K,ee.segments=R[M].segments+B[M].segments+(R[M].segments&B[M].segments?0:1),ee.direct=B[M].direct;else if(K===ee.d){var $=R[M].segments+B[M].segments+(R[M].segments&B[M].segments?0:1);($<ee.segments||$===ee.segments&&!(ee.direct&Nr.diagonal)&&B[M].direct&Nr.diagonal)&&(ee.k=M,ee.d=K,ee.segments=$,ee.direct=B[M].direct)}}S+ee.k===0&&S===0&&(S++,R[ee.k].direct=B[ee.k].direct,B[ee.k].direct=G[ee.k].direct),xB(e,r,r+S+ee.k,a,n,n+S,R[ee.k].d,u,B[ee.k].direct,A,d),xB(e,r+S+ee.k,t,a,n+S,i,B[ee.k].d,R[ee.k].direct,c,A,d)}function Eje(e,r,t,a){var n=wje(e,r,t);xB(e,0,e.length,r,0,r.length,n,Nr.diagonal,Nr.all,t,a)}function xje(e,r,t){t===void 0&&(t=function(n,i){return n===i});var a={removed:[],added:[]};return Eje(e,r,t,function(n,i,s,u,c,A,d){if(n==="add")for(var g=A;g<d;++g)a.added.push(c[g]);else if(n==="remove")for(var g=s;g<u;++g)a.removed.push(i[g])}),a}const kje=()=>{const e=Wa(),{eventSlug:r,contentId:t}=q4(),{props:{organizationId:a,loginUrl:n},user:i,loadingUser:s,organization:u}=G0(),[c,A]=Z.useState(!1),[d,g]=Z.useState(null),[m,b]=Z.useState([]),[w,E]=Z.useState(null),[x,_]=Z.useState("contain"),[I,S]=Z.useState({}),[R,M]=Z.useState(null),[N,L]=Z.useState(!1),[F,B]=Z.useState(!0),[G,V]=Z.useState(null),{loading:ee,event:K,parameters:$}=o6({eventSlug:r});Z.useEffect(()=>{K&&i&&z(K._id)},[K,i]);const re=u?.navigationSettings?.showAIDescription,z=async J=>{A(!0);try{const X=await at.get($r.CONTENT_FOR_CURATION,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:J,page:1,limit:10,includeDescription:re}}).json();if(X.error)throw new Error(X.error);const Y=t?X.data.filter(pe=>pe._id!==t):X.data;let se=Y,Q;if(t){const pe=await at.get($r.ELIGIBLE_TO_CURATE,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{contentId:t,includeDescription:re}}).json();if(pe.error)throw new Error(pe.error);const he=pe.data;se=he?[he,...Y]:Y||[],Q=he&&he.userId===i?._id?"Sorry, you cannot rate your own content":he&&he.ratingStatus===M4e.CURATED?"Sorry, you have already rated this photo.":null}const ne=await at.get($r.GET_EVENT_POINTS,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:J}}).json();if(ne.error)throw new Error(ne.error);E(ne.data),b(se),g(Q)}catch(X){console.error("Failed to fetch contents",X)}A(!1)},U=async J=>{try{const X=await at.get($r.CONTENT_FOR_CURATION,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},searchParams:{eventId:K?._id,page:1,limit:10,includeDescription:re}});if(X.error)throw new Error(X.error);if(X?.data?.length>0){const Y=xje(J,X.data,(Q,ne)=>Q._id===ne._id),se=[...J,...Y.added];b(se)}}catch(X){console.error(X)}},j=async()=>{if($.length<1){V("no parameters found");return}if(Object.keys(I).length<$.length){V("please select your ratings");return}V(null),L(!0);const J=await at.post($r.CURATE_CONTENT,{headers:{"x-org-id":a,Authorization:i?`Bearer ${i.token}`:void 0},json:{eventId:K._id,contentId:m[0]._id,parameterCount:$.length,userRatings:$.map(X=>({parameterId:X._id,weight:X.weight,rate:I[X._id]})),inappropriate:""}}).json();if(J.error)V(J.error);else{const X=J.data,Y=X.crowdRatings||{},se={parameters:$.map(ne=>({name:ne.name,crowdRating:Y[ne._id],userRating:X.ratings?.find(pe=>pe.parameterId===ne._id)?.rate})),similarity:X.similarity||null,points:X.points||0,rateCount:X.rateCount||0};M(se);const Q={...w};Q.curate+=K.activityScores.curate,E(Q)}L(!1)},W=()=>{const J=m.slice(1);g(null),M(null),S({}),J.length===I4e?U(J):b(J),B(!0)};if(s)return O.jsx(Kt,{className:"qc:mx-auto qc:h-6 qc:w-64"});if(!i)if(u.customAuth)if(n)window.history.pushState({},"",n);else return O.jsx(i6,{title:"Please login to upload content"});else return O.jsx(jf,{to:nr.LOGIN,state:{referrer:e.pathname}});return O.jsx("div",{className:"qc:min-h-[80vh] qc:bg-background",children:c||ee?O.jsxs("div",{className:"qc:mt-8 qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[O.jsx(Kt,{className:"qc:h-64 qc:w-full qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"}),O.jsx("div",{className:"qc:space-y-8",children:Array.from({length:2}).map((J,X)=>O.jsxs("div",{className:"qc:space-y-4",children:[O.jsx(Kt,{className:"qc:h-8 qc:w-36"}),O.jsx("div",{className:"qc:flex qc:w-full qc:gap-4",children:Array.from({length:5}).map((Y,se)=>O.jsx(Kt,{className:"qc:h-24 qc:w-full qc:sm:h-32"},se))})]},X))})]}):O.jsxs("div",{className:"qc:lg:mt-8",children:[K?.status===Wi.CLOSED&&O.jsx(A0,{variant:"h3",color:"primary",align:"center",children:"Event is now closed. Thank you for participating!"}),K?.status===Wi.OPEN&&m.length<=0&&O.jsx(A0,{variant:"h3",color:"primary",align:"center",children:"No content to rate. Please find another event to rate contents."}),K?.status===Wi.OPEN&&m.length>0&&O.jsxs("div",{children:[!($?.length<=0&&re)&&O.jsxs("div",{className:"qc:flex qc:w-full qc:items-center qc:justify-between",children:[O.jsxs(A0,{variant:"h4",children:["Rate this ",m[0].type===Ua.IMAGE?"image":"video"]}),O.jsxs(A0,{variant:"h4",children:[K?.pointName,":"," ",O.jsx("span",{className:"qc:text-primary",children:w.upload+w.curate})]})]}),O.jsxs("div",{className:"qc:grid qc:grid-cols-1 qc:gap-6 qc:md:grid-cols-2",children:[O.jsxs("div",{className:"qc:relative qc:mt-4 qc:w-full",children:[m[0].type===Ua.IMAGE&&O.jsx(Z.Fragment,{children:O.jsx(BR,{sizeMode:x,src:m[0].url,alt:m[0].caption,blurhash:m[0].blurhash,wrapperClassName:"qc:w-full qc:h-60 qc:md:h-[30rem] qc:md:max-h-screen qc:md:rounded"})}),m[0].type===Ua.VIDEO&&O.jsx("div",{className:"qc:mx-auto qc:h-80 qc:w-fit qc:overflow-hidden qc:rounded qc:sm:h-[30rem]",children:O.jsx(k0e,{fit:x,src:m[0].url,loop:!0,playing:F,volume:0,muted:!0,onPlay:()=>B(!0),onPause:()=>B(!1),onEnd:()=>B(!1)})}),m[0].caption&&m[0].caption.length>0&&O.jsx("div",{className:"qc:bg-background qc:absolute qc:bottom-0 qc:w-full qc:bg-opacity-75 qc:p-2",children:O.jsx(A0,{variant:"body3",lines:"2",children:m[0].caption})}),m.length>1&&O.jsx("img",{style:{display:"none"},src:m[1].url,alt:"Next image"})]}),O.jsxs("div",{className:"qc:px-2 qc:md:px-4",children:[!d&&$&&$.map(J=>O.jsx(yje,{parameter:J,selected:I[J._id],onChange:X=>S({...I,[J._id]:X})},J._id)),G&&$?.length>0&&O.jsx(A0,{variant:"h5",color:"error",children:G}),d&&$?.length>0&&O.jsx("div",{className:"qc:sm:pt-16",children:O.jsx(A0,{variant:"h5",color:"error",align:"center",children:d})}),$?.length>0&&O.jsx(gt,{type:"button",color:"primary",className:"qc:mt-4 qc:w-full",disabled:N,loading:N,icon:"material-symbols:check-rounded",onClick:d?W:j,children:d?"Rate Next Image":N?"Rating...":"Submit"}),m?.length>0&&re&&O.jsx(_je,{summary:m[0].contentSummary,url:m[0].url})]})]}),O.jsx("div",{className:"qc:mt-16",children:O.jsx(Jt,{to:nr.GALLERY(r),state:{internalNavigation:!0},children:O.jsx(A0,{color:"primary",variant:"h5",align:"center",children:"Goto gallery"})})})]}),O.jsx(AY,{open:!!R,onOpenChange:J=>!J&&W(),children:O.jsxs(dY,{children:[O.jsxs(hY,{children:[O.jsxs(pY,{className:"qc:hidden",children:[K?.pointName,": ",w?.upload+w?.curate]}),O.jsx(mY,{className:"qc:hidden",children:"We are here to help you"})]}),O.jsxs("div",{className:"qc:w-full qc:space-y-3 qc:px-3 qc:pb-6 qc:lg:px-6",children:[O.jsx(bje,{feedback:R}),O.jsx(gt,{fullWidth:!0,color:"primary",onClick:W,children:"Next"})]})]})})]})})},_je=({summary:e,url:r})=>O.jsxs("div",{className:"qc:w-full",children:[e?.subject&&O.jsx(A0,{variant:"h3",className:"qc:mb-4",align:"center",children:e?.subject}),e?.labels&&O.jsx("div",{className:"qc:space-y-2",children:Object.entries(e?.labels).filter(([t,a])=>Array.isArray(a)&&a.length>0).map(([t,a])=>O.jsxs("div",{className:"",children:[O.jsx(A0,{variant:"h4",className:"qc:mb-2 qc:font-semibold qc:capitalize",children:t.replace("_"," ")}),O.jsx("ul",{className:"qc:space-y-1 qc:pl-2",children:a.map((n,i)=>O.jsxs("li",{className:"qc:flex qc:items-center qc:gap-2",children:[O.jsx(Xa,{name:"material-symbols:check-circle-outline",className:"qc:text-primary"}),O.jsx(A0,{variant:"body1",children:n}),O.jsx("a",{href:`https://www.google.com/search?q=${encodeURIComponent(n)}`,target:"_blank",rel:"noopener noreferrer",className:"qc:ml-2",children:O.jsx(gt,{variant:"outlined",icon:"flat-color-icons:google",children:O.jsx(Xa,{name:"material-symbols:open-in-new-rounded",size:"sm"})})})]},i))})]},t))}),e?.description&&O.jsxs(Z.Fragment,{children:[O.jsx("hr",{className:"qc:my-4 qc:lg:my-8"}),O.jsx(A0,{variant:"body2",children:e?.description})]}),O.jsx("div",{className:"qc:mt-4 qc:flex qc:justify-center qc:lg:mt-8",children:O.jsx("a",{target:"_blank",href:`https://www.bing.com/images/search?view=detailv2&iss=SBI&form=SBIIRP&sbisrc=UrlPaste&q=imgurl:${r}&idpbck=1&selectedindex=0&id=${r}&mediaurl=${r}&exph=480&expw=640&vt=3&sim=11&cal=0&cab=1&cat=0&car=1`,rel:"noopener noreferrer",children:O.jsx(gt,{icon:"logos:bing",variant:"outlined",color:"info",children:"Search on Bing"})})}),e&&O.jsx(A0,{variant:"caption",align:"center",color:"secondary",className:"qc:mt-4 qc:lg:mt-8",children:"These are AI generated summaries based on the content. Please verify the information before using it."})]}),Cje=Object.freeze(Object.defineProperty({__proto__:null,default:kje},Symbol.toStringTag,{value:"Module"})),Sje=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const e=Wa(),{initializing:r,organization:t,user:a}=G0();return r?O.jsxs("div",{className:"qc:mx-auto qc:max-w-lg qc:space-y-8 qc:py-8",children:[O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"}),O.jsx(Kt,{className:"qc:h-8"})]}):!t||t?.customAuth?null:a?O.jsx(jf,{replace:!0,to:e?.state?.referrer||"/"}):O.jsxs("div",{className:"qc:bg-background qc:mx-auto qc:mt-24 qc:min-h-[80vh] qc:max-w-md",children:[O.jsxs("div",{className:"qc:my-8 qc:flex qc:w-full qc:justify-around",children:[O.jsx(Jt,{to:nr.LOGIN,state:e?.state,className:y0(e.pathname===nr.LOGIN?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:O.jsx(A0,{variant:"h5",align:"center",children:"Login"})}),O.jsx(Jt,{to:nr.REGISTER,state:e?.state,className:y0(e.pathname===nr.REGISTER?"qc:border-primary":"qc:border-border","qc:flex-1 qc:border-2 qc:border-x-0 qc:border-t-0 qc:pb-2"),children:O.jsx(A0,{variant:"h5",align:"center",children:"Register"})})]}),O.jsx(lG,{}),O.jsx("div",{className:"qc:mt-12",children:O.jsx(WG,{})})]})}},Symbol.toStringTag,{value:"Module"})),Qx=({disabled:e,provider:r,onClick:t,loading:a})=>{const n=(s,u=!1)=>{switch(s){case"google":return"https://qrati.com/images/continue-with-google.svg";case"apple":return"https://qrati.com/images/continue-with-apple.svg";default:return""}},i=async()=>{if(!(e||a))try{await t()}catch(s){console.error(`${MV(r)} login error:`,s)}};return O.jsx("button",{disabled:e||a,onClick:i,className:"qc:group qc:h-12 qc:rounded-full qc:transition qc:duration-300 qc:disabled:cursor-not-allowed qc:disabled:border-gray-500 qc:disabled:opacity-50",children:a?O.jsx("div",{className:"qc:flex qc:h-full qc:items-center qc:justify-center",children:O.jsx("div",{className:"qc:h-5 qc:w-5 qc:animate-spin qc:rounded-full qc:border-b-2 qc:border-gray-900"})}):O.jsx("img",{className:"qc:h-auto qc:w-full",src:n(r,e),alt:`sign in with ${MV(r)}`})})};var Jg=e=>e.type==="checkbox",hd=e=>e instanceof Date,bi=e=>e==null;const I0e=e=>typeof e=="object";var fa=e=>!bi(e)&&!Array.isArray(e)&&I0e(e)&&!hd(e),R0e=e=>fa(e)&&e.target?Jg(e.target)?e.target.checked:e.target.value:e,Tje=e=>e.substring(0,e.search(/\.\d+(\.|$)/))||e,M0e=(e,r)=>e.has(Tje(r)),Ije=e=>{const r=e.constructor&&e.constructor.prototype;return fa(r)&&r.hasOwnProperty("isPrototypeOf")},kB=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Sa(e){let r;const t=Array.isArray(e),a=typeof FileList<"u"?e instanceof FileList:!1;if(e instanceof Date)r=new Date(e);else if(!(kB&&(e instanceof Blob||a))&&(t||fa(e)))if(r=t?[]:Object.create(Object.getPrototypeOf(e)),!t&&!Ije(e))r=e;else for(const n in e)e.hasOwnProperty(n)&&(r[n]=Sa(e[n]));else return e;return r}var Jx=e=>/^\w*$/.test(e),Ut=e=>e===void 0,_B=e=>Array.isArray(e)?e.filter(Boolean):[],CB=e=>_B(e.replace(/["|']|\]/g,"").split(/\.|\[/)),j1=(e,r,t)=>{if(!r||!fa(e))return t;const a=(Jx(r)?[r]:CB(r)).reduce((n,i)=>bi(n)?n:n[i],e);return Ut(a)||a===e?Ut(e[r])?t:e[r]:a},to=e=>typeof e=="boolean",Fr=(e,r,t)=>{let a=-1;const n=Jx(r)?[r]:CB(r),i=n.length,s=i-1;for(;++a<i;){const u=n[a];let c=t;if(a!==s){const A=e[u];c=fa(A)||Array.isArray(A)?A:isNaN(+n[a+1])?{}:[]}if(u==="__proto__"||u==="constructor"||u==="prototype")return;e[u]=c,e=e[u]}};const Kx={BLUR:"blur",FOCUS_OUT:"focusout",CHANGE:"change"},Dl={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},fc={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},O0e=A1.createContext(null);O0e.displayName="HookFormContext";const SB=()=>A1.useContext(O0e);var D0e=(e,r,t,a=!0)=>{const n={defaultValues:r._defaultValues};for(const i in e)Object.defineProperty(n,i,{get:()=>{const s=i;return r._proxyFormState[s]!==Dl.all&&(r._proxyFormState[s]=!a||Dl.all),t&&(t[s]=!0),e[s]}});return n};const TB=typeof window<"u"?A1.useLayoutEffect:A1.useEffect;function Rje(e){const r=SB(),{control:t=r.control,disabled:a,name:n,exact:i}=e||{},[s,u]=A1.useState(t._formState),c=A1.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1});return TB(()=>t._subscribe({name:n,formState:c.current,exact:i,callback:A=>{!a&&u({...t._formState,...A})}}),[n,a,i]),A1.useEffect(()=>{c.current.isValid&&t._setValid(!0)},[t]),A1.useMemo(()=>D0e(s,t,c.current,!1),[s,t])}var ao=e=>typeof e=="string",IB=(e,r,t,a,n)=>ao(e)?(a&&r.watch.add(e),j1(t,e,n)):Array.isArray(e)?e.map(i=>(a&&r.watch.add(i),j1(t,i))):(a&&(r.watchAll=!0),t),RB=e=>bi(e)||!I0e(e);function Bl(e,r,t=new WeakSet){if(RB(e)||RB(r))return e===r;if(hd(e)&&hd(r))return e.getTime()===r.getTime();const a=Object.keys(e),n=Object.keys(r);if(a.length!==n.length)return!1;if(t.has(e)||t.has(r))return!0;t.add(e),t.add(r);for(const i of a){const s=e[i];if(!n.includes(i))return!1;if(i!=="ref"){const u=r[i];if(hd(s)&&hd(u)||fa(s)&&fa(u)||Array.isArray(s)&&Array.isArray(u)?!Bl(s,u,t):s!==u)return!1}}return!0}function Mje(e){const r=SB(),{control:t=r.control,name:a,defaultValue:n,disabled:i,exact:s,compute:u}=e||{},c=A1.useRef(n),A=A1.useRef(u),d=A1.useRef(void 0),g=A1.useRef(t),m=A1.useRef(a);A.current=u;const[b,w]=A1.useState(()=>{const R=t._getWatch(a,c.current);return A.current?A.current(R):R}),E=A1.useCallback(R=>{const M=IB(a,t._names,R||t._formValues,!1,c.current);return A.current?A.current(M):M},[t._formValues,t._names,a]),x=A1.useCallback(R=>{if(!i){const M=IB(a,t._names,R||t._formValues,!1,c.current);if(A.current){const N=A.current(M);Bl(N,d.current)||(w(N),d.current=N)}else w(M)}},[t._formValues,t._names,i,a]);TB(()=>((g.current!==t||!Bl(m.current,a))&&(g.current=t,m.current=a,x()),t._subscribe({name:a,formState:{values:!0},exact:s,callback:R=>{x(R.values)}})),[t,s,a,x]),A1.useEffect(()=>t._removeUnmounted());const _=g.current!==t,I=m.current,S=A1.useMemo(()=>{if(i)return null;const R=!_&&!Bl(I,a);return _||R?E():null},[i,_,a,I,E]);return S!==null?S:b}function Oje(e){const r=SB(),{name:t,disabled:a,control:n=r.control,shouldUnregister:i,defaultValue:s}=e,u=M0e(n._names.array,t),c=A1.useMemo(()=>j1(n._formValues,t,j1(n._defaultValues,t,s)),[n,t,s]),A=Mje({control:n,name:t,defaultValue:c,exact:!0}),d=Rje({control:n,name:t,exact:!0}),g=A1.useRef(e),m=A1.useRef(void 0),b=A1.useRef(n.register(t,{...e.rules,value:A,...to(e.disabled)?{disabled:e.disabled}:{}}));g.current=e;const w=A1.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!j1(d.errors,t)},isDirty:{enumerable:!0,get:()=>!!j1(d.dirtyFields,t)},isTouched:{enumerable:!0,get:()=>!!j1(d.touchedFields,t)},isValidating:{enumerable:!0,get:()=>!!j1(d.validatingFields,t)},error:{enumerable:!0,get:()=>j1(d.errors,t)}}),[d,t]),E=A1.useCallback(S=>b.current.onChange({target:{value:R0e(S),name:t},type:Kx.CHANGE}),[t]),x=A1.useCallback(()=>b.current.onBlur({target:{value:j1(n._formValues,t),name:t},type:Kx.BLUR}),[t,n._formValues]),_=A1.useCallback(S=>{const R=j1(n._fields,t);R&&S&&(R._f.ref={focus:()=>S.focus&&S.focus(),select:()=>S.select&&S.select(),setCustomValidity:M=>S.setCustomValidity(M),reportValidity:()=>S.reportValidity()})},[n._fields,t]),I=A1.useMemo(()=>({name:t,value:A,...to(a)||d.disabled?{disabled:d.disabled||a}:{},onChange:E,onBlur:x,ref:_}),[t,a,d.disabled,E,x,_,A]);return A1.useEffect(()=>{const S=n._options.shouldUnregister||i,R=m.current;R&&R!==t&&!u&&n.unregister(R),n.register(t,{...g.current.rules,...to(g.current.disabled)?{disabled:g.current.disabled}:{}});const M=(N,L)=>{const F=j1(n._fields,N);F&&F._f&&(F._f.mount=L)};if(M(t,!0),S){const N=Sa(j1(n._options.defaultValues,t,g.current.defaultValue));Fr(n._defaultValues,t,N),Ut(j1(n._formValues,t))&&Fr(n._formValues,t,N)}return!u&&n.register(t),m.current=t,()=>{(u?S&&!n._state.action:S)?n.unregister(t):M(t,!1)}},[t,n,u,i]),A1.useEffect(()=>{n._setDisabledField({disabled:a,name:t})},[a,t,n]),A1.useMemo(()=>({field:I,formState:d,fieldState:w}),[I,d,w])}const Nl=e=>e.render(Oje(e));var B0e=(e,r,t,a,n)=>r?{...t[e],types:{...t[e]&&t[e].types?t[e].types:{},[a]:n||!0}}:{},Kg=e=>Array.isArray(e)?e:[e],N0e=()=>{let e=[];return{get observers(){return e},next:n=>{for(const i of e)i.next&&i.next(n)},subscribe:n=>(e.push(n),{unsubscribe:()=>{e=e.filter(i=>i!==n)}}),unsubscribe:()=>{e=[]}}};function F0e(e,r){const t={};for(const a in e)if(e.hasOwnProperty(a)){const n=e[a],i=r[a];if(n&&fa(n)&&i){const s=F0e(n,i);fa(s)&&(t[a]=s)}else e[a]&&(t[a]=i)}return t}var I2=e=>fa(e)&&!Object.keys(e).length,MB=e=>e.type==="file",Fl=e=>typeof e=="function",ek=e=>{if(!kB)return!1;const r=e?e.ownerDocument:0;return e instanceof(r&&r.defaultView?r.defaultView.HTMLElement:HTMLElement)},Z0e=e=>e.type==="select-multiple",OB=e=>e.type==="radio",Dje=e=>OB(e)||Jg(e),DB=e=>ek(e)&&e.isConnected;function Bje(e,r){const t=r.slice(0,-1).length;let a=0;for(;a<t;)e=Ut(e)?a++:e[r[a++]];return e}function Nje(e){for(const r in e)if(e.hasOwnProperty(r)&&!Ut(e[r]))return!1;return!0}function Aa(e,r){const t=Array.isArray(r)?r:Jx(r)?[r]:CB(r),a=t.length===1?e:Bje(e,t),n=t.length-1,i=t[n];return a&&delete a[i],n!==0&&(fa(a)&&I2(a)||Array.isArray(a)&&Nje(a))&&Aa(e,t.slice(0,-1)),e}var Fje=e=>{for(const r in e)if(Fl(e[r]))return!0;return!1};function P0e(e){return Array.isArray(e)||fa(e)&&!Fje(e)}function BB(e,r={}){for(const t in e)P0e(e[t])?(r[t]=Array.isArray(e[t])?[]:{},BB(e[t],r[t])):Ut(e[t])||(r[t]=!0);return r}function r9(e,r,t){t||(t=BB(r));for(const a in e)P0e(e[a])?Ut(r)||RB(t[a])?t[a]=BB(e[a],Array.isArray(e[a])?[]:{}):r9(e[a],bi(r)?{}:r[a],t[a]):t[a]=!Bl(e[a],r[a]);return t}const j0e={value:!1,isValid:!1},q0e={value:!0,isValid:!0};var L0e=e=>{if(Array.isArray(e)){if(e.length>1){const r=e.filter(t=>t&&t.checked&&!t.disabled).map(t=>t.value);return{value:r,isValid:!!r.length}}return e[0].checked&&!e[0].disabled?e[0].attributes&&!Ut(e[0].attributes.value)?Ut(e[0].value)||e[0].value===""?q0e:{value:e[0].value,isValid:!0}:q0e:j0e}return j0e},V0e=(e,{valueAsNumber:r,valueAsDate:t,setValueAs:a})=>Ut(e)?e:r?e===""?NaN:e&&+e:t&&ao(e)?new Date(e):a?a(e):e;const G0e={isValid:!1,value:null};var z0e=e=>Array.isArray(e)?e.reduce((r,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:r,G0e):G0e;function U0e(e){const r=e.ref;return MB(r)?r.files:OB(r)?z0e(e.refs).value:Z0e(r)?[...r.selectedOptions].map(({value:t})=>t):Jg(r)?L0e(e.refs).value:V0e(Ut(r.value)?e.ref.value:r.value,e)}var Zje=(e,r,t,a)=>{const n={};for(const i of e){const s=j1(r,i);s&&Fr(n,i,s._f)}return{criteriaMode:t,names:[...e],fields:n,shouldUseNativeValidation:a}},rk=e=>e instanceof RegExp,e7=e=>Ut(e)?e:rk(e)?e.source:fa(e)?rk(e.value)?e.value.source:e.value:e,W0e=e=>({isOnSubmit:!e||e===Dl.onSubmit,isOnBlur:e===Dl.onBlur,isOnChange:e===Dl.onChange,isOnAll:e===Dl.all,isOnTouch:e===Dl.onTouched});const X0e="AsyncFunction";var Pje=e=>!!e&&!!e.validate&&!!(Fl(e.validate)&&e.validate.constructor.name===X0e||fa(e.validate)&&Object.values(e.validate).find(r=>r.constructor.name===X0e)),jje=e=>e.mount&&(e.required||e.min||e.max||e.maxLength||e.minLength||e.pattern||e.validate),H0e=(e,r,t)=>!t&&(r.watchAll||r.watch.has(e)||[...r.watch].some(a=>e.startsWith(a)&&/^\.\w+/.test(e.slice(a.length))));const r7=(e,r,t,a)=>{for(const n of t||Object.keys(e)){const i=j1(e,n);if(i){const{_f:s,...u}=i;if(s){if(s.refs&&s.refs[0]&&r(s.refs[0],n)&&!a)return!0;if(s.ref&&r(s.ref,s.name)&&!a)return!0;if(r7(u,r))break}else if(fa(u)&&r7(u,r))break}}};function $0e(e,r,t){const a=j1(e,t);if(a||Jx(t))return{error:a,name:t};const n=t.split(".");for(;n.length;){const i=n.join("."),s=j1(r,i),u=j1(e,i);if(s&&!Array.isArray(s)&&t!==i)return{name:t};if(u&&u.type)return{name:i,error:u};if(u&&u.root&&u.root.type)return{name:`${i}.root`,error:u.root};n.pop()}return{name:t}}var qje=(e,r,t,a)=>{t(e);const{name:n,...i}=e;return I2(i)||Object.keys(i).length>=Object.keys(r).length||Object.keys(i).find(s=>r[s]===(!a||Dl.all))},Lje=(e,r,t)=>!e||!r||e===r||Kg(e).some(a=>a&&(t?a===r:a.startsWith(r)||r.startsWith(a))),Vje=(e,r,t,a,n)=>n.isOnAll?!1:!t&&n.isOnTouch?!(r||e):(t?a.isOnBlur:n.isOnBlur)?!e:(t?a.isOnChange:n.isOnChange)?e:!0,Gje=(e,r)=>!_B(j1(e,r)).length&&Aa(e,r),zje=(e,r,t)=>{const a=Kg(j1(e,t));return Fr(a,"root",r[t]),Fr(e,t,a),e};function Y0e(e,r,t="validate"){if(ao(e)||Array.isArray(e)&&e.every(ao)||to(e)&&!e)return{type:t,message:ao(e)?e:"",ref:r}}var t9=e=>fa(e)&&!rk(e)?e:{value:e,message:""},Q0e=async(e,r,t,a,n,i)=>{const{ref:s,refs:u,required:c,maxLength:A,minLength:d,min:g,max:m,pattern:b,validate:w,name:E,valueAsNumber:x,mount:_}=e._f,I=j1(t,E);if(!_||r.has(E))return{};const S=u?u[0]:s,R=ee=>{n&&S.reportValidity&&(S.setCustomValidity(to(ee)?"":ee||""),S.reportValidity())},M={},N=OB(s),L=Jg(s),F=N||L,B=(x||MB(s))&&Ut(s.value)&&Ut(I)||ek(s)&&s.value===""||I===""||Array.isArray(I)&&!I.length,G=B0e.bind(null,E,a,M),V=(ee,K,$,re=fc.maxLength,z=fc.minLength)=>{const U=ee?K:$;M[E]={type:ee?re:z,message:U,ref:s,...G(ee?re:z,U)}};if(i?!Array.isArray(I)||!I.length:c&&(!F&&(B||bi(I))||to(I)&&!I||L&&!L0e(u).isValid||N&&!z0e(u).isValid)){const{value:ee,message:K}=ao(c)?{value:!!c,message:c}:t9(c);if(ee&&(M[E]={type:fc.required,message:K,ref:S,...G(fc.required,K)},!a))return R(K),M}if(!B&&(!bi(g)||!bi(m))){let ee,K;const $=t9(m),re=t9(g);if(!bi(I)&&!isNaN(I)){const z=s.valueAsNumber||I&&+I;bi($.value)||(ee=z>$.value),bi(re.value)||(K=z<re.value)}else{const z=s.valueAsDate||new Date(I),U=J=>new Date(new Date().toDateString()+" "+J),j=s.type=="time",W=s.type=="week";ao($.value)&&I&&(ee=j?U(I)>U($.value):W?I>$.value:z>new Date($.value)),ao(re.value)&&I&&(K=j?U(I)<U(re.value):W?I<re.value:z<new Date(re.value))}if((ee||K)&&(V(!!ee,$.message,re.message,fc.max,fc.min),!a))return R(M[E].message),M}if((A||d)&&!B&&(ao(I)||i&&Array.isArray(I))){const ee=t9(A),K=t9(d),$=!bi(ee.value)&&I.length>+ee.value,re=!bi(K.value)&&I.length<+K.value;if(($||re)&&(V($,ee.message,K.message),!a))return R(M[E].message),M}if(b&&!B&&ao(I)){const{value:ee,message:K}=t9(b);if(rk(ee)&&!I.match(ee)&&(M[E]={type:fc.pattern,message:K,ref:s,...G(fc.pattern,K)},!a))return R(K),M}if(w){if(Fl(w)){const ee=await w(I,t),K=Y0e(ee,S);if(K&&(M[E]={...K,...G(fc.validate,K.message)},!a))return R(K.message),M}else if(fa(w)){let ee={};for(const K in w){if(!I2(ee)&&!a)break;const $=Y0e(await w[K](I,t),S,K);$&&(ee={...$,...G(K,$.message)},R($.message),a&&(M[E]=ee))}if(!I2(ee)&&(M[E]={ref:S,...ee},!a))return M}}return R(!0),M};const Uje={mode:Dl.onSubmit,reValidateMode:Dl.onChange,shouldFocusError:!0};function Wje(e={}){let r={...Uje,...e},t={submitCount:0,isDirty:!1,isReady:!1,isLoading:Fl(r.defaultValues),isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{},errors:r.errors||{},disabled:r.disabled||!1},a={},n=fa(r.defaultValues)||fa(r.values)?Sa(r.defaultValues||r.values)||{}:{},i=r.shouldUnregister?{}:Sa(n),s={action:!1,mount:!1,watch:!1},u={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set},c,A=0;const d={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1};let g={...d};const m={array:N0e(),state:N0e()},b=r.criteriaMode===Dl.all,w=ve=>be=>{clearTimeout(A),A=setTimeout(ve,be)},E=async ve=>{if(!r.disabled&&(d.isValid||g.isValid||ve)){const be=r.resolver?I2((await L()).errors):await B(a,!0);be!==t.isValid&&m.state.next({isValid:be})}},x=(ve,be)=>{!r.disabled&&(d.isValidating||d.validatingFields||g.isValidating||g.validatingFields)&&((ve||Array.from(u.mount)).forEach(Ce=>{Ce&&(be?Fr(t.validatingFields,Ce,be):Aa(t.validatingFields,Ce))}),m.state.next({validatingFields:t.validatingFields,isValidating:!I2(t.validatingFields)}))},_=(ve,be=[],Ce,Ge,xe=!0,Ne=!0)=>{if(Ge&&Ce&&!r.disabled){if(s.action=!0,Ne&&Array.isArray(j1(a,ve))){const r1=Ce(j1(a,ve),Ge.argA,Ge.argB);xe&&Fr(a,ve,r1)}if(Ne&&Array.isArray(j1(t.errors,ve))){const r1=Ce(j1(t.errors,ve),Ge.argA,Ge.argB);xe&&Fr(t.errors,ve,r1),Gje(t.errors,ve)}if((d.touchedFields||g.touchedFields)&&Ne&&Array.isArray(j1(t.touchedFields,ve))){const r1=Ce(j1(t.touchedFields,ve),Ge.argA,Ge.argB);xe&&Fr(t.touchedFields,ve,r1)}(d.dirtyFields||g.dirtyFields)&&(t.dirtyFields=r9(n,i)),m.state.next({name:ve,isDirty:V(ve,be),dirtyFields:t.dirtyFields,errors:t.errors,isValid:t.isValid})}else Fr(i,ve,be)},I=(ve,be)=>{Fr(t.errors,ve,be),m.state.next({errors:t.errors})},S=ve=>{t.errors=ve,m.state.next({errors:t.errors,isValid:!1})},R=(ve,be,Ce,Ge)=>{const xe=j1(a,ve);if(xe){const Ne=j1(i,ve,Ut(Ce)?j1(n,ve):Ce);Ut(Ne)||Ge&&Ge.defaultChecked||be?Fr(i,ve,be?Ne:U0e(xe._f)):$(ve,Ne),s.mount&&E()}},M=(ve,be,Ce,Ge,xe)=>{let Ne=!1,r1=!1;const C1={name:ve};if(!r.disabled){if(!Ce||Ge){(d.isDirty||g.isDirty)&&(r1=t.isDirty,t.isDirty=C1.isDirty=V(),Ne=r1!==C1.isDirty);const d1=Bl(j1(n,ve),be);r1=!!j1(t.dirtyFields,ve),d1?Aa(t.dirtyFields,ve):Fr(t.dirtyFields,ve,!0),C1.dirtyFields=t.dirtyFields,Ne=Ne||(d.dirtyFields||g.dirtyFields)&&r1!==!d1}if(Ce){const d1=j1(t.touchedFields,ve);d1||(Fr(t.touchedFields,ve,Ce),C1.touchedFields=t.touchedFields,Ne=Ne||(d.touchedFields||g.touchedFields)&&d1!==Ce)}Ne&&xe&&m.state.next(C1)}return Ne?C1:{}},N=(ve,be,Ce,Ge)=>{const xe=j1(t.errors,ve),Ne=(d.isValid||g.isValid)&&to(be)&&t.isValid!==be;if(r.delayError&&Ce?(c=w(()=>I(ve,Ce)),c(r.delayError)):(clearTimeout(A),c=null,Ce?Fr(t.errors,ve,Ce):Aa(t.errors,ve)),(Ce?!Bl(xe,Ce):xe)||!I2(Ge)||Ne){const r1={...Ge,...Ne&&to(be)?{isValid:be}:{},errors:t.errors,name:ve};t={...t,...r1},m.state.next(r1)}},L=async ve=>{x(ve,!0);const be=await r.resolver(i,r.context,Zje(ve||u.mount,a,r.criteriaMode,r.shouldUseNativeValidation));return x(ve),be},F=async ve=>{const{errors:be}=await L(ve);if(ve)for(const Ce of ve){const Ge=j1(be,Ce);Ge?Fr(t.errors,Ce,Ge):Aa(t.errors,Ce)}else t.errors=be;return be},B=async(ve,be,Ce={valid:!0})=>{for(const Ge in ve){const xe=ve[Ge];if(xe){const{_f:Ne,...r1}=xe;if(Ne){const C1=u.array.has(Ne.name),d1=xe._f&&Pje(xe._f);d1&&d.validatingFields&&x([Ne.name],!0);const U1=await Q0e(xe,u.disabled,i,b,r.shouldUseNativeValidation&&!be,C1);if(d1&&d.validatingFields&&x([Ne.name]),U1[Ne.name]&&(Ce.valid=!1,be))break;!be&&(j1(U1,Ne.name)?C1?zje(t.errors,U1,Ne.name):Fr(t.errors,Ne.name,U1[Ne.name]):Aa(t.errors,Ne.name))}!I2(r1)&&await B(r1,be,Ce)}}return Ce.valid},G=()=>{for(const ve of u.unMount){const be=j1(a,ve);be&&(be._f.refs?be._f.refs.every(Ce=>!DB(Ce)):!DB(be._f.ref))&&he(ve)}u.unMount=new Set},V=(ve,be)=>!r.disabled&&(ve&&be&&Fr(i,ve,be),!Bl(J(),n)),ee=(ve,be,Ce)=>IB(ve,u,{...s.mount?i:Ut(be)?n:ao(ve)?{[ve]:be}:be},Ce,be),K=ve=>_B(j1(s.mount?i:n,ve,r.shouldUnregister?j1(n,ve,[]):[])),$=(ve,be,Ce={})=>{const Ge=j1(a,ve);let xe=be;if(Ge){const Ne=Ge._f;Ne&&(!Ne.disabled&&Fr(i,ve,V0e(be,Ne)),xe=ek(Ne.ref)&&bi(be)?"":be,Z0e(Ne.ref)?[...Ne.ref.options].forEach(r1=>r1.selected=xe.includes(r1.value)):Ne.refs?Jg(Ne.ref)?Ne.refs.forEach(r1=>{(!r1.defaultChecked||!r1.disabled)&&(Array.isArray(xe)?r1.checked=!!xe.find(C1=>C1===r1.value):r1.checked=xe===r1.value||!!xe)}):Ne.refs.forEach(r1=>r1.checked=r1.value===xe):MB(Ne.ref)?Ne.ref.value="":(Ne.ref.value=xe,Ne.ref.type||m.state.next({name:ve,values:Sa(i)})))}(Ce.shouldDirty||Ce.shouldTouch)&&M(ve,xe,Ce.shouldTouch,Ce.shouldDirty,!0),Ce.shouldValidate&&W(ve)},re=(ve,be,Ce)=>{for(const Ge in be){if(!be.hasOwnProperty(Ge))return;const xe=be[Ge],Ne=ve+"."+Ge,r1=j1(a,Ne);(u.array.has(ve)||fa(xe)||r1&&!r1._f)&&!hd(xe)?re(Ne,xe,Ce):$(Ne,xe,Ce)}},z=(ve,be,Ce={})=>{const Ge=j1(a,ve),xe=u.array.has(ve),Ne=Sa(be);Fr(i,ve,Ne),xe?(m.array.next({name:ve,values:Sa(i)}),(d.isDirty||d.dirtyFields||g.isDirty||g.dirtyFields)&&Ce.shouldDirty&&m.state.next({name:ve,dirtyFields:r9(n,i),isDirty:V(ve,Ne)})):Ge&&!Ge._f&&!bi(Ne)?re(ve,Ne,Ce):$(ve,Ne,Ce),H0e(ve,u)&&m.state.next({...t,name:ve}),m.state.next({name:s.mount?ve:void 0,values:Sa(i)})},U=async ve=>{s.mount=!0;const be=ve.target;let Ce=be.name,Ge=!0;const xe=j1(a,Ce),Ne=d1=>{Ge=Number.isNaN(d1)||hd(d1)&&isNaN(d1.getTime())||Bl(d1,j1(i,Ce,d1))},r1=W0e(r.mode),C1=W0e(r.reValidateMode);if(xe){let d1,U1;const Y1=be.type?U0e(xe._f):R0e(ve),x1=ve.type===Kx.BLUR||ve.type===Kx.FOCUS_OUT,R1=!jje(xe._f)&&!r.resolver&&!j1(t.errors,Ce)&&!xe._f.deps||Vje(x1,j1(t.touchedFields,Ce),t.isSubmitted,C1,r1),v1=H0e(Ce,u,x1);Fr(i,Ce,Y1),x1?(!be||!be.readOnly)&&(xe._f.onBlur&&xe._f.onBlur(ve),c&&c(0)):xe._f.onChange&&xe._f.onChange(ve);const I1=M(Ce,Y1,x1),e0=!I2(I1)||v1;if(!x1&&m.state.next({name:Ce,type:ve.type,values:Sa(i)}),R1)return(d.isValid||g.isValid)&&(r.mode==="onBlur"?x1&&E():x1||E()),e0&&m.state.next({name:Ce,...v1?{}:I1});if(!x1&&v1&&m.state.next({...t}),r.resolver){const{errors:r0}=await L([Ce]);if(Ne(Y1),Ge){const W1=$0e(t.errors,a,Ce),T1=$0e(r0,a,W1.name||Ce);d1=T1.error,Ce=T1.name,U1=I2(r0)}}else x([Ce],!0),d1=(await Q0e(xe,u.disabled,i,b,r.shouldUseNativeValidation))[Ce],x([Ce]),Ne(Y1),Ge&&(d1?U1=!1:(d.isValid||g.isValid)&&(U1=await B(a,!0)));Ge&&(xe._f.deps&&(!Array.isArray(xe._f.deps)||xe._f.deps.length>0)&&W(xe._f.deps),N(Ce,U1,d1,I1))}},j=(ve,be)=>{if(j1(t.errors,be)&&ve.focus)return ve.focus(),1},W=async(ve,be={})=>{let Ce,Ge;const xe=Kg(ve);if(r.resolver){const Ne=await F(Ut(ve)?ve:xe);Ce=I2(Ne),Ge=ve?!xe.some(r1=>j1(Ne,r1)):Ce}else ve?(Ge=(await Promise.all(xe.map(async Ne=>{const r1=j1(a,Ne);return await B(r1&&r1._f?{[Ne]:r1}:r1)}))).every(Boolean),!(!Ge&&!t.isValid)&&E()):Ge=Ce=await B(a);return m.state.next({...!ao(ve)||(d.isValid||g.isValid)&&Ce!==t.isValid?{}:{name:ve},...r.resolver||!ve?{isValid:Ce}:{},errors:t.errors}),be.shouldFocus&&!Ge&&r7(a,j,ve?xe:u.mount),Ge},J=(ve,be)=>{let Ce={...s.mount?i:n};return be&&(Ce=F0e(be.dirtyFields?t.dirtyFields:t.touchedFields,Ce)),Ut(ve)?Ce:ao(ve)?j1(Ce,ve):ve.map(Ge=>j1(Ce,Ge))},X=(ve,be)=>({invalid:!!j1((be||t).errors,ve),isDirty:!!j1((be||t).dirtyFields,ve),error:j1((be||t).errors,ve),isValidating:!!j1(t.validatingFields,ve),isTouched:!!j1((be||t).touchedFields,ve)}),Y=ve=>{ve&&Kg(ve).forEach(be=>Aa(t.errors,be)),m.state.next({errors:ve?t.errors:{}})},se=(ve,be,Ce)=>{const Ge=(j1(a,ve,{_f:{}})._f||{}).ref,xe=j1(t.errors,ve)||{},{ref:Ne,message:r1,type:C1,...d1}=xe;Fr(t.errors,ve,{...d1,...be,ref:Ge}),m.state.next({name:ve,errors:t.errors,isValid:!1}),Ce&&Ce.shouldFocus&&Ge&&Ge.focus&&Ge.focus()},Q=(ve,be)=>Fl(ve)?m.state.subscribe({next:Ce=>"values"in Ce&&ve(ee(void 0,be),Ce)}):ee(ve,be,!0),ne=ve=>m.state.subscribe({next:be=>{Lje(ve.name,be.name,ve.exact)&&qje(be,ve.formState||d,Ve,ve.reRenderRoot)&&ve.callback({values:{...i},...t,...be,defaultValues:n})}}).unsubscribe,pe=ve=>(s.mount=!0,g={...g,...ve.formState},ne({...ve,formState:g})),he=(ve,be={})=>{for(const Ce of ve?Kg(ve):u.mount)u.mount.delete(Ce),u.array.delete(Ce),be.keepValue||(Aa(a,Ce),Aa(i,Ce)),!be.keepError&&Aa(t.errors,Ce),!be.keepDirty&&Aa(t.dirtyFields,Ce),!be.keepTouched&&Aa(t.touchedFields,Ce),!be.keepIsValidating&&Aa(t.validatingFields,Ce),!r.shouldUnregister&&!be.keepDefaultValue&&Aa(n,Ce);m.state.next({values:Sa(i)}),m.state.next({...t,...be.keepDirty?{isDirty:V()}:{}}),!be.keepIsValid&&E()},ye=({disabled:ve,name:be})=>{(to(ve)&&s.mount||ve||u.disabled.has(be))&&(ve?u.disabled.add(be):u.disabled.delete(be))},Ee=(ve,be={})=>{let Ce=j1(a,ve);const Ge=to(be.disabled)||to(r.disabled);return Fr(a,ve,{...Ce||{},_f:{...Ce&&Ce._f?Ce._f:{ref:{name:ve}},name:ve,mount:!0,...be}}),u.mount.add(ve),Ce?ye({disabled:to(be.disabled)?be.disabled:r.disabled,name:ve}):R(ve,!0,be.value),{...Ge?{disabled:be.disabled||r.disabled}:{},...r.progressive?{required:!!be.required,min:e7(be.min),max:e7(be.max),minLength:e7(be.minLength),maxLength:e7(be.maxLength),pattern:e7(be.pattern)}:{},name:ve,onChange:U,onBlur:U,ref:xe=>{if(xe){Ee(ve,be),Ce=j1(a,ve);const Ne=Ut(xe.value)&&xe.querySelectorAll&&xe.querySelectorAll("input,select,textarea")[0]||xe,r1=Dje(Ne),C1=Ce._f.refs||[];if(r1?C1.find(d1=>d1===Ne):Ne===Ce._f.ref)return;Fr(a,ve,{_f:{...Ce._f,...r1?{refs:[...C1.filter(DB),Ne,...Array.isArray(j1(n,ve))?[{}]:[]],ref:{type:Ne.type,name:ve}}:{ref:Ne}}}),R(ve,!1,void 0,Ne)}else Ce=j1(a,ve,{}),Ce._f&&(Ce._f.mount=!1),(r.shouldUnregister||be.shouldUnregister)&&!(M0e(u.array,ve)&&s.action)&&u.unMount.add(ve)}}},Me=()=>r.shouldFocusError&&r7(a,j,u.mount),De=ve=>{to(ve)&&(m.state.next({disabled:ve}),r7(a,(be,Ce)=>{const Ge=j1(a,Ce);Ge&&(be.disabled=Ge._f.disabled||ve,Array.isArray(Ge._f.refs)&&Ge._f.refs.forEach(xe=>{xe.disabled=Ge._f.disabled||ve}))},0,!1))},ge=(ve,be)=>async Ce=>{let Ge;Ce&&(Ce.preventDefault&&Ce.preventDefault(),Ce.persist&&Ce.persist());let xe=Sa(i);if(m.state.next({isSubmitting:!0}),r.resolver){const{errors:Ne,values:r1}=await L();t.errors=Ne,xe=Sa(r1)}else await B(a);if(u.disabled.size)for(const Ne of u.disabled)Aa(xe,Ne);if(Aa(t.errors,"root"),I2(t.errors)){m.state.next({errors:{}});try{await ve(xe,Ce)}catch(Ne){Ge=Ne}}else be&&await be({...t.errors},Ce),Me(),setTimeout(Me);if(m.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:I2(t.errors)&&!Ge,submitCount:t.submitCount+1,errors:t.errors}),Ge)throw Ge},Oe=(ve,be={})=>{j1(a,ve)&&(Ut(be.defaultValue)?z(ve,Sa(j1(n,ve))):(z(ve,be.defaultValue),Fr(n,ve,Sa(be.defaultValue))),be.keepTouched||Aa(t.touchedFields,ve),be.keepDirty||(Aa(t.dirtyFields,ve),t.isDirty=be.defaultValue?V(ve,Sa(j1(n,ve))):V()),be.keepError||(Aa(t.errors,ve),d.isValid&&E()),m.state.next({...t}))},Ke=(ve,be={})=>{const Ce=ve?Sa(ve):n,Ge=Sa(Ce),xe=I2(ve),Ne=xe?n:Ge;if(be.keepDefaultValues||(n=Ce),!be.keepValues){if(be.keepDirtyValues){const r1=new Set([...u.mount,...Object.keys(r9(n,i))]);for(const C1 of Array.from(r1))j1(t.dirtyFields,C1)?Fr(Ne,C1,j1(i,C1)):z(C1,j1(Ne,C1))}else{if(kB&&Ut(ve))for(const r1 of u.mount){const C1=j1(a,r1);if(C1&&C1._f){const d1=Array.isArray(C1._f.refs)?C1._f.refs[0]:C1._f.ref;if(ek(d1)){const U1=d1.closest("form");if(U1){U1.reset();break}}}}if(be.keepFieldsRef)for(const r1 of u.mount)z(r1,j1(Ne,r1));else a={}}i=r.shouldUnregister?be.keepDefaultValues?Sa(n):{}:Sa(Ne),m.array.next({values:{...Ne}}),m.state.next({values:{...Ne}})}u={mount:be.keepDirtyValues?u.mount:new Set,unMount:new Set,array:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},s.mount=!d.isValid||!!be.keepIsValid||!!be.keepDirtyValues||!r.shouldUnregister&&!I2(Ne),s.watch=!!r.shouldUnregister,m.state.next({submitCount:be.keepSubmitCount?t.submitCount:0,isDirty:xe?!1:be.keepDirty?t.isDirty:!!(be.keepDefaultValues&&!Bl(ve,n)),isSubmitted:be.keepIsSubmitted?t.isSubmitted:!1,dirtyFields:xe?{}:be.keepDirtyValues?be.keepDefaultValues&&i?r9(n,i):t.dirtyFields:be.keepDefaultValues&&ve?r9(n,ve):be.keepDirty?t.dirtyFields:{},touchedFields:be.keepTouched?t.touchedFields:{},errors:be.keepErrors?t.errors:{},isSubmitSuccessful:be.keepIsSubmitSuccessful?t.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:n})},Je=(ve,be)=>Ke(Fl(ve)?ve(i):ve,be),h1=(ve,be={})=>{const Ce=j1(a,ve),Ge=Ce&&Ce._f;if(Ge){const xe=Ge.refs?Ge.refs[0]:Ge.ref;xe.focus&&(xe.focus(),be.shouldSelect&&Fl(xe.select)&&xe.select())}},Ve=ve=>{t={...t,...ve}},p1={control:{register:Ee,unregister:he,getFieldState:X,handleSubmit:ge,setError:se,_subscribe:ne,_runSchema:L,_focusError:Me,_getWatch:ee,_getDirty:V,_setValid:E,_setFieldArray:_,_setDisabledField:ye,_setErrors:S,_getFieldArray:K,_reset:Ke,_resetDefaultValues:()=>Fl(r.defaultValues)&&r.defaultValues().then(ve=>{Je(ve,r.resetOptions),m.state.next({isLoading:!1})}),_removeUnmounted:G,_disableForm:De,_subjects:m,_proxyFormState:d,get _fields(){return a},get _formValues(){return i},get _state(){return s},set _state(ve){s=ve},get _defaultValues(){return n},get _names(){return u},set _names(ve){u=ve},get _formState(){return t},get _options(){return r},set _options(ve){r={...r,...ve}}},subscribe:pe,trigger:W,register:Ee,handleSubmit:ge,watch:Q,setValue:z,getValues:J,reset:Je,resetField:Oe,clearErrors:Y,unregister:he,setError:se,setFocus:h1,getFieldState:X};return{...p1,formControl:p1}}function t7(e={}){const r=A1.useRef(void 0),t=A1.useRef(void 0),[a,n]=A1.useState({isDirty:!1,isValidating:!1,isLoading:Fl(e.defaultValues),isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,submitCount:0,dirtyFields:{},touchedFields:{},validatingFields:{},errors:e.errors||{},disabled:e.disabled||!1,isReady:!1,defaultValues:Fl(e.defaultValues)?void 0:e.defaultValues});if(!r.current)if(e.formControl)r.current={...e.formControl,formState:a},e.defaultValues&&!Fl(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{const{formControl:s,...u}=Wje(e);r.current={...u,formState:a}}const i=r.current.control;return i._options=e,TB(()=>{const s=i._subscribe({formState:i._proxyFormState,callback:()=>n({...i._formState}),reRenderRoot:!0});return n(u=>({...u,isReady:!0})),i._formState.isReady=!0,s},[i]),A1.useEffect(()=>i._disableForm(e.disabled),[i,e.disabled]),A1.useEffect(()=>{e.mode&&(i._options.mode=e.mode),e.reValidateMode&&(i._options.reValidateMode=e.reValidateMode)},[i,e.mode,e.reValidateMode]),A1.useEffect(()=>{e.errors&&(i._setErrors(e.errors),i._focusError())},[i,e.errors]),A1.useEffect(()=>{e.shouldUnregister&&i._subjects.state.next({values:i._getWatch()})},[i,e.shouldUnregister]),A1.useEffect(()=>{if(i._proxyFormState.isDirty){const s=i._getDirty();s!==a.isDirty&&i._subjects.state.next({isDirty:s})}},[i,a.isDirty]),A1.useEffect(()=>{e.values&&!Bl(e.values,t.current)?(i._reset(e.values,{keepFieldsRef:!0,...i._options.resetOptions}),t.current=e.values,n(s=>({...s}))):i._resetDefaultValues()},[i,e.values]),A1.useEffect(()=>{i._state.mount||(i._setValid(),i._state.mount=!0),i._state.watch&&(i._state.watch=!1,i._subjects.state.next({...i._formState})),i._removeUnmounted()}),r.current.formState=D0e(a,i),r.current}const J0e=(e,r,t)=>{if(e&&"reportValidity"in e){const a=j1(t,r);e.setCustomValidity(a&&a.message||""),e.reportValidity()}},K0e=(e,r)=>{for(const t in r.fields){const a=r.fields[t];a&&a.ref&&"reportValidity"in a.ref?J0e(a.ref,t,e):a&&a.refs&&a.refs.forEach(n=>J0e(n,t,e))}},Xje=(e,r)=>{r.shouldUseNativeValidation&&K0e(e,r);const t={};for(const a in e){const n=j1(r.fields,a),i=Object.assign(e[a]||{},{ref:n&&n.ref});if(Hje(r.names||Object.keys(e),a)){const s=Object.assign({},j1(t,a));Fr(s,"root",i),Fr(t,a,s)}else Fr(t,a,i)}return t},Hje=(e,r)=>{const t=ere(r);return e.some(a=>ere(a).match(`^${t}\\.\\d+`))};function ere(e){return e.replace(/\]|\[/g,"")}var $je={};function a7(e,r,t){return t===void 0&&(t={}),function(a,n,i){try{return Promise.resolve((function(s,u){try{var c=(r!=null&&r.context&&$je.NODE_ENV==="development"&&console.warn("You should not used the yup options context. Please, use the 'useForm' context object instead"),Promise.resolve(e[t.mode==="sync"?"validateSync":"validate"](a,Object.assign({abortEarly:!1},r,{context:n}))).then(function(A){return i.shouldUseNativeValidation&&K0e({},i),{values:t.raw?Object.assign({},a):A,errors:{}}}))}catch(A){return u(A)}return c&&c.then?c.then(void 0,u):c})(0,function(s){if(!s.inner)throw s;return{values:{},errors:Xje((u=s,c=!i.shouldUseNativeValidation&&i.criteriaMode==="all",(u.inner||[]).reduce(function(A,d){if(A[d.path]||(A[d.path]={message:d.message,type:d.type}),c){var g=A[d.path].types,m=g&&g[d.type];A[d.path]=B0e(d.path,c,A,d.type,m?[].concat(m,d.message):d.message)}return A},{})),i)};var u,c}))}catch(s){return Promise.reject(s)}}}var NB,rre;function Yje(){if(rre)return NB;rre=1;function e(_){this._maxSize=_,this.clear()}e.prototype.clear=function(){this._size=0,this._values=Object.create(null)},e.prototype.get=function(_){return this._values[_]},e.prototype.set=function(_,I){return this._size>=this._maxSize&&this.clear(),_ in this._values||this._size++,this._values[_]=I};var r=/[^.^\]^[]+|(?=\[\]|\.\.)/g,t=/^\d+$/,a=/^\d/,n=/[~`!#$%\^&*+=\-\[\]\\';,/{}|\\":<>\?]/g,i=/^\s*(['"]?)(.*?)(\1)\s*$/,s=512,u=new e(s),c=new e(s),A=new e(s);NB={Cache:e,split:g,normalizePath:d,setter:function(_){var I=d(_);return c.get(_)||c.set(_,function(R,M){for(var N=0,L=I.length,F=R;N<L-1;){var B=I[N];if(B==="__proto__"||B==="constructor"||B==="prototype")return R;F=F[I[N++]]}F[I[N]]=M})},getter:function(_,I){var S=d(_);return A.get(_)||A.set(_,function(M){for(var N=0,L=S.length;N<L;)if(M!=null||!I)M=M[S[N++]];else return;return M})},join:function(_){return _.reduce(function(I,S){return I+(b(S)||t.test(S)?"["+S+"]":(I?".":"")+S)},"")},forEach:function(_,I,S){m(Array.isArray(_)?_:g(_),I,S)}};function d(_){return u.get(_)||u.set(_,g(_).map(function(I){return I.replace(i,"$2")}))}function g(_){return _.match(r)||[""]}function m(_,I,S){var R=_.length,M,N,L,F;for(N=0;N<R;N++)M=_[N],M&&(x(M)&&(M='"'+M+'"'),F=b(M),L=!F&&/^\d+$/.test(M),I.call(S,M,F,L,N,_))}function b(_){return typeof _=="string"&&_&&["'",'"'].indexOf(_.charAt(0))!==-1}function w(_){return _.match(a)&&!_.match(t)}function E(_){return n.test(_)}function x(_){return!b(_)&&(w(_)||E(_))}return NB}var pd=Yje(),FB,tre;function Qje(){if(tre)return FB;tre=1;const e=/[A-Z\xc0-\xd6\xd8-\xde]?[a-z\xdf-\xf6\xf8-\xff]+(?:['’](?:d|ll|m|re|s|t|ve))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde]|$)|(?:[A-Z\xc0-\xd6\xd8-\xde]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:D|LL|M|RE|S|T|VE))?(?=[\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000]|[A-Z\xc0-\xd6\xd8-\xde](?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])|$)|[A-Z\xc0-\xd6\xd8-\xde]?(?:[a-z\xdf-\xf6\xf8-\xff]|[^\ud800-\udfff\xac\xb1\xd7\xf7\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\xbf\u2000-\u206f \t\x0b\f\xa0\ufeff\n\r\u2028\u2029\u1680\u180e\u2000\u2001\u2002\u2003\u2004\u2005\u2006\u2007\u2008\u2009\u200a\u202f\u205f\u3000\d+\u2700-\u27bfa-z\xdf-\xf6\xf8-\xffA-Z\xc0-\xd6\xd8-\xde])+(?:['’](?:d|ll|m|re|s|t|ve))?|[A-Z\xc0-\xd6\xd8-\xde]+(?:['’](?:D|LL|M|RE|S|T|VE))?|\d*(?:1ST|2ND|3RD|(?![123])\dTH)(?=\b|[a-z_])|\d*(?:1st|2nd|3rd|(?![123])\dth)(?=\b|[A-Z_])|\d+|(?:[\u2700-\u27bf]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?(?:\u200d(?:[^\ud800-\udfff]|(?:\ud83c[\udde6-\uddff]){2}|[\ud800-\udbff][\udc00-\udfff])[\ufe0e\ufe0f]?(?:[\u0300-\u036f\ufe20-\ufe2f\u20d0-\u20ff]|\ud83c[\udffb-\udfff])?)*/g,r=d=>d.match(e)||[],t=d=>d[0].toUpperCase()+d.slice(1),a=(d,g)=>r(d).join(g).toLowerCase(),n=d=>r(d).reduce((g,m)=>`${g}${g?m[0].toUpperCase()+m.slice(1).toLowerCase():m.toLowerCase()}`,"");return FB={words:r,upperFirst:t,camelCase:n,pascalCase:d=>t(n(d)),snakeCase:d=>a(d,"_"),kebabCase:d=>a(d,"-"),sentenceCase:d=>t(a(d," ")),titleCase:d=>r(d).map(t).join(" ")},FB}var ZB=Qje(),tk={exports:{}},are;function Jje(){if(are)return tk.exports;are=1,tk.exports=function(n){return e(r(n),n)},tk.exports.array=e;function e(n,i){var s=n.length,u=new Array(s),c={},A=s,d=t(i),g=a(n);for(i.forEach(function(b){if(!g.has(b[0])||!g.has(b[1]))throw new Error("Unknown node. There is an unknown node in the supplied edges.")});A--;)c[A]||m(n[A],A,new Set);return u;function m(b,w,E){if(E.has(b)){var x;try{x=", node was:"+JSON.stringify(b)}catch{x=""}throw new Error("Cyclic dependency"+x)}if(!g.has(b))throw new Error("Found unknown node. Make sure to provided all involved nodes. Unknown node: "+JSON.stringify(b));if(!c[w]){c[w]=!0;var _=d.get(b)||new Set;if(_=Array.from(_),w=_.length){E.add(b);do{var I=_[--w];m(I,g.get(I),E)}while(w);E.delete(b)}u[--s]=b}}}function r(n){for(var i=new Set,s=0,u=n.length;s<u;s++){var c=n[s];i.add(c[0]),i.add(c[1])}return Array.from(i)}function t(n){for(var i=new Map,s=0,u=n.length;s<u;s++){var c=n[s];i.has(c[0])||i.set(c[0],new Set),i.has(c[1])||i.set(c[1],new Set),i.get(c[0]).add(c[1])}return i}function a(n){for(var i=new Map,s=0,u=n.length;s<u;s++)i.set(n[s],s);return i}return tk.exports}var Kje=Jje();const eqe=Of(Kje),rqe=Object.prototype.toString,tqe=Error.prototype.toString,aqe=RegExp.prototype.toString,nqe=typeof Symbol<"u"?Symbol.prototype.toString:()=>"",iqe=/^Symbol\((.*)\)(.*)$/;function oqe(e){return e!=+e?"NaN":e===0&&1/e<0?"-0":""+e}function nre(e,r=!1){if(e==null||e===!0||e===!1)return""+e;const t=typeof e;if(t==="number")return oqe(e);if(t==="string")return r?`"${e}"`:e;if(t==="function")return"[Function "+(e.name||"anonymous")+"]";if(t==="symbol")return nqe.call(e).replace(iqe,"Symbol($1)");const a=rqe.call(e).slice(8,-1);return a==="Date"?isNaN(e.getTime())?""+e:e.toISOString(e):a==="Error"||e instanceof Error?"["+tqe.call(e)+"]":a==="RegExp"?aqe.call(e):null}function uA(e,r){let t=nre(e,r);return t!==null?t:JSON.stringify(e,function(a,n){let i=nre(this[a],r);return i!==null?i:n},2)}function ire(e){return e==null?[]:[].concat(e)}let ore,sre,lre,sqe=/\$\{\s*(\w+)\s*\}/g;ore=Symbol.toStringTag;class ure{constructor(r,t,a,n){this.name=void 0,this.message=void 0,this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=void 0,this.inner=void 0,this[ore]="Error",this.name="ValidationError",this.value=t,this.path=a,this.type=n,this.errors=[],this.inner=[],ire(r).forEach(i=>{if(R2.isError(i)){this.errors.push(...i.errors);const s=i.inner.length?i.inner:[i];this.inner.push(...s)}else this.errors.push(i)}),this.message=this.errors.length>1?`${this.errors.length} errors occurred`:this.errors[0]}}sre=Symbol.hasInstance,lre=Symbol.toStringTag;class R2 extends Error{static formatError(r,t){const a=t.label||t.path||"this";return t=Object.assign({},t,{path:a,originalPath:t.path}),typeof r=="string"?r.replace(sqe,(n,i)=>uA(t[i])):typeof r=="function"?r(t):r}static isError(r){return r&&r.name==="ValidationError"}constructor(r,t,a,n,i){const s=new ure(r,t,a,n);if(i)return s;super(),this.value=void 0,this.path=void 0,this.type=void 0,this.params=void 0,this.errors=[],this.inner=[],this[lre]="Error",this.name=s.name,this.message=s.message,this.type=s.type,this.value=s.value,this.path=s.path,this.errors=s.errors,this.inner=s.inner,Error.captureStackTrace&&Error.captureStackTrace(this,R2)}static[sre](r){return ure[Symbol.hasInstance](r)||super[Symbol.hasInstance](r)}}let zu={default:"${path} is invalid",required:"${path} is a required field",defined:"${path} must be defined",notNull:"${path} cannot be null",oneOf:"${path} must be one of the following values: ${values}",notOneOf:"${path} must not be one of the following values: ${values}",notType:({path:e,type:r,value:t,originalValue:a})=>{const n=a!=null&&a!==t?` (cast from the value \`${uA(a,!0)}\`).`:".";return r!=="mixed"?`${e} must be a \`${r}\` type, but the final value was: \`${uA(t,!0)}\``+n:`${e} must match the configured type. The validated value was: \`${uA(t,!0)}\``+n}},vi={length:"${path} must be exactly ${length} characters",min:"${path} must be at least ${min} characters",max:"${path} must be at most ${max} characters",matches:'${path} must match the following: "${regex}"',email:"${path} must be a valid email",url:"${path} must be a valid URL",uuid:"${path} must be a valid UUID",datetime:"${path} must be a valid ISO date-time",datetime_precision:"${path} must be a valid ISO date-time with a sub-second precision of exactly ${precision} digits",datetime_offset:'${path} must be a valid ISO date-time with UTC "Z" timezone',trim:"${path} must be a trimmed string",lowercase:"${path} must be a lowercase string",uppercase:"${path} must be a upper case string"},lqe={min:"${path} must be greater than or equal to ${min}",max:"${path} must be less than or equal to ${max}",lessThan:"${path} must be less than ${less}",moreThan:"${path} must be greater than ${more}",positive:"${path} must be a positive number",negative:"${path} must be a negative number",integer:"${path} must be an integer"},PB={min:"${path} field must be later than ${min}",max:"${path} field must be at earlier than ${max}"},uqe={isValue:"${path} field must be ${value}"},ak={noUnknown:"${path} field has unspecified keys: ${unknown}",exact:"${path} object contains unknown properties: ${properties}"};Object.assign(Object.create(null),{mixed:zu,string:vi,number:lqe,date:PB,object:ak,array:{min:"${path} field must have at least ${min} items",max:"${path} field must have less than or equal to ${max} items",length:"${path} must have ${length} items"},boolean:uqe,tuple:{notType:e=>{const{path:r,value:t,spec:a}=e,n=a.types.length;if(Array.isArray(t)){if(t.length<n)return`${r} tuple value has too few items, expected a length of ${n} but got ${t.length} for value: \`${uA(t,!0)}\``;if(t.length>n)return`${r} tuple value has too many items, expected a length of ${n} but got ${t.length} for value: \`${uA(t,!0)}\``}return R2.formatError(zu.notType,e)}}});const jB=e=>e&&e.__isYupSchema__;class nk{static fromOptions(r,t){if(!t.then&&!t.otherwise)throw new TypeError("either `then:` or `otherwise:` is required for `when()` conditions");let{is:a,then:n,otherwise:i}=t,s=typeof a=="function"?a:(...u)=>u.every(c=>c===a);return new nk(r,(u,c)=>{var A;let d=s(...u)?n:i;return(A=d?.(c))!=null?A:c})}constructor(r,t){this.fn=void 0,this.refs=r,this.refs=r,this.fn=t}resolve(r,t){let a=this.refs.map(i=>i.getValue(t?.value,t?.parent,t?.context)),n=this.fn(a,r,t);if(n===void 0||n===r)return r;if(!jB(n))throw new TypeError("conditions must return a schema object");return n.resolve(t)}}const ik={context:"$",value:"."};function cre(e,r){return new cA(e,r)}class cA{constructor(r,t={}){if(this.key=void 0,this.isContext=void 0,this.isValue=void 0,this.isSibling=void 0,this.path=void 0,this.getter=void 0,this.map=void 0,typeof r!="string")throw new TypeError("ref must be a string, got: "+r);if(this.key=r.trim(),r==="")throw new TypeError("ref must be a non-empty string");this.isContext=this.key[0]===ik.context,this.isValue=this.key[0]===ik.value,this.isSibling=!this.isContext&&!this.isValue;let a=this.isContext?ik.context:this.isValue?ik.value:"";this.path=this.key.slice(a.length),this.getter=this.path&&pd.getter(this.path,!0),this.map=t.map}getValue(r,t,a){let n=this.isContext?a:this.isValue?r:t;return this.getter&&(n=this.getter(n||{})),this.map&&(n=this.map(n)),n}cast(r,t){return this.getValue(r,t?.parent,t?.context)}resolve(){return this}describe(){return{type:"ref",key:this.key}}toString(){return`Ref(${this.key})`}static isRef(r){return r&&r.__isYupRef}}cA.prototype.__isYupRef=!0;const md=e=>e==null;function a9(e){function r({value:t,path:a="",options:n,originalValue:i,schema:s},u,c){const{name:A,test:d,params:g,message:m,skipAbsent:b}=e;let{parent:w,context:E,abortEarly:x=s.spec.abortEarly,disableStackTrace:_=s.spec.disableStackTrace}=n;const I={value:t,parent:w,context:E};function S(V={}){const ee=fre(Object.assign({value:t,originalValue:i,label:s.spec.label,path:V.path||a,spec:s.spec,disableStackTrace:V.disableStackTrace||_},g,V.params),I),K=new R2(R2.formatError(V.message||m,ee),t,ee.path,V.type||A,ee.disableStackTrace);return K.params=ee,K}const R=x?u:c;let M={path:a,parent:w,type:A,from:n.from,createError:S,resolve(V){return Are(V,I)},options:n,originalValue:i,schema:s};const N=V=>{R2.isError(V)?R(V):V?c(null):R(S())},L=V=>{R2.isError(V)?R(V):u(V)};if(b&&md(t))return N(!0);let B;try{var G;if(B=d.call(M,t,M),typeof((G=B)==null?void 0:G.then)=="function"){if(n.sync)throw new Error(`Validation test of type: "${M.type}" returned a Promise during a synchronous validate. This test will finish after the validate call has returned`);return Promise.resolve(B).then(N,L)}}catch(V){L(V);return}N(B)}return r.OPTIONS=e,r}function fre(e,r){if(!e)return e;for(const t of Object.keys(e))e[t]=Are(e[t],r);return e}function Are(e,r){return cA.isRef(e)?e.getValue(r.value,r.parent,r.context):e}function cqe(e,r,t,a=t){let n,i,s;return r?(pd.forEach(r,(u,c,A)=>{let d=c?u.slice(1,u.length-1):u;e=e.resolve({context:a,parent:n,value:t});let g=e.type==="tuple",m=A?parseInt(d,10):0;if(e.innerType||g){if(g&&!A)throw new Error(`Yup.reach cannot implicitly index into a tuple type. the path part "${s}" must contain an index to the tuple element, e.g. "${s}[0]"`);if(t&&m>=t.length)throw new Error(`Yup.reach cannot resolve an array item at index: ${u}, in the path: ${r}. because there is no value at that index. `);n=t,t=t&&t[m],e=g?e.spec.types[m]:e.innerType}if(!A){if(!e.fields||!e.fields[d])throw new Error(`The schema does not contain the path: ${r}. (failed at: ${s} which is a type: "${e.type}")`);n=t,t=t&&t[d],e=e.fields[d]}i=d,s=c?"["+u+"]":"."+u}),{schema:e,parent:n,parentPath:i}):{parent:n,parentPath:r,schema:e}}class ok extends Set{describe(){const r=[];for(const t of this.values())r.push(cA.isRef(t)?t.describe():t);return r}resolveAll(r){let t=[];for(const a of this.values())t.push(r(a));return t}clone(){return new ok(this.values())}merge(r,t){const a=this.clone();return r.forEach(n=>a.add(n)),t.forEach(n=>a.delete(n)),a}}function n9(e,r=new Map){if(jB(e)||!e||typeof e!="object")return e;if(r.has(e))return r.get(e);let t;if(e instanceof Date)t=new Date(e.getTime()),r.set(e,t);else if(e instanceof RegExp)t=new RegExp(e),r.set(e,t);else if(Array.isArray(e)){t=new Array(e.length),r.set(e,t);for(let a=0;a<e.length;a++)t[a]=n9(e[a],r)}else if(e instanceof Map){t=new Map,r.set(e,t);for(const[a,n]of e.entries())t.set(a,n9(n,r))}else if(e instanceof Set){t=new Set,r.set(e,t);for(const a of e)t.add(n9(a,r))}else if(e instanceof Object){t={},r.set(e,t);for(const[a,n]of Object.entries(e))t[a]=n9(n,r)}else throw Error(`Unable to clone ${e}`);return t}function fqe(e){if(!(e!=null&&e.length))return;const r=[];let t="",a=!1,n=!1;for(let i=0;i<e.length;i++){const s=e[i];if(s==="["&&!n){t&&(r.push(...t.split(".").filter(Boolean)),t=""),a=!0;continue}if(s==="]"&&!n){t&&(/^\d+$/.test(t)?r.push(t):r.push(t.replace(/^"|"$/g,"")),t=""),a=!1;continue}if(s==='"'){n=!n;continue}if(s==="."&&!a&&!n){t&&(r.push(t),t="");continue}t+=s}return t&&r.push(...t.split(".").filter(Boolean)),r}function Aqe(e,r){const t=r?`${r}.${e.path}`:e.path;return e.errors.map(a=>({message:a,path:fqe(t)}))}function dre(e,r){var t;if(!((t=e.inner)!=null&&t.length)&&e.errors.length)return Aqe(e,r);const a=r?`${r}.${e.path}`:e.path;return e.inner.flatMap(n=>dre(n,a))}class Uu{constructor(r){this.type=void 0,this.deps=[],this.tests=void 0,this.transforms=void 0,this.conditions=[],this._mutate=void 0,this.internalTests={},this._whitelist=new ok,this._blacklist=new ok,this.exclusiveTests=Object.create(null),this._typeCheck=void 0,this.spec=void 0,this.tests=[],this.transforms=[],this.withMutation(()=>{this.typeError(zu.notType)}),this.type=r.type,this._typeCheck=r.check,this.spec=Object.assign({strip:!1,strict:!1,abortEarly:!0,recursive:!0,disableStackTrace:!1,nullable:!1,optional:!0,coerce:!0},r?.spec),this.withMutation(t=>{t.nonNullable()})}get _type(){return this.type}clone(r){if(this._mutate)return r&&Object.assign(this.spec,r),this;const t=Object.create(Object.getPrototypeOf(this));return t.type=this.type,t._typeCheck=this._typeCheck,t._whitelist=this._whitelist.clone(),t._blacklist=this._blacklist.clone(),t.internalTests=Object.assign({},this.internalTests),t.exclusiveTests=Object.assign({},this.exclusiveTests),t.deps=[...this.deps],t.conditions=[...this.conditions],t.tests=[...this.tests],t.transforms=[...this.transforms],t.spec=n9(Object.assign({},this.spec,r)),t}label(r){let t=this.clone();return t.spec.label=r,t}meta(...r){if(r.length===0)return this.spec.meta;let t=this.clone();return t.spec.meta=Object.assign(t.spec.meta||{},r[0]),t}withMutation(r){let t=this._mutate;this._mutate=!0;let a=r(this);return this._mutate=t,a}concat(r){if(!r||r===this)return this;if(r.type!==this.type&&this.type!=="mixed")throw new TypeError(`You cannot \`concat()\` schema's of different types: ${this.type} and ${r.type}`);let t=this,a=r.clone();const n=Object.assign({},t.spec,a.spec);return a.spec=n,a.internalTests=Object.assign({},t.internalTests,a.internalTests),a._whitelist=t._whitelist.merge(r._whitelist,r._blacklist),a._blacklist=t._blacklist.merge(r._blacklist,r._whitelist),a.tests=t.tests,a.exclusiveTests=t.exclusiveTests,a.withMutation(i=>{r.tests.forEach(s=>{i.test(s.OPTIONS)})}),a.transforms=[...t.transforms,...a.transforms],a}isType(r){return r==null?!!(this.spec.nullable&&r===null||this.spec.optional&&r===void 0):this._typeCheck(r)}resolve(r){let t=this;if(t.conditions.length){let a=t.conditions;t=t.clone(),t.conditions=[],t=a.reduce((n,i)=>i.resolve(n,r),t),t=t.resolve(r)}return t}resolveOptions(r){var t,a,n,i;return Object.assign({},r,{from:r.from||[],strict:(t=r.strict)!=null?t:this.spec.strict,abortEarly:(a=r.abortEarly)!=null?a:this.spec.abortEarly,recursive:(n=r.recursive)!=null?n:this.spec.recursive,disableStackTrace:(i=r.disableStackTrace)!=null?i:this.spec.disableStackTrace})}cast(r,t={}){let a=this.resolve(Object.assign({},t,{value:r})),n=t.assert==="ignore-optionality",i=a._cast(r,t);if(t.assert!==!1&&!a.isType(i)){if(n&&md(i))return i;let s=uA(r),u=uA(i);throw new TypeError(`The value of ${t.path||"field"} could not be cast to a value that satisfies the schema type: "${a.type}".
1759
1759
 
1760
1760
  attempted value: ${s}
1761
1761
  `+(u!==s?`result of cast: ${u}`:""))}return i}_cast(r,t){let a=r===void 0?r:this.transforms.reduce((n,i)=>i.call(this,n,r,this,t),r);return a===void 0&&(a=this.getDefault(t)),a}_validate(r,t={},a,n){let{path:i,originalValue:s=r,strict:u=this.spec.strict}=t,c=r;u||(c=this._cast(c,Object.assign({assert:!1},t)));let A=[];for(let d of Object.values(this.internalTests))d&&A.push(d);this.runTests({path:i,value:c,originalValue:s,options:t,tests:A},a,d=>{if(d.length)return n(d,c);this.runTests({path:i,value:c,originalValue:s,options:t,tests:this.tests},a,n)})}runTests(r,t,a){let n=!1,{tests:i,value:s,originalValue:u,path:c,options:A}=r,d=E=>{n||(n=!0,t(E,s))},g=E=>{n||(n=!0,a(E,s))},m=i.length,b=[];if(!m)return g([]);let w={value:s,originalValue:u,path:c,options:A,schema:this};for(let E=0;E<i.length;E++){const x=i[E];x(w,d,function(I){I&&(Array.isArray(I)?b.push(...I):b.push(I)),--m<=0&&g(b)})}}asNestedTest({key:r,index:t,parent:a,parentPath:n,originalParent:i,options:s}){const u=r??t;if(u==null)throw TypeError("Must include `key` or `index` for nested validations");const c=typeof u=="number";let A=a[u];const d=Object.assign({},s,{strict:!0,parent:a,value:A,originalValue:i[u],key:void 0,[c?"index":"key"]:u,path:c||u.includes(".")?`${n||""}[${c?u:`"${u}"`}]`:(n?`${n}.`:"")+r});return(g,m,b)=>this.resolve(d)._validate(A,d,m,b)}validate(r,t){var a;let n=this.resolve(Object.assign({},t,{value:r})),i=(a=t?.disableStackTrace)!=null?a:n.spec.disableStackTrace;return new Promise((s,u)=>n._validate(r,t,(c,A)=>{R2.isError(c)&&(c.value=A),u(c)},(c,A)=>{c.length?u(new R2(c,A,void 0,void 0,i)):s(A)}))}validateSync(r,t){var a;let n=this.resolve(Object.assign({},t,{value:r})),i,s=(a=t?.disableStackTrace)!=null?a:n.spec.disableStackTrace;return n._validate(r,Object.assign({},t,{sync:!0}),(u,c)=>{throw R2.isError(u)&&(u.value=c),u},(u,c)=>{if(u.length)throw new R2(u,r,void 0,void 0,s);i=c}),i}isValid(r,t){return this.validate(r,t).then(()=>!0,a=>{if(R2.isError(a))return!1;throw a})}isValidSync(r,t){try{return this.validateSync(r,t),!0}catch(a){if(R2.isError(a))return!1;throw a}}_getDefault(r){let t=this.spec.default;return t==null?t:typeof t=="function"?t.call(this,r):n9(t)}getDefault(r){return this.resolve(r||{})._getDefault(r)}default(r){return arguments.length===0?this._getDefault():this.clone({default:r})}strict(r=!0){return this.clone({strict:r})}nullability(r,t){const a=this.clone({nullable:r});return a.internalTests.nullable=a9({message:t,name:"nullable",test(n){return n===null?this.schema.spec.nullable:!0}}),a}optionality(r,t){const a=this.clone({optional:r});return a.internalTests.optionality=a9({message:t,name:"optionality",test(n){return n===void 0?this.schema.spec.optional:!0}}),a}optional(){return this.optionality(!0)}defined(r=zu.defined){return this.optionality(!1,r)}nullable(){return this.nullability(!0)}nonNullable(r=zu.notNull){return this.nullability(!1,r)}required(r=zu.required){return this.clone().withMutation(t=>t.nonNullable(r).defined(r))}notRequired(){return this.clone().withMutation(r=>r.nullable().optional())}transform(r){let t=this.clone();return t.transforms.push(r),t}test(...r){let t;if(r.length===1?typeof r[0]=="function"?t={test:r[0]}:t=r[0]:r.length===2?t={name:r[0],test:r[1]}:t={name:r[0],message:r[1],test:r[2]},t.message===void 0&&(t.message=zu.default),typeof t.test!="function")throw new TypeError("`test` is a required parameters");let a=this.clone(),n=a9(t),i=t.exclusive||t.name&&a.exclusiveTests[t.name]===!0;if(t.exclusive&&!t.name)throw new TypeError("Exclusive tests must provide a unique `name` identifying the test");return t.name&&(a.exclusiveTests[t.name]=!!t.exclusive),a.tests=a.tests.filter(s=>!(s.OPTIONS.name===t.name&&(i||s.OPTIONS.test===n.OPTIONS.test))),a.tests.push(n),a}when(r,t){!Array.isArray(r)&&typeof r!="string"&&(t=r,r=".");let a=this.clone(),n=ire(r).map(i=>new cA(i));return n.forEach(i=>{i.isSibling&&a.deps.push(i.key)}),a.conditions.push(typeof t=="function"?new nk(n,t):nk.fromOptions(n,t)),a}typeError(r){let t=this.clone();return t.internalTests.typeError=a9({message:r,name:"typeError",skipAbsent:!0,test(a){return this.schema._typeCheck(a)?!0:this.createError({params:{type:this.schema.type}})}}),t}oneOf(r,t=zu.oneOf){let a=this.clone();return r.forEach(n=>{a._whitelist.add(n),a._blacklist.delete(n)}),a.internalTests.whiteList=a9({message:t,name:"oneOf",skipAbsent:!0,test(n){let i=this.schema._whitelist,s=i.resolveAll(this.resolve);return s.includes(n)?!0:this.createError({params:{values:Array.from(i).join(", "),resolved:s}})}}),a}notOneOf(r,t=zu.notOneOf){let a=this.clone();return r.forEach(n=>{a._blacklist.add(n),a._whitelist.delete(n)}),a.internalTests.blacklist=a9({message:t,name:"notOneOf",test(n){let i=this.schema._blacklist,s=i.resolveAll(this.resolve);return s.includes(n)?this.createError({params:{values:Array.from(i).join(", "),resolved:s}}):!0}}),a}strip(r=!0){let t=this.clone();return t.spec.strip=r,t}describe(r){const t=(r?this.resolve(r):this).clone(),{label:a,meta:n,optional:i,nullable:s}=t.spec;return{meta:n,label:a,optional:i,nullable:s,default:t.getDefault(r),type:t.type,oneOf:t._whitelist.describe(),notOneOf:t._blacklist.describe(),tests:t.tests.filter((c,A,d)=>d.findIndex(g=>g.OPTIONS.name===c.OPTIONS.name)===A).map(c=>{const A=c.OPTIONS.params&&r?fre(Object.assign({},c.OPTIONS.params),r):c.OPTIONS.params;return{name:c.OPTIONS.name,params:A}})}}get"~standard"(){const r=this;return{version:1,vendor:"yup",async validate(a){try{return{value:await r.validate(a,{abortEarly:!1})}}catch(n){if(n instanceof R2)return{issues:dre(n)};throw n}}}}}Uu.prototype.__isYupSchema__=!0;for(const e of["validate","validateSync"])Uu.prototype[`${e}At`]=function(r,t,a={}){const{parent:n,parentPath:i,schema:s}=cqe(this,r,t,a.context);return s[e](n&&n[i],Object.assign({},a,{parent:n,path:r}))};for(const e of["equals","is"])Uu.prototype[e]=Uu.prototype.oneOf;for(const e of["not","nope"])Uu.prototype[e]=Uu.prototype.notOneOf;const dqe=/^(\d{4}|[+-]\d{6})(?:-?(\d{2})(?:-?(\d{2}))?)?(?:[ T]?(\d{2}):?(\d{2})(?::?(\d{2})(?:[,.](\d{1,}))?)?(?:(Z)|([+-])(\d{2})(?::?(\d{2}))?)?)?$/;function hqe(e){const r=qB(e);if(!r)return Date.parse?Date.parse(e):Number.NaN;if(r.z===void 0&&r.plusMinus===void 0)return new Date(r.year,r.month,r.day,r.hour,r.minute,r.second,r.millisecond).valueOf();let t=0;return r.z!=="Z"&&r.plusMinus!==void 0&&(t=r.hourOffset*60+r.minuteOffset,r.plusMinus==="+"&&(t=0-t)),Date.UTC(r.year,r.month,r.day,r.hour,r.minute+t,r.second,r.millisecond)}function qB(e){var r,t;const a=dqe.exec(e);return a?{year:Ac(a[1]),month:Ac(a[2],1)-1,day:Ac(a[3],1),hour:Ac(a[4]),minute:Ac(a[5]),second:Ac(a[6]),millisecond:a[7]?Ac(a[7].substring(0,3)):0,precision:(r=(t=a[7])==null?void 0:t.length)!=null?r:void 0,z:a[8]||void 0,plusMinus:a[9]||void 0,hourOffset:Ac(a[10]),minuteOffset:Ac(a[11])}:null}function Ac(e,r=0){return Number(e)||r}let pqe=/^[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,mqe=/^((https?|ftp):)?\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(\#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i,gqe=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i,bqe="^\\d{4}-\\d{2}-\\d{2}",vqe="\\d{2}:\\d{2}:\\d{2}",yqe="(([+-]\\d{2}(:?\\d{2})?)|Z)",wqe=new RegExp(`${bqe}T${vqe}(\\.\\d+)?${yqe}$`),Eqe=e=>md(e)||e===e.trim(),xqe={}.toString();function ns(){return new hre}class hre extends Uu{constructor(){super({type:"string",check(r){return r instanceof String&&(r=r.valueOf()),typeof r=="string"}}),this.withMutation(()=>{this.transform((r,t)=>{if(!this.spec.coerce||this.isType(r)||Array.isArray(r))return r;const a=r!=null&&r.toString?r.toString():r;return a===xqe?r:a})})}required(r){return super.required(r).withMutation(t=>t.test({message:r||zu.required,name:"required",skipAbsent:!0,test:a=>!!a.length}))}notRequired(){return super.notRequired().withMutation(r=>(r.tests=r.tests.filter(t=>t.OPTIONS.name!=="required"),r))}length(r,t=vi.length){return this.test({message:t,name:"length",exclusive:!0,params:{length:r},skipAbsent:!0,test(a){return a.length===this.resolve(r)}})}min(r,t=vi.min){return this.test({message:t,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(a){return a.length>=this.resolve(r)}})}max(r,t=vi.max){return this.test({name:"max",exclusive:!0,message:t,params:{max:r},skipAbsent:!0,test(a){return a.length<=this.resolve(r)}})}matches(r,t){let a=!1,n,i;return t&&(typeof t=="object"?{excludeEmptyString:a=!1,message:n,name:i}=t:n=t),this.test({name:i||"matches",message:n||vi.matches,params:{regex:r},skipAbsent:!0,test:s=>s===""&&a||s.search(r)!==-1})}email(r=vi.email){return this.matches(pqe,{name:"email",message:r,excludeEmptyString:!0})}url(r=vi.url){return this.matches(mqe,{name:"url",message:r,excludeEmptyString:!0})}uuid(r=vi.uuid){return this.matches(gqe,{name:"uuid",message:r,excludeEmptyString:!1})}datetime(r){let t="",a,n;return r&&(typeof r=="object"?{message:t="",allowOffset:a=!1,precision:n=void 0}=r:t=r),this.matches(wqe,{name:"datetime",message:t||vi.datetime,excludeEmptyString:!0}).test({name:"datetime_offset",message:t||vi.datetime_offset,params:{allowOffset:a},skipAbsent:!0,test:i=>{if(!i||a)return!0;const s=qB(i);return s?!!s.z:!1}}).test({name:"datetime_precision",message:t||vi.datetime_precision,params:{precision:n},skipAbsent:!0,test:i=>{if(!i||n==null)return!0;const s=qB(i);return s?s.precision===n:!1}})}ensure(){return this.default("").transform(r=>r===null?"":r)}trim(r=vi.trim){return this.transform(t=>t!=null?t.trim():t).test({message:r,name:"trim",test:Eqe})}lowercase(r=vi.lowercase){return this.transform(t=>md(t)?t:t.toLowerCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>md(t)||t===t.toLowerCase()})}uppercase(r=vi.uppercase){return this.transform(t=>md(t)?t:t.toUpperCase()).test({message:r,name:"string_case",exclusive:!0,skipAbsent:!0,test:t=>md(t)||t===t.toUpperCase()})}}ns.prototype=hre.prototype;let kqe=new Date(""),_qe=e=>Object.prototype.toString.call(e)==="[object Date]";class LB extends Uu{constructor(){super({type:"date",check(r){return _qe(r)&&!isNaN(r.getTime())}}),this.withMutation(()=>{this.transform((r,t)=>!this.spec.coerce||this.isType(r)||r===null?r:(r=hqe(r),isNaN(r)?LB.INVALID_DATE:new Date(r)))})}prepareParam(r,t){let a;if(cA.isRef(r))a=r;else{let n=this.cast(r);if(!this._typeCheck(n))throw new TypeError(`\`${t}\` must be a Date or a value that can be \`cast()\` to a Date`);a=n}return a}min(r,t=PB.min){let a=this.prepareParam(r,"min");return this.test({message:t,name:"min",exclusive:!0,params:{min:r},skipAbsent:!0,test(n){return n>=this.resolve(a)}})}max(r,t=PB.max){let a=this.prepareParam(r,"max");return this.test({message:t,name:"max",exclusive:!0,params:{max:r},skipAbsent:!0,test(n){return n<=this.resolve(a)}})}}LB.INVALID_DATE=kqe;function Cqe(e,r=[]){let t=[],a=new Set,n=new Set(r.map(([s,u])=>`${s}-${u}`));function i(s,u){let c=pd.split(s)[0];a.add(c),n.has(`${u}-${c}`)||t.push([u,c])}for(const s of Object.keys(e)){let u=e[s];a.add(s),cA.isRef(u)&&u.isSibling?i(u.path,s):jB(u)&&"deps"in u&&u.deps.forEach(c=>i(c,s))}return eqe.array(Array.from(a),t).reverse()}function pre(e,r){let t=1/0;return e.some((a,n)=>{var i;if((i=r.path)!=null&&i.includes(a))return t=n,!0}),t}function mre(e){return(r,t)=>pre(e,r)-pre(e,t)}const Sqe=(e,r,t)=>{if(typeof e!="string")return e;let a=e;try{a=JSON.parse(e)}catch{}return t.isType(a)?a:e};function sk(e){if("fields"in e){const r={};for(const[t,a]of Object.entries(e.fields))r[t]=sk(a);return e.setFields(r)}if(e.type==="array"){const r=e.optional();return r.innerType&&(r.innerType=sk(r.innerType)),r}return e.type==="tuple"?e.optional().clone({types:e.spec.types.map(sk)}):"optional"in e?e.optional():e}const Tqe=(e,r)=>{const t=[...pd.normalizePath(r)];if(t.length===1)return t[0]in e;let a=t.pop(),n=pd.getter(pd.join(t),!0)(e);return!!(n&&a in n)};let gre=e=>Object.prototype.toString.call(e)==="[object Object]";function bre(e,r){let t=Object.keys(e.fields);return Object.keys(r).filter(a=>t.indexOf(a)===-1)}const Iqe=mre([]);function i9(e){return new vre(e)}class vre extends Uu{constructor(r){super({type:"object",check(t){return gre(t)||typeof t=="function"}}),this.fields=Object.create(null),this._sortErrors=Iqe,this._nodes=[],this._excludedEdges=[],this.withMutation(()=>{r&&this.shape(r)})}_cast(r,t={}){var a;let n=super._cast(r,t);if(n===void 0)return this.getDefault(t);if(!this._typeCheck(n))return n;let i=this.fields,s=(a=t.stripUnknown)!=null?a:this.spec.noUnknown,u=[].concat(this._nodes,Object.keys(n).filter(g=>!this._nodes.includes(g))),c={},A=Object.assign({},t,{parent:c,__validating:t.__validating||!1}),d=!1;for(const g of u){let m=i[g],b=g in n,w=n[g];if(m){let E;A.path=(t.path?`${t.path}.`:"")+g,m=m.resolve({value:w,context:t.context,parent:c});let x=m instanceof Uu?m.spec:void 0,_=x?.strict;if(x!=null&&x.strip){d=d||g in n;continue}E=!t.__validating||!_?m.cast(w,A):w,E!==void 0&&(c[g]=E)}else b&&!s&&(c[g]=w);(b!==g in c||c[g]!==w)&&(d=!0)}return d?c:n}_validate(r,t={},a,n){let{from:i=[],originalValue:s=r,recursive:u=this.spec.recursive}=t;t.from=[{schema:this,value:s},...i],t.__validating=!0,t.originalValue=s,super._validate(r,t,a,(c,A)=>{if(!u||!gre(A)){n(c,A);return}s=s||A;let d=[];for(let g of this._nodes){let m=this.fields[g];!m||cA.isRef(m)||d.push(m.asNestedTest({options:t,key:g,parent:A,parentPath:t.path,originalParent:s}))}this.runTests({tests:d,value:A,originalValue:s,options:t},a,g=>{n(g.sort(this._sortErrors).concat(c),A)})})}clone(r){const t=super.clone(r);return t.fields=Object.assign({},this.fields),t._nodes=this._nodes,t._excludedEdges=this._excludedEdges,t._sortErrors=this._sortErrors,t}concat(r){let t=super.concat(r),a=t.fields;for(let[n,i]of Object.entries(this.fields)){const s=a[n];a[n]=s===void 0?i:s}return t.withMutation(n=>n.setFields(a,[...this._excludedEdges,...r._excludedEdges]))}_getDefault(r){if("default"in this.spec)return super._getDefault(r);if(!this._nodes.length)return;let t={};return this._nodes.forEach(a=>{var n;const i=this.fields[a];let s=r;(n=s)!=null&&n.value&&(s=Object.assign({},s,{parent:s.value,value:s.value[a]})),t[a]=i&&"getDefault"in i?i.getDefault(s):void 0}),t}setFields(r,t){let a=this.clone();return a.fields=r,a._nodes=Cqe(r,t),a._sortErrors=mre(Object.keys(r)),t&&(a._excludedEdges=t),a}shape(r,t=[]){return this.clone().withMutation(a=>{let n=a._excludedEdges;return t.length&&(Array.isArray(t[0])||(t=[t]),n=[...a._excludedEdges,...t]),a.setFields(Object.assign(a.fields,r),n)})}partial(){const r={};for(const[t,a]of Object.entries(this.fields))r[t]="optional"in a&&a.optional instanceof Function?a.optional():a;return this.setFields(r)}deepPartial(){return sk(this)}pick(r){const t={};for(const a of r)this.fields[a]&&(t[a]=this.fields[a]);return this.setFields(t,this._excludedEdges.filter(([a,n])=>r.includes(a)&&r.includes(n)))}omit(r){const t=[];for(const a of Object.keys(this.fields))r.includes(a)||t.push(a);return this.pick(t)}from(r,t,a){let n=pd.getter(r,!0);return this.transform(i=>{if(!i)return i;let s=i;return Tqe(i,r)&&(s=Object.assign({},i),a||delete s[r],s[t]=n(i)),s})}json(){return this.transform(Sqe)}exact(r){return this.test({name:"exact",exclusive:!0,message:r||ak.exact,test(t){if(t==null)return!0;const a=bre(this.schema,t);return a.length===0||this.createError({params:{properties:a.join(", ")}})}})}stripUnknown(){return this.clone({noUnknown:!0})}noUnknown(r=!0,t=ak.noUnknown){typeof r!="boolean"&&(t=r,r=!0);let a=this.test({name:"noUnknown",exclusive:!0,message:t,test(n){if(n==null)return!0;const i=bre(this.schema,n);return!r||i.length===0||this.createError({params:{unknown:i.join(", ")}})}});return a.spec.noUnknown=r,a}unknown(r=!0,t=ak.noUnknown){return this.noUnknown(!r,t)}transformKeys(r){return this.transform(t=>{if(!t)return t;const a={};for(const n of Object.keys(t))a[r(n)]=t[n];return a})}camelCase(){return this.transformKeys(ZB.camelCase)}snakeCase(){return this.transformKeys(ZB.snakeCase)}constantCase(){return this.transformKeys(r=>ZB.snakeCase(r).toUpperCase())}describe(r){const t=(r?this.resolve(r):this).clone(),a=super.describe(r);a.fields={};for(const[i,s]of Object.entries(t.fields)){var n;let u=r;(n=u)!=null&&n.value&&(u=Object.assign({},u,{parent:u.value,value:u.value[i]})),a.fields[i]=s.describe(u)}return a}}i9.prototype=vre.prototype;const Rqe=i9().shape({email:ns().required("Please enter your email").email("Enter a valid email"),password:ns().required("Please enter your password").min(8,"Min password length is 8")}),Mqe=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const[e,r]=Z.useState(!1),[t,a]=Z.useState(!1),[n,i]=Z.useState({google:!1,apple:!1}),[s,u]=Z.useState(null),c=Wa(),{control:A,handleSubmit:d,formState:{errors:g}}=t7({defaultValues:{email:"",password:""},mode:"onSubmit",resolver:a7(Rqe)}),{loginUsingEmail:m,loginWithGoogle:b,loginWithApple:w}=G0(),E=async(_,I)=>{i(S=>({...S,[_]:!0})),u(null);try{await I()}catch(S){u(S.message||`Failed to login with ${_.charAt(0).toUpperCase()+_.slice(1)}`)}finally{i(S=>({...S,[_]:!1}))}},x=async _=>{const{email:I,password:S}=_;a(!0);try{const R=await m(I.toLowerCase(),S);R?.error&&u(R.error)}catch(R){u(R)}finally{a(!1)}};return O.jsxs("div",{className:"qc:w-full qc:space-y-6 qc:bg-background",children:[O.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:d(x),className:"qc:space-y-6",children:[O.jsxs("div",{className:"qc:space-y-9",children:[O.jsx(Nl,{name:"email",control:A,render:({field:{value:_,onChange:I,onBlur:S}})=>O.jsx(xl,{label:"Email",disabled:t,type:"email",value:_,onChange:I,onBlur:S,autoComplete:"email",error:g.email?.message})}),O.jsx(Nl,{name:"password",control:A,render:({field:{value:_,onChange:I,onBlur:S}})=>O.jsxs("div",{className:"qc:relative",children:[O.jsx(xl,{label:"Password",disabled:t,type:e?"text":"password",value:_,onChange:I,onBlur:S,autoComplete:"current-password",error:g.password?.message}),O.jsx(gt,{variant:"ghost",color:"primary",className:"qc:absolute qc:right-0 qc:top-8",icon:e?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>r(!e)})]})})]}),s&&O.jsx(A0,{align:"center",weight:"medium",color:"error",children:s}),O.jsx("div",{className:"qc:flex qc:justify-end",children:O.jsx(Jt,{to:nr.FORGOT_PASSWORD,state:c?.state,children:O.jsx(A0,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),O.jsx(gt,{type:"submit",color:"primary",className:"qc:w-full",loading:t,disabled:t,children:"Login"})]}),O.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[O.jsx(Qx,{disabled:t||n.google||n.apple,loading:n.google,onClick:()=>E("google",b),provider:"google"}),O.jsx(Qx,{disabled:t||n.google||n.apple,loading:n.apple,onClick:()=>E("apple",w),provider:"apple"})]})]})}},Symbol.toStringTag,{value:"Module"})),Oqe={fname:"",lname:"",email:"",password:"",confirmPassword:""},Dqe=i9().shape({fname:ns().required("First name is required"),lname:ns().required("Last name is required"),email:ns().required("Please enter your Email").email("Enter a valid Email"),password:ns().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:ns().required("Please confirm your password").oneOf([cre("password"),null],"Passwords do not match")}),Bqe=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const[e,r]=Z.useState(null),[t,a]=Z.useState(!1),[n,i]=Z.useState({google:!1,apple:!1}),[s,u]=Z.useState({showPassword:!1,showConfirmPassword:!1}),{registerUsingEmail:c,loginWithGoogle:A,loginWithApple:d}=G0(),g=async(x,_)=>{i(I=>({...I,[x]:!0})),r(null);try{await _()}catch(I){r(I.message||`Failed to sign up with ${x.charAt(0).toUpperCase()+x.slice(1)}`)}finally{i(I=>({...I,[x]:!1}))}},{control:m,handleSubmit:b,formState:{errors:w}}=t7({defaultValues:Oqe,mode:"onSubmit",resolver:a7(Dqe)}),E=async x=>{const{email:_,password:I,fname:S,lname:R}=x;a(!0);try{const M=await c(_.toLowerCase(),I,S,R);M?.error&&r(M.error)}catch(M){r(M)}finally{a(!1)}};return O.jsxs("div",{className:"qc:w-full qc:space-y-8 qc:bg-background",children:[O.jsxs("form",{noValidate:!0,autoComplete:"off",onSubmit:b(E),className:"qc:space-y-4",children:[O.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-4",children:[O.jsx(Nl,{name:"fname",control:m,render:({field:{value:x,onChange:_,onBlur:I}})=>O.jsx(xl,{label:"First name",disabled:t,type:"text",value:x,onChange:_,onBlur:I,error:w.fname?.message})}),O.jsx(Nl,{name:"lname",control:m,render:({field:{value:x,onChange:_,onBlur:I}})=>O.jsx(xl,{label:"Last name",disabled:t,type:"text",value:x,onChange:_,onBlur:I,error:w.lname?.message})})]}),O.jsx(Nl,{name:"email",control:m,render:({field:{value:x,onChange:_,onBlur:I}})=>O.jsx(xl,{label:"Email",disabled:t,type:"email",value:x,onChange:_,onBlur:I,error:w.email?.message})}),O.jsxs("div",{className:"qc:relative",children:[O.jsx(Nl,{name:"password",control:m,render:({field:{value:x,onChange:_,onBlur:I}})=>O.jsx(xl,{label:"Password",disabled:t,type:s.showPassword?"text":"password",value:x,onChange:_,onBlur:I,error:w.password?.message})}),O.jsx(gt,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:s.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u({...s,showPassword:!s.showPassword})})]}),O.jsxs("div",{className:"qc:relative",children:[O.jsx(Nl,{name:"confirmPassword",control:m,render:({field:{value:x,onChange:_,onBlur:I}})=>O.jsx(xl,{label:"Confirm password",disabled:t,type:s.showConfirmPassword?"text":"password",value:x,onChange:_,onBlur:I,error:w.confirmPassword?.message})}),O.jsx(gt,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-5 qc:top-7",icon:s.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>u({...s,showConfirmPassword:!s.showConfirmPassword})})]}),e&&O.jsx(A0,{weight:"medium",color:"error",align:"center",children:e}),e&&O.jsx(A0,{weight:"medium",color:"error",align:"center",children:e}),O.jsx("div",{className:"qc:flex qc:justify-end",children:O.jsx(Jt,{to:nr.FORGOT_PASSWORD,state:location?.state,children:O.jsx(A0,{variant:"h6",className:"qc:w-fit",children:"Forgot password?"})})}),O.jsx(gt,{type:"submit",color:"primary",className:"qc:w-full",disabled:t,loading:t,children:"Register"})]}),O.jsxs("div",{className:"qc:grid qc:grid-cols-2 qc:gap-2",children:[O.jsx(Qx,{disabled:t||n.google||n.apple,loading:n.google,onClick:()=>g("google",A),provider:"google"}),O.jsx(Qx,{disabled:t||n.google||n.apple,loading:n.apple,onClick:()=>g("apple",d),provider:"apple"})]})]})}},Symbol.toStringTag,{value:"Module"})),Nqe=({count:e=1,currentStep:r=0,disabled:t,onStepClick:a})=>{const n=t||!a;return O.jsx("ol",{role:"list",className:"qc:flex qc:items-center qc:space-x-4 qc:pl-1.5",children:Array.from({length:e}).map((i,s)=>O.jsx("li",{children:s<r?O.jsx("button",{className:"qc:bg-primary qc:block qc:size-3 qc:rounded-full",disabled:n,onClick:()=>a&&a(s)}):s===r?O.jsxs("button",{className:"qc:relative qc:flex qc:items-center qc:justify-center","aria-current":"step",disabled:n,onClick:()=>a&&a(s),children:[O.jsx("span",{className:"qc:absolute qc:flex qc:size-6 qc:p-px","aria-hidden":"true",children:O.jsx("span",{className:"qc:bg-primary qc:size-full qc:rounded-full qc:bg-opacity-40"})}),O.jsx("span",{className:"qc:bg-primary qc:relative qc:block qc:size-3 qc:rounded-full","aria-hidden":"true"})]}):O.jsx("button",{className:"qc:block qc:size-3 qc:rounded-full qc:bg-text-secondary-light",disabled:n,onClick:()=>a&&a(s)})},`progress-dot-${s}`))})},Fqe={email:""},Zqe=i9().shape({email:ns().required("Please enter your email").email("Enter a valid email")}),Pqe=({onCodeSent:e})=>{const[r,t]=Z.useState(!1),[a,n]=Z.useState(null),{props:{organizationId:i}}=G0(),{control:s,handleSubmit:u,formState:{errors:c}}=t7({mode:"onSubmit",defaultValues:Fqe,resolver:a7(Zqe)}),A=async d=>{n(null),t(!0);try{await at.post($r.SEND_PASSWORD_RESET_CODE,{json:{email:d.email?.toLowerCase()},headers:{"x-org-id":i}}),e(d.email.toLowerCase())}catch(g){console.error("Error sending verification code:",g),n(g.message||g||"An error occurred while sending the code. Please try again.")}t(!1)};return O.jsxs("div",{className:"w-full space-y-6",children:[O.jsx(A0,{variant:"h5",align:"center",children:"Reset password"}),O.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-4 qc:lg:space-y-8",onSubmit:u(A),children:[O.jsx(Nl,{name:"email",control:s,render:({field:{value:d,onChange:g,onBlur:m}})=>O.jsx(xl,{label:"Email",disabled:r,type:"email",value:d,onChange:g,onBlur:m,error:c.email?.message})}),O.jsx(gt,{fullWidth:!0,type:"submit",loading:r,children:"Send verification code"})]}),a&&O.jsx(A0,{variant:"h3",align:"center",color:"color",children:a})]})};var yre=function(e){return typeof e=="object"&&e!==null},jqe=function(e){var r=e.value,t=r===void 0?"":r,a=e.numInputs,n=a===void 0?4:a,i=e.onChange,s=e.onPaste,u=e.renderInput,c=e.shouldAutoFocus,A=c===void 0?!1:c,d=e.inputType,g=d===void 0?"text":d,m=e.renderSeparator,b=e.placeholder,w=e.containerStyle,E=e.inputStyle,x=e.skipDefaultStyles,_=x===void 0?!1:x,I=A1.useState(0),S=I[0],R=I[1],M=A1.useRef([]),N=function(){return t?t.toString().split(""):[]},L=g==="number"||g==="tel";A1.useEffect(function(){M.current=M.current.slice(0,n)},[n]),A1.useEffect(function(){var W;A&&((W=M.current[0])===null||W===void 0||W.focus())},[A]);var F=function(){if(typeof b=="string"){if(b.length===n)return b;b.length>0&&console.error("Length of the placeholder should be equal to the number of inputs.")}},B=function(W){var J=L?!isNaN(Number(W)):typeof W=="string";return J&&W.trim().length===1},G=function(W){var J=W.target.value;B(J)&&(z(J),re(S+1))},V=function(W){var J=W.nativeEvent,X=W.target.value;if(!B(X)){if(X.length===n){var Y=X.split("").some(function(se){return!B(se)});Y||(U(X.split("")),re(n-1))}J.data===null&&J.inputType==="deleteContentBackward"&&(W.preventDefault(),z(""),re(S-1)),W.target.value=""}},ee=function(W){return function(J){R(J),W.target.select()}},K=function(){R(S-1)},$=function(W){var J=N();[W.code,W.key].includes("Backspace")?(W.preventDefault(),z(""),re(S-1)):W.code==="Delete"?(W.preventDefault(),z("")):W.code==="ArrowLeft"?(W.preventDefault(),re(S-1)):W.code==="ArrowRight"||W.key===J[S]?(W.preventDefault(),re(S+1)):(W.code==="Spacebar"||W.code==="Space"||W.code==="ArrowUp"||W.code==="ArrowDown")&&W.preventDefault()},re=function(W){var J,X,Y=Math.max(Math.min(n-1,W),0);M.current[Y]&&((J=M.current[Y])===null||J===void 0||J.focus(),(X=M.current[Y])===null||X===void 0||X.select(),R(Y))},z=function(W){var J=N();J[S]=W[0],U(J)},U=function(W){var J=W.join("");i(J)},j=function(W){var J;W.preventDefault();var X=N(),Y=S,se=W.clipboardData.getData("text/plain").slice(0,n-S).split("");if(!(L&&se.some(function(ne){return isNaN(Number(ne))}))){for(var Q=0;Q<n;++Q)Q>=S&&se.length>0&&(X[Q]=(J=se.shift())!==null&&J!==void 0?J:"",Y++);re(Y),U(X)}};return A1.createElement("div",{style:Object.assign({display:"flex",alignItems:"center"},yre(w)&&w),className:typeof w=="string"?w:void 0,onPaste:s},Array.from({length:n},function(W,J){return J}).map(function(W){var J,X,Y;return A1.createElement(A1.Fragment,{key:W},u({value:(J=N()[W])!==null&&J!==void 0?J:"",placeholder:(Y=(X=F())===null||X===void 0?void 0:X[W])!==null&&Y!==void 0?Y:void 0,ref:function(se){return M.current[W]=se},onChange:G,onFocus:function(se){return ee(se)(W)},onBlur:K,onKeyDown:$,onPaste:j,autoComplete:"off","aria-label":"Please enter OTP character ".concat(W+1),style:Object.assign(_?{}:{width:"1em",textAlign:"center"},yre(E)?E:{}),className:typeof E=="string"?E:void 0,type:g,inputMode:L?"numeric":"text",onInput:V},W),W<n-1&&(typeof m=="function"?m(W):m))}))};const qqe={code:""},Lqe=i9().shape({code:ns().required("Please enter the code")}),Vqe=({email:e,onCodeVerified:r})=>{const{props:{organizationId:t}}=G0(),[a,n]=Z.useState(!1),[i,s]=Z.useState(null),{control:u,handleSubmit:c,watch:A}=t7({mode:"onSubmit",defaultValues:qqe,resolver:a7(Lqe)}),d=async g=>{s(null),n(!0);try{await at.post($r.VERIFY_PASSWORD_RESET_CODE,{json:{email:e,code:g.code},headers:{"x-org-id":t}}),r&&r()}catch(m){console.error(m.message),s("An error occurred while verifying the code. Please try again.")}n(!1)};return O.jsxs("div",{className:"qc:space-y-4 qc:lg:space-y-8",children:[O.jsxs(A0,{variant:"h5",align:"center",children:["Enter the code sent to ",O.jsx("span",{className:"qc:text-primary qc:font-medium",children:e})]}),O.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:flex qc:w-full qc:flex-col qc:items-center qc:gap-4 qc:lg:gap-8",onSubmit:c(d),children:[O.jsx(Nl,{name:"code",control:u,render:({field:{value:g,onChange:m}})=>O.jsx(jqe,{value:g,onChange:m,numInputs:6,shouldAutoFocus:!0,inputType:"number",isInputNum:!0,containerStyle:"qc:flex qc:gap-4",inputStyle:"qc:rounded qc:border qc:focus:border-primary qc:text-foreground qc:bg-white qc:disabled:border-border qc:disabled:text-gray-400 otp-input qc:text-xl qc:focus:outline-none qc:focus:ring-0 qc:focus:boder-none",renderInput:b=>O.jsx("input",{...b})})}),O.jsx(gt,{fullWidth:!0,type:"submit",disabled:A("code").length<6,loading:a,children:"Submit"})]}),i&&O.jsx(A0,{variant:"h3",align:"center",color:"color",children:i})]})},Gqe={password:"",confirmPassword:""},zqe=i9().shape({password:ns().required("Please enter your password").min(8,"Min password length is 8"),confirmPassword:ns().required("Please confirm your password").min(8,"Min password length is 8").oneOf([cre("password"),null],"Passwords do not match")}),Uqe=({email:e,onPasswordReset:r})=>{const{props:{organizationId:t}}=G0(),[a,n]=Z.useState({showPassword:!1,showConfirmPassword:!1}),[i,s]=Z.useState(!1),[u,c]=Z.useState(null),{control:A,handleSubmit:d,formState:{errors:g}}=t7({defaultValues:Gqe,mode:"onSubmit",resolver:a7(zqe)}),m=async b=>{c(null),s(!0);try{const w=await at.post($r.RESET_PASSWORD,{json:{email:e.toLowerCase(),password:b.password},headers:{"x-org-id":t}});w.error?c(w.error):r()}catch{c("An error occurred while resetting the password. Please try again.")}s(!1)};return O.jsxs("div",{className:"qc:w-full qc:space-y-4",children:[O.jsx(A0,{variant:"h5",align:"center",children:"Set new password"}),O.jsxs("form",{noValidate:!0,autoComplete:"off",className:"qc:w-full qc:space-y-8",onSubmit:d(m),children:[O.jsxs("div",{className:"qc:relative",children:[O.jsx(Nl,{name:"password",control:A,render:({field:{value:b,onChange:w,onBlur:E}})=>O.jsx(xl,{label:"New password",disabled:i,type:a.showPassword?"text":"password",value:b,onChange:w,onBlur:E,error:g.password?.message})}),O.jsx(gt,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-4 qc:top-7",icon:a.showPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>n({...a,showPassword:!a.showPassword})})]}),O.jsxs("div",{className:"qc:relative",children:[O.jsx(Nl,{name:"confirmPassword",control:A,render:({field:{value:b,onChange:w,onBlur:E}})=>O.jsx(xl,{label:"Confirm new password",disabled:i,type:a.showConfirmPassword?"text":"password",value:b,onChange:w,onBlur:E,error:g.confirmPassword?.message})}),O.jsx(gt,{variant:"ghost",color:"primary",className:"qc:absolute qc:-right-4 qc:top-7",icon:a.showConfirmPassword?"mdi:eye-outline":"mdi:eye-off-outline",onClick:()=>n({...a,showConfirmPassword:!a.showConfirmPassword})})]}),O.jsx(gt,{fullWidth:!0,type:"submit",color:"primary",loading:i,children:"Reset password"})]}),u&&O.jsx(A0,{variant:"h3",align:"center",color:"color",children:u})]})},Wqe=Object.freeze(Object.defineProperty({__proto__:null,default:()=>{const e=a6(),[r,t]=Z.useState(null),[a,n]=Z.useState(0),i=({index:s})=>{switch(s){case 0:return O.jsx(Pqe,{onCodeSent:u=>{t(u),n(1)}});case 1:return O.jsx(Vqe,{email:r,onCodeVerified:()=>n(2)});case 2:return O.jsx(Uqe,{email:r,onPasswordReset:()=>{e(nr.LOGIN)}})}};return O.jsxs("div",{className:"qc:space-y-9 qc:bg-background",children:[i({index:a}),O.jsx("div",{className:"qc:mt-8 qc:flex qc:justify-center",children:O.jsx(Nqe,{count:3,currentStep:a})})]})}},Symbol.toStringTag,{value:"Module"})),Xqe=.35,Hqe=.6,wre=.4,Ere=.5;function $qe(e,r){return e*r/(1-r)}class Yqe{constructor(r){this.gestures=r,this.pswp=r.pswp,this.startPan={x:0,y:0}}start(){this.pswp.currSlide&&la(this.startPan,this.pswp.currSlide.pan),this.pswp.animations.stopAll()}change(){const{p1:r,prevP1:t,dragAxis:a}=this.gestures,{currSlide:n}=this.pswp;if(a==="y"&&this.pswp.options.closeOnVerticalDrag&&n&&n.currZoomLevel<=n.zoomLevels.fit&&!this.gestures.isMultitouch){const i=n.pan.y+(r.y-t.y);if(!this.pswp.dispatch("verticalDrag",{panY:i}).defaultPrevented){this._setPanWithFriction("y",i,Hqe);const s=1-Math.abs(this._getVerticalDragRatio(n.pan.y));this.pswp.applyBgOpacity(s),n.applyCurrentZoomPan()}}else this._panOrMoveMainScroll("x")||(this._panOrMoveMainScroll("y"),n&&(d$(n.pan),n.applyCurrentZoomPan()))}end(){const{velocity:r}=this.gestures,{mainScroll:t,currSlide:a}=this.pswp;let n=0;if(this.pswp.animations.stopAll(),t.isShifted()){const s=(t.x-t.getCurrSlideX())/this.pswp.viewportSize.x;r.x<-Ere&&s<0||r.x<.1&&s<-.5?(n=1,r.x=Math.min(r.x,0)):(r.x>Ere&&s>0||r.x>-.1&&s>.5)&&(n=-1,r.x=Math.max(r.x,0)),t.moveIndexBy(n,!0,r.x,!0)}a&&a.currZoomLevel>a.zoomLevels.max||this.gestures.isMultitouch?this.gestures.zoomLevels.correctZoomPan(!0):(this._finishPanGestureForAxis("x"),this._finishPanGestureForAxis("y"))}_finishPanGestureForAxis(r){const{velocity:t}=this.gestures,{currSlide:a}=this.pswp;if(!a)return;const{pan:n,bounds:i}=a,s=n[r],u=this.pswp.bgOpacity<1&&r==="y",A=s+$qe(t[r],.995);if(u){const w=this._getVerticalDragRatio(s),E=this._getVerticalDragRatio(A);if(w<0&&E<-wre||w>0&&E>wre){this.pswp.close();return}}const d=i.correctPan(r,A);if(s===d)return;const g=d===A?1:.82,m=this.pswp.bgOpacity,b=d-s;this.pswp.animations.startSpring({name:"panGesture"+r,isPan:!0,start:s,end:d,velocity:t[r],dampingRatio:g,onUpdate:w=>{if(u&&this.pswp.bgOpacity<1){const E=1-(d-w)/b;this.pswp.applyBgOpacity(yg(m+(1-m)*E,0,1))}n[r]=Math.floor(w),a.applyCurrentZoomPan()}})}_panOrMoveMainScroll(r){const{p1:t,dragAxis:a,prevP1:n,isMultitouch:i}=this.gestures,{currSlide:s,mainScroll:u}=this.pswp,c=t[r]-n[r],A=u.x+c;if(!c||!s)return!1;if(r==="x"&&!s.isPannable()&&!i)return u.moveTo(A,!0),!0;const{bounds:d}=s,g=s.pan[r]+c;if(this.pswp.options.allowPanToNext&&a==="x"&&r==="x"&&!i){const m=u.getCurrSlideX(),b=u.x-m,w=c>0,E=!w;if(g>d.min[r]&&w){if(d.min[r]<=this.startPan[r])return u.moveTo(A,!0),!0;this._setPanWithFriction(r,g)}else if(g<d.max[r]&&E){if(this.startPan[r]<=d.max[r])return u.moveTo(A,!0),!0;this._setPanWithFriction(r,g)}else if(b!==0){if(b>0)return u.moveTo(Math.max(A,m),!0),!0;if(b<0)return u.moveTo(Math.min(A,m),!0),!0}else this._setPanWithFriction(r,g)}else r==="y"?!u.isShifted()&&d.min.y!==d.max.y&&this._setPanWithFriction(r,g):this._setPanWithFriction(r,g);return!1}_getVerticalDragRatio(r){return(r-(this.pswp.currSlide?.bounds.center.y??0))/(this.pswp.viewportSize.y/3)}_setPanWithFriction(r,t,a){const{currSlide:n}=this.pswp;if(!n)return;const{pan:i,bounds:s}=n;if(s.correctPan(r,t)!==t||a){const c=Math.round(t-i[r]);i[r]+=c*(a||Xqe)}else i[r]=t}}function xre(e){return!!e.target.closest(".pswp__container")}class Qqe{constructor(r){this.gestures=r}click(r,t){const a=t.target.classList,n=a.contains("pswp__img"),i=a.contains("pswp__item")||a.contains("pswp__zoom-wrap");n?this._doClickOrTapAction("imageClick",r,t):i&&this._doClickOrTapAction("bgClick",r,t)}tap(r,t){xre(t)&&this._doClickOrTapAction("tap",r,t)}doubleTap(r,t){xre(t)&&this._doClickOrTapAction("doubleTap",r,t)}_doClickOrTapAction(r,t,a){const{pswp:n}=this.gestures,{currSlide:i}=n,s=r+"Action",u=n.options[s];if(!n.dispatch(s,{point:t,originalEvent:a}).defaultPrevented){if(typeof u=="function"){u.call(n,t,a);return}switch(u){case"close":case"next":n[u]();break;case"zoom":i?.toggleZoom(t);break;case"zoom-or-close":i?.isZoomable()&&i.zoomLevels.secondary!==i.zoomLevels.initial?i.toggleZoom(t):n.options.clickToCloseNonZoomable&&n.close();break;case"toggle-controls":this.gestures.pswp.element?.classList.toggle("pswp--ui-visible");break}}}}const Jqe=.05,Kqe=.15;function kre(e,r,t){return e.x=(r.x+t.x)/2,e.y=(r.y+t.y)/2,e}class eLe{constructor(r){this.gestures=r,this._startPan={x:0,y:0},this._startZoomPoint={x:0,y:0},this._zoomPoint={x:0,y:0},this._wasOverFitZoomLevel=!1,this._startZoomLevel=1}start(){const{currSlide:r}=this.gestures.pswp;r&&(this._startZoomLevel=r.currZoomLevel,la(this._startPan,r.pan)),this.gestures.pswp.animations.stopAllPan(),this._wasOverFitZoomLevel=!1}change(){const{p1:r,startP1:t,p2:a,startP2:n,pswp:i}=this.gestures,{currSlide:s}=i;if(!s)return;const u=s.zoomLevels.min,c=s.zoomLevels.max;if(!s.isZoomable()||i.mainScroll.isShifted())return;kre(this._startZoomPoint,t,n),kre(this._zoomPoint,r,a);let A=1/PM(t,n)*PM(r,a)*this._startZoomLevel;if(A>s.zoomLevels.initial+s.zoomLevels.initial/15&&(this._wasOverFitZoomLevel=!0),A<u)if(i.options.pinchToClose&&!this._wasOverFitZoomLevel&&this._startZoomLevel<=s.zoomLevels.initial){const d=1-(u-A)/(u/1.2);i.dispatch("pinchClose",{bgOpacity:d}).defaultPrevented||i.applyBgOpacity(d)}else A=u-(u-A)*Kqe;else A>c&&(A=c+(A-c)*Jqe);s.pan.x=this._calculatePanForZoomLevel("x",A),s.pan.y=this._calculatePanForZoomLevel("y",A),s.setZoomLevel(A),s.applyCurrentZoomPan()}end(){const{pswp:r}=this.gestures,{currSlide:t}=r;(!t||t.currZoomLevel<t.zoomLevels.initial)&&!this._wasOverFitZoomLevel&&r.options.pinchToClose?r.close():this.correctZoomPan()}_calculatePanForZoomLevel(r,t){const a=t/this._startZoomLevel;return this._zoomPoint[r]-(this._startZoomPoint[r]-this._startPan[r])*a}correctZoomPan(r){const{pswp:t}=this.gestures,{currSlide:a}=t;if(!a?.isZoomable())return;this._zoomPoint.x===0&&(r=!0);const n=a.currZoomLevel;let i,s=!0;n<a.zoomLevels.initial?i=a.zoomLevels.initial:n>a.zoomLevels.max?i=a.zoomLevels.max:(s=!1,i=n);const u=t.bgOpacity,c=t.bgOpacity<1,A=la({x:0,y:0},a.pan);let d=la({x:0,y:0},A);r&&(this._zoomPoint.x=0,this._zoomPoint.y=0,this._startZoomPoint.x=0,this._startZoomPoint.y=0,this._startZoomLevel=n,la(this._startPan,A)),s&&(d={x:this._calculatePanForZoomLevel("x",i),y:this._calculatePanForZoomLevel("y",i)}),a.setZoomLevel(i),d={x:a.bounds.correctPan("x",d.x),y:a.bounds.correctPan("y",d.y)},a.setZoomLevel(n);const g=!vg(d,A);if(!g&&!s&&!c){a._setResolution(i),a.applyCurrentZoomPan();return}t.animations.stopAllPan(),t.animations.startSpring({isPan:!0,start:0,end:1e3,velocity:0,dampingRatio:1,naturalFrequency:40,onUpdate:m=>{if(m/=1e3,g||s){if(g&&(a.pan.x=A.x+(d.x-A.x)*m,a.pan.y=A.y+(d.y-A.y)*m),s){const b=n+(i-n)*m;a.setZoomLevel(b)}a.applyCurrentZoomPan()}c&&t.bgOpacity<1&&t.applyBgOpacity(yg(u+(1-u)*m,0,1))},onComplete:()=>{a._setResolution(i),a.applyCurrentZoomPan()}})}}const rLe=10,tLe=300,aLe=25;class nLe{constructor(r){this.pswp=r,this.dragAxis=null,this.p1={x:0,y:0},this.p2={x:0,y:0},this.prevP1={x:0,y:0},this.prevP2={x:0,y:0},this.startP1={x:0,y:0},this.startP2={x:0,y:0},this.velocity={x:0,y:0},this._lastStartP1={x:0,y:0},this._intervalP1={x:0,y:0},this._numActivePoints=0,this._ongoingPointers=[],this._touchEventEnabled="ontouchstart"in window,this._pointerEventEnabled=!!window.PointerEvent,this.supportsTouch=this._touchEventEnabled||this._pointerEventEnabled&&navigator.maxTouchPoints>1,this._numActivePoints=0,this._intervalTime=0,this._velocityCalculated=!1,this.isMultitouch=!1,this.isDragging=!1,this.isZooming=!1,this.raf=null,this._tapTimer=null,this.supportsTouch||(r.options.allowPanToNext=!1),this.drag=new Yqe(this),this.zoomLevels=new eLe(this),this.tapHandler=new Qqe(this),r.on("bindEvents",()=>{r.events.add(r.scrollWrap,"click",this._onClick.bind(this)),this._pointerEventEnabled?this._bindEvents("pointer","down","up","cancel"):this._touchEventEnabled?(this._bindEvents("touch","start","end","cancel"),r.scrollWrap&&(r.scrollWrap.ontouchmove=()=>{},r.scrollWrap.ontouchend=()=>{})):this._bindEvents("mouse","down","up")})}_bindEvents(r,t,a,n){const{pswp:i}=this,{events:s}=i,u=n?r+n:"";s.add(i.scrollWrap,r+t,this.onPointerDown.bind(this)),s.add(window,r+"move",this.onPointerMove.bind(this)),s.add(window,r+a,this.onPointerUp.bind(this)),u&&s.add(i.scrollWrap,u,this.onPointerUp.bind(this))}onPointerDown(r){const t=r.type==="mousedown"||r.pointerType==="mouse";if(t&&r.button>0)return;const{pswp:a}=this;if(!a.opener.isOpen){r.preventDefault();return}a.dispatch("pointerDown",{originalEvent:r}).defaultPrevented||(t&&(a.mouseDetected(),this._preventPointerEventBehaviour(r,"down")),a.animations.stopAll(),this._updatePoints(r,"down"),this._numActivePoints===1&&(this.dragAxis=null,la(this.startP1,this.p1)),this._numActivePoints>1?(this._clearTapTimer(),this.isMultitouch=!0):this.isMultitouch=!1)}onPointerMove(r){this._preventPointerEventBehaviour(r,"move"),this._numActivePoints&&(this._updatePoints(r,"move"),!this.pswp.dispatch("pointerMove",{originalEvent:r}).defaultPrevented&&(this._numActivePoints===1&&!this.isDragging?(this.dragAxis||this._calculateDragDirection(),this.dragAxis&&!this.isDragging&&(this.isZooming&&(this.isZooming=!1,this.zoomLevels.end()),this.isDragging=!0,this._clearTapTimer(),this._updateStartPoints(),this._intervalTime=Date.now(),this._velocityCalculated=!1,la(this._intervalP1,this.p1),this.velocity.x=0,this.velocity.y=0,this.drag.start(),this._rafStopLoop(),this._rafRenderLoop())):this._numActivePoints>1&&!this.isZooming&&(this._finishDrag(),this.isZooming=!0,this._updateStartPoints(),this.zoomLevels.start(),this._rafStopLoop(),this._rafRenderLoop())))}_finishDrag(){this.isDragging&&(this.isDragging=!1,this._velocityCalculated||this._updateVelocity(!0),this.drag.end(),this.dragAxis=null)}onPointerUp(r){this._numActivePoints&&(this._updatePoints(r,"up"),!this.pswp.dispatch("pointerUp",{originalEvent:r}).defaultPrevented&&(this._numActivePoints===0&&(this._rafStopLoop(),this.isDragging?this._finishDrag():!this.isZooming&&!this.isMultitouch&&this._finishTap(r)),this._numActivePoints<2&&this.isZooming&&(this.isZooming=!1,this.zoomLevels.end(),this._numActivePoints===1&&(this.dragAxis=null,this._updateStartPoints()))))}_rafRenderLoop(){(this.isDragging||this.isZooming)&&(this._updateVelocity(),this.isDragging?vg(this.p1,this.prevP1)||this.drag.change():(!vg(this.p1,this.prevP1)||!vg(this.p2,this.prevP2))&&this.zoomLevels.change(),this._updatePrevPoints(),this.raf=requestAnimationFrame(this._rafRenderLoop.bind(this)))}_updateVelocity(r){const t=Date.now(),a=t-this._intervalTime;a<50&&!r||(this.velocity.x=this._getVelocity("x",a),this.velocity.y=this._getVelocity("y",a),this._intervalTime=t,la(this._intervalP1,this.p1),this._velocityCalculated=!0)}_finishTap(r){const{mainScroll:t}=this.pswp;if(t.isShifted()){t.moveIndexBy(0,!0);return}if(r.type.indexOf("cancel")>0)return;if(r.type==="mouseup"||r.pointerType==="mouse"){this.tapHandler.click(this.startP1,r);return}const a=this.pswp.options.doubleTapAction?tLe:0;this._tapTimer?(this._clearTapTimer(),PM(this._lastStartP1,this.startP1)<aLe&&this.tapHandler.doubleTap(this.startP1,r)):(la(this._lastStartP1,this.startP1),this._tapTimer=setTimeout(()=>{this.tapHandler.tap(this.startP1,r),this._clearTapTimer()},a))}_clearTapTimer(){this._tapTimer&&(clearTimeout(this._tapTimer),this._tapTimer=null)}_getVelocity(r,t){const a=this.p1[r]-this._intervalP1[r];return Math.abs(a)>1&&t>5?a/t:0}_rafStopLoop(){this.raf&&(cancelAnimationFrame(this.raf),this.raf=null)}_preventPointerEventBehaviour(r,t){this.pswp.applyFilters("preventPointerEvent",!0,r,t)&&r.preventDefault()}_updatePoints(r,t){if(this._pointerEventEnabled){const a=r,n=this._ongoingPointers.findIndex(i=>i.id===a.pointerId);t==="up"&&n>-1?this._ongoingPointers.splice(n,1):t==="down"&&n===-1?this._ongoingPointers.push(this._convertEventPosToPoint(a,{x:0,y:0})):n>-1&&this._convertEventPosToPoint(a,this._ongoingPointers[n]),this._numActivePoints=this._ongoingPointers.length,this._numActivePoints>0&&la(this.p1,this._ongoingPointers[0]),this._numActivePoints>1&&la(this.p2,this._ongoingPointers[1])}else{const a=r;this._numActivePoints=0,a.type.indexOf("touch")>-1?a.touches&&a.touches.length>0&&(this._convertEventPosToPoint(a.touches[0],this.p1),this._numActivePoints++,a.touches.length>1&&(this._convertEventPosToPoint(a.touches[1],this.p2),this._numActivePoints++)):(this._convertEventPosToPoint(r,this.p1),t==="up"?this._numActivePoints=0:this._numActivePoints++)}}_updatePrevPoints(){la(this.prevP1,this.p1),la(this.prevP2,this.p2)}_updateStartPoints(){la(this.startP1,this.p1),la(this.startP2,this.p2),this._updatePrevPoints()}_calculateDragDirection(){if(this.pswp.mainScroll.isShifted())this.dragAxis="x";else{const r=Math.abs(this.p1.x-this.startP1.x)-Math.abs(this.p1.y-this.startP1.y);if(r!==0){const t=r>0?"x":"y";Math.abs(this.p1[t]-this.startP1[t])>=rLe&&(this.dragAxis=t)}}}_convertEventPosToPoint(r,t){return t.x=r.pageX-this.pswp.offset.x,t.y=r.pageY-this.pswp.offset.y,"pointerId"in r?t.id=r.pointerId:r.identifier!==void 0&&(t.id=r.identifier),t}_onClick(r){this.pswp.mainScroll.isShifted()&&(r.preventDefault(),r.stopPropagation())}}const iLe={Escape:27,z:90,ArrowLeft:37,ArrowUp:38,ArrowRight:39,ArrowDown:40,Tab:9},gd=(e,r)=>r?e:iLe[e];class oLe{constructor(r){this.pswp=r,this._wasFocused=!1,r.on("bindEvents",()=>{r.options.trapFocus&&(r.options.initialPointerPos||this._focusRoot(),r.events.add(document,"focusin",this._onFocusIn.bind(this))),r.events.add(document,"keydown",this._onKeyDown.bind(this))});const t=document.activeElement;r.on("destroy",()=>{r.options.returnFocus&&t&&this._wasFocused&&t.focus()})}_focusRoot(){!this._wasFocused&&this.pswp.element&&(this.pswp.element.focus(),this._wasFocused=!0)}_onKeyDown(r){const{pswp:t}=this;if(t.dispatch("keydown",{originalEvent:r}).defaultPrevented||p$(r))return;let a,n,i=!1;const s="key"in r;switch(s?r.key:r.keyCode){case gd("Escape",s):t.options.escKey&&(a="close");break;case gd("z",s):a="toggleZoom";break;case gd("ArrowLeft",s):n="x";break;case gd("ArrowUp",s):n="y";break;case gd("ArrowRight",s):n="x",i=!0;break;case gd("ArrowDown",s):i=!0,n="y";break;case gd("Tab",s):this._focusRoot();break}if(n){r.preventDefault();const{currSlide:u}=t;t.options.arrowKeys&&n==="x"&&t.getNumItems()>1?a=i?"next":"prev":u&&u.currZoomLevel>u.zoomLevels.fit&&(u.pan[n]+=i?-80:80,u.panTo(u.pan.x,u.pan.y))}a&&(r.preventDefault(),t[a]())}_onFocusIn(r){const{template:t}=this.pswp;t&&document!==r.target&&t!==r.target&&!t.contains(r.target)&&t.focus()}}const sLe=.35;class lLe{constructor(r){this.pswp=r,this.x=0,this.slideWidth=0,this._currPositionIndex=0,this._prevPositionIndex=0,this._containerShiftIndex=-1,this.itemHolders=[]}resize(r){const{pswp:t}=this,a=Math.round(t.viewportSize.x+t.viewportSize.x*t.options.spacing),n=a!==this.slideWidth;n&&(this.slideWidth=a,this.moveTo(this.getCurrSlideX())),this.itemHolders.forEach((i,s)=>{n&&K4(i.el,(s+this._containerShiftIndex)*this.slideWidth),r&&i.slide&&i.slide.resize()})}resetPosition(){this._currPositionIndex=0,this._prevPositionIndex=0,this.slideWidth=0,this._containerShiftIndex=-1}appendHolders(){this.itemHolders=[];for(let r=0;r<3;r++){const t=eo("pswp__item","div",this.pswp.container);t.setAttribute("role","group"),t.setAttribute("aria-roledescription","slide"),t.setAttribute("aria-hidden","true"),t.style.display=r===1?"block":"none",this.itemHolders.push({el:t})}}canBeSwiped(){return this.pswp.getNumItems()>1}moveIndexBy(r,t,a){const{pswp:n}=this;let i=n.potentialIndex+r;const s=n.getNumItems();if(n.canLoop()){i=n.getLoopedIndex(i);const c=(r+s)%s;c<=s/2?r=c:r=c-s}else i<0?i=0:i>=s&&(i=s-1),r=i-n.potentialIndex;n.potentialIndex=i,this._currPositionIndex-=r,n.animations.stopMainScroll();const u=this.getCurrSlideX();if(!t)this.moveTo(u),this.updateCurrItem();else{n.animations.startSpring({isMainScroll:!0,start:this.x,end:u,velocity:a||0,naturalFrequency:30,dampingRatio:1,onUpdate:A=>{this.moveTo(A)},onComplete:()=>{this.updateCurrItem(),n.appendHeavy()}});let c=n.potentialIndex-n.currIndex;if(n.canLoop()){const A=(c+s)%s;A<=s/2?c=A:c=A-s}Math.abs(c)>1&&this.updateCurrItem()}return!!r}getCurrSlideX(){return this.slideWidth*this._currPositionIndex}isShifted(){return this.x!==this.getCurrSlideX()}updateCurrItem(){const{pswp:r}=this,t=this._prevPositionIndex-this._currPositionIndex;if(!t)return;this._prevPositionIndex=this._currPositionIndex,r.currIndex=r.potentialIndex;let a=Math.abs(t),n;a>=3&&(this._containerShiftIndex+=t+(t>0?-3:3),a=3,this.itemHolders.forEach(i=>{i.slide?.destroy(),i.slide=void 0}));for(let i=0;i<a;i++)t>0?(n=this.itemHolders.shift(),n&&(this.itemHolders[2]=n,this._containerShiftIndex++,K4(n.el,(this._containerShiftIndex+2)*this.slideWidth),r.setContent(n,r.currIndex-a+i+2))):(n=this.itemHolders.pop(),n&&(this.itemHolders.unshift(n),this._containerShiftIndex--,K4(n.el,this._containerShiftIndex*this.slideWidth),r.setContent(n,r.currIndex+a-i-2)));Math.abs(this._containerShiftIndex)>50&&!this.isShifted()&&(this.resetPosition(),this.resize()),r.animations.stopAllPan(),this.itemHolders.forEach((i,s)=>{i.slide&&i.slide.setIsActive(s===1)}),r.currSlide=this.itemHolders[1]?.slide,r.contentLoader.updateLazy(t),r.currSlide&&r.currSlide.applyCurrentZoomPan(),r.dispatch("change")}moveTo(r,t){if(!this.pswp.canLoop()&&t){let a=(this.slideWidth*this._currPositionIndex-r)/this.slideWidth;a+=this.pswp.currIndex;const n=Math.round(r-this.x);(a<0&&n>0||a>=this.pswp.getNumItems()-1&&n<0)&&(r=this.x+n*sLe)}this.x=r,this.pswp.container&&K4(this.pswp.container,r),this.pswp.dispatch("moveMainScroll",{x:r,dragging:t??!1})}}const n7=.003;class uLe{constructor(r){this.pswp=r,this.isClosed=!0,this.isOpen=!1,this.isClosing=!1,this.isOpening=!1,this._duration=void 0,this._useAnimation=!1,this._croppedZoom=!1,this._animateRootOpacity=!1,this._animateBgOpacity=!1,this._placeholder=void 0,this._opacityElement=void 0,this._cropContainer1=void 0,this._cropContainer2=void 0,this._thumbBounds=void 0,this._prepareOpen=this._prepareOpen.bind(this),r.on("firstZoomPan",this._prepareOpen)}open(){this._prepareOpen(),this._start()}close(){if(this.isClosed||this.isClosing||this.isOpening)return;const r=this.pswp.currSlide;this.isOpen=!1,this.isOpening=!1,this.isClosing=!0,this._duration=this.pswp.options.hideAnimationDuration,r&&r.currZoomLevel*r.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps(),setTimeout(()=>{this._start()},this._croppedZoom?30:0)}_prepareOpen(){if(this.pswp.off("firstZoomPan",this._prepareOpen),!this.isOpening){const r=this.pswp.currSlide;this.isOpening=!0,this.isClosing=!1,this._duration=this.pswp.options.showAnimationDuration,r&&r.zoomLevels.initial*r.width>=this.pswp.options.maxWidthToAnimate&&(this._duration=0),this._applyStartProps()}}_applyStartProps(){const{pswp:r}=this,t=this.pswp.currSlide,{options:a}=r;if(a.showHideAnimationType==="fade"?(a.showHideOpacity=!0,this._thumbBounds=void 0):a.showHideAnimationType==="none"?(a.showHideOpacity=!1,this._duration=0,this._thumbBounds=void 0):this.isOpening&&r._initialThumbBounds?this._thumbBounds=r._initialThumbBounds:this._thumbBounds=this.pswp.getThumbBounds(),this._placeholder=t?.getPlaceholderElement(),r.animations.stopAll(),this._useAnimation=!!(this._duration&&this._duration>50),this._animateZoom=!!this._thumbBounds&&t?.content.usePlaceholder()&&(!this.isClosing||!r.mainScroll.isShifted()),this._animateZoom?this._animateRootOpacity=a.showHideOpacity??!1:(this._animateRootOpacity=!0,this.isOpening&&t&&(t.zoomAndPanToInitial(),t.applyCurrentZoomPan())),this._animateBgOpacity=!this._animateRootOpacity&&this.pswp.options.bgOpacity>n7,this._opacityElement=this._animateRootOpacity?r.element:r.bg,!this._useAnimation){this._duration=0,this._animateZoom=!1,this._animateBgOpacity=!1,this._animateRootOpacity=!0,this.isOpening&&(r.element&&(r.element.style.opacity=String(n7)),r.applyBgOpacity(1));return}this._animateZoom&&this._thumbBounds&&this._thumbBounds.innerRect?(this._croppedZoom=!0,this._cropContainer1=this.pswp.container,this._cropContainer2=this.pswp.currSlide?.holderElement,r.container&&(r.container.style.overflow="hidden",r.container.style.width=r.viewportSize.x+"px")):this._croppedZoom=!1,this.isOpening?(this._animateRootOpacity?(r.element&&(r.element.style.opacity=String(n7)),r.applyBgOpacity(1)):(this._animateBgOpacity&&r.bg&&(r.bg.style.opacity=String(n7)),r.element&&(r.element.style.opacity="1")),this._animateZoom&&(this._setClosedStateZoomPan(),this._placeholder&&(this._placeholder.style.willChange="transform",this._placeholder.style.opacity=String(n7)))):this.isClosing&&(r.mainScroll.itemHolders[0]&&(r.mainScroll.itemHolders[0].el.style.display="none"),r.mainScroll.itemHolders[2]&&(r.mainScroll.itemHolders[2].el.style.display="none"),this._croppedZoom&&r.mainScroll.x!==0&&(r.mainScroll.resetPosition(),r.mainScroll.resize()))}_start(){this.isOpening&&this._useAnimation&&this._placeholder&&this._placeholder.tagName==="IMG"?new Promise(r=>{let t=!1,a=!0;qxe(this._placeholder).finally(()=>{t=!0,a||r(!0)}),setTimeout(()=>{a=!1,t&&r(!0)},50),setTimeout(r,250)}).finally(()=>this._initiate()):this._initiate()}_initiate(){this.pswp.element?.style.setProperty("--pswp-transition-duration",this._duration+"ms"),this.pswp.dispatch(this.isOpening?"openingAnimationStart":"closingAnimationStart"),this.pswp.dispatch("initialZoom"+(this.isOpening?"In":"Out")),this.pswp.element?.classList.toggle("pswp--ui-visible",this.isOpening),this.isOpening?(this._placeholder&&(this._placeholder.style.opacity="1"),this._animateToOpenState()):this.isClosing&&this._animateToClosedState(),this._useAnimation||this._onAnimationComplete()}_onAnimationComplete(){const{pswp:r}=this;this.isOpen=this.isOpening,this.isClosed=this.isClosing,this.isOpening=!1,this.isClosing=!1,r.dispatch(this.isOpen?"openingAnimationEnd":"closingAnimationEnd"),r.dispatch("initialZoom"+(this.isOpen?"InEnd":"OutEnd")),this.isClosed?r.destroy():this.isOpen&&(this._animateZoom&&r.container&&(r.container.style.overflow="visible",r.container.style.width="100%"),r.currSlide?.applyCurrentZoomPan())}_animateToOpenState(){const{pswp:r}=this;this._animateZoom&&(this._croppedZoom&&this._cropContainer1&&this._cropContainer2&&(this._animateTo(this._cropContainer1,"transform","translate3d(0,0,0)"),this._animateTo(this._cropContainer2,"transform","none")),r.currSlide&&(r.currSlide.zoomAndPanToInitial(),this._animateTo(r.currSlide.container,"transform",r.currSlide.getCurrentTransform()))),this._animateBgOpacity&&r.bg&&this._animateTo(r.bg,"opacity",String(r.options.bgOpacity)),this._animateRootOpacity&&r.element&&this._animateTo(r.element,"opacity","1")}_animateToClosedState(){const{pswp:r}=this;this._animateZoom&&this._setClosedStateZoomPan(!0),this._animateBgOpacity&&r.bgOpacity>.01&&r.bg&&this._animateTo(r.bg,"opacity","0"),this._animateRootOpacity&&r.element&&this._animateTo(r.element,"opacity","0")}_setClosedStateZoomPan(r){if(!this._thumbBounds)return;const{pswp:t}=this,{innerRect:a}=this._thumbBounds,{currSlide:n,viewportSize:i}=t;if(this._croppedZoom&&a&&this._cropContainer1&&this._cropContainer2){const s=-i.x+(this._thumbBounds.x-a.x)+a.w,u=-i.y+(this._thumbBounds.y-a.y)+a.h,c=i.x-a.w,A=i.y-a.h;r?(this._animateTo(this._cropContainer1,"transform",wg(s,u)),this._animateTo(this._cropContainer2,"transform",wg(c,A))):(K4(this._cropContainer1,s,u),K4(this._cropContainer2,c,A))}n&&(la(n.pan,a||this._thumbBounds),n.currZoomLevel=this._thumbBounds.w/n.width,r?this._animateTo(n.container,"transform",n.getCurrentTransform()):n.applyCurrentZoomPan())}_animateTo(r,t,a){if(!this._duration){r.style[t]=a;return}const{animations:n}=this.pswp,i={duration:this._duration,easing:this.pswp.options.easing,onComplete:()=>{n.activeAnimations.length||this._onAnimationComplete()},target:r};i[t]=a,n.startTransition(i)}}class cLe{constructor(r){this.pswp=r,r.events.add(r.element,"wheel",this._onWheel.bind(this))}_onWheel(r){r.preventDefault();const{currSlide:t}=this.pswp;let{deltaX:a,deltaY:n}=r;if(t&&!this.pswp.dispatch("wheel",{originalEvent:r}).defaultPrevented)if(r.ctrlKey||this.pswp.options.wheelToZoom){if(t.isZoomable()){let i=-n;r.deltaMode===1?i*=.05:i*=r.deltaMode?1:.002,i=2**i;const s=t.currZoomLevel*i;t.zoomTo(s,{x:r.clientX,y:r.clientY})}}else t.isPannable()&&(r.deltaMode===1&&(a*=18,n*=18),t.panTo(t.pan.x-a,t.pan.y-n))}}function fLe(e){const r=e.getBoundingClientRect();return{x:r.left,y:r.top,w:r.width}}function ALe(e,r,t){const a=e.getBoundingClientRect(),n=a.width/r,i=a.height/t,s=n>i?n:i,u=(a.width-r*s)/2,c=(a.height-t*s)/2,A={x:a.left+u,y:a.top+c,w:r*s};return A.innerRect={w:a.width,h:a.height,x:u,y:c},A}function dLe(e,r,t){const a=t.dispatch("thumbBounds",{index:e,itemData:r,instance:t});if(a.thumbBounds)return a.thumbBounds;const{element:n}=r;let i,s;if(n&&t.options.thumbSelector!==!1){const u=t.options.thumbSelector||"img";s=n.matches(u)?n:n.querySelector(u)}return s=t.applyFilters("thumbEl",s,r,e),s&&(r.thumbCropped?i=ALe(s,r.width||r.w||0,r.height||r.h||0):i=fLe(s)),t.applyFilters("thumbBounds",i,r,e)}class hLe{constructor(r){this.slide=r,this.currZoomLevel=1,this.center={x:0,y:0},this.max={x:0,y:0},this.min={x:0,y:0}}update(r){this.currZoomLevel=r,this.slide.width?(this._updateAxis("x"),this._updateAxis("y"),this.slide.pswp.dispatch("calcBounds",{slide:this.slide})):this.reset()}_updateAxis(r){const{pswp:t}=this.slide,a=this.slide[r==="x"?"width":"height"]*this.currZoomLevel,i=xg(r==="x"?"left":"top",t.options,t.viewportSize,this.slide.data,this.slide.index),s=this.slide.panAreaSize[r];this.center[r]=Math.round((s-a)/2)+i,this.max[r]=a>s?Math.round(s-a)+i:this.center[r],this.min[r]=a>s?i:this.center[r]}reset(){this.center.x=0,this.center.y=0,this.max.x=0,this.max.y=0,this.min.x=0,this.min.y=0}correctPan(r,t){return yg(t,this.max[r],this.min[r])}}class pLe{constructor(r,t,a){this.data=r,this.index=t,this.pswp=a,this.isActive=t===a.currIndex,this.currentResolution=0,this.panAreaSize={x:0,y:0},this.pan={x:0,y:0},this.isFirstSlide=this.isActive&&!a.opener.isOpen,this.zoomLevels=new y$(a.options,r,t,a),this.pswp.dispatch("gettingData",{slide:this,data:this.data,index:t}),this.content=this.pswp.contentLoader.getContentBySlide(this),this.container=eo("pswp__zoom-wrap","div"),this.holderElement=null,this.currZoomLevel=1,this.width=this.content.width,this.height=this.content.height,this.heavyAppended=!1,this.bounds=new hLe(this),this.prevDisplayedWidth=-1,this.prevDisplayedHeight=-1,this.pswp.dispatch("slideInit",{slide:this})}setIsActive(r){r&&!this.isActive?this.activate():!r&&this.isActive&&this.deactivate()}append(r){this.holderElement=r,this.container.style.transformOrigin="0 0",this.data&&(this.calculateSize(),this.load(),this.updateContentSize(),this.appendHeavy(),this.holderElement.appendChild(this.container),this.zoomAndPanToInitial(),this.pswp.dispatch("firstZoomPan",{slide:this}),this.applyCurrentZoomPan(),this.pswp.dispatch("afterSetContent",{slide:this}),this.isActive&&this.activate())}load(){this.content.load(!1),this.pswp.dispatch("slideLoad",{slide:this})}appendHeavy(){const{pswp:r}=this;this.heavyAppended||!r.opener.isOpen||r.mainScroll.isShifted()||!this.isActive&&!1||this.pswp.dispatch("appendHeavy",{slide:this}).defaultPrevented||(this.heavyAppended=!0,this.content.append(),this.pswp.dispatch("appendHeavyContent",{slide:this}))}activate(){this.isActive=!0,this.appendHeavy(),this.content.activate(),this.pswp.dispatch("slideActivate",{slide:this})}deactivate(){this.isActive=!1,this.content.deactivate(),this.currZoomLevel!==this.zoomLevels.initial&&this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize(),this.pswp.dispatch("slideDeactivate",{slide:this})}destroy(){this.content.hasSlide=!1,this.content.remove(),this.container.remove(),this.pswp.dispatch("slideDestroy",{slide:this})}resize(){this.currZoomLevel===this.zoomLevels.initial||!this.isActive?(this.calculateSize(),this.currentResolution=0,this.zoomAndPanToInitial(),this.applyCurrentZoomPan(),this.updateContentSize()):(this.calculateSize(),this.bounds.update(this.currZoomLevel),this.panTo(this.pan.x,this.pan.y))}updateContentSize(r){const t=this.currentResolution||this.zoomLevels.initial;if(!t)return;const a=Math.round(this.width*t)||this.pswp.viewportSize.x,n=Math.round(this.height*t)||this.pswp.viewportSize.y;!this.sizeChanged(a,n)&&!r||this.content.setDisplayedSize(a,n)}sizeChanged(r,t){return r!==this.prevDisplayedWidth||t!==this.prevDisplayedHeight?(this.prevDisplayedWidth=r,this.prevDisplayedHeight=t,!0):!1}getPlaceholderElement(){return this.content.placeholder?.element}zoomTo(r,t,a,n){const{pswp:i}=this;if(!this.isZoomable()||i.mainScroll.isShifted())return;i.dispatch("beforeZoomTo",{destZoomLevel:r,centerPoint:t,transitionDuration:a}),i.animations.stopAllPan();const s=this.currZoomLevel;n||(r=yg(r,this.zoomLevels.min,this.zoomLevels.max)),this.setZoomLevel(r),this.pan.x=this.calculateZoomToPanOffset("x",t,s),this.pan.y=this.calculateZoomToPanOffset("y",t,s),d$(this.pan);const u=()=>{this._setResolution(r),this.applyCurrentZoomPan()};a?i.animations.startTransition({isPan:!0,name:"zoomTo",target:this.container,transform:this.getCurrentTransform(),onComplete:u,duration:a,easing:i.options.easing}):u()}toggleZoom(r){this.zoomTo(this.currZoomLevel===this.zoomLevels.initial?this.zoomLevels.secondary:this.zoomLevels.initial,r,this.pswp.options.zoomAnimationDuration)}setZoomLevel(r){this.currZoomLevel=r,this.bounds.update(this.currZoomLevel)}calculateZoomToPanOffset(r,t,a){if(this.bounds.max[r]-this.bounds.min[r]===0)return this.bounds.center[r];t||(t=this.pswp.getViewportCenterPoint()),a||(a=this.zoomLevels.initial);const i=this.currZoomLevel/a;return this.bounds.correctPan(r,(this.pan[r]-t[r])*i+t[r])}panTo(r,t){this.pan.x=this.bounds.correctPan("x",r),this.pan.y=this.bounds.correctPan("y",t),this.applyCurrentZoomPan()}isPannable(){return!!this.width&&this.currZoomLevel>this.zoomLevels.fit}isZoomable(){return!!this.width&&this.content.isZoomable()}applyCurrentZoomPan(){this._applyZoomTransform(this.pan.x,this.pan.y,this.currZoomLevel),this===this.pswp.currSlide&&this.pswp.dispatch("zoomPanUpdate",{slide:this})}zoomAndPanToInitial(){this.currZoomLevel=this.zoomLevels.initial,this.bounds.update(this.currZoomLevel),la(this.pan,this.bounds.center),this.pswp.dispatch("initialZoomPan",{slide:this})}_applyZoomTransform(r,t,a){a/=this.currentResolution||this.zoomLevels.initial,K4(this.container,r,t,a)}calculateSize(){const{pswp:r}=this;la(this.panAreaSize,b$(r.options,r.viewportSize,this.data,this.index)),this.zoomLevels.update(this.width,this.height,this.panAreaSize),r.dispatch("calcSlideSize",{slide:this})}getCurrentTransform(){const r=this.currZoomLevel/(this.currentResolution||this.zoomLevels.initial);return wg(this.pan.x,this.pan.y,r)}_setResolution(r){r!==this.currentResolution&&(this.currentResolution=r,this.updateContentSize(),this.pswp.dispatch("resolutionChanged"))}}function _re(e,r,t){e.classList.add("pswp__button--arrow"),e.setAttribute("aria-controls","pswp__items"),r.on("change",()=>{r.options.loop||(t?e.disabled=!(r.currIndex<r.getNumItems()-1):e.disabled=!(r.currIndex>0))})}const mLe={name:"arrowPrev",className:"pswp__button--arrow--prev",title:"Previous",order:10,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<path d="M29 43l-3 3-16-16 16-16 3 3-13 13 13 13z" id="pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"prev",onInit:_re},gLe={name:"arrowNext",className:"pswp__button--arrow--next",title:"Next",order:11,isButton:!0,appendTo:"wrapper",html:{isCustomSVG:!0,size:60,inner:'<use xlink:href="#pswp__icn-arrow"/>',outlineID:"pswp__icn-arrow"},onClick:"next",onInit:(e,r)=>{_re(e,r,!0)}},bLe={name:"close",title:"Close",order:20,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M24 10l-2-2-6 6-6-6-2 2 6 6-6 6 2 2 6-6 6 6 2-2-6-6z" id="pswp__icn-close"/>',outlineID:"pswp__icn-close"},onClick:"close"},vLe={name:"zoom",title:"Zoom",order:10,isButton:!0,html:{isCustomSVG:!0,inner:'<path d="M17.426 19.926a6 6 0 1 1 1.5-1.5L23 22.5 21.5 24l-4.074-4.074z" id="pswp__icn-zoom"/><path fill="currentColor" class="pswp__zoom-icn-bar-h" d="M11 16v-2h6v2z"/><path fill="currentColor" class="pswp__zoom-icn-bar-v" d="M13 12h2v6h-2z"/>',outlineID:"pswp__icn-zoom"},onClick:"toggleZoom"},yLe={name:"counter",order:5,onInit:(e,r)=>{r.on("change",()=>{e.innerText=r.currIndex+1+r.options.indexIndicatorSep+r.getNumItems()})}},wLe={name:"preloader",appendTo:"bar",order:7,html:{isCustomSVG:!0,inner:'<path fill-rule="evenodd" clip-rule="evenodd" d="M21.2 16a5.2 5.2 0 1 1-5.2-5.2V8a8 8 0 1 0 8 8h-2.8Z" id="pswp__icn-loading"/>',outlineID:"pswp__icn-loading"},onInit:(e,r)=>{let t,a=null;const n=(u,c)=>{e.classList.toggle("pswp__preloader--"+u,c)},i=u=>{t!==u&&(t=u,n("active",u))},s=()=>{if(!r.currSlide?.content.isLoading()){i(!1),a&&(clearTimeout(a),a=null);return}a||(a=setTimeout(()=>{i(!!r.currSlide?.content.isLoading()),a=null},r.options.preloaderDelay))};r.on("change",s),r.on("loadComplete",u=>{r.currSlide===u.slide&&s()}),r.ui&&(r.ui.updatePreloaderVisibility=s)}};function ELe(e){if(typeof e=="string")return e;if(!e||!e.isCustomSVG)return"";const r=e;let t='<svg aria-hidden="true" class="pswp__icn" viewBox="0 0 %d %d" width="%d" height="%d">';return t=t.split("%d").join(r.size||32),r.outlineID&&(t+='<use class="pswp__icn-shadow" xlink:href="#'+r.outlineID+'"/>'),t+=r.inner,t+="</svg>",t}class xLe{constructor(r,t){const a=t.name||t.className;let n=t.html;if(r.options[a]===!1)return;typeof r.options[a+"SVG"]=="string"&&(n=r.options[a+"SVG"]),r.dispatch("uiElementCreate",{data:t});let i="";t.isButton?(i+="pswp__button ",i+=t.className||`pswp__button--${t.name}`):i+=t.className||`pswp__${t.name}`;let s=t.isButton?t.tagName||"button":t.tagName||"div";s=s.toLowerCase();const u=eo(i,s);if(t.isButton){s==="button"&&(u.type="button");let{title:d}=t;const{ariaLabel:g}=t;typeof r.options[a+"Title"]=="string"&&(d=r.options[a+"Title"]),d&&(u.title=d);const m=g||d;m&&u.setAttribute("aria-label",m)}u.innerHTML=ELe(n),t.onInit&&t.onInit(u,r),t.onClick&&(u.onclick=d=>{typeof t.onClick=="string"?r[t.onClick]():typeof t.onClick=="function"&&t.onClick(d,u,r)});const c=t.appendTo||"bar";let A=r.element;c==="bar"?(r.topBar||(r.topBar=eo("pswp__top-bar pswp__hide-on-close","div",r.scrollWrap)),A=r.topBar):(u.classList.add("pswp__hide-on-close"),c==="wrapper"&&(A=r.scrollWrap)),A?.appendChild(r.applyFilters("uiElement",u,t))}}function Cre(e,r){e.classList.toggle("pswp--zoomed-in",r)}class kLe{constructor(r){this.pswp=r,this.isRegistered=!1,this.uiElementsData=[],this.items=[],this.updatePreloaderVisibility=()=>{},this._lastUpdatedZoomLevel=void 0}init(){const{pswp:r}=this;this.isRegistered=!1,this.uiElementsData=[bLe,mLe,gLe,vLe,wLe,yLe],r.dispatch("uiRegister"),this.uiElementsData.sort((t,a)=>(t.order||0)-(a.order||0)),this.items=[],this.isRegistered=!0,this.uiElementsData.forEach(t=>{this.registerElement(t)}),r.on("change",()=>{r.element?.classList.toggle("pswp--one-slide",r.getNumItems()===1)}),r.on("zoomPanUpdate",()=>this._onZoomPanUpdate())}registerElement(r){this.isRegistered?this.items.push(new xLe(this.pswp,r)):this.uiElementsData.push(r)}_onZoomPanUpdate(){const{template:r,currSlide:t,options:a}=this.pswp;if(this.pswp.opener.isClosing||!r||!t)return;let{currZoomLevel:n}=t;if(this.pswp.opener.isOpen||(n=t.zoomLevels.initial),n===this._lastUpdatedZoomLevel)return;this._lastUpdatedZoomLevel=n;const i=t.zoomLevels.initial-t.zoomLevels.secondary;if(Math.abs(i)<.01||!t.isZoomable()){Cre(r,!1),r.classList.remove("pswp--zoom-allowed");return}r.classList.add("pswp--zoom-allowed");const s=n===t.zoomLevels.initial?t.zoomLevels.secondary:t.zoomLevels.initial;Cre(r,s<=n),(a.imageClickAction==="zoom"||a.imageClickAction==="zoom-or-close")&&r.classList.add("pswp--click-to-zoom")}}const _Le="cubic-bezier(.4,0,.22,1)";class CLe{constructor(r){this.props=r;const{target:t,onComplete:a,transform:n,onFinish:i=()=>{},duration:s=333,easing:u=_Le}=r;this.onFinish=i;const c=n?"transform":"opacity",A=r[c]??"";this._target=t,this._onComplete=a,this._finished=!1,this._onTransitionEnd=this._onTransitionEnd.bind(this),this._helperTimeout=setTimeout(()=>{h$(t,c,s,u),this._helperTimeout=setTimeout(()=>{t.addEventListener("transitionend",this._onTransitionEnd,!1),t.addEventListener("transitioncancel",this._onTransitionEnd,!1),this._helperTimeout=setTimeout(()=>{this._finalizeAnimation()},s+500),t.style[c]=A},30)},0)}_onTransitionEnd(r){r.target===this._target&&this._finalizeAnimation()}_finalizeAnimation(){this._finished||(this._finished=!0,this.onFinish(),this._onComplete&&this._onComplete())}destroy(){this._helperTimeout&&(clearTimeout(this._helperTimeout),this._helperTimeout=null),jxe(this._target),this._target.removeEventListener("transitionend",this._onTransitionEnd,!1),this._target.removeEventListener("transitioncancel",this._onTransitionEnd,!1),this._finished||this._finalizeAnimation()}}const SLe=12,TLe=.75;class ILe{constructor(r,t,a){this.velocity=r*1e3,this._dampingRatio=t||TLe,this._naturalFrequency=a||SLe,this._dampedFrequency=this._naturalFrequency,this._dampingRatio<1&&(this._dampedFrequency*=Math.sqrt(1-this._dampingRatio*this._dampingRatio))}easeFrame(r,t){let a=0,n;t/=1e3;const i=Math.E**(-this._dampingRatio*this._naturalFrequency*t);if(this._dampingRatio===1)n=this.velocity+this._naturalFrequency*r,a=(r+n*t)*i,this.velocity=a*-this._naturalFrequency+n*i;else if(this._dampingRatio<1){n=1/this._dampedFrequency*(this._dampingRatio*this._naturalFrequency*r+this.velocity);const s=Math.cos(this._dampedFrequency*t),u=Math.sin(this._dampedFrequency*t);a=i*(r*s+n*u),this.velocity=a*-this._naturalFrequency*this._dampingRatio+i*(-this._dampedFrequency*r*u+this._dampedFrequency*n*s)}return a}}class RLe{constructor(r){this.props=r,this._raf=0;const{start:t,end:a,velocity:n,onUpdate:i,onComplete:s,onFinish:u=()=>{},dampingRatio:c,naturalFrequency:A}=r;this.onFinish=u;const d=new ILe(n,c,A);let g=Date.now(),m=t-a;const b=()=>{this._raf&&(m=d.easeFrame(m,Date.now()-g),Math.abs(m)<1&&Math.abs(d.velocity)<50?(i(a),s&&s(),this.onFinish()):(g=Date.now(),i(m+a),this._raf=requestAnimationFrame(b)))};this._raf=requestAnimationFrame(b)}destroy(){this._raf>=0&&cancelAnimationFrame(this._raf),this._raf=0}}class MLe{constructor(){this.activeAnimations=[]}startSpring(r){this._start(r,!0)}startTransition(r){this._start(r)}_start(r,t){const a=t?new RLe(r):new CLe(r);return this.activeAnimations.push(a),a.onFinish=()=>this.stop(a),a}stop(r){r.destroy();const t=this.activeAnimations.indexOf(r);t>-1&&this.activeAnimations.splice(t,1)}stopAll(){this.activeAnimations.forEach(r=>{r.destroy()}),this.activeAnimations=[]}stopAllPan(){this.activeAnimations=this.activeAnimations.filter(r=>r.props.isPan?(r.destroy(),!1):!0)}stopMainScroll(){this.activeAnimations=this.activeAnimations.filter(r=>r.props.isMainScroll?(r.destroy(),!1):!0)}isPanRunning(){return this.activeAnimations.some(r=>r.props.isPan)}}let Sre=!1;try{window.addEventListener("test",null,Object.defineProperty({},"passive",{get:()=>{Sre=!0}}))}catch{}class OLe{constructor(){this._pool=[]}add(r,t,a,n){this._toggleListener(r,t,a,n)}remove(r,t,a,n){this._toggleListener(r,t,a,n,!0)}removeAll(){this._pool.forEach(r=>{this._toggleListener(r.target,r.type,r.listener,r.passive,!0,!0)}),this._pool=[]}_toggleListener(r,t,a,n,i,s){if(!r)return;const u=i?"removeEventListener":"addEventListener";t.split(" ").forEach(A=>{if(A){s||(i?this._pool=this._pool.filter(g=>g.type!==A||g.listener!==a||g.target!==r):this._pool.push({target:r,type:A,listener:a,passive:n}));const d=Sre?{passive:n||!1}:!1;r[u](A,a,d)}})}}const DLe={allowPanToNext:!0,spacing:.1,loop:!0,pinchToClose:!0,closeOnVerticalDrag:!0,hideAnimationDuration:333,showAnimationDuration:333,zoomAnimationDuration:333,escKey:!0,arrowKeys:!0,trapFocus:!0,returnFocus:!0,maxWidthToAnimate:4e3,clickToCloseNonZoomable:!0,imageClickAction:"zoom-or-close",bgClickAction:"close",tapAction:"toggle-controls",doubleTapAction:"zoom",indexIndicatorSep:" / ",preloaderDelay:2e3,bgOpacity:.8,index:0,errorMsg:"The image cannot be loaded",preload:[1,2],easing:"cubic-bezier(.4,0,.22,1)"};class BLe extends x${constructor(r){super(),this.options=this._prepareOptions(r||{}),this.offset={x:0,y:0},this._prevViewportSize={x:0,y:0},this.viewportSize={x:0,y:0},this.bgOpacity=1,this.currIndex=0,this.potentialIndex=0,this.isOpen=!1,this.isDestroying=!1,this.hasMouse=!1,this._initialItemData={},this._initialThumbBounds=void 0,this.topBar=void 0,this.element=void 0,this.template=void 0,this.container=void 0,this.scrollWrap=void 0,this.currSlide=void 0,this.events=new OLe,this.animations=new MLe,this.mainScroll=new lLe(this),this.gestures=new nLe(this),this.opener=new uLe(this),this.keyboard=new oLe(this),this.contentLoader=new Uxe(this)}init(){if(this.isOpen||this.isDestroying)return!1;this.isOpen=!0,this.dispatch("init"),this.dispatch("beforeOpen"),this._createMainStructure();let r="pswp--open";return this.gestures.supportsTouch&&(r+=" pswp--touch"),this.options.mainClass&&(r+=" "+this.options.mainClass),this.element&&(this.element.className+=" "+r),this.currIndex=this.options.index||0,this.potentialIndex=this.currIndex,this.dispatch("firstUpdate"),this.scrollWheel=new cLe(this),(Number.isNaN(this.currIndex)||this.currIndex<0||this.currIndex>=this.getNumItems())&&(this.currIndex=0),this.gestures.supportsTouch||this.mouseDetected(),this.updateSize(),this.offset.y=window.pageYOffset,this._initialItemData=this.getItemData(this.currIndex),this.dispatch("gettingData",{index:this.currIndex,data:this._initialItemData,slide:void 0}),this._initialThumbBounds=this.getThumbBounds(),this.dispatch("initialLayout"),this.on("openingAnimationEnd",()=>{const{itemHolders:t}=this.mainScroll;t[0]&&(t[0].el.style.display="block",this.setContent(t[0],this.currIndex-1)),t[2]&&(t[2].el.style.display="block",this.setContent(t[2],this.currIndex+1)),this.appendHeavy(),this.contentLoader.updateLazy(),this.events.add(window,"resize",this._handlePageResize.bind(this)),this.events.add(window,"scroll",this._updatePageScrollOffset.bind(this)),this.dispatch("bindEvents")}),this.mainScroll.itemHolders[1]&&this.setContent(this.mainScroll.itemHolders[1],this.currIndex),this.dispatch("change"),this.opener.open(),this.dispatch("afterInit"),!0}getLoopedIndex(r){const t=this.getNumItems();return this.options.loop&&(r>t-1&&(r-=t),r<0&&(r+=t)),yg(r,0,t-1)}appendHeavy(){this.mainScroll.itemHolders.forEach(r=>{r.slide?.appendHeavy()})}goTo(r){this.mainScroll.moveIndexBy(this.getLoopedIndex(r)-this.potentialIndex,!0)}next(){this.goTo(this.potentialIndex+1)}prev(){this.goTo(this.potentialIndex-1)}zoomTo(...r){this.currSlide?.zoomTo(...r)}toggleZoom(){this.currSlide?.toggleZoom()}close(){!this.opener.isOpen||this.isDestroying||(this.isDestroying=!0,this.dispatch("close"),this.events.removeAll(),this.opener.close())}destroy(){if(!this.isDestroying){this.options.showHideAnimationType="none",this.close();return}this.dispatch("destroy"),this._listeners={},this.scrollWrap&&(this.scrollWrap.ontouchmove=null,this.scrollWrap.ontouchend=null),this.element?.remove(),this.mainScroll.itemHolders.forEach(r=>{r.slide?.destroy()}),this.contentLoader.destroy(),this.events.removeAll()}refreshSlideContent(r){this.contentLoader.removeByIndex(r),this.mainScroll.itemHolders.forEach((t,a)=>{let n=(this.currSlide?.index??0)-1+a;this.canLoop()&&(n=this.getLoopedIndex(n)),n===r&&(this.setContent(t,r,!0),a===1&&(this.currSlide=t.slide,t.slide?.setIsActive(!0)))}),this.dispatch("change")}setContent(r,t,a){if(this.canLoop()&&(t=this.getLoopedIndex(t)),r.slide){if(r.slide.index===t&&!a)return;r.slide.destroy(),r.slide=void 0}if(!this.canLoop()&&(t<0||t>=this.getNumItems()))return;const n=this.getItemData(t);r.slide=new pLe(n,t,this),t===this.currIndex&&(this.currSlide=r.slide),r.slide.append(r.el)}getViewportCenterPoint(){return{x:this.viewportSize.x/2,y:this.viewportSize.y/2}}updateSize(r){if(this.isDestroying)return;const t=g$(this.options,this);!r&&vg(t,this._prevViewportSize)||(la(this._prevViewportSize,t),this.dispatch("beforeResize"),la(this.viewportSize,this._prevViewportSize),this._updatePageScrollOffset(),this.dispatch("viewportSize"),this.mainScroll.resize(this.opener.isOpen),!this.hasMouse&&window.matchMedia("(any-hover: hover)").matches&&this.mouseDetected(),this.dispatch("resize"))}applyBgOpacity(r){this.bgOpacity=Math.max(r,0),this.bg&&(this.bg.style.opacity=String(this.bgOpacity*this.options.bgOpacity))}mouseDetected(){this.hasMouse||(this.hasMouse=!0,this.element?.classList.add("pswp--has_mouse"))}_handlePageResize(){this.updateSize(),/iPhone|iPad|iPod/i.test(window.navigator.userAgent)&&setTimeout(()=>{this.updateSize()},500)}_updatePageScrollOffset(){this.setScrollOffset(0,window.pageYOffset)}setScrollOffset(r,t){this.offset.x=r,this.offset.y=t,this.dispatch("updateScrollOffset")}_createMainStructure(){this.element=eo("pswp","div"),this.element.setAttribute("tabindex","-1"),this.element.setAttribute("role","dialog"),this.template=this.element,this.bg=eo("pswp__bg","div",this.element),this.scrollWrap=eo("pswp__scroll-wrap","section",this.element),this.container=eo("pswp__container","div",this.scrollWrap),this.scrollWrap.setAttribute("aria-roledescription","carousel"),this.container.setAttribute("aria-live","off"),this.container.setAttribute("id","pswp__items"),this.mainScroll.appendHolders(),this.ui=new kLe(this),this.ui.init(),(this.options.appendToEl||document.body).appendChild(this.element)}getThumbBounds(){return dLe(this.currIndex,this.currSlide?this.currSlide.data:this._initialItemData,this)}canLoop(){return this.options.loop&&this.getNumItems()>2}_prepareOptions(r){return window.matchMedia("(prefers-reduced-motion), (update: slow)").matches&&(r.showHideAnimationType="none",r.zoomAnimationDuration=0),{...DLe,...r}}}const NLe=Object.freeze(Object.defineProperty({__proto__:null,default:BLe},Symbol.toStringTag,{value:"Module"}));var lk={exports:{}},FLe=lk.exports,Tre;function ZLe(){return Tre||(Tre=1,(function(e,r){(function(t,a,n,i){function s(){return L.isValid()}function u(){return L.isValid()}function c(){var j={getUserMedia:!0};return L.isValid(j)}function A(j){var W=!1;if(M.isArray(j)&&j.length){if(M.each(j,function(J,X){M.isSupported.videoCodecs[X]&&(W=!0)}),!W)return!1}else if(M.isString(j)&&j.length&&!M.isSupported.videoCodecs[j])return!1;return L.isValid({getUserMedia:!0})}function d(){function j(o1,e1,S1){var s1,M1;for(Ee=o1,Me=e1,De=S1,ge=new Array(Oe),s1=0;Oe>s1;s1++)ge[s1]=new Array(4),M1=ge[s1],M1[0]=M1[1]=M1[2]=(s1<<ve+8)/Oe|0,t1[s1]=Ge/Oe|0,Be[s1]=0}function W(){for(var o1=[],e1=new Array(Oe),S1=0;Oe>S1;S1++)e1[ge[S1][3]]=S1;for(var s1=0,M1=0;Oe>M1;M1++){var m1=e1[M1];o1[s1++]=ge[m1][0],o1[s1++]=ge[m1][1],o1[s1++]=ge[m1][2]}return o1}function J(){var o1,e1,S1,s1,M1,m1,N1,g0;for(N1=0,g0=0,o1=0;Oe>o1;o1++){for(M1=ge[o1],S1=o1,s1=M1[1],e1=o1+1;Oe>e1;e1++)m1=ge[e1],m1[1]<s1&&(S1=e1,s1=m1[1]);if(m1=ge[S1],o1!=S1&&(e1=m1[0],m1[0]=M1[0],M1[0]=e1,e1=m1[1],m1[1]=M1[1],M1[1]=e1,e1=m1[2],m1[2]=M1[2],M1[2]=e1,e1=m1[3],m1[3]=M1[3],M1[3]=e1),s1!=N1){for(ue[N1]=g0+o1>>1,e1=N1+1;s1>e1;e1++)ue[e1]=o1;N1=s1,g0=o1}}for(ue[N1]=g0+p1>>1,e1=N1+1;256>e1;e1++)ue[e1]=p1}function X(){var o1,e1,S1,s1,M1,m1,N1,g0,p0,I0,sr,U0,Vr,rn;for(qe>Me&&(De=1),ye=30+(De-1)/3,U0=Ee,Vr=0,rn=Me,sr=Me/(3*De),I0=sr/be|0,g0=I1,m1=x1,N1=m1>>U1,1>=N1&&(N1=0),o1=0;N1>o1;o1++)u1[o1]=g0*((N1*N1-o1*o1)*r0/(N1*N1));for(p0=qe>Me?3:Me%Ke!==0?3*Ke:Me%Je!==0?3*Je:Me%h1!==0?3*h1:3*Ve,o1=0;sr>o1;)if(S1=(255&U0[Vr+0])<<ve,s1=(255&U0[Vr+1])<<ve,M1=(255&U0[Vr+2])<<ve,e1=he(S1,s1,M1),pe(g0,e1,S1,s1,M1),N1!==0&&ne(N1,e1,S1,s1,M1),Vr+=p0,Vr>=rn&&(Vr-=Me),o1++,I0===0&&(I0=1),o1%I0===0)for(g0-=g0/ye,m1-=m1/R1,N1=m1>>U1,1>=N1&&(N1=0),e1=0;N1>e1;e1++)u1[e1]=g0*((N1*N1-e1*e1)*r0/(N1*N1))}function Y(o1,e1,S1){var s1,M1,m1,N1,g0,p0,I0;for(g0=1e3,I0=-1,s1=ue[e1],M1=s1-1;Oe>s1||M1>=0;)Oe>s1&&(p0=ge[s1],m1=p0[1]-e1,m1>=g0?s1=Oe:(s1++,0>m1&&(m1=-m1),N1=p0[0]-o1,0>N1&&(N1=-N1),m1+=N1,g0>m1&&(N1=p0[2]-S1,0>N1&&(N1=-N1),m1+=N1,g0>m1&&(g0=m1,I0=p0[3])))),M1>=0&&(p0=ge[M1],m1=e1-p0[1],m1>=g0?M1=-1:(M1--,0>m1&&(m1=-m1),N1=p0[0]-o1,0>N1&&(N1=-N1),m1+=N1,g0>m1&&(N1=p0[2]-S1,0>N1&&(N1=-N1),m1+=N1,g0>m1&&(g0=m1,I0=p0[3]))));return I0}function se(){return X(),Q(),J(),W()}function Q(){var o1;for(o1=0;Oe>o1;o1++)ge[o1][0]>>=ve,ge[o1][1]>>=ve,ge[o1][2]>>=ve,ge[o1][3]=o1}function ne(o1,e1,S1,s1,M1){var m1,N1,g0,p0,I0,sr,U0;for(g0=e1-o1,-1>g0&&(g0=-1),p0=e1+o1,p0>Oe&&(p0=Oe),m1=e1+1,N1=e1-1,sr=1;p0>m1||N1>g0;){if(I0=u1[sr++],p0>m1){U0=ge[m1++];try{U0[0]-=I0*(U0[0]-S1)/T1|0,U0[1]-=I0*(U0[1]-s1)/T1|0,U0[2]-=I0*(U0[2]-M1)/T1|0}catch{}}if(N1>g0){U0=ge[N1--];try{U0[0]-=I0*(U0[0]-S1)/T1|0,U0[1]-=I0*(U0[1]-s1)/T1|0,U0[2]-=I0*(U0[2]-M1)/T1|0}catch{}}}}function pe(o1,e1,S1,s1,M1){var m1=ge[e1],N1=o1/I1;m1[0]-=N1*(m1[0]-S1)|0,m1[1]-=N1*(m1[1]-s1)|0,m1[2]-=N1*(m1[2]-M1)|0}function he(o1,e1,S1){var s1,M1,m1,N1,g0,p0,I0,sr,U0,Vr;for(sr=2147483647,U0=sr,p0=-1,I0=p0,s1=0;Oe>s1;s1++)Vr=ge[s1],M1=Vr[0]-o1,0>M1&&(M1=-M1),m1=Vr[1]-e1,0>m1&&(m1=-m1),M1+=m1,m1=Vr[2]-S1,0>m1&&(m1=-m1),M1+=m1,sr>M1&&(sr=M1,p0=s1),N1=M1-(Be[s1]>>Ce-ve),U0>N1&&(U0=N1,I0=s1),g0=t1[s1]>>Ne,t1[s1]-=g0,Be[s1]+=g0<<xe;return t1[p0]+=r1,Be[p0]-=C1,I0}var ye,Ee,Me,De,ge,Oe=256,Ke=499,Je=491,h1=487,Ve=503,qe=3*Ve,p1=Oe-1,ve=4,be=100,Ce=16,Ge=1<<Ce,xe=10,Ne=10,r1=Ge>>Ne,C1=Ge<<xe-Ne,d1=Oe>>3,U1=6,Y1=1<<U1,x1=d1*Y1,R1=30,v1=10,I1=1<<v1,e0=8,r0=1<<e0,W1=v1+e0,T1=1<<W1,ue=[],Be=[],t1=[],u1=[];j.apply(this,arguments);var k1={};return k1.map=Y,k1.process=se,k1}function g(){var j=this;try{j.onmessage=function(J){var X,Y=J.data||{};Y.gifshot&&(X=W.run(Y),postMessage(X))}}catch{}var W={dataToRGB:function(J,X,Y){for(var se=X*Y*4,Q=0,ne=[];se>Q;)ne.push(J[Q++]),ne.push(J[Q++]),ne.push(J[Q++]),Q++;return ne},componentizedPaletteToArray:function(J){J=J||[];for(var X=[],Y=0;Y<J.length;Y+=3){var se=J[Y],Q=J[Y+1],ne=J[Y+2];X.push(se<<16|Q<<8|ne)}return X},processFrameWithQuantizer:function(J,X,Y,se){for(var Q=this.dataToRGB(J,X,Y),ne=new d(Q,Q.length,se),pe=ne.process(),he=new Uint32Array(this.componentizedPaletteToArray(pe)),ye=X*Y,Ee=new Uint8Array(ye),Me=0,De=0;ye>De;De++){var ge=Q[Me++],Oe=Q[Me++],Ke=Q[Me++];Ee[De]=ne.map(ge,Oe,Ke)}return{pixels:Ee,palette:he}},run:function(J){J=J||{};var X=J,Y=X.height,se=(X.palette,X.sampleInterval),Q=X.width,ne=J.data;return this.processFrameWithQuantizer(ne,Q,Y,se)}};return W}function m(j,W,J,X){function Y(Me){var De=Me.length;if(2>De||De>256||De&De-1)throw"Invalid code/color length, must be power of 2 and 2 .. 256.";return De}function se(Me,De,ge,Oe){function Ke(x1){for(;Ce>=x1;)Me[De++]=255&Ge,Ge>>=8,Ce-=8,De===h1+256&&(Me[h1]=255,h1=De++)}function Je(x1){Ge|=x1<<Ce,Ce+=be,Ke(8)}Me[De++]=ge;var h1=De++,Ve=1<<ge,qe=Ve-1,p1=Ve+1,ve=p1+1,be=ge+1,Ce=0,Ge=0,xe=Oe[0]&qe,Ne={};Je(Ve);for(var r1=1,C1=Oe.length;C1>r1;++r1){var d1=Oe[r1]&qe,U1=xe<<8|d1,Y1=Ne[U1];if(Y1===i){for(Ge|=xe<<Ce,Ce+=be;Ce>=8;)Me[De++]=255&Ge,Ge>>=8,Ce-=8,De===h1+256&&(Me[h1]=255,h1=De++);ve===4096?(Je(Ve),ve=p1+1,be=ge+1,Ne={}):(ve>=1<<be&&++be,Ne[U1]=ve++),xe=d1}else xe=Y1}return Je(xe),Je(p1),Ke(1),h1+1===De?Me[h1]=0:(Me[h1]=De-h1-1,Me[De++]=0),De}var Q=0;X=X===i?{}:X;var ne=X.loop===i?null:X.loop,pe=X.palette===i?null:X.palette;if(0>=W||0>=J||W>65535||J>65535)throw"Width/Height invalid.";j[Q++]=71,j[Q++]=73,j[Q++]=70,j[Q++]=56,j[Q++]=57,j[Q++]=97;var he=0,ye=0;if(j[Q++]=255&W,j[Q++]=W>>8&255,j[Q++]=255&J,j[Q++]=J>>8&255,j[Q++]=(pe!==null?128:0)|he,j[Q++]=ye,j[Q++]=0,ne!==null){if(0>ne||ne>65535)throw"Loop count invalid.";j[Q++]=33,j[Q++]=255,j[Q++]=11,j[Q++]=78,j[Q++]=69,j[Q++]=84,j[Q++]=83,j[Q++]=67,j[Q++]=65,j[Q++]=80,j[Q++]=69,j[Q++]=50,j[Q++]=46,j[Q++]=48,j[Q++]=3,j[Q++]=1,j[Q++]=255&ne,j[Q++]=ne>>8&255,j[Q++]=0}var Ee=!1;this.addFrame=function(Me,De,ge,Oe,Ke,Je){if(Ee===!0&&(--Q,Ee=!1),Je=Je===i?{}:Je,0>Me||0>De||Me>65535||De>65535)throw"x/y invalid.";if(0>=ge||0>=Oe||ge>65535||Oe>65535)throw"Width/Height invalid.";if(Ke.length<ge*Oe)throw"Not enough pixels for the frame size.";var h1=!0,Ve=Je.palette;if((Ve===i||Ve===null)&&(h1=!1,Ve=pe),Ve===i||Ve===null)throw"Must supply either a local or global palette.";for(var qe=Y(Ve),p1=0;qe>>=1;)++p1;qe=1<<p1;var ve=Je.delay===i?0:Je.delay,be=Je.disposal===i?0:Je.disposal;if(0>be||be>3)throw"Disposal out of range.";var Ce=!1,Ge=0;if(Je.transparent!==i&&Je.transparent!==null&&(Ce=!0,Ge=Je.transparent,0>Ge||Ge>=qe))throw"Transparent color index.";if((be!==0||Ce||ve!==0)&&(j[Q++]=33,j[Q++]=249,j[Q++]=4,j[Q++]=be<<2|(Ce===!0?1:0),j[Q++]=255&ve,j[Q++]=ve>>8&255,j[Q++]=Ge,j[Q++]=0),j[Q++]=44,j[Q++]=255&Me,j[Q++]=Me>>8&255,j[Q++]=255&De,j[Q++]=De>>8&255,j[Q++]=255&ge,j[Q++]=ge>>8&255,j[Q++]=255&Oe,j[Q++]=Oe>>8&255,j[Q++]=h1===!0?128|p1-1:0,h1===!0)for(var xe=0,Ne=Ve.length;Ne>xe;++xe){var r1=Ve[xe];j[Q++]=r1>>16&255,j[Q++]=r1>>8&255,j[Q++]=255&r1}Q=se(j,Q,2>p1?2:p1,Ke)},this.end=function(){return Ee===!1&&(j[Q++]=59,Ee=!0),Q}}function b(j,W){j.getBase64GIF(function(J){W({error:!1,errorCode:"",errorMsg:"",image:J})})}function w(){function j(){M.each(pe,function(Me,De){De&&(De.text?Ee.addFrame(De.img,Y,De.text):Ee.addFrame(De,Y))}),b(Ee,J)}var W=arguments.length>0&&arguments[0]!==i?arguments[0]:{},J=W.callback,X=W.images,Y=W.options,se=W.imagesLength,Q={getUserMedia:!0,"window.URL":!0},ne=L.validate(Q),pe=[],he=0,ye=void 0,Ee=void 0;return ne.error?J(ne):(Ee=new K(Y),M.each(X,function(Me,De){var ge=De;De.src&&(ge=ge.src),M.isElement(ge)?(Y.crossOrigin&&(ge.crossOrigin=Y.crossOrigin),pe[Me]=ge,he+=1,he===se&&j()):M.isString(ge)&&(ye=new Image,Y.crossOrigin&&(ye.crossOrigin=Y.crossOrigin),(function(Oe){De.text&&(Oe.text=De.text),Oe.onerror=function(){var Ke=void 0;return--se,se===0?(Ke={},Ke.error="None of the requested images was capable of being retrieved",J(Ke)):void 0},Oe.onload=function(){pe[Me]=De.text?{img:Oe,text:Oe.text}:Oe,he+=1,he===se&&j(),M.removeElement(Oe)},Oe.src=ge})(ye),M.setCSSAttr(ye,{position:"fixed",opacity:"0"}),a.body.appendChild(ye))}),void 0)}function E(j){j=M.isObject(j)?j:{},z.stopVideoStreaming(j)}function x(j,W){var J=j.options||{},X=J.images,Y=J.video,se=Number(J.gifWidth),Q=Number(J.gifHeight),ne=(Number(J.numFrames),j.cameraStream),pe=j.videoElement,he=j.videoWidth,ye=j.videoHeight,Ee=re.getCropDimensions({videoWidth:he,videoHeight:ye,gifHeight:Q,gifWidth:se}),Me=W;J.crop=Ee,J.videoElement=pe,J.videoWidth=he,J.videoHeight=ye,J.cameraStream=ne,M.isElement(pe)&&(pe.width=se+Ee.width,pe.height=Q+Ee.height,J.webcamVideoElement||(M.setCSSAttr(pe,{position:"fixed",opacity:"0"}),a.body.appendChild(pe)),pe.play(),re.getGIF(J,function(De){X&&X.length||Y&&Y.length||E(De),Me(De)}))}function _(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{},W=j.callback,J=j.existingVideo,X=j.options,Y={getUserMedia:!0,"window.URL":!0},se=L.validate(Y),Q=void 0,ne=void 0;if(se.error)return W(se);if(M.isElement(J)&&J.src){if(ne=J.src,Q=M.getExtension(ne),!M.isSupported.videoCodecs[Q])return W(L.messages.videoCodecs)}else M.isArray(J)&&M.each(J,function(pe,he){return Q=he instanceof Blob?he.type.substr(he.type.lastIndexOf("/")+1,he.length):he.substr(he.lastIndexOf(".")+1,he.length),M.isSupported.videoCodecs[Q]?(J=he,!1):void 0});z.startStreaming({completed:function(pe){pe.options=X||{},x(pe,W)},existingVideo:J,crossOrigin:X.crossOrigin,options:X})}function I(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{},W=j.callback,J=j.lastCameraStream,X=j.options,Y=j.webcamVideoElement;return u()?X.savedRenderingContexts.length?(re.getGIF(X,function(se){W(se)}),void 0):(z.startVideoStreaming(function(){var se=arguments.length>0&&arguments[0]!==i?arguments[0]:{};se.options=X||{},x(se,W)},{lastCameraStream:J,callback:W,webcamVideoElement:Y,crossOrigin:X.crossOrigin}),void 0):W(L.validate())}function S(j,W){if(W=M.isFunction(j)?j:W,j=M.isObject(j)?j:{},M.isFunction(W)){var J=M.mergeOptions(G,j)||{},X=j.cameraStream,Y=J.images,se=Y?Y.length:0,Q=J.video,ne=J.webcamVideoElement;J=M.mergeOptions(J,{gifWidth:Math.floor(J.gifWidth),gifHeight:Math.floor(J.gifHeight)}),se?w({images:Y,imagesLength:se,callback:W,options:J}):Q?_({existingVideo:Q,callback:W,options:J}):I({lastCameraStream:X,callback:W,webcamVideoElement:ne,options:J})}}function R(j,W){if(W=M.isFunction(j)?j:W,j=M.isObject(j)?j:{},M.isFunction(W)){var J=M.mergeOptions(G,j),X=M.mergeOptions(J,{interval:.1,numFrames:1,gifWidth:Math.floor(J.gifWidth),gifHeight:Math.floor(J.gifHeight)});S(X,W)}}var M={URL:t.URL||t.webkitURL||t.mozURL||t.msURL,getUserMedia:(function(){var j=n.getUserMedia||n.webkitGetUserMedia||n.mozGetUserMedia||n.msGetUserMedia;return j&&j.bind(n)})(),requestAnimFrame:t.requestAnimationFrame||t.webkitRequestAnimationFrame||t.mozRequestAnimationFrame||t.oRequestAnimationFrame||t.msRequestAnimationFrame,requestTimeout:function(j,W){if(j=j||M.noop,W=W||0,!M.requestAnimFrame)return setTimeout(j,W);var J=new Date().getTime(),X=new Object,Y=M.requestAnimFrame,se=function Q(){var ne=new Date().getTime(),pe=ne-J;pe>=W?j.call():X.value=Y(Q)};return X.value=Y(se),X},Blob:t.Blob||t.BlobBuilder||t.WebKitBlobBuilder||t.MozBlobBuilder||t.MSBlobBuilder,btoa:(function(){var j=t.btoa||function(W){for(var J="",X=0,Y=W.length,se="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",Q=void 0,ne=void 0,pe=void 0,he=void 0,ye=void 0,Ee=void 0,Me=void 0;Y>X;)Q=W.charCodeAt(X++),ne=W.charCodeAt(X++),pe=W.charCodeAt(X++),he=Q>>2,ye=(3&Q)<<4|ne>>4,Ee=(15&ne)<<2|pe>>6,Me=63&pe,isNaN(ne)?Ee=Me=64:isNaN(pe)&&(Me=64),J=J+se.charAt(he)+se.charAt(ye)+se.charAt(Ee)+se.charAt(Me);return J};return j?j.bind(t):M.noop})(),isObject:function(j){return j&&Object.prototype.toString.call(j)==="[object Object]"},isEmptyObject:function(j){return M.isObject(j)&&!Object.keys(j).length},isArray:function(j){return j&&Array.isArray(j)},isFunction:function(j){return j&&typeof j=="function"},isElement:function(j){return j&&j.nodeType===1},isString:function(j){return typeof j=="string"||Object.prototype.toString.call(j)==="[object String]"},isSupported:{canvas:function(){var j=a.createElement("canvas");return j&&j.getContext&&j.getContext("2d")},webworkers:function(){return t.Worker},blob:function(){return M.Blob},Uint8Array:function(){return t.Uint8Array},Uint32Array:function(){return t.Uint32Array},videoCodecs:(function(){var j=a.createElement("video"),W={mp4:!1,h264:!1,ogv:!1,ogg:!1,webm:!1};try{j&&j.canPlayType&&(W.mp4=j.canPlayType('video/mp4; codecs="mp4v.20.8"')!=="",W.h264=(j.canPlayType('video/mp4; codecs="avc1.42E01E"')||j.canPlayType('video/mp4; codecs="avc1.42E01E, mp4a.40.2"'))!=="",W.ogv=j.canPlayType('video/ogg; codecs="theora"')!=="",W.ogg=j.canPlayType('video/ogg; codecs="theora"')!=="",W.webm=j.canPlayType('video/webm; codecs="vp8, vorbis"')!==-1)}catch{}return W})()},noop:function(){},each:function(j,W){var J=void 0,X=void 0;if(M.isArray(j))for(J=-1,X=j.length;++J<X&&W(J,j[J])!==!1;);else if(M.isObject(j)){for(J in j)if(j.hasOwnProperty(J)&&W(J,j[J])===!1)break}},mergeOptions:function(j,W){if(M.isObject(j)&&M.isObject(W)&&Object.keys){var J={};return M.each(j,function(X){J[X]=j[X]}),M.each(W,function(X){var Y=W[X];J[X]=M.isObject(Y)&&j[X]?M.mergeOptions(j[X],Y):Y}),J}},setCSSAttr:function(j,W,J){M.isElement(j)&&(M.isString(W)&&M.isString(J)?j.style[W]=J:M.isObject(W)&&M.each(W,function(X,Y){j.style[X]=Y}))},removeElement:function(j){M.isElement(j)&&j.parentNode&&j.parentNode.removeChild(j)},createWebWorker:function(j){if(!M.isString(j))return{};try{var W=new M.Blob([j],{type:"text/javascript"}),J=M.URL.createObjectURL(W),X=new Worker(J);return{objectUrl:J,worker:X}}catch(Y){return""+Y}},getExtension:function(j){return j.substr(j.lastIndexOf(".")+1,j.length)},getFontSize:function(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{};if(!a.body||j.resizeFont===!1)return j.fontSize;var W=j.text,J=j.gifWidth,X=parseInt(j.fontSize,10),Y=parseInt(j.minFontSize,10),se=a.createElement("div"),Q=a.createElement("span");for(se.setAttribute("width",J),se.appendChild(Q),Q.innerHTML=W,Q.style.fontSize=X+"px",Q.style.textIndent="-9999px",Q.style.visibility="hidden",a.body.appendChild(Q);Q.offsetWidth>J&&X>=Y;)Q.style.fontSize=--X+"px";return a.body.removeChild(Q),X+"px"},webWorkerError:!1},N=Object.freeze({default:M}),L={validate:function(j){j=M.isObject(j)?j:{};var W={};return M.each(L.validators,function(J,X){var Y=X.errorCode;return j[Y]||X.condition?void 0:(W=X,W.error=!0,!1)}),delete W.condition,W},isValid:function(W){var J=L.validate(W),X=J.error!==!0;return X},validators:[{condition:M.isFunction(M.getUserMedia),errorCode:"getUserMedia",errorMsg:"The getUserMedia API is not supported in your browser"},{condition:M.isSupported.canvas(),errorCode:"canvas",errorMsg:"Canvas elements are not supported in your browser"},{condition:M.isSupported.webworkers(),errorCode:"webworkers",errorMsg:"The Web Workers API is not supported in your browser"},{condition:M.isFunction(M.URL),errorCode:"window.URL",errorMsg:"The window.URL API is not supported in your browser"},{condition:M.isSupported.blob(),errorCode:"window.Blob",errorMsg:"The window.Blob File API is not supported in your browser"},{condition:M.isSupported.Uint8Array(),errorCode:"window.Uint8Array",errorMsg:"The window.Uint8Array function constructor is not supported in your browser"},{condition:M.isSupported.Uint32Array(),errorCode:"window.Uint32Array",errorMsg:"The window.Uint32Array function constructor is not supported in your browser"}],messages:{videoCodecs:{errorCode:"videocodec",errorMsg:"The video codec you are trying to use is not supported in your browser"}}},F=Object.freeze({default:L}),B=function(){},G={sampleInterval:10,numWorkers:2,filter:"",gifWidth:200,gifHeight:200,interval:.1,numFrames:10,frameDuration:1,keepCameraOn:!1,images:[],video:null,webcamVideoElement:null,cameraStream:null,text:"",fontWeight:"normal",fontSize:"16px",minFontSize:"10px",resizeFont:!1,fontFamily:"sans-serif",fontColor:"#ffffff",textAlign:"center",textBaseline:"bottom",textXCoordinate:null,textYCoordinate:null,progressCallback:B,completeCallback:B,saveRenderingContexts:!1,savedRenderingContexts:[],showFrameText:!0,crossOrigin:"Anonymous",waterMark:null,waterMarkHeight:null,waterMarkWidth:null,waterMarkXCoordinate:1,waterMarkYCoordinate:1},V=Object.freeze({default:G}),ee=function(){},K=function(j){this.canvas=null,this.ctx=null,this.repeat=0,this.frames=[],this.numRenderedFrames=0,this.onRenderCompleteCallback=ee,this.onRenderProgressCallback=ee,this.workers=[],this.availableWorkers=[],this.generatingGIF=!1,this.options=j,this.initializeWebWorkers(j)};K.prototype={workerMethods:g(),initializeWebWorkers:function(j){var W=this,J=d.toString()+"("+g.toString()+"());",X=void 0,Y=void 0,se=void 0,Q=void 0,ne=-1,pe="";for(Q=j.numWorkers;++ne<Q;)X=M.createWebWorker(J),M.isObject(X)?(Y=X.objectUrl,se=X.worker,W.workers.push({worker:se,objectUrl:Y}),W.availableWorkers.push(se)):(pe=X,M.webWorkerError=!!X);this.workerError=pe,this.canvas=a.createElement("canvas"),this.canvas.width=j.gifWidth,this.canvas.height=j.gifHeight,this.ctx=this.canvas.getContext("2d"),this.frames=[]},getWorker:function(){return this.availableWorkers.pop()},freeWorker:function(j){this.availableWorkers.push(j)},byteMap:(function(){for(var j=[],W=0;256>W;W++)j[W]=String.fromCharCode(W);return j})(),bufferToString:function(j){for(var W=j.length,J="",X=-1;++X<W;)J+=this.byteMap[j[X]];return J},onFrameFinished:function(j){var W=this,J=W.frames,X=W.options,Y=!!(X.images||[]).length,se=J.every(function(Q){return!Q.beingProcessed&&Q.done});W.numRenderedFrames++,Y&&j(W.numRenderedFrames/J.length),W.onRenderProgressCallback(.75*W.numRenderedFrames/J.length),se?W.generatingGIF||W.generateGIF(J,W.onRenderCompleteCallback):M.requestTimeout(function(){W.processNextFrame()},1)},processFrame:function(j){var W=this,J=(this.options,this.options),X=J.progressCallback,Y=J.sampleInterval,se=this.frames,Q=void 0,ne=void 0,pe=function(){var he=arguments.length>0&&arguments[0]!==i?arguments[0]:{},ye=he.data;delete Q.data,Q.pixels=Array.prototype.slice.call(ye.pixels),Q.palette=Array.prototype.slice.call(ye.palette),Q.done=!0,Q.beingProcessed=!1,W.freeWorker(ne),W.onFrameFinished(X)};return Q=se[j],Q.beingProcessed||Q.done?(this.onFrameFinished(),void 0):(Q.sampleInterval=Y,Q.beingProcessed=!0,Q.gifshot=!0,ne=this.getWorker(),ne?(ne.onmessage=pe,ne.postMessage(Q)):pe({data:W.workerMethods.run(Q)}),void 0)},startRendering:function(j){this.onRenderCompleteCallback=j;for(var W=0;W<this.options.numWorkers&&W<this.frames.length;W++)this.processFrame(W)},processNextFrame:function(){for(var j=-1,W=0;W<this.frames.length;W++){var J=this.frames[W];if(!J.done&&!J.beingProcessed){j=W;break}}j>=0&&this.processFrame(j)},generateGIF:function(j,W){var J=[],X={loop:this.repeat},Y=this.options,se=Y.interval,Q=Y.frameDuration,ne=Y.images,pe=!!ne.length,he=Y.gifHeight,ye=Y.gifWidth,Ee=new m(J,ye,he,X),Me=this.onRenderProgressCallback,De=pe?100*se:0,ge=void 0,Oe=void 0;this.generatingGIF=!0,M.each(j,function(Ke,Je){var h1=Je.palette;Me(.75+.25*Je.position*1/j.length);for(var Ve=0;Q>Ve;Ve++)Ee.addFrame(0,0,ye,he,Je.pixels,{palette:h1,delay:De})}),Ee.end(),Me(1),this.frames=[],this.generatingGIF=!1,M.isFunction(W)&&(ge=this.bufferToString(J),Oe="data:image/gif;base64,"+M.btoa(ge),W(Oe))},setRepeat:function(j){this.repeat=j},addFrame:function(j,W,J){W=M.isObject(W)?W:{};var X=this,Y=X.ctx,se=X.options,Q=se.gifWidth,ne=se.gifHeight,pe=M.getFontSize(W),he=W,ye=he.filter,Ee=he.fontColor,Me=he.fontFamily,De=he.fontWeight,ge=(he.gifHeight,he.gifWidth,he.text),Oe=he.textAlign,Ke=he.textBaseline,Je=he.waterMark,h1=he.waterMarkHeight,Ve=he.waterMarkWidth,qe=he.waterMarkXCoordinate,p1=he.waterMarkYCoordinate,ve=W.textXCoordinate?W.textXCoordinate:Oe==="left"?1:Oe==="right"?Q:Q/2,be=W.textYCoordinate?W.textYCoordinate:Ke==="top"?1:Ke==="center"?ne/2:ne,Ce=De+" "+pe+" "+Me,Ge=J&&W.showFrameText?J:ge,xe=void 0;try{Y.filter=ye,Y.drawImage(j,0,0,Q,ne),Ge&&(Y.font=Ce,Y.fillStyle=Ee,Y.textAlign=Oe,Y.textBaseline=Ke,Y.fillText(Ge,ve,be)),Je&&Y.drawImage(Je,qe,p1,Ve,h1),xe=Y.getImageData(0,0,Q,ne),X.addFrameImageData(xe)}catch(Ne){return""+Ne}},addFrameImageData:function(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{},W=this.frames,J=j.data;this.frames.push({data:J,width:j.width,height:j.height,palette:null,dithering:null,done:!1,beingProcessed:!1,position:W.length})},onRenderProgress:function(j){this.onRenderProgressCallback=j},isRendering:function(){return this.generatingGIF},getBase64GIF:function(j){var W=this,J=function(X){W.destroyWorkers(),M.requestTimeout(function(){j(X)},0)};W.startRendering(J)},destroyWorkers:function(){if(!this.workerError){var j=this.workers;M.each(j,function(W,J){var X=J.worker,Y=J.objectUrl;X.terminate(),M.URL.revokeObjectURL(Y)})}}};var $=function(){},re={getGIF:function(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{},W=arguments[1];W=M.isFunction(W)?W:$;var J=a.createElement("canvas"),X=void 0,Y=j.images,se=!!Y.length,Q=j.cameraStream,ne=j.crop,pe=j.filter,he=j.fontColor,ye=j.fontFamily,Ee=j.fontWeight,Me=j.keepCameraOn,De=(j.numWorkers,j.progressCallback),ge=j.saveRenderingContexts,Oe=j.savedRenderingContexts,Ke=j.text,Je=j.textAlign,h1=j.textBaseline,Ve=j.videoElement,qe=j.videoHeight,p1=j.videoWidth,ve=j.webcamVideoElement,be=j.waterMark,Ce=j.waterMarkHeight,Ge=j.waterMarkWidth,xe=j.waterMarkXCoordinate,Ne=j.waterMarkYCoordinate,r1=Number(j.gifWidth),C1=Number(j.gifHeight),d1=Number(j.interval),U1=(Number(j.sampleInterval),se?0:1e3*d1),Y1=[],x1=Oe.length?Oe.length:j.numFrames,R1=x1,v1=new K(j),I1=M.getFontSize(j),e0=j.textXCoordinate?j.textXCoordinate:Je==="left"?1:Je==="right"?r1:r1/2,r0=j.textYCoordinate?j.textYCoordinate:h1==="top"?1:h1==="center"?C1/2:C1,W1=Ee+" "+I1+" "+ye,T1=ne?Math.floor(ne.scaledWidth/2):0,ue=ne?p1-ne.scaledWidth:0,Be=ne?Math.floor(ne.scaledHeight/2):0,t1=ne?qe-ne.scaledHeight:0,u1=function k1(){function o1(){try{ue>p1&&(ue=p1),t1>qe&&(t1=qe),0>T1&&(T1=0),0>Be&&(Be=0),X.filter=pe,X.drawImage(Ve,T1,Be,ue,t1,0,0,r1,C1),e1()}catch(s1){if(s1.name!=="NS_ERROR_NOT_AVAILABLE")throw s1;M.requestTimeout(o1,100)}}function e1(){var s1=void 0;ge&&Y1.push(X.getImageData(0,0,r1,C1)),be&&X.drawImage(be,xe,Ne,Ge,Ce),Ke&&(X.font=W1,X.fillStyle=he,X.textAlign=Je,X.textBaseline=h1,X.fillText(Ke,e0,r0)),s1=X.getImageData(0,0,r1,C1),v1.addFrameImageData(s1),R1=S1,De((x1-R1)/x1),S1>0&&M.requestTimeout(k1,U1),R1||v1.getBase64GIF(function(M1){W({error:!1,errorCode:"",errorMsg:"",image:M1,cameraStream:Q,videoElement:Ve,webcamVideoElement:ve,savedRenderingContexts:Y1,keepCameraOn:Me})})}var S1=R1-1;Oe.length?(X.putImageData(Oe[x1-R1],0,0),e1()):o1()};x1=x1!==i?x1:10,d1=d1!==i?d1:.1,J.width=r1,J.height=C1,X=J.getContext("2d"),(function k1(){return Oe.length||Ve.currentTime!==0?(u1(),void 0):(M.requestTimeout(k1,100),void 0)})()},getCropDimensions:function(){var j=arguments.length>0&&arguments[0]!==i?arguments[0]:{},W=j.videoWidth,J=j.videoHeight,X=j.gifWidth,Y=j.gifHeight,se={width:0,height:0,scaledWidth:0,scaledHeight:0};return W>J?(se.width=Math.round(W*(Y/J))-X,se.scaledWidth=Math.round(se.width*(J/Y))):(se.height=Math.round(J*(X/W))-Y,se.scaledHeight=Math.round(se.height*(W/X))),se}},z={loadedData:!1,defaultVideoDimensions:{width:640,height:480},findVideoSize:function j(W){j.attempts=j.attempts||0;var J=W.cameraStream,X=W.completedCallback,Y=W.videoElement;Y&&(Y.videoWidth>0&&Y.videoHeight>0?(Y.removeEventListener("loadeddata",z.findVideoSize),X({videoElement:Y,cameraStream:J,videoWidth:Y.videoWidth,videoHeight:Y.videoHeight})):j.attempts<10?(j.attempts+=1,M.requestTimeout(function(){z.findVideoSize(W)},400)):X({videoElement:Y,cameraStream:J,videoWidth:z.defaultVideoDimensions.width,videoHeight:z.defaultVideoDimensions.height}))},onStreamingTimeout:function(j){M.isFunction(j)&&j({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - Timed out while trying to start streaming",image:null,cameraStream:{}})},stream:function(j){var W=M.isArray(j.existingVideo)?j.existingVideo[0]:j.existingVideo,J=j.cameraStream,X=j.completedCallback,Y=j.streamedCallback,se=j.videoElement;if(M.isFunction(Y)&&Y(),W){if(M.isString(W))se.src=W,se.innerHTML='<source src="'+W+'" type="video/'+M.getExtension(W)+'" />';else if(W instanceof Blob){try{se.src=M.URL.createObjectURL(W)}catch{}se.innerHTML='<source src="'+W+'" type="'+W.type+'" />'}}else if(se.mozSrcObject)se.mozSrcObject=J;else if(M.URL)try{se.srcObject=J,se.src=M.URL.createObjectURL(J)}catch{se.srcObject=J}se.play(),M.requestTimeout(function Q(){Q.count=Q.count||0,z.loadedData===!0?(z.findVideoSize({videoElement:se,cameraStream:J,completedCallback:X}),z.loadedData=!1):(Q.count+=1,Q.count>10?z.findVideoSize({videoElement:se,cameraStream:J,completedCallback:X}):Q())},0)},startStreaming:function(j){var W=M.isFunction(j.error)?j.error:M.noop,J=M.isFunction(j.streamed)?j.streamed:M.noop,X=M.isFunction(j.completed)?j.completed:M.noop,Y=j.crossOrigin,se=j.existingVideo,Q=j.lastCameraStream,ne=j.options,pe=j.webcamVideoElement,he=M.isElement(se)?se:pe||a.createElement("video");Y&&(he.crossOrigin=ne.crossOrigin),he.autoplay=!0,he.loop=!0,he.muted=!0,he.addEventListener("loadeddata",function(){z.loadedData=!0,ne.offset&&(he.currentTime=ne.offset)}),se?z.stream({videoElement:he,existingVideo:se,completedCallback:X}):Q?z.stream({videoElement:he,cameraStream:Q,streamedCallback:J,completedCallback:X}):M.getUserMedia({video:!0},function(ye){z.stream({videoElement:he,cameraStream:ye,streamedCallback:J,completedCallback:X})},W)},startVideoStreaming:function(j){var W=arguments.length>1&&arguments[1]!==i?arguments[1]:{},J=W.timeout!==i?W.timeout:0,X=W.callback,Y=W.webcamVideoElement,se=void 0;J>0&&(se=M.requestTimeout(function(){z.onStreamingTimeout(X)},1e4)),z.startStreaming({error:function(){X({error:!0,errorCode:"getUserMedia",errorMsg:"There was an issue with the getUserMedia API - the user probably denied permission",image:null,cameraStream:{}})},streamed:function(){clearTimeout(se)},completed:function(){var Q=arguments.length>0&&arguments[0]!==i?arguments[0]:{},ne=Q.cameraStream,pe=Q.videoElement,he=Q.videoHeight,ye=Q.videoWidth;j({cameraStream:ne,videoElement:pe,videoHeight:he,videoWidth:ye})},lastCameraStream:W.lastCameraStream,webcamVideoElement:Y,crossOrigin:W.crossOrigin,options:W})},stopVideoStreaming:function(j){j=M.isObject(j)?j:{};var W=j,J=W.keepCameraOn,X=W.videoElement,Y=W.webcamVideoElement,se=j.cameraStream||{},Q=se.getTracks?se.getTracks()||[]:[],ne=!!Q.length,pe=Q[0];!J&&ne&&M.isFunction(pe.stop)&&pe.stop(),M.isElement(X)&&!Y&&(X.pause(),M.isFunction(M.URL.revokeObjectURL)&&!M.webWorkerError&&X.src&&M.URL.revokeObjectURL(X.src),M.removeElement(X))}},U={utils:N,error:F,defaultOptions:V,createGIF:S,takeSnapShot:R,stopVideoStreaming:E,isSupported:s,isWebCamGIFSupported:u,isExistingVideoGIFSupported:A,isExistingImagesGIFSupported:c,VERSION:"0.4.5"};e.exports=U})(typeof window<"u"?window:{},typeof document<"u"?document:{createElement:function(){}},typeof window<"u"?window.navigator:{}),(function(t,a){e.exports=a(),e.exports.default=a()})(FLe,function(){var t=`