web-to-print 0.1.0
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.
- package/LICENSE +21 -0
- package/dist/cjs/app-globals-V2Kpy_OQ.js +5 -0
- package/dist/cjs/canvas-helpers-A6rp5rPD.js +765 -0
- package/dist/cjs/index-IFGFRm-i.js +1649 -0
- package/dist/cjs/index.cjs.js +232 -0
- package/dist/cjs/loader.cjs.js +13 -0
- package/dist/cjs/logo-BUX-b45R.js +18 -0
- package/dist/cjs/web-to-print.cjs.js +25 -0
- package/dist/cjs/wtp-editor_2.cjs.entry.js +12386 -0
- package/dist/cjs/wtp-logo-renderer.cjs.entry.js +353 -0
- package/dist/cjs/wtp-print-area-editor.cjs.entry.js +431 -0
- package/dist/collection/collection-manifest.json +16 -0
- package/dist/collection/components/wtp-editor/wtp-editor.css +124 -0
- package/dist/collection/components/wtp-editor/wtp-editor.js +1114 -0
- package/dist/collection/components/wtp-logo-renderer/wtp-logo-renderer.css +30 -0
- package/dist/collection/components/wtp-logo-renderer/wtp-logo-renderer.js +455 -0
- package/dist/collection/components/wtp-logo-upload/wtp-logo-upload.css +428 -0
- package/dist/collection/components/wtp-logo-upload/wtp-logo-upload.js +573 -0
- package/dist/collection/components/wtp-print-area-editor/wtp-print-area-editor.css +20 -0
- package/dist/collection/components/wtp-print-area-editor/wtp-print-area-editor.js +600 -0
- package/dist/collection/examples/schaeffler--big.svg +1 -0
- package/dist/collection/index.js +8 -0
- package/dist/collection/types/editor.js +1 -0
- package/dist/collection/types/index.js +2 -0
- package/dist/collection/types/labels.js +30 -0
- package/dist/collection/types/logo.js +13 -0
- package/dist/collection/utils/background-removal.js +717 -0
- package/dist/collection/utils/canvas-helpers.js +380 -0
- package/dist/collection/utils/format-detection.js +48 -0
- package/dist/collection/utils/html-render-helpers.js +106 -0
- package/dist/collection/utils/image-preview.js +54 -0
- package/dist/collection/utils/logo-validation.js +141 -0
- package/dist/collection/utils/pdf-export.js +224 -0
- package/dist/components/index.d.ts +35 -0
- package/dist/components/index.js +1 -0
- package/dist/components/p-5qCsRzlt.js +1 -0
- package/dist/components/p-Bn9gR_8e.js +1 -0
- package/dist/components/p-D8pVJRuX.js +1 -0
- package/dist/components/wtp-editor.d.ts +11 -0
- package/dist/components/wtp-editor.js +1 -0
- package/dist/components/wtp-logo-renderer.d.ts +11 -0
- package/dist/components/wtp-logo-renderer.js +1 -0
- package/dist/components/wtp-logo-upload.d.ts +11 -0
- package/dist/components/wtp-logo-upload.js +1 -0
- package/dist/components/wtp-print-area-editor.d.ts +11 -0
- package/dist/components/wtp-print-area-editor.js +1 -0
- package/dist/esm/app-globals-DQuL1Twl.js +3 -0
- package/dist/esm/canvas-helpers-CK8OAq2J.js +748 -0
- package/dist/esm/index-CUetmLbL.js +1641 -0
- package/dist/esm/index.js +228 -0
- package/dist/esm/loader.js +11 -0
- package/dist/esm/logo-D8pVJRuX.js +15 -0
- package/dist/esm/web-to-print.js +21 -0
- package/dist/esm/wtp-editor_2.entry.js +12383 -0
- package/dist/esm/wtp-logo-renderer.entry.js +351 -0
- package/dist/esm/wtp-print-area-editor.entry.js +429 -0
- package/dist/index.cjs.js +1 -0
- package/dist/index.js +1 -0
- package/dist/types/components/wtp-editor/wtp-editor.d.ts +101 -0
- package/dist/types/components/wtp-logo-renderer/wtp-logo-renderer.d.ts +55 -0
- package/dist/types/components/wtp-logo-upload/wtp-logo-upload.d.ts +76 -0
- package/dist/types/components/wtp-print-area-editor/wtp-print-area-editor.d.ts +43 -0
- package/dist/types/components.d.ts +507 -0
- package/dist/types/index.d.ts +11 -0
- package/dist/types/stencil-public-runtime.d.ts +1860 -0
- package/dist/types/types/editor.d.ts +79 -0
- package/dist/types/types/index.d.ts +5 -0
- package/dist/types/types/labels.d.ts +30 -0
- package/dist/types/types/logo.d.ts +47 -0
- package/dist/types/utils/background-removal.d.ts +95 -0
- package/dist/types/utils/canvas-helpers.d.ts +60 -0
- package/dist/types/utils/format-detection.d.ts +4 -0
- package/dist/types/utils/html-render-helpers.d.ts +44 -0
- package/dist/types/utils/image-preview.d.ts +13 -0
- package/dist/types/utils/logo-validation.d.ts +2 -0
- package/dist/types/utils/pdf-export.d.ts +32 -0
- package/dist/web-to-print/index.esm.js +1 -0
- package/dist/web-to-print/p-611ec561.entry.js +1 -0
- package/dist/web-to-print/p-703e4c52.entry.js +1 -0
- package/dist/web-to-print/p-CK8OAq2J.js +1 -0
- package/dist/web-to-print/p-CUetmLbL.js +2 -0
- package/dist/web-to-print/p-D8pVJRuX.js +1 -0
- package/dist/web-to-print/p-DQuL1Twl.js +1 -0
- package/dist/web-to-print/p-b532777b.entry.js +1 -0
- package/dist/web-to-print/web-to-print.esm.js +1 -0
- package/loader/cdn.js +1 -0
- package/loader/index.cjs.js +1 -0
- package/loader/index.d.ts +24 -0
- package/loader/index.es2017.js +1 -0
- package/loader/index.js +2 -0
- package/package.json +68 -0
- package/readme.md +490 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{r as e,c as t,g as n,h as r}from"./p-CUetmLbL.js";import{s as i,g as o,u as a,w as s,f as c,p as u,d as f,h as l,t as d,a as p}from"./p-CK8OAq2J.js";import{D as h,a as m}from"./p-D8pVJRuX.js";const g={urlPlaceholder:"https://example.com/logo.png",urlSubmit:"Fetch",dividerText:"or",dropPromptText:"Drag & drop your logo here or click to browse",dropPromptHint:"PNG, JPEG, SVG, TIFF, or AVIF",uploadAriaLabel:"Upload logo file",removeAriaLabel:e=>`Remove ${e}`,urlErrorEmpty:"Please enter a URL",urlErrorInvalid:"Invalid URL format",urlErrorProtocol:"Only HTTPS URLs are supported",urlErrorHttp:(e,t)=>`HTTP ${e}: ${t}`,urlErrorNetwork:"Could not fetch the image. The server may not allow cross-origin requests (CORS).",urlErrorFetch:"Failed to fetch image",bgRemovalProcessing:"Removing background...",bgRemovalUseOriginal:"Use Original",bgRemovalUseRemoved:"Without Background",bgRemovalFailed:"Failed",rejectionDpiUnit:"DPI"},b={addTextButton:"Add Text",addTextTooltip:"Add text",fontSelectTooltip:"Font family",colorPickerTooltip:"Text color",deleteButtonTooltip:"Delete selected",defaultText:"New Text"},v=class{constructor(n){e(this,n),this.wtpEditorReady=t(this,"wtpEditorReady"),this.wtpEditorStateChanged=t(this,"wtpEditorStateChanged"),this.wtpEditorObjectSelected=t(this,"wtpEditorObjectSelected"),this.wtpEditorObjectDeselected=t(this,"wtpEditorObjectDeselected")}get el(){return n(this)}width=800;height=600;productImage;initialState;fonts=["Arial","Helvetica","Times New Roman","Georgia","Verdana"];printArea;debug=!1;labels={};getLabels(){return{...b,...this.labels}}selectedObjectId=null;selectedObjectType=null;selectedFont="Arial";selectedTextColor="#000000";wtpEditorReady;wtpEditorStateChanged;wtpEditorObjectSelected;wtpEditorObjectDeselected;canvas;canvasEl;objectMap=new Map;previewUrlMap=new Map;backgroundReady=Promise.resolve();componentDidLoad(){this.initCanvas()}disconnectedCallback(){this.canvas?.dispose()}onProductImageChange(){void 0!==this.canvas&&void 0!==this.productImage&&(this.canvas.setDimensions({width:this.width,height:this.height}),this.backgroundReady=i(this.canvas,this.productImage))}onSizeChange(){void 0!==this.canvas&&(this.canvas.setDimensions({width:this.width,height:this.height}),void 0!==this.productImage&&""!==this.productImage&&(this.backgroundReady=i(this.canvas,this.productImage)),this.canvas.renderAll())}onDebugChange(){this.canvas?.renderAll()}async onPrintAreaChange(){if(await this.backgroundReady,void 0!==this.canvas){for(const e of this.objectMap.values())this.clampObjectToPrintArea(e);this.canvas.renderAll()}}async addLogo(e){if(void 0===this.canvas)throw new Error("Canvas not initialized");await this.backgroundReady;const t=o(),{dataUrl:n}=a(e.dataUrl),r=await s.fromURL(n),i=this.canvas.getWidth(),u=this.canvas.getHeight();if(void 0!==this.printArea){const e=c(r.width??100,r.height??100,this.printArea,i,u);r.set({left:e.x,top:e.y,originX:"center",originY:"center",scaleX:e.scaleX,scaleY:e.scaleY,angle:e.angle})}else{const e=Math.min(.3*i/(r.width??100),.3*u/(r.height??100)),t=Math.min(e,1);r.set({left:i/2,top:u/2,originX:"center",originY:"center",scaleX:t,scaleY:t})}return r._objectId=t,this.objectMap.set(t,r),void 0!==e.previewDataUrl&&this.previewUrlMap.set(t,e.previewDataUrl),this.canvas.add(r),this.canvas.setActiveObject(r),this.canvas.renderAll(),this.emitStateChanged(),t}async addText(e,t){if(void 0===this.canvas)throw new Error("Canvas not initialized");await this.backgroundReady;const n=o();let r=this.canvas.getWidth()/2,i=this.canvas.getHeight()/2;if(void 0!==this.printArea){const e=u(this.printArea,this.canvas.getWidth(),this.canvas.getHeight());r=(e[0].x+e[1].x+e[2].x+e[3].x)/4,i=(e[0].y+e[1].y+e[2].y+e[3].y)/4}const a=new f(e,{left:r,top:i,originX:"center",originY:"center",fontFamily:t?.fontFamily??this.selectedFont,fontSize:t?.fontSize??24,fill:t?.fill??"#000000"});return a._objectId=n,this.objectMap.set(n,a),this.canvas.add(a),this.canvas.setActiveObject(a),this.canvas.renderAll(),this.emitStateChanged(),n}async removeObject(e){if(void 0===this.canvas)return;const t=this.objectMap.get(e);void 0!==t&&(this.canvas.remove(t),this.objectMap.delete(e),this.canvas.renderAll(),this.emitStateChanged())}async exportState(){return this.buildEditorState()}async loadState(e){if(void 0===this.canvas)throw new Error("Canvas not initialized");this.canvas.clear(),this.objectMap.clear(),this.previewUrlMap.clear();for(const t of e.logos)void 0!==t.previewDataUrl&&this.previewUrlMap.set(t.id,t.previewDataUrl);if(this.canvas.setDimensions({width:e.width,height:e.height}),void 0!==e.fabricJson&&""!==e.fabricJson){await this.canvas.loadFromJSON(e.fabricJson);for(const e of this.canvas.getObjects()){const t=e._objectId;void 0!==t&&""!==t&&this.objectMap.set(t,e)}}null!=e.productImage&&""!==e.productImage&&(this.backgroundReady=i(this.canvas,e.productImage),await this.backgroundReady),this.canvas.renderAll()}async resetCanvas(){if(void 0!==this.canvas){this.canvas.discardActiveObject();for(const e of this.canvas.getObjects().slice())this.canvas.remove(e);this.objectMap.clear(),this.previewUrlMap.clear(),this.selectedObjectId=null,this.canvas.viewportTransform=[1,0,0,1,0,0],this.canvas.setDimensions({width:this.width,height:this.height}),this.canvas.backgroundColor="#ffffff",this.canvas.requestRenderAll()}}async exportImage(e="png",t=1){if(void 0===this.canvas)throw new Error("Canvas not initialized");try{return this.canvas.toDataURL({multiplier:1,format:e,quality:t})}catch(e){if(e instanceof DOMException&&"SecurityError"===e.name)throw new Error("Cannot export: product image is cross-origin. Use a CORS proxy or serve images from the same domain.");throw e}}async exportImageHighRes(e="png",t=1,n=3){if(void 0===this.canvas)throw new Error("Canvas not initialized");this.canvas.discardActiveObject();const r=this.debug;let i;this.debug=!1,this.canvas.renderAll();try{i=this.canvas.toDataURL({multiplier:n,format:e,quality:t})}catch(e){if(this.debug=r,this.canvas.renderAll(),e instanceof DOMException&&"SecurityError"===e.name)throw new Error("Cannot export: product image is cross-origin. Use a CORS proxy or serve images from the same domain.");throw e}const o=this.canvas.getWidth(),a=this.canvas.getHeight();return this.debug=r,this.canvas.renderAll(),{dataUrl:i,width:o,height:a}}async getObjects(){const e=[];for(const[t,n]of this.objectMap)e.push({id:t,type:n.type??"unknown"});return e}async updateText(e,t){if(void 0===this.canvas)return;const n=this.objectMap.get(e);void 0!==n&&"i-text"===n.type&&(n.set("text",t),this.canvas.renderAll(),this.emitStateChanged())}initCanvas(){if(void 0!==this.canvasEl){if(this.canvas=new l(this.canvasEl,{width:this.width,height:this.height,backgroundColor:"#ffffff"}),this.canvas.on("selection:created",(e=>{this.handleSelection(e.selected?.[0])})),this.canvas.on("selection:updated",(e=>{this.handleSelection(e.selected?.[0])})),this.canvas.on("selection:cleared",(()=>{this.selectedObjectId=null,this.selectedObjectType=null,this.wtpEditorObjectDeselected.emit()})),this.canvas.on("object:modified",(()=>{this.emitStateChanged()})),this.canvas.on("text:changed",(()=>{this.emitStateChanged()})),this.canvas.on("object:moving",(e=>{void 0!==e.target&&this.clampObjectToPrintArea(e.target)})),this.canvas.on("object:scaling",(e=>{void 0!==e.target&&this.clampObjectToPrintArea(e.target)})),this.canvas.on("after:render",(()=>this.drawDebugOverlay())),void 0!==this.initialState&&""!==this.initialState)try{const e=JSON.parse(this.initialState);this.loadState(e)}catch{}else void 0!==this.productImage&&""!==this.productImage&&(this.backgroundReady=i(this.canvas,this.productImage));this.wtpEditorReady.emit()}}drawDebugOverlay(){if(!this.debug||void 0===this.canvas||void 0===this.printArea)return;const e=this.canvas.getContext(),t=u(this.printArea,this.canvas.getWidth(),this.canvas.getHeight());e.save(),e.beginPath(),e.moveTo(t[0].x,t[0].y),e.lineTo(t[1].x,t[1].y),e.lineTo(t[2].x,t[2].y),e.lineTo(t[3].x,t[3].y),e.closePath(),e.fillStyle="rgba(37, 99, 235, 0.08)",e.fill(),e.strokeStyle="#2563eb",e.lineWidth=1.5,e.setLineDash([6,4]),e.stroke(),e.setLineDash([]);for(const n of t)e.beginPath(),e.arc(n.x,n.y,4,0,2*Math.PI),e.fillStyle="#2563eb",e.fill(),e.strokeStyle="#fff",e.lineWidth=1.5,e.stroke();const n=t.map((e=>e.x)),r=t.map((e=>e.y)),i=Math.min(...n),o=Math.max(...n),a=Math.min(...r),s=Math.max(...r);e.strokeStyle="rgba(220, 38, 38, 0.5)",e.lineWidth=1,e.setLineDash([3,3]),e.strokeRect(i,a,o-i,s-a),e.setLineDash([]),e.font="10px monospace",e.fillStyle="#2563eb";const c=["TL","TR","BR","BL"];for(let n=0;n<4;n++)e.fillText(c[n],t[n].x+6,t[n].y-6);e.restore()}getPrintAreaFrame(){if(void 0===this.printArea||void 0===this.canvas)return null;const e=u(this.printArea,this.canvas.getWidth(),this.canvas.getHeight()),[t,n,r,i]=e,o=(t.x+n.x+r.x+i.x)/4,a=(t.y+n.y+r.y+i.y)/4,s=(Math.hypot(n.x-t.x,n.y-t.y)+Math.hypot(r.x-i.x,r.y-i.y))/4,c=(Math.hypot(i.x-t.x,i.y-t.y)+Math.hypot(r.x-n.x,r.y-n.y))/4,f=Math.atan2(r.y-i.y,r.x-i.x);return{cx:o,cy:a,halfW:s,halfH:c,cos:Math.cos(f),sin:Math.sin(f)}}clampObjectToPrintArea(e){const t=this.getPrintAreaFrame();if(null===t)return;if(!0===e._isBackground)return;const{cx:n,cy:r,halfW:i,halfH:o,cos:a,sin:s}=t,c=(e.width??0)*(e.scaleX??1),u=(e.height??0)*(e.scaleY??1),f=(e.angle??0)*Math.PI/180-Math.atan2(s,a),l=Math.abs(Math.cos(f)),d=Math.abs(Math.sin(f));let p=(c*l+u*d)/2,h=(c*d+u*l)/2;if(p>i||h>o){const t=Math.min(i/Math.max(p,1),o/Math.max(h,1));e.set({scaleX:(e.scaleX??1)*t,scaleY:(e.scaleY??1)*t}),e.setCoords();const n=(e.width??0)*(e.scaleX??1),r=(e.height??0)*(e.scaleY??1);p=(n*l+r*d)/2,h=(n*d+r*l)/2}e.setCoords();const m=e.getCenterPoint(),g=m.x-n,b=m.y-r,v=g*a+b*s,w=-g*s+b*a,y=Math.max(-i+p,Math.min(i-p,v)),x=Math.max(-o+h,Math.min(o-h,w));y===v&&x===w||(e.set({left:(e.left??0)+(n+y*a-x*s-m.x),top:(e.top??0)+(r+y*s+x*a-m.y)}),e.setCoords())}handleSelection(e){if(void 0===e)return;const t=e._objectId;if(void 0!==t&&""!==t){if(this.selectedObjectId=t,this.selectedObjectType=e.type??null,"i-text"===e.type){const t=e;this.selectedFont=t.fontFamily??"Arial",this.selectedTextColor=t.fill??"#000000"}this.wtpEditorObjectSelected.emit({id:t,type:e.type??"unknown"})}}getObjectTransform(e){return{x:e.left??0,y:e.top??0,scaleX:e.scaleX??1,scaleY:e.scaleY??1,angle:e.angle??0}}buildEditorState(){const e=[],t=[];for(const[n,r]of this.objectMap)if("image"===r.type){const t=this.previewUrlMap.get(n);e.push({id:n,dataUrl:r.getSrc(),...void 0!==t?{previewDataUrl:t}:{},transform:this.getObjectTransform(r)})}else"i-text"===r.type&&t.push({id:n,text:r.text??"",fontFamily:r.fontFamily??"Arial",fontSize:r.fontSize??24,fill:r.fill??"#000000",transform:this.getObjectTransform(r)});return{fabricJson:void 0!==this.canvas?JSON.stringify(this.canvas.toJSON()):"",logos:e,texts:t,productImage:this.productImage??null,width:this.width,height:this.height}}emitStateChanged(){this.wtpEditorStateChanged.emit(this.buildEditorState())}handleAddText=()=>{this.addText(this.getLabels().defaultText,{fontFamily:this.selectedFont})};handleFontChange=e=>{if(this.selectedFont=e.target.value,void 0!==this.canvas&&null!==this.selectedObjectId){const e=this.objectMap.get(this.selectedObjectId);void 0!==e&&"i-text"===e.type&&(e.set("fontFamily",this.selectedFont),this.canvas.renderAll(),this.emitStateChanged())}};handleColorChange=e=>{if(this.selectedTextColor=e.target.value,void 0!==this.canvas&&null!==this.selectedObjectId){const e=this.objectMap.get(this.selectedObjectId);void 0!==e&&"i-text"===e.type&&(e.set("fill",this.selectedTextColor),this.canvas.renderAll(),this.emitStateChanged())}};handleDeleteSelected=()=>{null!==this.selectedObjectId&&(this.removeObject(this.selectedObjectId),this.selectedObjectId=null)};render(){const e=this.getLabels();return r("div",{key:"c9ef130a1fa731852990de6c3c926d0bc52e628d",class:"wtp-editor"},r("div",{key:"80f434e1784fdbe1ffc48686a2eb05e8db522dec",class:"toolbar"},r("button",{key:"8f03a61f63a605ca732f227e709db12f005888a3",class:"toolbar-btn",onClick:this.handleAddText,title:e.addTextTooltip},r("svg",{key:"990dad4cdb46e74fae7c887dde4416f5f16ac1fc",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("polyline",{key:"a1182b18466e0f31b95648543bd436e743a0bc09",points:"4 7 4 4 20 4 20 7"}),r("line",{key:"bb74bd40a58c5cb25a9842989bc7f5dbe94df684",x1:"9",y1:"20",x2:"15",y2:"20"}),r("line",{key:"be1eee4ddee7fadddfe00f694196861d582950e7",x1:"12",y1:"4",x2:"12",y2:"20"})),r("span",{key:"6d95e21682aa3a14de50c1b19c6f9ff01b0ba9e6"},e.addTextButton)),r("div",{key:"7180e61d20f4a5a6420dd313c78df5809a2e258e",class:"toolbar-separator"}),r("select",{key:"e44709cb401e316392dc178e2173dec0990cbadc",class:"font-select",onChange:this.handleFontChange,title:e.fontSelectTooltip},this.fonts.map((e=>r("option",{value:e,style:{fontFamily:e}},e)))),"i-text"===this.selectedObjectType&&r("input",{key:"1f369b84753de1f363e76d0b6815318055738b9c",class:"color-input",type:"color",value:this.selectedTextColor,onInput:this.handleColorChange,title:e.colorPickerTooltip}),r("div",{key:"abed11c63044bf6d27ab59ed7262e665ddf6ea32",class:"toolbar-separator"}),r("button",{key:"a7fa4df142fca5d1160a801731c3be41bddf6373",class:"toolbar-btn danger",onClick:this.handleDeleteSelected,disabled:null===this.selectedObjectId,title:e.deleteButtonTooltip},r("svg",{key:"a41f1fb373bdd2d1830b7627f6c3f9234a2a86ce",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("polyline",{key:"c731ac84aec857802f1ea1b85268c880c85ab254",points:"3 6 5 6 21 6"}),r("path",{key:"70a5b08147e64f940f55afd4680e9a8b5a8ec0ab",d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6m3 0V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})))),r("div",{key:"1f04ba454f9c834a4554b018be6dba40607dbebc",class:"canvas-container"},r("canvas",{key:"4894f481c67e7021cdd575f276ac1b4c5d20951d",ref:e=>this.canvasEl=e})))}static get watchers(){return{productImage:[{onProductImageChange:0}],width:[{onSizeChange:0}],height:[{onSizeChange:0}],debug:[{onDebugChange:0}],printArea:[{onPrintAreaChange:0}]}}};v.style='*.sc-wtp-editor,*.sc-wtp-editor::before,*.sc-wtp-editor::after{box-sizing:border-box}.sc-wtp-editor-h{font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--wtp-color-text, #1e293b);line-height:1.5}.wtp-editor.sc-wtp-editor{display:flex;flex-direction:column;border:1px solid var(--wtp-color-border, #e2e8f0);border-radius:12px;overflow:hidden;background:var(--wtp-color-bg, #ffffff)}.toolbar.sc-wtp-editor{display:flex;align-items:center;gap:8px;padding:8px 16px;border-bottom:1px solid var(--wtp-color-border, #e2e8f0);background:var(--wtp-color-bg-muted, #f8fafc);flex-wrap:wrap}.toolbar-btn.sc-wtp-editor{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);font-size:14px;font-weight:500;border-radius:8px;border:1px solid var(--wtp-color-border, #e2e8f0);background:var(--wtp-color-bg, #ffffff);color:var(--wtp-color-text, #1e293b);cursor:pointer;transition-property:all;transition-duration:250ms;transition-timing-function:ease}.toolbar-btn.sc-wtp-editor:hover{background:var(--wtp-color-bg-muted, #f8fafc)}.toolbar-btn.sc-wtp-editor:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.toolbar-btn.sc-wtp-editor:disabled{opacity:0.5;cursor:not-allowed}.toolbar-btn.sc-wtp-editor{padding:4px 8px;font-size:12px}.toolbar-btn.sc-wtp-editor svg.sc-wtp-editor{width:16px;height:16px;flex-shrink:0}.toolbar-btn.danger.sc-wtp-editor:hover:not(:disabled){background:var(--wtp-color-error-light, #fee2e2);color:var(--wtp-color-error, #dc2626);border-color:var(--wtp-color-error, #dc2626)}.font-select.sc-wtp-editor{padding:4px 8px;font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);font-size:12px;border:1px solid var(--wtp-color-border, #e2e8f0);border-radius:8px;background:var(--wtp-color-bg, #ffffff);color:var(--wtp-color-text, #1e293b);cursor:pointer;transition-property:all;transition-duration:250ms;transition-timing-function:ease}.font-select.sc-wtp-editor:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.color-input.sc-wtp-editor{width:32px;height:28px;padding:2px;border:1px solid var(--wtp-color-border, #e2e8f0);border-radius:8px;background:var(--wtp-color-bg, #ffffff);cursor:pointer;transition-property:all;transition-duration:250ms;transition-timing-function:ease}.color-input.sc-wtp-editor:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.toolbar-separator.sc-wtp-editor{width:1px;height:24px;background:var(--wtp-color-border, #e2e8f0)}.toolbar-spacer.sc-wtp-editor{flex:1}.canvas-container.sc-wtp-editor{line-height:0;overflow:auto;background:repeating-conic-gradient(#e5e7eb 0% 25%, transparent 0% 50%) 50%/20px 20px}';let w=class{constructor(e){if(function(e){return"object"!=typeof e||void 0===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}(e))throw new Error("DataView: Passed buffer type is unsupported.");this.buffer=e,this.byteLength=this.buffer.length}getUint8(e){return this.buffer.readUInt8(e)}getUint16(e,t){return t?this.buffer.readUInt16LE(e):this.buffer.readUInt16BE(e)}getUint32(e,t){return t?this.buffer.readUInt32LE(e):this.buffer.readUInt32BE(e)}getInt32(e,t){return t?this.buffer.readInt32LE(e):this.buffer.readInt32BE(e)}};function y(e,t,n){try{return new DataView(e,t,n)}catch(r){return new w(e,t,n)}}function x(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i++)r.push(e.getUint8(t+i));return P(r)}function S(e,t){const n=[];let r=0;for(;t+r<e.byteLength;){const i=e.getUint8(t+r);if(0===i)break;n.push(i),r++}return P(n)}function C(e,t,n){const r=[];for(let i=0;i<n&&t+i<e.byteLength;i+=2)r.push(e.getUint16(t+i));return 0===r[r.length-1]&&r.pop(),P(r)}function I(e,t){const n=e.getUint8(t);return[n,x(e,t+1,n)]}function P(e){return e.map((e=>String.fromCharCode(e))).join("")}function k(){for(let e=1;e<arguments.length;e++)for(const t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function T(e,t,n){let r=!1;Object.defineProperty(e,t,{get:()=>(r||(r=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:n.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function A(e){return"undefined"!=typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),((e,t)=>e+String.fromCharCode(t)),"")):"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(e).toString("base64"):new Buffer(e).toString("base64"):void 0}function D(e,t){return new Array(t+1).join(e)}const O=void 0,M="brotli";function R(e,t,n,r="string",i){const o=function(e){return e&&"number"==typeof e.maxDecompressedSize?e.maxDecompressedSize:134217728}(i);if(i&&t!==O){const a=i[0===t?"deflate":"brotli"];if("function"==typeof a){const t=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Promise.resolve(a(t)).then((e=>function(e){return e&&"number"==typeof e.byteLength?e.byteLength:0}(e)>o?E(o):"dataview"===r?e instanceof DataView?e:e instanceof ArrayBuffer?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength):new TextDecoder(n).decode(e)))}}if(0===t&&"function"==typeof DecompressionStream)return F(e,"deflate",o).then((e=>U(e,r,n)));if(t===M){if("function"==typeof DecompressionStream)try{return F(e,"brotli",o).then((e=>U(e,r,n)))}catch(e){}return Promise.reject("Brotli decompression is not supported in this environment. Pass in a brotli decompression function via the decompress option.")}if(void 0!==t)return Promise.reject(`Unknown compression method ${t}.`);if("string"===r)try{return new TextDecoder(n).decode(e)}catch(t){const n=new Uint8Array(e.buffer,e.byteOffset,e.byteLength);return Array.from(n,(e=>String.fromCharCode(e))).join("")}return e}function F(e,t,n){const r=new DecompressionStream(t),i=new Blob([e]).stream().pipeThrough(r).getReader(),o=[];let a=0;return function e(){return i.read().then((({done:t,value:r})=>t?function(e,t){const n=new Uint8Array(t);let r=0;for(let t=0;t<e.length;t++)n.set(e[t],r),r+=e[t].byteLength;return n.buffer}(o,a):(a+=r.byteLength,a>n?i.cancel().then((()=>E(n))):(o.push(r),e()))))}()}function U(e,t,n){return"dataview"===t?new DataView(e):new TextDecoder(n).decode(e)}function E(e){return"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(`ExifReader: skipped a compressed metadata block that would exceed the maximum decompressed size of ${e} bytes.`),Promise.reject(`Decompressed metadata exceeded the maximum allowed size of ${e} bytes.`)}var N={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_JXL:!0,USE_WEBP:!0,USE_GIF:!0,USE_MAKER_NOTES:!0};function G(e){return e.map((e=>String.fromCharCode(e))).join("")}function L(e){if(e.length>=8){const t=G(e.slice(0,8));if("ASCII\0\0\0"===t)return G(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";if("\0\0\0\0\0\0\0\0"===t){const t=G(e.slice(8));return/[\x20-\x7e]/.test(t)?t:"[Undefined encoding]"}}return"Undefined"}function B(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}function j(e,t,n,r,i,o,a,s){if(void 0===s)return[];const c=[];let u=n.items;for(let n=0;n<s;n++){const n={extents:[]};n.itemId=$(e,u,t),u+=r.item.itemId,n.constructionMethod=1===t||2===t?15&e.getUint16(u):void 0,u+=r.item.constructionMethod,n.dataReferenceIndex=e.getUint16(u),u+=r.item.dataReferenceIndex,n.baseOffset=_(e,u,r.item.baseOffset),u+=r.item.baseOffset,n.extentCount=e.getUint16(u),u+=r.item.extentCount;for(let s=0;s<n.extentCount;s++){const s={};s.extentIndex=z(e,t,u,a),u+=r.item.extent.extentIndex,s.extentOffset=_(e,u,i),u+=r.item.extent.extentOffset,s.extentLength=_(e,u,o),u+=r.item.extent.extentLength,n.extents.push(s)}c.push(n)}return c}function $(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}function z(e,t,n,r){if((1===t||2===t)&&r>0)return _(e,n,r)}function _(e,t,n){return 4===n?e.getUint32(t):8===n?(console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),function(e,t){return e.getUint32(t+4)}(e,t)):0}const V=1165519206,H=1835625829;function W(e,t){const{length:n,contentOffset:r}=X(e,t);if(n<8)return;const i=e.getUint32(t+4);if(1718909296===i)return function(e,t,n){return{type:"ftyp",majorBrand:x(e,t,4),length:n}}(e,r,n);if(1768977008===i)return function(e,t,n,r){return{type:"iprp",subBoxes:Z(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1768973167===i)return function(e,t,n,r){return{type:"ipco",properties:Z(e,n,r-(n-t)),length:r}}(e,t,r,n);if(1668246642===i)return function(e,t,n){return{type:"colr",icc:q(e,t),length:n}}(e,r,n);const o=e.getUint8(r);return 1835365473===i?function(e,t,n,r){return{type:"meta",subBoxes:Z(e,n+3,r-(n+3-t)),length:r}}(e,t,r+1,n):1768714083===i?function(e,t,n,r){const{offsets:i,sizes:o}=function(e,t){const n={item:{dataReferenceIndex:2,extentCount:2,extent:{}}};e<2?(n.itemCount=2,n.item.itemId=2):2===e&&(n.itemCount=4,n.item.itemId=4),n.item.constructionMethod=1===e||2===e?2:0;const r={offsetSize:t,lengthSize:t,baseOffsetSize:t+1,indexSize:t+1};return r.itemCount=t+2,r.items=r.itemCount+n.itemCount,r.item={itemId:0},r.item.constructionMethod=r.item.itemId+n.item.itemId,r.item.dataReferenceIndex=r.item.constructionMethod+n.item.constructionMethod,{offsets:r,sizes:n}}(t,n+3),a=e.getUint8(i.offsetSize)>>4;o.item.extent.extentOffset=a;const s=15&e.getUint8(i.lengthSize);o.item.extent.extentLength=s;const c=e.getUint8(i.baseOffsetSize)>>4;o.item.baseOffset=c;const u=function(e,t,n){if(1===n||2===n)return 15&e.getUint8(t)}(e,i.indexSize,t);o.item.extent.extentIndex=void 0!==u?u:0;const f=function(e,t,n){return n<2?e.getUint16(t):2===n?e.getUint32(t):void 0}(e,i.itemCount,t);return{type:"iloc",items:j(e,t,i,o,a,s,u,f),length:r}}(e,o,r+1,n):1768517222===i?function(e,t,n,r,i){const{offsets:o}=function(e,t){const n={entryCount:t+3},r={};return r.entryCount=0===e?2:4,n.itemInfos=n.entryCount+r.entryCount,{offsets:n}}(n,r);return{type:"iinf",itemInfos:Z(e,o.itemInfos,i-(o.itemInfos-t)),length:i}}(e,t,o,r+1,n):1768842853===i?function(e,t,n,r,i){r+=3;const o={type:"infe",length:i};return 0!==n&&1!==n||(o.itemId=e.getUint16(r),o.itemProtectionIndex=e.getUint16(r+=2),o.itemName=S(e,r+=2),r+=o.itemName.length+1),n>=2&&(2===n?(o.itemId=e.getUint16(r),r+=2):3===n&&(o.itemId=e.getUint32(r),r+=4),o.itemProtectionIndex=e.getUint16(r),o.itemType=e.getUint32(r+=2),o.itemName=S(e,r+=4),r+=o.itemName.length+1,o.itemType===H?(o.contentType=S(e,r),t+i>(r+=o.contentType.length+1)&&(o.contentEncoding=S(e,r),r+=o.contentEncoding.length+1)):1970432288===o.itemType&&(o.itemUri=S(e,r),r+=o.itemUri.length+1)),o}(e,t,o,r+1,n):{type:void 0,length:n}}function X(e,t){const n=e.getUint32(t);return function(e){return 0===e}(n)?{length:e.byteLength-t,contentOffset:t+4+4}:function(e){return 1===e}(n)&&function(e,t){return 0===e.getUint32(t+8)}(e,t)?{length:e.getUint32(t+12),contentOffset:t+4+4+8}:{length:n,contentOffset:t+4+4}}function K(e){if(N.USE_EXIF||N.USE_XMP||N.USE_ICC){const t={},n=function(e){let t=0;for(;t+4+4<=e.byteLength;){const n=W(e,t);if(void 0===n)break;if("meta"===n.type)return n;t+=n.length}}(e);return n?(N.USE_EXIF&&(t.tiffHeaderOffset=function(e,t){try{const n=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===V))}(t).itemId,r=Y(t,n);return J(e,r.baseOffset+r.extents[0].extentOffset)}catch(e){return}}(e,n)),N.USE_XMP&&(t.xmpChunks=function(e){try{const t=function(e){return e.subBoxes.find((e=>"iinf"===e.type)).itemInfos.find((e=>e.itemType===H&&"application/rdf+xml"===e.contentType))}(e).itemId,n=Y(e,t),r=Y(e,t).extents[0];return[{dataOffset:n.baseOffset+r.extentOffset,length:r.extentLength}]}catch(e){return}}(n)),N.USE_ICC&&(t.iccChunks=function(e){try{const t=e.subBoxes.find((e=>"iprp"===e.type)).subBoxes.find((e=>"ipco"===e.type)).properties.find((e=>"colr"===e.type)).icc;if(t)return[t]}catch(e){}}(n)),t.hasAppMarkers=void 0!==t.tiffHeaderOffset||void 0!==t.xmpChunks||void 0!==t.iccChunks,t):{hasAppMarkers:!1}}return{}}function Y(e,t){return e.subBoxes.find((e=>"iloc"===e.type)).items.find((e=>e.itemId===t))}function J(e,t){return t+4+e.getUint32(t)}function q(e,t){const n=x(e,t,4);if("prof"===n||"rICC"===n)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}function Z(e,t,n){const r=[V,H],i=[];let o=t;for(;o<t+n;){const t=W(e,o);if(void 0===t)break;void 0===t.type||void 0!==t.itemType&&-1===r.indexOf(t.itemType)||i.push(t),o+=t.length}return i}const Q=18761,ee=19789;var te=ee,ne=Q,re=function(e,t){if(e.getUint16(t)===Q)return Q;if(e.getUint16(t)===ee)return ee;throw new Error("Illegal byte order value. Faulty image.")},ie=function(e){return!!e&&e.byteLength>=4&&function(e){const t=e.getUint16(0)===ne;return 42===e.getUint16(2,t)}(e)},oe=function(){return N.USE_EXIF?{hasAppMarkers:!0,tiffHeaderOffset:0}:{}},ae=function(e){return!!e&&e.byteLength>=ce&&e.getUint16(0)===ue},se=function(e){let t,n,r,i,o,a,s,c,u,f,l,d,p,h=fe,m=0;for(;h+le+5<=e.byteLength;){if(N.USE_FILE&&_e(e,h))t=e.getUint16(h+de),n=h+de;else if(N.USE_FILE&&Ve(e,h))t=e.getUint16(h+de),r=h+de;else if(N.USE_JFIF&&Xe(e,h))t=e.getUint16(h+de),i=h+pe;else if(N.USE_EXIF&&Ke(e,h)){t=e.getUint16(h+de),m++;const n=h+he;if(1===m)l=n,d=h,p=t;else if(2===m){f=nt(e,d,p,l);const r=nt(e,h,t,n);r>f&&(f=r,l=n,d=h,p=t)}else{const r=nt(e,h,t,n);r>f&&(f=r,l=n,d=h,p=t)}o=l}else if(N.USE_XMP&&Ye(e,h))s||(s=[]),t=e.getUint16(h+de),s.push(qe(h,t));else if(N.USE_XMP&&Je(e,h))s||(s=[]),t=e.getUint16(h+de),s.push(Ze(h,t));else if(N.USE_IPTC&&Qe(e,h))t=e.getUint16(h+de),a=h+me;else if(N.USE_ICC&&He(e,h)){t=e.getUint16(h+de);const n=h+ve,r=t-(ve-de),i=e.getUint8(h+xe),o=e.getUint8(h+Se);c||(c=[]),c.push({offset:n,length:r,chunkNumber:i,chunksTotal:o})}else if(N.USE_MPF&&We(e,h))t=e.getUint16(h+de),u=h+we;else{if(!et(e,h)){if(tt(e,h)){h++;continue}break}t=e.getUint16(h+de)}h+=de+t}return m>1&&function(e){"undefined"!=typeof console&&"function"==typeof console.warn&&console.warn(`ExifReader: Found ${e} Exif segments (APP1). Will pick the best candidate segment.`)}(m),{hasAppMarkers:h>fe,fileDataOffset:n||r,jfifDataOffset:i,tiffHeaderOffset:o,iptcDataOffset:a,xmpChunks:s,iccChunks:c,mpfDataOffset:u}};const ce=2,ue=65496,fe=2,le=4,de=2,pe=2,he=10,me=18,ge=33,be=79,ve=18,we=8,ye="ICC_PROFILE\0",xe=le+ye.length,Se=xe+1,Ce="MPF\0",Ie=65472,Pe=65474,ke=65476,Te=65499,Ae=65501,De=65498,Oe=65504,Me=65505,Re=65506,Fe=65517,Ue=65519,Ee=65534,Ne=65535,Ge="JFIF",Le="Exif",Be="http://ns.adobe.com/xap/1.0/\0",je="http://ns.adobe.com/xmp/extension/\0",$e="Photoshop 3.0",ze="8BIM";function _e(e,t){return e.getUint16(t)===Ie}function Ve(e,t){return e.getUint16(t)===Pe}function He(e,t){const n=ye.length;return e.getUint16(t)===Re&&x(e,t+le,n)===ye}function We(e,t){const n=Ce.length;return e.getUint16(t)===Re&&x(e,t+le,n)===Ce}function Xe(e,t){const n=Ge.length;return e.getUint16(t)===Oe&&x(e,t+le,n)===Ge&&0===e.getUint8(t+le+n)}function Ke(e,t){const n=Le.length;return e.getUint16(t)===Me&&x(e,t+le,n)===Le&&0===e.getUint8(t+le+n)}function Ye(e,t){return e.getUint16(t)===Me&&function(e,t){return x(e,t+le,Be.length)===Be}(e,t)}function Je(e,t){return e.getUint16(t)===Me&&function(e,t){return x(e,t+le,je.length)===je}(e,t)}function qe(e,t){return{dataOffset:e+ge,length:t-(ge-de)}}function Ze(e,t){return{dataOffset:e+be,length:t-(be-de)}}function Qe(e,t){const n=$e.length,r=ze.length,i=t+le+n+1;return e.getUint16(t)===Fe&&x(e,t+le,n)===$e&&0===e.getUint8(t+le+n)&&x(e,i,r)===ze}function et(e,t){const n=e.getUint16(t);return n>=Oe&&n<=Ue||n===Ee||n===Ie||n===Pe||n===ke||n===Te||n===Ae||n===De}function tt(e,t){return e.getUint16(t)===Ne}function nt(e,t,n,r){const i=function(e,t,n){try{if(t+8>n)return;const r=e.getUint16(t+0),i=r===ne;if(!i&&r!==te)return;if(42!==e.getUint16(t+2,i))return;const o=t+e.getUint32(t+4,i);if(o+2>n)return;const a=e.getUint16(o,i);return{ifdEntries:a,isValid:o+(2+12*a+4)<=n&&a>0}}catch(e){return}}(e,r,t+de+n);if(!i)return 0;const o=Number.isInteger(i.ifdEntries)?i.ifdEntries:0;return(i.isValid?1e9:0)+1e6*o+n}var rt=function(e){return!!e&&x(e,0,ot.length)===ot},it=function(e,t){const n={hasAppMarkers:!1};let r=ot.length;for(;r+at+st<=e.byteLength;){if(N.USE_PNG_FILE&&wt(e,r))n.hasAppMarkers=!0,n.pngHeaderOffset=r+ft;else if(N.USE_XMP&&yt(e,r)){const t=Pt(e,r);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:e.getUint32(r+ct)-(t-(r+ft))}])}else if(xt(e,r,t)){n.hasAppMarkers=!0;const t=x(e,r+ut,st);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:e.getUint32(r+ct),type:t,offset:r+ft})}else if(St(e,r))n.hasAppMarkers=!0,n.tiffHeaderOffset=r+ft;else if(N.USE_ICC&&t&&Ct(e,r)){n.hasAppMarkers=!0;const t=e.getUint32(r+ct),i=r+ft,{profileName:o,compressionMethod:a,compressedProfileOffset:s}=kt(e,i);n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:s,length:t-(s-i),chunkNumber:1,chunksTotal:1,profileName:o,compressionMethod:a})}else It(e,r)&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(r+ct));r+=e.getUint32(r+ct)+at+st+4}return n};const ot="PNG\r\n\n",at=4,st=4,ct=0,ut=at,ft=at+st,lt="XML:com.adobe.xmp\0",dt="tEXt",pt="iTXt",ht="zTXt",mt="pHYs",gt="tIME",bt="eXIf",vt="iCCP";function wt(e,t){return"IHDR"===x(e,t+ut,st)}function yt(e,t){return x(e,t+ut,st)===pt&&x(e,t+ft,lt.length)===lt}function xt(e,t,n){const r=x(e,t+ut,st);return r===dt||r===pt||r===ht&&n}function St(e,t){return x(e,t+ut,st)===bt}function Ct(e,t){return x(e,t+ut,st)===vt}function It(e,t){const n=[mt,gt],r=x(e,t+ut,st);return n.includes(r)}function Pt(e,t){t+=ft+lt.length+1+1;let n=0;for(;n<2&&t<e.byteLength;)0===e.getUint8(t)&&n++,t++;if(!(n<2))return t}function kt(e,t){const n=S(e,t);return{profileName:n,compressionMethod:e.getUint8(t+=n.length+1),compressedProfileOffset:t+=1}}var Tt=function(e){if(!e)return!1;const t=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"];try{const n=W(e,0);return n&&-1!==t.indexOf(n.majorBrand)}catch(e){return!1}},At=function(e){return K(e)},Dt=function(e){if(!e)return!1;try{const t=W(e,0);return t&&"avif"===t.majorBrand}catch(e){return!1}},Ot=function(e){return K(e)},Mt=function(e){try{return function(e){if(!e||e.byteLength<Ft.length)return!1;for(let t=0;t<Ft.length;t++)if(e.getUint8(t)!==Ft[t])return!1;return!0}(e)||Vt(e)}catch(e){return!1}},Rt=function(e){let t,n,r,i,o,a=0;for(Vt(e)&&(o=0);a+Nt<=e.byteLength;){const{length:s,contentOffset:c}=X(e,a);if(s<Nt)break;const u=e.getUint32(a+Et);if(N.USE_EXIF&&u===Gt)try{t=J(e,c)}catch(e){}if(N.USE_XMP&&u===Lt&&(n=[{dataOffset:c,length:s-(c-a)}]),u===jt&&void 0===o&&(o=c),u===$t&&void 0===o&&c+zt<=e.byteLength&&!(2147483647&e.getUint32(c))&&(o=c+zt),u===Bt&&c+_t<=e.byteLength){const o=e.getUint32(c),u=c+_t,f=s-(u-a);N.USE_EXIF&&o===Gt&&void 0===t&&!r&&(r={dataOffset:u,length:f}),!N.USE_XMP||o!==Lt||n||i||(i={dataOffset:u,length:f})}a+=s}return{hasAppMarkers:void 0!==t||void 0!==n||void 0!==r||void 0!==i||void 0!==o,tiffHeaderOffset:t,xmpChunks:n,brobExifChunk:r,brobXmpChunk:i,jxlCodestreamOffset:o}};const Ft=[0,0,0,12,74,88,76,32,13,10,135,10],Ut=[255,10],Et=4,Nt=8,Gt=1165519206,Lt=2020437024,Bt=1651666786,jt=1786276963,$t=1786276976,zt=4,_t=4;function Vt(e){return!(!e||e.byteLength<Ut.length)&&e.getUint8(0)===Ut[0]&&e.getUint8(1)===Ut[1]}var Ht=function(e){return!!e&&"RIFF"===x(e,0,4)&&"WEBP"===x(e,8,4)},Wt=function(e){let t,n,r,i,o=12,a=!1;for(;o+8<e.byteLength;){const s=x(e,o,4),c=e.getUint32(o+4,!0);N.USE_EXIF&&"EXIF"===s?(a=!0,t="Exif\0\0"===x(e,o+8,6)?o+8+6:o+8):N.USE_XMP&&"XMP "===s?(a=!0,n=[{dataOffset:o+8,length:c}]):N.USE_ICC&&"ICCP"===s?(a=!0,r=[{offset:o+8,length:c,chunkNumber:1,chunksTotal:1}]):"VP8X"===s&&(a=!0,i=o+8),o+=8+(c%2==0?c:c+1)}return{hasAppMarkers:a,tiffHeaderOffset:t,xmpChunks:n,iccChunks:r,vp8xChunkOffset:i}},Xt=function(e){return!!e&&Jt.includes(x(e,0,Yt))},Kt=function(){return{gifHeaderOffset:0}};const Yt=6,Jt=["GIF87a","GIF89a"];var qt=function(e){return!!e&&x(e,Qt,en.length)===en},Zt=function(e){const t=[];return t.push({dataOffset:Qt,length:e.byteLength}),{xmpChunks:t}};const Qt=0,en="<?xpacket begin";var tn=function(e,t){if(N.USE_TIFF&&ie(e))return nn(oe(),"tiff","TIFF");if(N.USE_JPEG&&ae(e))return nn(se(e),"jpeg","JPEG");if(N.USE_PNG&&rt(e))return nn(it(e,t),"png","PNG");if(N.USE_HEIC&&Tt(e))return nn(At(e),"heic","HEIC");if(N.USE_AVIF&&Dt(e))return nn(Ot(e),"avif","AVIF");if(N.USE_JXL&&Mt(e))return nn(Rt(e),"jxl","JPEG XL");if(N.USE_WEBP&&Ht(e))return nn(Wt(e),"webp","WebP");if(N.USE_GIF&&Xt(e))return nn(Kt(e),"gif","GIF");if(N.USE_XMP&&qt(e))return nn(Zt(e),"xml","XML");throw new Error("Invalid image format")};function nn(e,t,n){return k({},e,{fileType:{value:t,description:n}})}var rn={ApertureValue:e=>Math.pow(Math.sqrt(2),e[0]/e[1]).toFixed(2),ColorSpace:e=>1===e?"sRGB":65535===e?"Uncalibrated":"Unknown",ComponentsConfiguration:e=>e.map((e=>49===e?"Y":50===e?"Cb":51===e?"Cr":52===e?"R":53===e?"G":54===e?"B":void 0)).join(""),Contrast:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",CustomRendered:e=>0===e?"Normal process":1===e?"Custom process":"Unknown",ExposureMode:e=>0===e?"Auto exposure":1===e?"Manual exposure":2===e?"Auto bracket":"Unknown",ExposureProgram:e=>0===e?"Undefined":1===e?"Manual":2===e?"Normal program":3===e?"Aperture priority":4===e?"Shutter priority":5===e?"Creative program":6===e?"Action program":7===e?"Portrait mode":8===e?"Landscape mode":9===e?"Bulb":"Unknown",ExposureTime(e){if(e[0]/e[1]>.25){const t=e[0]/e[1];return Number.isInteger(t)?""+t:t.toFixed(1)}return 0!==e[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=>2===e?"inches":3===e?"centimeters":4===e?"millimeters":"Unknown",LightSource:e=>1===e?"Daylight":2===e?"Fluorescent":3===e?"Tungsten (incandescent light)":4===e?"Flash":9===e?"Fine weather":10===e?"Cloudy weather":11===e?"Shade":12===e?"Daylight fluorescent (D 5700 – 7100K)":13===e?"Day white fluorescent (N 4600 – 5400K)":14===e?"Cool white fluorescent (W 3900 – 4500K)":15===e?"White fluorescent (WW 3200 – 3700K)":17===e?"Standard light A":18===e?"Standard light B":19===e?"Standard light C":20===e?"D55":21===e?"D65":22===e?"D75":23===e?"D50":24===e?"ISO studio tungsten":255===e?"Other light source":"Unknown",MeteringMode:e=>1===e?"Average":2===e?"CenterWeightedAverage":3===e?"Spot":4===e?"MultiSpot":5===e?"Pattern":6===e?"Partial":255===e?"Other":"Unknown",ResolutionUnit:e=>2===e?"inches":3===e?"centimeters":"Unknown",Saturation:e=>0===e?"Normal":1===e?"Low saturation":2===e?"High saturation":"Unknown",FocalLengthIn35mmFilm:e=>0===e?"Unknown":e+" mm",SceneCaptureType:e=>0===e?"Standard":1===e?"Landscape":2===e?"Portrait":3===e?"Night scene":"Unknown",Sharpness:e=>0===e?"Normal":1===e?"Soft":2===e?"Hard":"Unknown",ShutterSpeedValue(e){const t=Math.pow(2,e[0]/e[1]);return t<=1?`${Math.round(1/t)}`:`1/${Math.round(t)}`},WhiteBalance:e=>0===e?"Auto white balance":1===e?"Manual white balance":"Unknown",XResolution:e=>""+Math.round(e[0]/e[1]),YResolution:e=>""+Math.round(e[0]/e[1])},on={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=>1===e?"top-left":2===e?"top-right":3===e?"bottom-right":4===e?"bottom-left":5===e?"left-top":6===e?"right-top":7===e?"right-bottom":8===e?"left-bottom":"Undefined"},277:"SamplesPerPixel",278:"RowsPerStrip",279:"StripByteCounts",280:"MinSampleValue",281:"MaxSampleValue",282:{name:"XResolution",description:rn.XResolution},283:{name:"YResolution",description:rn.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:rn.ResolutionUnit},297:"PageNumber",301:"TransferFunction",305:"Software",306:"DateTime",315:"Artist",316:"HostComputer",317:"Predictor",318:{name:"WhitePoint",description:e=>e.map((e=>`${e[0]}/${e[1]}`)).join(", ")},319:{name:"PrimaryChromaticities",description:e=>e.map((e=>`${e[0]}/${e[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 t={1:"Unsigned",2:"Signed",3:"Float",4:"Undefined",5:"Complex int",6:"Complex float"};return Array.isArray(e)?e.map((e=>t[e]||"Unknown")).join(", "):"Unknown"}},513:"JPEGInterchangeFormat",514:"JPEGInterchangeFormatLength",529:{name:"YCbCrCoefficients",description:e=>e.map((e=>""+e[0]/e[1])).join("/")},530:"YCbCrSubSampling",531:{name:"YCbCrPositioning",description:e=>1===e?"centered":2===e?"co-sited":"undefined "+e},532:{name:"ReferenceBlackWhite",description:e=>e.map((e=>""+e[0]/e[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:an},40092:{name:"XPComment",description:an},40093:{name:"XPAuthor",description:an},40094:{name:"XPKeywords",description:an},40095:{name:"XPSubject",description:an},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:rn.LightSource},50779:{name:"CalibrationIlluminant2",description:rn.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 an(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}var sn={0:{name:"GPSVersionID",description:e=>2===e[0]&&2===e[1]&&0===e[2]&&0===e[3]?"Version 2.2":"Unknown"},1:{name:"GPSLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:B},3:{name:"GPSLongitudeRef",description:e=>{const t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:B},5:{name:"GPSAltitudeRef",description:e=>0===e?"Sea level":1===e?"Sea level reference (negative value)":"Unknown"},6:{name:"GPSAltitude",description:e=>e[0]/e[1]+" m"},7:{name:"GPSTimeStamp",description:e=>e.map((([e,t])=>{const n=e/t;return/^\d(\.|$)/.test(`${n}`)?`0${n}`:n})).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{const t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{const t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers per hour":"M"===t?"Miles per hour":"N"===t?"Knots":"Unknown"}},13:"GPSSpeed",14:{name:"GPSTrackRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{const t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{const t=e.join("");return"N"===t?"North latitude":"S"===t?"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 t=e.join("");return"E"===t?"East longitude":"W"===t?"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 t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{const t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:L},28:{name:"GPSAreaInformation",description:L},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},cn={1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>G(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},un={45056:{name:"MPFVersion",description:e=>G(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"};const fn=k({},on,{33434:{name:"ExposureTime",description:rn.ExposureTime},33437:{name:"FNumber",description:rn.FNumber},34850:{name:"ExposureProgram",description:rn.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=>G(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:rn.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:rn.ShutterSpeedValue},37378:{name:"ApertureValue",description:rn.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:rn.MeteringMode},37384:{name:"LightSource",description:rn.LightSource},37385:{name:"Flash",description:e=>0===e?"Flash did not fire":1===e?"Flash fired":5===e?"Strobe return light not detected":7===e?"Strobe return light detected":9===e?"Flash fired, compulsory flash mode":13===e?"Flash fired, compulsory flash mode, return light not detected":15===e?"Flash fired, compulsory flash mode, return light detected":16===e?"Flash did not fire, compulsory flash mode":24===e?"Flash did not fire, auto mode":25===e?"Flash fired, auto mode":29===e?"Flash fired, auto mode, return light not detected":31===e?"Flash fired, auto mode, return light detected":32===e?"No flash function":65===e?"Flash fired, red-eye reduction mode":69===e?"Flash fired, red-eye reduction mode, return light not detected":71===e?"Flash fired, red-eye reduction mode, return light detected":73===e?"Flash fired, compulsory flash mode, red-eye reduction mode":77===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected":79===e?"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected":89===e?"Flash fired, auto mode, red-eye reduction mode":93===e?"Flash fired, auto mode, return light not detected, red-eye reduction mode":95===e?"Flash fired, auto mode, return light detected, red-eye reduction mode":"Unknown"},37386:{name:"FocalLength",description:rn.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=>2===e.length?`Location; X: ${e[0]}, Y: ${e[1]}`:3===e.length?`Circle; X: ${e[0]}, Y: ${e[1]}, diameter: ${e[2]}`:4===e.length?`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:L},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((e=>String.fromCharCode(e))).join("")},40961:{name:"ColorSpace",description:rn.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:rn.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>1===e?"Undefined":2===e?"One-chip color area sensor":3===e?"Two-chip color area sensor":4===e?"Three-chip color area sensor":5===e?"Color sequential area sensor":7===e?"Trilinear sensor":8===e?"Color sequential linear sensor":"Unknown"},41728:{name:"FileSource",description:e=>3===e?"DSC":"Unknown"},41729:{name:"SceneType",description:e=>1===e?"A directly photographed image":"Unknown"},41730:{name:"CFAPattern",description:()=>"[Raw CFA pattern table data]"},41985:{name:"CustomRendered",description:rn.CustomRendered},41986:{name:"ExposureMode",description:rn.ExposureMode},41987:{name:"WhiteBalance",description:rn.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:rn.FocalLengthIn35mmFilm},41990:{name:"SceneCaptureType",description:rn.SceneCaptureType},41991:{name:"GainControl",description:e=>0===e?"None":1===e?"Low gain up":2===e?"High gain up":3===e?"Low gain down":4===e?"High gain down":"Unknown"},41992:{name:"Contrast",description:rn.Contrast},41993:{name:"Saturation",description:rn.Saturation},41994:{name:"Sharpness",description:rn.Sharpness},41995:{name:"DeviceSettingDescription",description:()=>"[Raw device settings table data]"},41996:{name:"SubjectDistanceRange",description:e=>1===e?"Macro":2===e?"Close view":3===e?"Distant view":"Unknown"},42016:"ImageUniqueID",42032:"CameraOwnerName",42033:"BodySerialNumber",42034:{name:"LensSpecification",description:e=>{const t=`${parseFloat((e[0][0]/e[0][1]).toFixed(5))}-${parseFloat((e[1][0]/e[1][1]).toFixed(5))} mm`;return 0===e[3][1]?`${t} f/?`:`${t} f/${parseFloat((1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]))).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"}),ln="0th",dn="1st",pn="exif",hn="gps",mn="interoperability",gn="mpf",bn="canon",vn="pentax";var wn={[ln]:fn,[dn]:on,[pn]:fn,[hn]:sn,[mn]:cn,[gn]:N.USE_MPF?un:{},[bn]:N.USE_MAKER_NOTES?{1:{name:"CameraSettings",description:e=>e},4:{name:"ShotInfo",description:e=>e},149:"LensModel"}:{},[vn]:N.USE_MAKER_NOTES?{0:{name:"PentaxVersion",description:e=>e.join(".")},5:"PentaxModelID",555:"LevelInfo"}:{}};const yn={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},xn={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13};var Sn={getAsciiValue:function(e){return e.map((e=>String.fromCharCode(e)))},getByteAt:Cn,getAsciiAt:function(e,t){return e.getUint8(t)},getShortAt:function(e,t,n){return e.getUint16(t,n===ne)},getLongAt:In,getRationalAt:function(e,t,n){return[In(e,t,n),In(e,t+4,n)]},getUndefinedAt:function(e,t){return Cn(e,t)},getSlongAt:Pn,getSrationalAt:function(e,t,n){return[Pn(e,t,n),Pn(e,t+4,n)]},getIfdPointerAt:function(e,t,n){return In(e,t,n)},typeSizes:yn,tagTypes:xn,getTypeSize:function(e){if(void 0===xn[e])throw new Error("No such type found.");return yn[xn[e]]}};function Cn(e,t){return e.getUint8(t)}function In(e,t,n){return e.getUint32(t,n===ne)}function Pn(e,t,n){return e.getInt32(t,n===ne)}const kn={exif:!0,iptc:!0,photoshop:!0,mpf:!0,makerNotes:!0},Tn={exif:!0,iptc:!0,xmp:!0,icc:!0,photoshop:!0,makerNotes:!0,mpf:!0,file:!0,jfif:!0,png:!0,riff:!0,gif:!0,gps:!0,composite:!0,thumbnail:!0},An="Exif IFD Pointer",Dn="GPS Info IFD Pointer",On={thumbnail:["JPEGInterchangeFormat","JPEGInterchangeFormatLength"],iptc:["IPTC-NAA"],xmp:["ApplicationNotes"],icc:["ICC_Profile"],photoshop:["ImageSourceData","PhotoshopSettings"],makerNotes:["MakerNote","Make"],gps:["GPSLatitude","GPSLatitudeRef","GPSLongitude","GPSLongitudeRef","GPSAltitude","GPSAltitudeRef"]},Mn=["Image Width","Image Height"],Rn=["FocalLength","FocalPlaneXResolution","FocalPlaneYResolution","FocalPlaneResolutionUnit","FocalLengthIn35mmFilm"];function Fn(e){return!0===e||Array.isArray(e)&&e.length>0}function Un(){return{isActive:!1,shouldReturnGroup:e,shouldParseGroup:e,shouldReturnTag:e,shouldParseTag:e};function e(){return!0}}const En=Un();function Nn({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,includeTags:r,shouldParseExif:i,shouldParseFile:o}){return!t||(n?!("thumbnail"!==e||!Array.isArray(r[e]))||r[e]:"exif"===e&&i||"file"===e&&o?[]:void 0)}function Gn({groupKey:e,hasIncludeTags:t,hasIncludeEntry:n,shouldParseExif:r,shouldParseFile:i,exifIncludeDependencies:o,fileIncludeDependencies:a}){return t?"exif"===e&&(r||n&&Object.keys(o).length>0)?o:"file"===e&&i?a:Object.create(null):Object.create(null)}function Ln(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return!1;const n=e[t];return!0===n||Array.isArray(n)&&n.length>0}function Bn({groupKey:e,includeValue:t,excludeValue:n,extraIncludeNames:r}){const i=!!kn[e],o={includeAll:!1,includeNames:void 0,includeIds:void 0,excludeAll:!1,excludeNames:void 0,excludeIds:void 0};if(!0===t)o.includeAll=!0;else if(Array.isArray(t)){o.includeNames=Object.create(null),i&&(o.includeIds=Object.create(null));for(let e=0;e<t.length;e++)a=o,"number"==typeof(s=t[e])&&a.includeIds?a.includeIds[String(s)]=!0:"string"==typeof s&&(a.includeNames[s.toLowerCase()]=!0);for(const e in r)o.includeNames[e.toLowerCase()]=!0}else if(r&&Object.keys(r).length>0){o.includeNames=Object.create(null);for(const e in r)o.includeNames[e.toLowerCase()]=!0}var a,s;if(!0===n)return o.excludeAll=!0,o;if(Array.isArray(n)){o.excludeNames=Object.create(null),i&&(o.excludeIds=Object.create(null));for(let e=0;e<n.length;e++)c(o,n[e])}return o;function c(e,t){"number"==typeof t&&e.excludeIds?e.excludeIds[String(t)]=!0:"string"==typeof t&&(e.excludeNames[t.toLowerCase()]=!0)}}function jn(e,t,n){return!(e.excludeAll||(e.includeAll?$n(e,t,n):(e.includeNames||e.includeIds)&&!function(e,t,n){return!(void 0===n||!e.includeIds||!e.includeIds[String(n)])||!!(t&&e.includeNames&&e.includeNames[String(t).toLowerCase()])}(e,t,n)||$n(e,t,n)))}function $n(e,t,n){return!(void 0===n||!e.excludeIds||!e.excludeIds[String(n)])||!!(t&&e.excludeNames&&e.excludeNames[String(t).toLowerCase()])}const zn={1:Sn.getByteAt,2:Sn.getAsciiAt,3:Sn.getShortAt,4:Sn.getLongAt,5:Sn.getRationalAt,7:Sn.getUndefinedAt,9:Sn.getSlongAt,10:Sn.getSrationalAt,13:Sn.getIfdPointerAt};function _n(e,t,n){const r=t+4;if(!(r+Sn.getTypeSize("LONG")>e.byteLength))return t+Sn.getLongAt(e,r,n)}function Vn(e,t,n,r,i,o,a=!1,s=En,c="exif"){const u=Sn.getTypeSize("SHORT"),f={},l=function(e,t,n){return t+Sn.getTypeSize("SHORT")<=e.byteLength?Sn.getShortAt(e,t,n):0}(e,r,i);r+=u;for(let u=0;u<l&&!(r+12>e.byteLength);u++){const u=Hn(e,t,n,r,i,o,s,c);void 0!==u&&(f[u.name]={id:u.id,value:u.value,description:u.description},a&&(f[u.name].computed=(p=u.value,(d=u.tagType)===Sn.tagTypes.ASCII?Array.isArray(p)&&1===p.length?p[0]:p:d===Sn.tagTypes.RATIONAL||d===Sn.tagTypes.SRATIONAL?function(e){return!(!Array.isArray(e)||2!==e.length)&&("number"==typeof e[0]&&"number"==typeof e[1])}(p)?Kn(p):Array.isArray(p)?p.map((e=>Kn(e))):p:p)),("MakerNote"===u.name||t===vn&&"LevelInfo"===u.name)&&(f[u.name].__offset=u.__offset)),r+=12}var d,p;if(N.USE_THUMBNAIL&&r<e.byteLength-Sn.getTypeSize("LONG")){const c=Sn.getLongAt(e,r,i);0!==c&&t===ln&&s.shouldParseGroup("thumbnail")&&(f.Thumbnail=Vn(e,"1st",n,n+c,i,o,a,s,"thumbnail"))}return f}function Hn(e,t,n,r,i,o=!1,a=En,s="exif"){const c=Sn.getTypeSize("SHORT"),u=c+Sn.getTypeSize("SHORT"),f=u+Sn.getTypeSize("LONG"),l=Sn.getShortAt(e,r,i),d=Sn.getShortAt(e,r+c,i),p=Sn.getLongAt(e,r+u,i);let h,m;if(void 0===Sn.typeSizes[d]||!o&&void 0===wn[t][l])return;const g=function(e,t){if(void 0!==wn[e][t]){if("string"==typeof wn[e][t])return wn[e][t];if(wn[e][t].name)return wn[e][t].name}return`undefined-${t}`}(t,l);if(!a.shouldParseTag(s,g,l))return;!function(e,t){return Sn.typeSizes[e]*t<=Sn.getTypeSize("LONG")}(d,p)?(m=Sn.getLongAt(e,r+f,i),h=function(e,t,n,r,i){return t+n+Sn.typeSizes[r]*i<=e.byteLength}(e,n,m,d,p)?Wn(e,n+m,d,p,i,33723===l):"<faulty value>"):(m=r+f,h=Wn(e,m,d,p,i)),d===Sn.tagTypes.ASCII&&(h=function(e){const t=[];let n=0;for(let r=0;r<e.length;r++)"\0"!==e[r]?(void 0===t[n]&&(t[n]=""),t[n]+=e[r]):n++;return t}(h),h=function(e){try{return e.map((e=>decodeURIComponent(escape(e))))}catch(t){return e}}(h));let b=h;if(void 0!==wn[t][l])if(void 0!==wn[t][l].name&&void 0!==wn[t][l].description)try{b=wn[t][l].description(h)}catch(e){b=Xn(h)}else b=d===Sn.tagTypes.RATIONAL||d===Sn.tagTypes.SRATIONAL?""+h[0]/h[1]:Xn(h);return{id:l,name:g,value:h,description:b,tagType:d,__offset:m}}function Wn(e,t,n,r,i,o=!1){let a=[];o&&(r*=Sn.typeSizes[n],n=Sn.tagTypes.BYTE);for(let o=0;o<r;o++)a.push(zn[n](e,t,i)),t+=Sn.typeSizes[n];return n===Sn.tagTypes.ASCII?a=Sn.getAsciiValue(a):1===a.length&&(a=a[0]),a}function Xn(e){return e instanceof Array?e.join(", "):e}function Kn(e){if(!Array.isArray(e)||2!==e.length)return e;const t=e[0],n=e[1];return Number.isFinite(t)&&Number.isFinite(n)?0===n?null:t/n:e}const Yn="Exif IFD Pointer",Jn="GPS Info IFD Pointer",qn="Interoperability IFD Pointer";var Zn=function(e,t,n,r=!1,i){const o=re(e,t);let a=function(e,t,n,r,i,o){const a=_n(e,t,n);return void 0===a?{}:Vn(e,ln,t,a,n,r,i,o,"exif")}(e,t,o,n,r,i);return a=function(e,t,n,r,i,o,a){return void 0!==e[Yn]?k(e,Vn(t,pn,n,n+e[Yn].value,r,i,o,a,"exif")):e}(a,e,t,o,n,r,i),a=function(e,t,n,r,i,o,a){return void 0!==e[Jn]?k(e,Vn(t,"gps",n,n+e[Jn].value,r,i,o,a,"exif")):e}(a,e,t,o,n,r,i),a=function(e,t,n,r,i,o,a){return void 0!==e[qn]?k(e,Vn(t,mn,n,n+e[qn].value,r,i,o,a,"exif")):e}(a,e,t,o,n,r,i),{tags:a,byteOrder:o}};var Qn=function(e,t,n,r=!1,i){const o=re(e,t),a=_n(e,t,o);if(void 0===a)return{};return function(e,t,n,r){if(!n.MPEntry)return n;const i=[];for(let o=0;o<Math.ceil(n.MPEntry.value.length/er);o++){i[o]={};const a=tr(n.MPEntry.value,o*er,Sn.getTypeSize("LONG"),r);i[o].ImageFlags=nr(a),i[o].ImageFormat=rr(a),i[o].ImageType=ir(a);const s=tr(n.MPEntry.value,o*er+4,Sn.getTypeSize("LONG"),r);i[o].ImageSize={value:s,description:""+s};const c=or(o,n.MPEntry,r,t);i[o].ImageOffset={value:c,description:""+c};const u=tr(n.MPEntry.value,o*er+12,Sn.getTypeSize("SHORT"),r);i[o].DependentImage1EntryNumber={value:u,description:""+u};const f=tr(n.MPEntry.value,o*er+14,Sn.getTypeSize("SHORT"),r);i[o].DependentImage2EntryNumber={value:f,description:""+f},i[o].image=e.buffer.slice(c,c+s),T(i[o],"base64",(function(){return A(this.image)}))}return n.Images=i,n}(e,t,Vn(e,"mpf",t,a,o,n,r,i,"mpf"),o)};const er=16;function tr(e,t,n,r){if(r===ne){let r=0;for(let i=0;i<n;i++)r+=e[t+i]<<8*i;return r}let i=0;for(let r=0;r<n;r++)i+=e[t+r]<<8*(n-1-r);return i}function nr(e){const t=[e>>31&1,e>>30&1,e>>29&1],n=[];return t[0]&&n.push("Dependent Parent Image"),t[1]&&n.push("Dependent Child Image"),t[2]&&n.push("Representative Image"),{value:t,description:n.join(", ")||"None"}}function rr(e){const t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}function ir(e){const t=16777215&e;return{value:t,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"}[t]||"Unknown"}}function or(e,t,n,r){return function(e){return 0===e}(e)?0:tr(t.value,e*er+8,Sn.getTypeSize("LONG"),n)+r}var ar=function(e,t){const n=function(e,t){return Sn.getShortAt(e,t)}(e,t),r=function(e,t,n){if(8>n)return;const r=Sn.getByteAt(e,t+7);return{value:r,description:""+r}}(e,t,n);return{"Bits Per Sample":sr(e,t,n),"Image Height":cr(e,t,n),"Image Width":ur(e,t,n),"Color Components":r,Subsampling:r&&fr(e,t,r.value,n)}};function sr(e,t,n){if(3>n)return;const r=Sn.getByteAt(e,t+2);return{value:r,description:""+r}}function cr(e,t,n){if(5>n)return;const r=Sn.getShortAt(e,t+3);return{value:r,description:`${r}px`}}function ur(e,t,n){if(7>n)return;const r=Sn.getShortAt(e,t+5);return{value:r,description:`${r}px`}}function fr(e,t,n,r){if(8+3*n>r)return;const i=[];for(let r=0;r<n;r++){const n=t+8+3*r;i.push([Sn.getByteAt(e,n),Sn.getByteAt(e,n+1),Sn.getByteAt(e,n+2)])}return{value:i,description:i.length>1?lr(i)+dr(i):""}}function lr(e){const t={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"};return e.map((e=>t[e[0]])).join("")}function dr(e){const t={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 0===e.length||void 0===e[0][1]||void 0===t[e[0][1]]?"":t[e[0][1]]}var pr=function(e,t){const n={};try{const r=function(e,t){let n=t,r=0;return{readBits(t){let i=0;for(let o=0;o<t;o++){if(n>=e.byteLength)throw new Error("Unexpected end of data");i|=(e.getUint8(n)>>r&1)<<o,r++,r>=8&&(r=0,n++)}return i}}}(e,t+hr),{height:i,width:o}=function(e){let t,n;if(e.readBits(1)){t=8*(e.readBits(5)+1);const r=e.readBits(3);n=0===r?8*(e.readBits(5)+1):Math.ceil(t*gr[r])}else{t=br(e);const r=e.readBits(3);n=0===r?br(e):Math.ceil(t*gr[r])}return{height:t,width:n}}(r);n["Image Height"]={value:i,description:`${i}px`},n["Image Width"]={value:o,description:`${o}px`}}catch(e){}return n};const hr=2,mr=[9,13,18,30],gr=[0,1,1.2,4/3,1.5,16/9,5/4,2];function br(e){const t=e.readBits(2);return 1+e.readBits(mr[t])}var vr=function(e,t){const n=function(e,t){return Sn.getShortAt(e,t)}(e,t),r=function(e,t,n){if(15>n)return;const r=Sn.getByteAt(e,t+14);return{value:r,description:`${r}px`}}(e,t,n),i=function(e,t,n){if(16>n)return;const r=Sn.getByteAt(e,t+15);return{value:r,description:`${r}px`}}(e,t,n),o={"JFIF Version":wr(e,t,n),"Resolution Unit":yr(e,t,n),XResolution:Sr(e,t,n),YResolution:Cr(e,t,n),"JFIF Thumbnail Width":r,"JFIF Thumbnail Height":i};if(void 0!==r&&void 0!==i){const a=function(e,t,n,r){if(0===n||16+n>r)return;return{value:e.buffer.slice(t+16,t+16+n),description:"<24-bit RGB pixel data>"}}(e,t,3*r.value*i.value,n);a&&(o["JFIF Thumbnail"]=a)}for(const e in o)void 0===o[e]&&delete o[e];return o};function wr(e,t,n){if(9>n)return;const r=Sn.getByteAt(e,t+7),i=Sn.getByteAt(e,t+7+1);return{value:256*r+i,description:r+"."+i}}function yr(e,t,n){if(10>n)return;const r=Sn.getByteAt(e,t+9);return{value:r,description:xr(r)}}function xr(e){return 0===e?"None":1===e?"inches":2===e?"cm":"Unknown"}function Sr(e,t,n){if(12>n)return;const r=Sn.getShortAt(e,t+10);return{value:r,description:""+r}}function Cr(e,t,n){if(14>n)return;const r=Sn.getShortAt(e,t+12);return{value:r,description:""+r}}var Ir={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:Pr},336:{name:"Time Sent",description:kr},346:{name:"Coded Character Set",description:Tr,encoding_name:Tr},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=>"01"===G(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{const t=G(e).split(":");return t[2]+(t[3]?"/"+t[3]:"")+(t[4]?"/"+t[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 t=G(e);return"01"===t?"Object Kill":"02"===t?"Object Replace":"03"===t?"Object Append":"04"===t?"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:Pr},572:{name:"Time Created",description:kr},574:{name:"Digital Creation Date",description:Pr},575:{name:"Digital Creation Time",description:kr},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{const t=G(e);return"a"===t?"morning":"p"===t?"evening":"b"===t?"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 t=G(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{const t=G(e),n=t.charAt(0),r=t.charAt(1);let i="";return"1"===n?i+="Mono":"2"===n&&(i+="Stereo"),"A"===r?i+=", actuality":"C"===r?i+=", question and answer session":"M"===r?i+=", music, transmitted by itself":"Q"===r?i+=", response to a question":"R"===r?i+=", raw sound":"S"===r?i+=", scener":"V"===r?i+=", voicer":"W"===r&&(i+=", wrap"),""!==i?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(G(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{const t=parseInt(G(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{const t=G(e);return t.length>=6?t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2):t}},666:"Audio Outcue",698:"Short Document ID",699:"Unique Document ID",700:"Owner ID",712:{name:e=>2===e.length?"ObjectData Preview File Format":"Record 2 destination",description:e=>{if(2===e.length){const t=(e[0]<<8)+e[1];return 0===t?"No ObjectData":1===t?"IPTC-NAA Digital Newsphoto Parameter Record":2===t?"IPTC7901 Recommended Message Format":3===t?"Tagged Image File Format (Adobe/Aldus Image data)":4===t?"Illustrator (Adobe Graphics data)":5===t?"AppleSingle (Apple Computer Inc)":6===t?"NAA 89-3 (ANPA 1312)":7===t?"MacBinary II":8===t?"IPTC Unstructured Character Oriented File Format (UCOFF)":9===t?"United Press International ANPA 1312 variant":10===t?"United Press International Down-Load Message":11===t?"JPEG File Interchange (JFIF)":12===t?"Photo-CD Image-Pac (Eastman Kodak)":13===t?"Microsoft Bit Mapped Graphics File [*.BMP]":14===t?"Digital Audio File [*.WAV] (Microsoft & Creative Labs)":15===t?"Audio plus Moving Video [*.AVI] (Microsoft)":16===t?"PC DOS/Windows Executable Files [*.COM][*.EXE]":17===t?"Compressed Binary File [*.ZIP] (PKWare Inc)":18===t?"Audio Interchange File Format AIFF (Apple Computer Inc)":19===t?"RIFF Wave (Microsoft Corporation)":20===t?"Freehand (Macromedia/Aldus)":21===t?'Hypertext Markup Language "HTML" (The Internet Society)':22===t?"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC":23===t?"MPEG 2 Audio Layer 3, ISO/IEC":24===t?"Portable Document File (*.PDF) Adobe":25===t?"News Industry Text Format (NITF)":26===t?"Tape Archive (*.TAR)":27===t?"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)":28===t?"Ritzaus Bureau NITF version (RBNITF DTD)":29===t?"Corel Draw [*.CDR]":`Unknown format ${t}`}return G(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{const n={"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"}},r=G(e);if(t["ObjectData Preview File Format"]){const e=G(t["ObjectData Preview File Format"].value);if(n[e]&&n[e][r])return n[e][r]}return r}},714:"ObjectData Preview Data",1802:{name:"Size Mode",description:e=>e[0].toString()},1812:{name:"Max Subfile Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let n=0;n<e.length;n++)t=(t<<8)+e[n];return t.toString()}}}};function Pr(e){const t=G(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function kr(e){const t=G(e);let n=t;return t.length>=6&&(n=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(n+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),n}function Tr(e){const t=G(e);return"%G"===t?"UTF-8":"%5"===t?"Windows-1252":"%/G"===t?"UTF-8 Level 1":"%/H"===t?"UTF-8 Level 2":"%/I"===t?"UTF-8 Level 3":"/A"===t?"ISO-8859-1":"/B"===t?"ISO-8859-2":"/C"===t?"ISO-8859-3":"/D"===t?"ISO-8859-4":"/@"===t?"ISO-8859-5":"/G"===t?"ISO-8859-6":"/F"===t?"ISO-8859-7":"/H"===t?"ISO-8859-8":"Unknown"}var Ar=function(){if("undefined"!=typeof TextDecoder)return TextDecoder};const Dr={128:8364,130:8218,131:402,132:8222,133:8230,134:8224,135:8225,136:710,137:8240,138:352,139:8249,140:338,142:381,145:8216,146:8217,147:8220,148:8221,149:8226,150:8211,151:8212,152:732,153:8482,154:353,155:8250,156:339,158:382,159:376};var Or=function(e,t){if("string"==typeof t)return function(e){try{return decodeURIComponent(escape(e))}catch(t){return e}}(t);const n=Ar();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}const r=t.map((e=>String.fromCharCode(e))).join("");try{return decodeURIComponent(escape(r))}catch(e){return function(e){const t=e instanceof DataView,n=t?e.byteLength:e.length,r=t?t=>e.getUint8(t):t=>e[t],i=new Array(n);for(let e=0;e<n;e++){const t=r(e),n=Dr[t];i[e]=void 0!==n?n:t}return String.fromCharCode.apply(null,i)}(t)}},Mr=function(e,t,n,r=En){try{if(Array.isArray(e))return Er(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,n,r);const{naaBlock:i,dataOffset:o}=function(e,t){for(;t+12<=e.byteLength;){const n=Rr(e,t);if(Fr(n))return{naaBlock:n,dataOffset:t+n.headerSize};t+=n.headerSize+n.size+Ur(n)}throw new Error("No IPTC NAA resource block.")}(e,t);return Er(e,i,o,n,r)}catch(e){return{}}};function Rr(e,t){if(943868237!==e.getUint32(t,!1))throw new Error("Not an IPTC resource block.");const n=e.getUint8(t+4+2),r=(n%2==0?n+1:n)+1;return{headerSize:6+r+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+r)}}function Fr(e){return 1028===e.type}function Ur(e){return e.size%2!=0?1:0}function Er(e,t,n,r,i){const o={};let a;const s=n+t.size;for(;n<s&&n<e.byteLength;){const{tag:t,tagSize:s}=Nr(e,n,o,a,r,i);if(null===t)break;t&&("encoding"in t&&(a=t.encoding),void 0===o[t.name]||void 0===t.repeatable?o[t.name]={id:t.id,value:t.value,description:t.description}:(o[t.name]instanceof Array||(o[t.name]=[{id:o[t.name].id,value:o[t.name].value,description:o[t.name].description}]),o[t.name].push({id:t.id,value:t.value,description:t.description}))),n+=5+s}return o}function Nr(e,t,n={},r,i=!1,o=En){if(function(e,t){return 28!==e.getUint8(t)}(e,t))return{tag:null,tagSize:0};const a=e.getUint16(t+1),s=e.getUint16(t+3);if(!i&&!Ir.iptc[a])return{tag:void 0,tagSize:s};if(!o.shouldParseTag("iptc",function(e,t){const n=Ir.iptc[e];return n?"string"==typeof n?n:n&&"string"==typeof n.name?n.name:void 0:t?`undefined-${e}`:void 0}(a,i),a))return{tag:void 0,tagSize:s};const c=function(e,t,n){const r=[];for(let i=0;i<n;i++)r.push(e.getUint8(t+i));return r}(e,t+5,s),u={id:a,name:Gr(Ir.iptc[a],a,c),value:c,description:Lr(Ir.iptc[a],c,n,r)};return function(e){return Ir.iptc[e]&&Ir.iptc[e].repeatable}(a)&&(u.repeatable=!0),function(e){return Ir.iptc[e]&&void 0!==Ir.iptc[e].encoding_name}(a)&&(u.encoding=Ir.iptc[a].encoding_name(c)),{tag:u,tagSize:s}}function Gr(e,t,n){return e?function(e){return"string"==typeof e}(e)?e:function(e){return"function"==typeof e.name}(e)?e.name(n):e.name:`undefined-${t}`}function Lr(e,t,n,r){if(function(e){return e&&void 0!==e.description}(e))try{return e.description(t,n)}catch(e){}return function(e,t){return e&&t instanceof Array}(e,t)?Or(r,t):t}var Br={"tiff:Orientation":e=>"1"===e?"Horizontal (normal)":"2"===e?"Mirror horizontal":"3"===e?"Rotate 180":"4"===e?"Mirror vertical":"5"===e?"Mirror horizontal and rotate 270 CW":"6"===e?"Rotate 90 CW":"7"===e?"Mirror horizontal and rotate 90 CW":"8"===e?"Rotate 270 CW":e,"tiff:ResolutionUnit":e=>rn.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>jr(rn.XResolution,e),"tiff:YResolution":e=>jr(rn.YResolution,e),"exif:ApertureValue":e=>jr(rn.ApertureValue,e),"exif:GPSLatitude":zr,"exif:GPSLongitude":zr,"exif:FNumber":e=>jr(rn.FNumber,e),"exif:FocalLength":e=>jr(rn.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>rn.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>rn.ColorSpace(function(e){return"0x"===e.substring(0,2)?parseInt(e.substring(2),16):parseInt(e,10)}(e)),"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){const e=t.split(", ").map((e=>e.charCodeAt(0)));return rn.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>rn.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>rn.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>rn.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>rn.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>$r(e)?rn.ExposureTime(e.split("/").map((e=>parseInt(e,10)))):e,"exif:MeteringMode":e=>rn.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>rn.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>rn.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>rn.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>jr(rn.ShutterSpeedValue,e),"exif:WhiteBalance":e=>rn.WhiteBalance(parseInt(e,10))};function jr(e,t){return $r(t)?e(t.split("/")):t}function $r(e){return/^-?\d+\/-?\d+$/.test(e)}function zr(e){const[t,n]=e.split(",");if(void 0!==t&&void 0!==n){const e=parseFloat(t),r=parseFloat(n),i=n.charAt(n.length-1);if(!Number.isNaN(e)&&!Number.isNaN(r))return""+(e+r/60)+i}return e}var _r=function(e){if(e)return e;if("undefined"!=typeof DOMParser)return new DOMParser;try{const{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}};const Vr={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/"};var Hr=function(e,t,n){const r={};if("string"==typeof e)return Kr(r,e,n),r;const[i,o]=function(e,t){if(0===t.length)return[];const n=[Xr(e,t.slice(0,1))];return t.length>1&&n.push(Xr(e,t.slice(1))),n}(e,t),a=Kr(r,i,n);if(o){const i=Kr(r,o,n);a||i||(delete r._raw,Kr(r,Xr(e,t),n))}return r};class Wr extends Error{constructor(e){super(e),this.name="ParseError"}}function Xr(e,t){const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;for(let n=0;n<t.length;n++){const o=t[n],a=e.buffer.slice(o.dataOffset,o.dataOffset+o.length);r.set(new Uint8Array(a),i),i+=o.length}return new DataView(r.buffer)}function Kr(e,t,n){try{const{doc:r,raw:i}=function(e,t){const n=_r(t);if(!n)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),new Error;const r="string"==typeof e?e:x(e,0,e.byteLength);return{doc:Yr(n,r.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")),raw:r}}(t,n);return e._raw=(e._raw||"")+i,k(e,Qr(qr(Jr(r),!0))),!0}catch(e){return!1}}function Yr(e,t,n=!1){try{const n=e.parseFromString(t,"application/xml"),r=n.getElementsByTagName("parsererror");if(r.length>0)throw new Wr(r[0].textContent);return n}catch(r){if("ParseError"===r.name&&function(e){const t=["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 n=0;n<t.length;n++)if(new RegExp(t[n]).test(e.message))return!0;return!1}(r)&&!n)return Yr(e,function(e){const t=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!t)return e;const n=t[1],r=function(e){const t=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;let r;for(;null!==(r=n.exec(e));)-1===t.indexOf(r[1])&&t.push(r[1]);return t}(e),i=function(e){const t=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;let r;for(;null!==(r=n.exec(e));){const e=r[1];"xmlns"!==e&&"xml"!==e&&-1===t.indexOf(e)&&t.push(e)}return t}(e).filter((e=>-1===r.indexOf(e)));return 0===i.length?e:function(e,t,n){const r=new RegExp("<"+t+"([^>]*)>");return e.replace(r,"<"+t+"$1"+n+">")}(e,n,function(e){const t=[];for(let n=0;n<e.length;n++){const r=e[n];t.push(" xmlns:"+r+'="'+(Vr[r]||"http://fallback.namespace/"+r)+'"')}return t.join("")}(i))}(t),!0);throw r}}function Jr(e){for(let t=0;t<e.childNodes.length;t++){if("x:xmpmeta"===e.childNodes[t].tagName)return Jr(e.childNodes[t]);if("rdf:RDF"===e.childNodes[t].tagName)return e.childNodes[t]}throw new Error}function qr(e,t=!1){const n=function(e){const t=[];for(let n=0;n<e.childNodes.length;n++)t.push(e.childNodes[n]);return t}(e);return 1===(r=n).length&&"#text"===r[0].nodeName?t?{}:function(e){return e.nodeValue}(n[0]):function(e){const t={};return e.forEach((e=>{if(function(e){return e.nodeName&&"#text"!==e.nodeName}(e)){const n=function(e){return{attributes:Zr(e),value:qr(e)}}(e);void 0!==t[e.nodeName]?(Array.isArray(t[e.nodeName])||(t[e.nodeName]=[t[e.nodeName]]),t[e.nodeName].push(n)):t[e.nodeName]=n}})),t}(n);var r}function Zr(e){const t={};for(let n=0;n<e.attributes.length;n++)t[e.attributes[n].nodeName]=decodeURIComponent(escape(e.attributes[n].value));return t}function Qr(e){const t={};if("string"==typeof e)return e;for(const n in e){let r=e[n];Array.isArray(r)||(r=[r]),r.forEach((e=>{k(t,ei(e.attributes)),"object"==typeof e.value&&k(t,ai(e.value))}))}return t}function ei(e){const t={};for(const n in e)try{ti(n)&&(t[ri(n)]={value:e[n],attributes:{},description:ii(e[n],n)})}catch(e){}return t}function ti(e){return"rdf:parseType"!==e&&!ni(e)}function ni(e){return"xmlns"===e.split(":")[0]}function ri(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function ii(e,t){if(Array.isArray(e)){const n=function(e){return e.map((e=>ii(void 0!==e.value?e.value:e))).join(", ")}(e);return t&&"function"==typeof Br[t]?Br[t](e,n):n}if("object"==typeof e)return function(e){const t=[];for(const n in e)t.push(`${oi(n)}: ${ii(e[n].value)}`);return t.join("; ")}(e);try{return t&&"function"==typeof Br[t]?Br[t](e):decodeURIComponent(escape(e))}catch(t){return e}}function oi(e){return"CiAdrCity"===e?"CreatorCity":"CiAdrCtry"===e?"CreatorCountry":"CiAdrExtadr"===e?"CreatorAddress":"CiAdrPcode"===e?"CreatorPostalCode":"CiAdrRegion"===e?"CreatorRegion":"CiEmailWork"===e?"CreatorWorkEmail":"CiTelWork"===e?"CreatorWorkPhone":"CiUrlWork"===e?"CreatorWorkUrl":e}function ai(e){const t={};for(const n in e)try{ni(n)||(t[ri(n)]=si(e[n],n))}catch(e){}return t}function si(e,t){return function(e){return Array.isArray(e)}(e)?function(e,t){return gi(e[e.length-1],t)}(e,t):function(e){return"Resource"===e.attributes["rdf:parseType"]&&"string"==typeof e.value&&""===e.value.trim()}(e)?{value:"",attributes:{},description:""}:ci(e)?ui(e,t):li(e)?di(e,t):pi(e)?hi(e,t):function(e){return void 0!==mi(e.value)}(e)?function(e,t){let n=mi(e.value).value["rdf:li"];const r=fi(e),i=[];return void 0===n?n=[]:Array.isArray(n)||(n=[n]),n.forEach((e=>{i.push(function(e){return ci(e)?ui(e):li(e)?di(e).value:pi(e)?hi(e).value:gi(e)}(e))})),{value:i,attributes:r,description:ii(i,t)}}(e,t):gi(e,t)}function ci(e){return"Resource"===e.attributes["rdf:parseType"]&&void 0!==e.value["rdf:value"]||void 0!==e.value["rdf:Description"]&&void 0!==e.value["rdf:Description"].value["rdf:value"]}function ui(e,t){const n=fi(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),k(n,fi(e),function(e){const t={};for(const n in e.value)"rdf:value"===n||ni(n)||(t[ri(n)]=e.value[n].value);return t}(e));const r=function(e){return bi(e.value["rdf:value"])||e.value["rdf:value"].value}(e);return{value:r,attributes:n,description:ii(r,t)}}function fi(e){const t={};for(const n in e.attributes)"rdf:parseType"===n||"rdf:resource"===n||ni(n)||(t[ri(n)]=e.attributes[n]);return t}function li(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function di(e,t){const n={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(k(n.value,ei(e.value["rdf:Description"].attributes)),k(n.attributes,fi(e)),e=e.value["rdf:Description"]),k(n.value,ai(e.value)),n.description=ii(n.value,t),n}function pi(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function hi(e,t){const n=ei(e.attributes);return{value:n,attributes:{},description:ii(n,t)}}function mi(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function gi(e,t){const n=bi(e)||Qr(e.value);return{value:n,attributes:fi(e),description:ii(n,t)}}function bi(e){return e.attributes&&e.attributes["rdf:resource"]}const vi=0,wi=1,yi=2,xi=3,Si=4,Ci=5,Ii=6,Pi=7,ki=8;var Ti={2e3:{name:"PathInformation",description:function(e){const t={},n=[];for(let r=0;r<e.byteLength;r+=26){const i=Sn.getShortAt(e,r);Ai[i]&&(t[i]||(t[i]=Ai[i].description),n.push({type:i,path:Ai[i].path(e,r+2)}))}return JSON.stringify({types:t,paths:n})}},2999:{name:"ClippingPathName",description(e){const[,t]=I(e,0);return t}}};const Ai={[vi]:{description:"Closed subpath length",path:(e,t)=>[Sn.getShortAt(e,t)]},[wi]:{description:"Closed subpath Bezier knot, linked",path:Di},[yi]:{description:"Closed subpath Bezier knot, unlinked",path:Di},[xi]:{description:"Open subpath length",path:(e,t)=>[Sn.getShortAt(e,t)]},[Si]:{description:"Open subpath Bezier knot, linked",path:Di},[Ci]:{description:"Open subpath Bezier knot, unlinked",path:Di},[Ii]:{description:"Path fill rule",path:()=>[]},[ki]:{description:"Initial fill rule",path:(e,t)=>[Sn.getShortAt(e,t)]},[Pi]:{description:"Clipboard",path:function(e,t){return[[Mi(e,t,8),Mi(e,t+4,8),Mi(e,t+8,8),Mi(e,t+12,8)],Mi(e,t+16,8)]}}};function Di(e,t){const n=[];for(let r=0;r<24;r+=8)n.push(Oi(e,t+r));return n}function Oi(e,t){const n=Mi(e,t,8);return[Mi(e,t+4,8),n]}function Mi(e,t,n){const r=Sn.getLongAt(e,t),i=r>>>31==0?1:-1,o=(2130706432&r)>>>32-n,a=r&parseInt(D("1",32-n),2);return i*function(e){return parseInt(e.replace(".",""),2)/Math.pow(2,(e.split(".")[1]||"").length)}(o.toString(2)+"."+(D("0",32-n-(s=a.toString(2)).length)+s));var s}var Ri=function(e,t,n=En){const r=y(new Uint8Array(e).buffer),i={};let o=0;for(;o<e.length;){const e=x(r,o,Ni);o+=Ni;const a=Sn.getShortAt(r,o);o+=Ui;const{tagName:s,tagNameSize:c}=Li(r,o);o+=c;const u=Sn.getLongAt(r,o);if(o+=Ei,e===Fi){const e=Gi(a,s,t);if(!n.shouldParseTag("photoshop",e,a)){o+=u+u%2;continue}const c=y(r.buffer,o,u),f={id:a,value:x(c,0,u)};if(Ti[a]){try{f.description=Ti[a].description(c)}catch(e){f.description="<no description formatter>"}i[s||Ti[a].name]=f}else t&&(i[`undefined-${a}`]=f)}o+=u+u%2}return i};const Fi="8BIM",Ui=2,Ei=4,Ni=Fi.length;function Gi(e,t,n){return t||(Ti[e]&&Ti[e].name?Ti[e].name:n?`undefined-${e}`:void 0)}function Li(e,t){const[n,r]=I(e,t);return{tagName:r,tagNameSize:1+n+(n%2==0?1:0)}}const Bi={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"}},ji={4:{name:"Preferred CMM type",value:(e,t)=>x(e,t,4),description:e=>null!==e?$i(e):""},8:{name:"Profile Version",value:(e,t)=>e.getUint8(t).toString(10)+"."+(e.getUint8(t+1)>>4).toString(10)+"."+(e.getUint8(t+1)%16).toString(10)},12:{name:"Profile/Device class",value:(e,t)=>x(e,t,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,t)=>x(e,t,4)},20:{name:"Connection Space",value:(e,t)=>x(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>function(e,t){const n=e.getUint16(t),r=e.getUint16(t+2)-1,i=e.getUint16(t+4),o=e.getUint16(t+6),a=e.getUint16(t+8),s=e.getUint16(t+10);return new Date(Date.UTC(n,r,i,o,a,s))}(e,t).toISOString()},36:{name:"ICC Signature",value:(e,t)=>{return n=e.buffer.slice(t,t+4),String.fromCharCode.apply(null,new Uint8Array(n));var n}},40:{name:"Primary Platform",value:(e,t)=>x(e,t,4),description:e=>$i(e)},48:{name:"Device Manufacturer",value:(e,t)=>x(e,t,4),description:e=>$i(e)},52:{name:"Device Model Number",value:(e,t)=>x(e,t,4)},64:{name:"Rendering Intent",value:(e,t)=>e.getUint32(t),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,t)=>x(e,t,4)}};function $i(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}}var zi=function(e,t,n,r){return n&&t[0].compressionMethod!==O?function(e,t,n){if(0!==t[0].compressionMethod)return{};return R(new DataView(e.buffer.slice(t[0].offset,t[0].offset+t[0].length)),t[0].compressionMethod,"utf-8","dataview",n).then(Zi).catch((()=>({})))}(e,t,r):function(e,t){try{const n=t.reduce(((e,t)=>e+t.length),0),r=new Uint8Array(n);let i=0;const o=function(e){return Array.isArray(e)?new DataView(Uint8Array.from(e).buffer).buffer:e.buffer}(e);for(let e=1;e<=t.length;e++){const n=t.find((t=>t.chunkNumber===e));if(!n)throw new Error(`ICC chunk ${e} not found`);const a=o.slice(n.offset,n.offset+n.length),s=new Uint8Array(a);r.set(s,i),i+=s.length}return Zi(new DataView(r.buffer))}catch(e){return{}}}(e,t)};const _i=84,Vi=128,Hi="acsp",Wi="desc",Xi="mluc",Ki="text",Yi="sig ",Ji=12;function qi(e,t){return e.length<t+Ji}function Zi(e){const t=e.buffer,n=e.getUint32();if(e.byteLength!==n)throw new Error("ICC profile length not matching");if(e.byteLength<_i)throw new Error("ICC profile too short");const r={},i=Object.keys(ji);for(let t=0;t<i.length;t++){const n=i[t],o=ji[n],a=o.value(e,parseInt(n,10));let s=a;o.description&&(s=o.description(a)),r[o.name]={value:a,description:s}}if(Qi(t.slice(36,40))!==Hi)throw new Error("ICC profile: missing signature");if(function(e){return e.length<Vi+4}(t))return r;const o=e.getUint32(128);let a=132;for(let n=0;n<o;n++){if(qi(t,a))return r;const n=x(e,a,4),i=e.getUint32(a+4),o=e.getUint32(a+8);if(i>t.length)return r;const s=x(e,i,4);if(s===Wi){const a=e.getUint32(i+8);if(a>o)return r;eo(r,n,Qi(t.slice(i+12,i+a+11)))}else if(s===Xi){const t=e.getUint32(i+8),o=e.getUint32(i+12);if(o<12)return r;if(t*o>e.byteLength-i-16)return r;let a=i+16;const s=[];for(let n=0;n<t;n++){const t=x(e,a+0,2),n=x(e,a+2,2),r=e.getUint32(a+4),c=e.getUint32(a+8),u=C(e,i+c,r);s.push({languageCode:t,countryCode:n,text:u}),a+=o}if(1===t)eo(r,n,s[0].text);else{const e={};for(let t=0;t<s.length;t++)e[`${s[t].languageCode}-${s[t].countryCode}`]=s[t].text;eo(r,n,e)}}else s===Ki?eo(r,n,Qi(t.slice(i+8,i+o-7))):s===Yi&&eo(r,n,Qi(t.slice(i+8,i+12)));a+=12}return r}function Qi(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function eo(e,t,n){Bi[t]?e[Bi[t].name]={value:n,description:n}:e[t]={value:n,description:n}}var to=function(e,t,n,r,i,o=!1,a){let s=Vn(e,bn,t,t+n,r,i,o,a,"makerNotes");return s.ShotInfo&&(s=k({},s,function(e){const t={};var n;return void 0!==e[27]&&(t.AutoRotate={value:e[27],description:(n=e[27],0===n?"None":1===n?"Rotate 90 CW":2===n?"Rotate 180":3===n?"Rotate 270 CW":"Unknown")}),t}(s.ShotInfo.value)),delete s.ShotInfo),s.CameraSettings&&(s=k({},s,function(e){const t={};if(!Array.isArray(e))return t;const n=e[22];return Number.isFinite(n)&&(t.LensType={value:n,description:`${n}`}),t}(s.CameraSettings.value)),delete s.CameraSettings),s};const no={K3_III:78420},ro={CAMERA_ORIENTATION:1,ROLL_ANGLE:3,PITCH_ANGLE:5};var io=function(e,t,n,r,i=!1,o){const a=re(e,t+n+8),s=t+n;let c=Vn(e,vn,s,s+10,a,r,i,o,"makerNotes");return function(e){return e.PentaxModelID&&e.PentaxModelID.value===no.K3_III&&e.LevelInfo}(c)&&(c=k({},c,function(e,t,n){const r={};if(t+7>e.byteLength)return r;const i=e.getInt8(t+ro.CAMERA_ORIENTATION);var o;r.CameraOrientation={value:i,description:(o=i,0===o?"Horizontal (normal)":1===o?"Rotate 270 CW":2===o?"Rotate 180":3===o?"Rotate 90 CW":4===o?"Upwards":5===o?"Downwards":"Unknown")};const a=e.getInt16(t+ro.ROLL_ANGLE,n===ne);r.RollAngle={value:a,description:oo(a)};const s=e.getInt16(t+ro.PITCH_ANGLE,n===ne);return r.PitchAngle={value:s,description:ao(s)},r}(e,s+c.LevelInfo.__offset,a)),delete c.LevelInfo),c};function oo(e){return""+-.5*e}function ao(e){return""+-.5*e}var so=function(e,t){return{"Image Width":co(e,t),"Image Height":uo(e,t),"Bit Depth":fo(e,t),"Color Type":lo(e,t),Compression:po(e,t),Filter:ho(e,t),Interlace:mo(e,t)}};function co(e,t){if(t+0+4>e.byteLength)return;const n=Sn.getLongAt(e,t);return{value:n,description:`${n}px`}}function uo(e,t){if(t+4+4>e.byteLength)return;const n=Sn.getLongAt(e,t+4);return{value:n,description:`${n}px`}}function fo(e,t){if(t+8+1>e.byteLength)return;const n=Sn.getByteAt(e,t+8);return{value:n,description:`${n}`}}function lo(e,t){if(t+9+1>e.byteLength)return;const n=Sn.getByteAt(e,t+9);return{value:n,description:{0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"}[n]||"Unknown"}}function po(e,t){if(t+10+1>e.byteLength)return;const n=Sn.getByteAt(e,t+10);return{value:n,description:0===n?"Deflate/Inflate":"Unknown"}}function ho(e,t){if(t+11+1>e.byteLength)return;const n=Sn.getByteAt(e,t+11);return{value:n,description:0===n?"Adaptive":"Unknown"}}function mo(e,t){if(t+12+1>e.byteLength)return;const n=Sn.getByteAt(e,t+12);return{value:n,description:{0:"Noninterlaced",1:"Adam7 Interlace"}[n]||"Unknown"}}var go=function(e,t,n,r,i=!1,o=En,a){const s={},c=[];for(let u=0;u<t.length;u++){const{offset:f,length:l,type:d}=t[u],p=Po(e,f,l,d,n,a);if(p instanceof Promise)c.push(p.then((({name:e,value:t,description:n})=>{try{if(N.USE_EXIF&&Mo(e,t))return o.shouldParseGroup("exif")?{__exif:Zn(Fo(t),Io,r,i,o).tags}:{};if(N.USE_IPTC&&Ro(e,t))return o.shouldParseGroup("iptc")?{__iptc:Mr(Fo(t),0,r,o)}:{};if(e&&!Mo(e,t)&&!Ro(e,t))return o.shouldParseGroup("png")?{[e]:{value:t,description:n}}:{}}catch(e){}return{}})));else{const{name:e,value:t,description:n}=p;e&&o.shouldParseGroup("png")&&(s[e]={value:t,description:n})}}return{readTags:s,readTagsPromise:c.length>0?Promise.all(c):void 0}};const bo="STATE_KEYWORD",vo="STATE_COMPRESSION",wo="STATE_LANG",yo="STATE_TRANSLATED_KEYWORD",xo="STATE_TEXT",So=1,Co=1,Io=6;function Po(e,t,n,r,i,o){const a=[],s=[];let c,u=bo,f=O;for(let i=0;i<n&&t+i<e.byteLength;i++){if(u===vo){f=ko({type:r,dataView:e,offset:t+i}),r===pt&&(i+=So),u=To(r,u);continue}if(u===xo){c=new DataView(e.buffer.slice(t+i,t+n));break}const o=e.getUint8(t+i);0===o?u=To(r,u):u===bo?a.push(o):u===wo&&s.push(o)}if(f!==O&&!i)return{};const l=R(c,f,function(e){return e===dt||e===ht?"latin1":"utf-8"}(r),"string",o);return l instanceof Promise?l.then((e=>Ao(e,r,s,a))).catch((()=>Ao("<text using unknown compression>".split(""),r,s,a))):Ao(l,r,s,a)}function ko({type:e,dataView:t,offset:n}){if(e===pt){if(t.getUint8(n)===Co)return t.getUint8(n+1)}else if(e===ht)return t.getUint8(n);return O}function To(e,t){return t===bo&&[pt,ht].includes(e)?vo:t===vo?e===pt?wo:xo:t===wo?yo:xo}function Ao(e,t,n,r){const i=function(e){return e instanceof DataView?x(e,0,e.byteLength):e}(e);return{name:Do(t,n,r),value:i,description:t===pt?Oo(e):i}}function Do(e,t,n){const r=P(n);return e===dt||0===t.length?r:`${r} (${P(t)})`}function Oo(e){return Or("UTF-8",e)}function Mo(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function Ro(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function Fo(e){return function(e){const t=new DataView(new ArrayBuffer(e.length/2));for(let n=0;n<e.length;n+=2)t.setUint8(n/2,parseInt(e.substring(n,n+2),16));return t}(e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,""))}var Uo=function(e,t){const n={};for(let r=0;r<t.length;r++){const i=Sn.getLongAt(e,t[r]+ct),o=x(e,t[r]+ut,st);o===mt?(n["Pixels Per Unit X"]=Eo(e,t[r],i),n["Pixels Per Unit Y"]=No(e,t[r],i),n["Pixel Units"]=Go(e,t[r],i)):o===gt&&(n["Modify Date"]=Lo(e,t[r],i))}return n};function Eo(e,t,n){if(!Bo(e,t,n,0,4))return;const r=Sn.getLongAt(e,t+ft+0);return{value:r,description:""+r}}function No(e,t,n){if(!Bo(e,t,n,4,4))return;const r=Sn.getLongAt(e,t+ft+4);return{value:r,description:""+r}}function Go(e,t,n){if(!Bo(e,t,n,8,1))return;const r=Sn.getByteAt(e,t+ft+8);return{value:r,description:1===r?"meters":"Unknown"}}function Lo(e,t,n){if(!Bo(e,t,n,0,7))return;const r=Sn.getShortAt(e,t+ft),i=Sn.getByteAt(e,t+ft+2),o=Sn.getByteAt(e,t+ft+3),a=Sn.getByteAt(e,t+ft+4),s=Sn.getByteAt(e,t+ft+5),c=Sn.getByteAt(e,t+ft+6);return{value:[r,i,o,a,s,c],description:`${jo(r,4)}-${jo(i,2)}-${jo(o,2)} ${jo(a,2)}:${jo(s,2)}:${jo(c,2)}`}}function Bo(e,t,n,r,i){return r+i<=n&&t+ft+r+i<=e.byteLength}function jo(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}var $o=function(e,t){const n={},r=Sn.getByteAt(e,t);return n.Alpha=function(e){const t=16&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.Animation=function(e){const t=2&e;return{value:t?1:0,description:t?"Yes":"No"}}(r),n.ImageWidth=Vo(e,t+zo),n.ImageHeight=Vo(e,t+_o),n};const zo=4,_o=7;function Vo(e,t){const n=Sn.getByteAt(e,t)+256*Sn.getByteAt(e,t+1)+65536*Sn.getByteAt(e,t+2)+1;return{value:n,description:n+"px"}}var Ho=function(e){return{"GIF Version":Wo(e),"Image Width":Xo(e),"Image Height":Ko(e),"Global Color Map":Yo(e),"Bits Per Pixel":qo(e),"Color Resolution Depth":Jo(e)}};function Wo(e){if(6>e.byteLength)return;const t=x(e,3,3);return{value:t,description:t}}function Xo(e){if(8>e.byteLength)return;const t=e.getUint16(6,!0);return{value:t,description:`${t}px`}}function Ko(e){if(10>e.byteLength)return;const t=e.getUint16(8,!0);return{value:t,description:`${t}px`}}function Yo(e){if(11>e.byteLength)return;const t=(128&e.getUint8(10))>>>7;return{value:t,description:1===t?"Yes":"No"}}function Jo(e){if(11>e.byteLength)return;const t=1+((112&e.getUint8(10))>>>4);return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}function qo(e){if(11>e.byteLength)return;const t=1+(7&e.getUint8(10));return{value:t,description:`${t} ${1===t?"bit":"bits"}`}}const Zo=[6,7,99];var Qo={get:function(e,t,n){if((r=t)&&(void 0===r.Compression||Zo.includes(r.Compression.value))&&r.JPEGInterchangeFormat&&r.JPEGInterchangeFormat.value&&r.JPEGInterchangeFormatLength&&r.JPEGInterchangeFormatLength.value){t.type="image/jpeg";const r=n+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(r,r+t.JPEGInterchangeFormatLength.value),T(t,"base64",(function(){return A(this.image)}))}var r;return t}};var ea={get:function(e,t){const n={};let r=!1;const i=ta(e,"exif","FocalLength",t),o=ta(e,"exif","FocalPlaneXResolution",t),a=ta(e,"exif","FocalPlaneYResolution",t),s=ta(e,"exif","FocalPlaneResolutionUnit",t),c=ta(e,"file","Image Width",t),u=ta(e,"file","Image Height",t),f=ta(e,"exif","FocalLengthIn35mmFilm",t)||function(e,t,n,r,i,o){if(e&&t&&n&&r&&i&&o)try{let a;switch(n){case 2:a=25.4;break;case 3:a=10;break;case 4:a=1;break;default:return}const s=Math.sqrt((r/(e[0]/e[1]*a))**2+(i/(t[0]/t[1]*a))**2);return o[0]/o[1]*(43.27/s)}catch(e){}}(o,a,s,c,u,i);f&&(n.FocalLength35efl={value:f,description:rn.FocalLengthIn35mmFilm(f)},r=!0);const l=function(e,t){if(e&&t)try{const n=t/(e[0]/e[1]);return{value:n,description:n.toFixed(1)}}catch(e){}}(i,f);l&&(n.ScaleFactorTo35mmEquivalent=l,r=!0);const d=function(e){if(e)try{const t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+" deg"}}catch(e){}}(f);if(d&&(n.FieldOfView=d,r=!0),r)return n}};function ta(e,t,n,r){return r&&e[t]&&e[t][n]?e[t][n].value:!r&&e[n]?e[n].value:void 0}function na({mergeSteps:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:o,tiffHeaderOffset:a,fileType:s,pngTextChunks:c,pngTextIsAsync:u,thumbnailIfdTags:f,deps:l}){let d={};for(let c=0;c<e.length;c++)d=ra({step:e[c],deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:o,tiffHeaderOffset:a,fileType:s,thumbnailIfdTags:f,tags:d,deps:l});return r&&u&&i.shouldReturnGroup("png")&&d.png&&(d.pngText=l.objectAssign({},d.png)),r&&i.shouldReturnGroup("png")&&l.hasPngTextData(c)&&d.png&&!d.pngText&&(d.pngText=l.objectAssign({},d.png)),d}function ra({step:e,deferredResults:t,parsedGroups:n,expanded:r,tagFilter:i,dataView:o,tiffHeaderOffset:a,fileType:s,thumbnailIfdTags:c,tags:u,deps:f}){if("mergeGroupAssign"===e.type){const t=f.filterTagsForReturn(e.groupKey,e.parsedTags,i);return ia(u,e.groupKey,t,r,f)}if("mergeGroupMerge"===e.type){const t=f.filterTagsForReturn(e.groupKey,e.parsedTags,i);return function(e,t,n,r,i){return r?(e[t]=e[t]?i.objectAssign({},e[t],n):n,e):i.objectAssign({},e,n)}(u,e.groupKey,t,r,f)}if("mergeXmpGroupAssign"===e.type){const t=f.filterTagsForReturn("xmp",e.parsedTags,i);if(r)return u.xmp=t,u;const n=f.objectAssign({},t);return delete n._raw,f.objectAssign({},u,n)}if("mergeIccDeferred"===e.type){const o=f.filterTagsForParse("icc",t[e.deferredKey],i);return n.icc=o,i.shouldReturnGroup("icc")?ia(u,"icc",f.filterTagsForReturn("icc",o,i),r,f):u}if("mergeBrobExifDeferred"===e.type){const o=t[e.deferredKey];if(!o||0===Object.keys(o).length)return u;const a=f.filterTagsForParse("exif",o,i);return n.exif=n.exif?f.objectAssign({},n.exif,a):a,i.shouldReturnGroup("exif")?ia(u,"exif",f.filterTagsForReturn("exif",a,i),r,f):u}if("mergeBrobXmpDeferred"===e.type){const o=t[e.deferredKey];if(!o||0===Object.keys(o).length)return u;const a=f.filterTagsForParse("xmp",o,i);if(n.xmp=a,!i.shouldReturnGroup("xmp"))return u;const s=f.filterTagsForReturn("xmp",a,i);if(r)return u.xmp=s,u;const c=f.objectAssign({},s);return delete c._raw,f.objectAssign({},u,c)}if("mergePngFile"===e.type){const t=f.filterTagsForReturn("png",e.parsedTags,i);return i.shouldReturnGroup("png")?r?(u.png=u.png?f.objectAssign({},u.png,t):t,u.pngFile=t,u):f.objectAssign({},u,t):u}if("mergePngChunk"===e.type){const t=f.filterTagsForReturn("png",e.parsedTags,i);return i.shouldReturnGroup("png")?r?(u.png=u.png?f.objectAssign({},u.png,t):t,u):f.objectAssign({},u,t):u}if("processPngTextReadTags"===e.type)return oa({readTags:e.readTags,parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:f});if("processPngTextReadTagsDeferredList"===e.type){const o=t[e.deferredKey]||[];for(let e=0;e<o.length;e++)u=oa({readTags:o[e],parsedGroups:n,expanded:r,tagFilter:i,tags:u,deps:f});return u}if("gps"===e.type){if(r&&i.shouldReturnGroup("gps")&&n.exif){const e=f.getGpsGroupFromExifTags(n.exif);if(e){const t=f.filterTagsForReturn("gps",e,i);u.gps=t}}return u}if("composite"===e.type){if(!i.shouldReturnGroup("composite"))return u;let e=u,t=r;i.isActive&&(e={exif:n.exif,file:n.file},t=!0);const o=f.Composite.get(e,t);return o?ia(u,"composite",f.filterTagsForReturn("composite",o,i),r,f):u}if("thumbnail"===e.type){if(!i.shouldReturnGroup("thumbnail")||!i.shouldReturnTag("thumbnail","Thumbnail"))return delete u.Thumbnail,u;if(!c)return u;const e=c?f.filterTagsForParse("thumbnail",c,i):void 0;e&&(n.thumbnail=e);const t=(f.Constants.USE_JPEG||f.Constants.USE_WEBP)&&f.Constants.USE_EXIF&&f.Constants.USE_THUMBNAIL&&f.Thumbnail.get(o,e,a);return t?u.Thumbnail=t:delete u.Thumbnail,u}return"fileType"===e.type?(s&&i.shouldReturnGroup("file")&&i.shouldReturnTag("file","FileType")&&(r?(u.file||(u.file={}),u.file.FileType=s):u.FileType=s),u):u}function ia(e,t,n,r,i){return r?(e[t]=n,e):i.objectAssign({},e,n)}function oa({readTags:e,parsedGroups:t,expanded:n,tagFilter:r,tags:i,deps:o}){const a=e.__exif,s=e.__iptc;if(delete e.__exif,delete e.__iptc,a){const e=o.filterTagsForParse("exif",a,r);if(t.exif=t.exif?o.objectAssign({},t.exif,e):e,r.shouldReturnGroup("exif")){const t=o.filterTagsForReturn("exif",e,r);n?i.exif=i.exif?o.objectAssign({},i.exif,t):t:i=o.objectAssign({},i,t)}}if(s){const e=o.filterTagsForParse("iptc",s,r);if(t.iptc=t.iptc?o.objectAssign({},t.iptc,e):e,r.shouldReturnGroup("iptc")){const t=o.filterTagsForReturn("iptc",e,r);n?i.iptc=i.iptc?o.objectAssign({},i.iptc,t):t:i=o.objectAssign({},i,t)}}if(r.shouldReturnGroup("png")){const a=o.filterTagsForParse("png",e,r),s=o.filterTagsForReturn("png",a,r);t.pngText=a,n?(i.png=i.png?o.objectAssign({},i.png,s):s,s&&Object.keys(s).length>0&&(i.pngText=i.pngText?o.objectAssign({},i.pngText,s):s)):i=o.objectAssign({},i,s)}return i}function aa(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=(new Error).stack}aa.prototype=new Error;var sa={MetadataMissingError:aa},ca=function(e,t={}){if(function(e){return"string"==typeof e}(e)){if(t.async=!0,"undefined"==typeof Promise)throw new Error("Promise is required when async mode is enabled.");return function(e,t){return/^\w+:\/\//.test(e)?"undefined"!=typeof fetch?function(e,{length:t}={}){const n={method:"GET"};return Number.isInteger(t)&&t>=0&&(n.headers={range:"bytes=0-"+(t-1)}),fetch(e,n).then((e=>e.arrayBuffer()))}(e,t):function(e,{length:t}={}){return new Promise(((n,r)=>{const i={};Number.isInteger(t)&&t>=0&&(i.headers={range:"bytes=0-"+(t-1)});const o=function(e){return/^https:\/\//.test(e)?__non_webpack_require__("https").get:__non_webpack_require__("http").get}(e);o(e,i,(e=>{if(e.statusCode>=200&&e.statusCode<=299){const t=[];e.on("data",(e=>t.push(Buffer.from(e)))),e.on("error",(e=>r(e))),e.on("end",(()=>n(Buffer.concat(t))))}else r(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`),e.resume()})).on("error",(e=>r(e)))}))}(e,t):function(e){return/^data:[^;,]*(;base64)?,/.test(e)}(e)?Promise.resolve(function(e){const t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64")){if("undefined"!=typeof atob)return Uint8Array.from(atob(t),(e=>e.charCodeAt(0))).buffer;if("undefined"==typeof Buffer)return;return void 0!==Buffer.from?Buffer.from(t,"base64"):new Buffer(t,"base64")}const n=decodeURIComponent(t);return"undefined"!=typeof Buffer?void 0!==Buffer.from?Buffer.from(n):new Buffer(n):Uint8Array.from(n,(e=>e.charCodeAt(0))).buffer}(e)):function(e,{length:t}={}){return new Promise(((n,r)=>{const i=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();i.open(e,((o,a)=>{o?r(o):i.stat(e,((o,s)=>{if(o)r(o);else{const o=Math.min(s.size,void 0!==t?t:s.size),c=Buffer.alloc(o);i.read(a,{buffer:c,length:o},(t=>{t?r(t):i.close(a,(t=>{t&&console.warn(`Could not close file ${e}:`,t),n(c)}))}))}}))}))}))}(e,t)}(e,t).then((e=>ua(e,t)))}if(function(e){return"undefined"!=typeof File&&e instanceof File}(e)){if(t.async=!0,"undefined"==typeof Promise)throw new Error("Promise is required when async mode is enabled.");return function(e,{length:t}){return new Promise(((n,r)=>{const i=new FileReader;i.onload=e=>n(e.target.result),i.onerror=()=>r(i.error),Number.isInteger(t)&&t>=0&&void 0!==e.slice?i.readAsArrayBuffer(e.slice(0,t)):i.readAsArrayBuffer(e)}))}(e,t).then((e=>ua(e,t)))}return ua(e,t)};function ua(e,t){return function(e){try{return Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),fa(function(e){try{return new DataView(e)}catch(t){return new w(e)}}(e),t)}function fa(e,{expanded:t=!1,async:n=!1,computed:r=!1,includeUnknown:i=!1,domParser:o,includeTags:a,excludeTags:s,decompress:c}={expanded:!1,async:!1,computed:!1,includeUnknown:!1,domParser:void 0,includeTags:void 0,excludeTags:void 0,decompress:void 0}){const u=function({includeTags:e,excludeTags:t}={}){const n=Boolean(e),r=Boolean(t),i=n||r,o=Object.create(null),a=Object.create(null),s=Object.create(null);if(!i)return Un();const c=n&&(Ln(e,"iptc")||Ln(e,"xmp")||Ln(e,"icc")||Ln(e,"photoshop")||Ln(e,"makerNotes")||Ln(e,"thumbnail")||Ln(e,"gps")||Ln(e,"composite")),u=n&&Ln(e,"composite");let f=Object.create(null);n&&(f=function(e){const t=function(e){const t=Object.create(null);if(!e)return t;Array.isArray(e.exif)&&e.exif.length>0&&(t[An]=!0,function(e,t){for(let n=0;n<t.length;n++){const r=t[n];if("string"!=typeof r)continue;const i=r.toLowerCase();0===i.indexOf("gps")&&(e[Dn]=!0),0!==i.indexOf("interoperability")&&0!==i.indexOf("relatedimage")||(e["Interoperability IFD Pointer"]=!0)}}(t,e.exif));for(const n in On)if(Fn(e[n])){const e=On[n];for(let n=0;n<e.length;n++)t[e[n]]=!0;t[An]=!0}return Fn(e.gps)&&(t[Dn]=!0,t[An]=!0),t}(e);return Ln(e,"composite")&&function(e,t){for(let n=0;n<t.length;n++)e[t[n]]=!0}(t,Rn),t}(e));let l=Object.create(null);n&&u&&(l=function(e){const t=Object.create(null);for(let n=0;n<e.length;n++)t[e[n].toLowerCase()]=!0;return t}(Mn));for(const i in Tn){const p=n&&Object.prototype.hasOwnProperty.call(e,i);let h;r&&Object.prototype.hasOwnProperty.call(t,i)&&!p&&(h=t[i]);const m=Bn({groupKey:i,includeValue:p?e[i]:void 0,excludeValue:h,extraIncludeNames:Object.create(null)});o[i]=!n||p,p&&(d=e[i],Array.isArray(d)&&0===d.length)&&(o[i]=!1),m.excludeAll&&(o[i]=!1),a[i]=m;const g=Bn({groupKey:i,includeValue:Nn({groupKey:i,hasIncludeTags:n,hasIncludeEntry:p,includeTags:e,shouldParseExif:c,shouldParseFile:u}),excludeValue:h,extraIncludeNames:Gn({groupKey:i,hasIncludeTags:n,hasIncludeEntry:p,shouldParseExif:c,shouldParseFile:u,exifIncludeDependencies:f,fileIncludeDependencies:l})});s[i]=g}var d;return{isActive:i,shouldReturnGroup:p,shouldParseGroup:h,shouldReturnTag:function(e,t,n){return!Tn[e]||!!p(e)&&jn(a[e],t,n)},shouldParseTag:function(e,t,n){return!Tn[e]||!!h(e)&&jn(s[e],t,n)}};function p(e){return!Tn[e]||!!o[e]}function h(e){return!Tn[e]||!!p(e)||("exif"===e?c:"file"===e&&u)}}({includeTags:a,excludeTags:s}),f=Object.create(null),l=[],d=Object.create(null),p=[];let h,m,g=!1;const{fileType:b,fileDataOffset:v,jfifDataOffset:w,tiffHeaderOffset:y,iptcDataOffset:x,xmpChunks:S,iccChunks:C,mpfDataOffset:I,pngHeaderOffset:T,pngTextChunks:A,pngChunkOffsets:D,vp8xChunkOffset:O,gifHeaderOffset:F,brobExifChunk:U,brobXmpChunk:E,jxlCodestreamOffset:G}=tn(e,n),L=function({fileType:e,fileDataOffset:t,jfifDataOffset:n,tiffHeaderOffset:r,iptcDataOffset:i,xmpChunks:o,iccChunks:a,mpfDataOffset:s,pngHeaderOffset:c,pngTextChunks:u,pngChunkOffsets:f,vp8xChunkOffset:l,gifHeaderOffset:d,jxlCodestreamOffset:p}){return!!e||N.USE_JPEG&&N.USE_FILE&&ma(t)||N.USE_JPEG&&N.USE_JFIF&&ga(n)||N.USE_EXIF&&ba(r)||N.USE_JPEG&&N.USE_IPTC&&va(i)||N.USE_XMP&&wa(o)||(N.USE_JPEG||N.USE_WEBP)&&N.USE_ICC&&ya(a)||N.USE_MPF&&xa(s)||N.USE_PNG&&N.USE_PNG_FILE&&Sa(c)||N.USE_PNG&&Ca(u)||N.USE_PNG&&Ia(f)||N.USE_WEBP&&Pa(l)||N.USE_GIF&&ka(d)||N.USE_JXL&&Ta(p)}({fileType:b,fileDataOffset:v,jfifDataOffset:w,tiffHeaderOffset:y,iptcDataOffset:x,xmpChunks:S,iccChunks:C,mpfDataOffset:I,pngHeaderOffset:T,pngTextChunks:A,pngChunkOffsets:D,vp8xChunkOffset:O,gifHeaderOffset:F,jxlCodestreamOffset:G});if(N.USE_JPEG&&N.USE_FILE&&ma(v)&&u.shouldParseGroup("file")&&(!(B=a)||!0===B.composite||Array.isArray(B.composite)&&B.composite.length>0||!B.file||!0===B.file||!Array.isArray(B.file)||1!==B.file.length||"FileType"!==B.file[0])){const t=la("file",ar(e,v),u);f.file=t,u.shouldReturnGroup("file")&&l.push({type:"mergeGroupAssign",groupKey:"file",parsedTags:t})}var B,j,$;if(N.USE_JPEG&&N.USE_JFIF&&ga(w)&&u.shouldParseGroup("jfif")){const t=la("jfif",vr(e,w),u);f.jfif=t,u.shouldReturnGroup("jfif")&&l.push({type:"mergeGroupAssign",groupKey:"jfif",parsedTags:t})}if(N.USE_EXIF&&ba(y)&&u.shouldParseGroup("exif")){const{tags:n,byteOrder:a}=Zn(e,y,i,r,u);n.Thumbnail&&(h=n.Thumbnail,delete n.Thumbnail);const s=la("exif",n,u);if(f.exif=s,N.USE_TIFF&&N.USE_IPTC&&s["IPTC-NAA"]&&!va(x)&&u.shouldParseGroup("iptc")){const e=la("iptc",Mr(s["IPTC-NAA"].value,0,i,u),u);f.iptc=e,u.shouldReturnGroup("iptc")&&l.push({type:"mergeGroupAssign",groupKey:"iptc",parsedTags:e})}if(N.USE_TIFF&&N.USE_XMP&&s.ApplicationNotes&&!wa(S)&&u.shouldParseGroup("xmp")){const e=la("xmp",Hr(P(s.ApplicationNotes.value),void 0,o),u);if(f.xmp=e,u.shouldReturnGroup("xmp")){const n={type:"mergeXmpGroupAssign",parsedTags:e};t?l.push(n):m=n}}if(N.USE_PHOTOSHOP&&s.ImageSourceData&&s.PhotoshopSettings&&u.shouldParseGroup("photoshop")){const e=la("photoshop",Ri(s.PhotoshopSettings.value,i,u),u);f.photoshop=e,u.shouldReturnGroup("photoshop")&&l.push({type:"mergeGroupAssign",groupKey:"photoshop",parsedTags:e})}if(N.USE_TIFF&&N.USE_ICC&&s.ICC_Profile&&!ya(C)&&u.shouldParseGroup("icc")){const e=la("icc",zi(s.ICC_Profile.value,[{offset:0,length:s.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]),u);f.icc=e,u.shouldReturnGroup("icc")&&l.push({type:"mergeGroupAssign",groupKey:"icc",parsedTags:e})}if(N.USE_MAKER_NOTES&&s.MakerNote&&u.shouldParseGroup("makerNotes"))if((j=s).Make&&j.Make.value&&Array.isArray(j.Make.value)&&"Canon"===j.Make.value[0]&&j.MakerNote&&j.MakerNote.__offset){const t=to(e,y,s.MakerNote.__offset,a,i,r,u);f.makerNotes=t,u.shouldReturnGroup("makerNotes")&&l.push({type:"mergeGroupAssign",groupKey:"makerNotes",parsedTags:t})}else if(function(e){const t="PENTAX ";return e.MakerNote.value.length>7&&P(e.MakerNote.value.slice(0,7))===t&&e.MakerNote.__offset}(s)){const t=io(e,y,s.MakerNote.__offset,i,r,u);f.makerNotes=t,u.shouldReturnGroup("makerNotes")&&l.push({type:"mergeGroupAssign",groupKey:"makerNotes",parsedTags:t})}s.MakerNote&&delete s.MakerNote.__offset,u.shouldReturnGroup("exif")&&l.push({type:"mergeGroupAssign",groupKey:"exif",parsedTags:s}),!t&&m&&(l.push(m),m=void 0)}if(N.USE_JPEG&&N.USE_IPTC&&va(x)&&u.shouldParseGroup("iptc")){const t=la("iptc",Mr(e,x,i,u),u);f.iptc=t,u.shouldReturnGroup("iptc")&&l.push({type:"mergeGroupAssign",groupKey:"iptc",parsedTags:t})}if(N.USE_XMP&&wa(S)&&u.shouldParseGroup("xmp")){const t=la("xmp",Hr(e,S,o),u);f.xmp=t,u.shouldReturnGroup("xmp")&&l.push({type:"mergeXmpGroupAssign",parsedTags:t})}if(N.USE_JXL&&N.USE_EXIF&&U&&!ba(y)&&u.shouldParseGroup("exif")&&n){const t=new DataView(e.buffer,e.byteOffset+U.dataOffset,U.length);p.push(R(t,M,void 0,"dataview",c).then((e=>{const t=J(e,0),{tags:n}=Zn(e,t,i,r,u);n.Thumbnail&&delete n.Thumbnail,d.brobExif=n})).catch((()=>{d.brobExif={}}))),l.push({type:"mergeBrobExifDeferred",deferredKey:"brobExif"})}if(N.USE_JXL&&N.USE_XMP&&E&&!wa(S)&&u.shouldParseGroup("xmp")&&n){const t=new DataView(e.buffer,e.byteOffset+E.dataOffset,E.length);p.push(R(t,M,void 0,"dataview",c).then((e=>{d.brobXmp=Hr(e,[{dataOffset:0,length:e.byteLength}],o)})).catch((()=>{d.brobXmp={}}))),l.push({type:"mergeBrobXmpDeferred",deferredKey:"brobXmp"})}if((N.USE_JPEG||N.USE_WEBP)&&N.USE_ICC&&ya(C)&&u.shouldParseGroup("icc")){const t=zi(e,C,n,c);if(($=t)&&"function"==typeof $.then){if(!n)throw new Error("Promise is required when async mode is enabled.");p.push(t.then((e=>{d.iccApp=e}))),l.push({type:"mergeIccDeferred",deferredKey:"iccApp"})}else{const e=la("icc",t,u);f.icc=e,u.shouldReturnGroup("icc")&&l.push({type:"mergeGroupAssign",groupKey:"icc",parsedTags:e})}}if(N.USE_MPF&&xa(I)&&u.shouldParseGroup("mpf")){const t=la("mpf",Qn(e,I,i,r,u),u);f.mpf=t,u.shouldReturnGroup("mpf")&&l.push({type:"mergeGroupAssign",groupKey:"mpf",parsedTags:t})}if(N.USE_PNG&&N.USE_PNG_FILE&&Sa(T)&&u.shouldParseGroup("png")){const t=la("png",so(e,T),u);f.pngFile=t,u.shouldReturnGroup("png")&&l.push({type:"mergePngFile",parsedTags:t})}if(N.USE_PNG&&Ca(A)&&(u.shouldParseGroup("png")||u.shouldParseGroup("exif")||u.shouldParseGroup("iptc"))){const{readTags:t,readTagsPromise:o}=go(e,A,n,i,r,u,c);g=!!o,l.push({type:"processPngTextReadTags",readTags:t}),o&&(p.push(o.then((e=>{d.pngTextTagList=e}))),l.push({type:"processPngTextReadTagsDeferredList",deferredKey:"pngTextTagList"}))}if(N.USE_PNG&&Ia(D)&&u.shouldParseGroup("png")){const t=la("png",Uo(e,D),u);f.pngChunk=t,u.shouldReturnGroup("png")&&l.push({type:"mergePngChunk",parsedTags:t})}if(N.USE_WEBP&&Pa(O)&&u.shouldParseGroup("riff")){const t=la("riff",$o(e,O),u);f.riff=t,u.shouldReturnGroup("riff")&&l.push({type:"mergeGroupMerge",groupKey:"riff",parsedTags:t})}if(N.USE_GIF&&ka(F)&&u.shouldParseGroup("gif")){const t=la("gif",Ho(e,F),u);f.gif=t,u.shouldReturnGroup("gif")&&l.push({type:"mergeGroupMerge",groupKey:"gif",parsedTags:t})}if(N.USE_JXL&&Ta(G)&&u.shouldParseGroup("file")){const t=la("file",pr(e,G),u);f.file=t,u.shouldReturnGroup("file")&&l.push({type:"mergeGroupAssign",groupKey:"file",parsedTags:t})}if(l.push({type:"gps"}),l.push({type:"composite"}),l.push({type:"thumbnail"}),l.push({type:"fileType"}),!L)throw new sa.MetadataMissingError;const z={objectAssign:k,hasPngTextData:Ca,filterTagsForParse:la,filterTagsForReturn:da,getGpsGroupFromExifTags:ha,Constants:N,Composite:ea,Thumbnail:Qo};if(n){if("undefined"==typeof Promise)throw new Error("Promise is required when async mode is enabled.");return Promise.all(p).then((()=>na({mergeSteps:l,deferredResults:d,parsedGroups:f,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:y,fileType:b,pngTextChunks:A,pngTextIsAsync:g,thumbnailIfdTags:h,deps:z})))}return na({mergeSteps:l,deferredResults:d,parsedGroups:f,expanded:t,tagFilter:u,dataView:e,tiffHeaderOffset:y,fileType:b,pngTextChunks:A,pngTextIsAsync:g,thumbnailIfdTags:h,deps:z})}function la(e,t,n){return n.isActive?pa(e,t,n.shouldParseTag):t}function da(e,t,n){return n.isActive?pa(e,t,n.shouldReturnTag):t}function pa(e,t,n){if(!t)return t;const r={};for(const o in t){const a=t[o];n(e,o,i(a))&&(r[o]=a)}return r;function i(e){if(e){if(Array.isArray(e)){if(0===e.length)return;return e[0].id}return e.id}}}function ha(e){let t;if(e.GPSLatitude&&e.GPSLatitudeRef){t=t||{};try{t.Latitude=B(e.GPSLatitude.value),"S"===e.GPSLatitudeRef.value.join("")&&(t.Latitude=-t.Latitude)}catch(e){}}if(e.GPSLongitude&&e.GPSLongitudeRef){t=t||{};try{t.Longitude=B(e.GPSLongitude.value),"W"===e.GPSLongitudeRef.value.join("")&&(t.Longitude=-t.Longitude)}catch(e){}}if(e.GPSAltitude&&e.GPSAltitudeRef){t=t||{};try{t.Altitude=e.GPSAltitude.value[0]/e.GPSAltitude.value[1],1===e.GPSAltitudeRef.value&&(t.Altitude=-t.Altitude)}catch(e){}}if(t)return t}function ma(e){return void 0!==e}function ga(e){return void 0!==e}function ba(e){return void 0!==e}function va(e){return void 0!==e}function wa(e){return Array.isArray(e)&&e.length>0}function ya(e){return Array.isArray(e)&&e.length>0}function xa(e){return void 0!==e}function Sa(e){return void 0!==e}function Ca(e){return Array.isArray(e)&&e.length>0}function Ia(e){return void 0!==e}function Pa(e){return void 0!==e}function ka(e){return void 0!==e}function Ta(e){return void 0!==e}const Aa=[{format:"png",bytes:[137,80,78,71]},{format:"jpeg",bytes:[255,216,255]},{format:"tiff",bytes:[73,73,42,0]},{format:"tiff",bytes:[77,77,0,42]},{format:"avif",bytes:[102,116,121,112,97,118,105,102],offset:4}];function Da(e){const t=e.trim();return t.startsWith("<?xml")||t.startsWith("<svg")}function Oa(e,t,n){return{code:e,severity:t,message:n}}async function Ma(e,t=h){const n=[],r=await async function(e){const t=await e.slice(0,16).arrayBuffer(),n=function(e){for(const t of Aa){const n=t.offset??0;if(!(e.length<n+t.bytes.length)&&t.bytes.every(((t,r)=>e[n+r]===t)))return t.format}return null}(new Uint8Array(t));return null!==n?n:("image/svg+xml"===e.type||e.name.endsWith(".svg"))&&Da(await e.text())?"svg":{"image/png":"png","image/jpeg":"jpeg","image/svg+xml":"svg","image/tiff":"tiff","image/avif":"avif"}[e.type]??"unknown"}(e);if(t.allowedFormats.includes(r)||n.push(Oa("FORMAT_NOT_ALLOWED","error",`Format "${r}" is not allowed. Allowed: ${t.allowedFormats.join(", ")}`)),e.size>t.maxFileSize){const e=Math.round(t.maxFileSize/1048576);n.push(Oa("FILE_TOO_LARGE","error",`File size exceeds ${e}MB limit`))}"svg"===r&&(Da(await e.text())||n.push(Oa("INVALID_SVG","error","File does not contain valid SVG content")));const{dpiX:i,dpiY:o}=await async function(e,t){if("jpeg"!==t&&"tiff"!==t&&"png"!==t&&"avif"!==t)return{dpiX:null,dpiY:null};try{const n=await e.arrayBuffer(),r=ca(n,{expanded:!0}),i=r.exif?.XResolution?.value,o=r.exif?.YResolution?.value;if(null!=i&&null!=o)return{dpiX:Array.isArray(i)?i[0]/i[1]:Number(i),dpiY:Array.isArray(o)?o[0]/o[1]:Number(o)};if("png"===t&&"pHYs"in r){const e=r.pHYs,t=e?.["Pixels Per Unit X"]?.value,n=e?.["Pixels Per Unit Y"]?.value,i=e?.Unit?.value;if(null!=t&&null!=n&&1===i)return{dpiX:Math.round(Number(t)/39.3701),dpiY:Math.round(Number(n)/39.3701)}}return{dpiX:null,dpiY:null}}catch{return{dpiX:null,dpiY:null}}}(e,r),{width:a,height:s}=await async function(e,t){if("svg"===t){const t=await e.text(),n=t.match(/viewBox=["'](\d+[\s,]+\d+[\s,]+(\d+(?:\.\d+)?)[\s,]+(\d+(?:\.\d+)?))["']/);if(null!==n)return{width:Math.round(parseFloat(n[2])),height:Math.round(parseFloat(n[3]))};const r=t.match(/width=["'](\d+(?:\.\d+)?)(?:px)?["']/),i=t.match(/height=["'](\d+(?:\.\d+)?)(?:px)?["']/);return{width:null!==r?Math.round(parseFloat(r[1])):0,height:null!==i?Math.round(parseFloat(i[1])):0}}try{const t=await e.arrayBuffer(),n=ca(t,{expanded:!0}),r=n.file?.["Image Width"]?.value??n.exif?.ImageWidth?.value??n.exif?.PixelXDimension?.value,i=n.file?.["Image Height"]?.value??n.exif?.ImageLength?.value??n.exif?.PixelYDimension?.value;if(null!=r&&null!=i)return{width:Number(r),height:Number(i)}}catch{}return void 0!==globalThis.Image?new Promise((t=>{const n=URL.createObjectURL(e),r=new globalThis.Image;r.onload=()=>{URL.revokeObjectURL(n),t({width:r.naturalWidth,height:r.naturalHeight})},r.onerror=()=>{URL.revokeObjectURL(n),t({width:0,height:0})},r.src=n})):{width:0,height:0}}(e,r),c="png"===r||"jpeg"===r||"tiff"===r||"avif"===r;if(c)if(null===i||null===o)n.push(Oa("DPI_UNKNOWN","warning","Could not determine image DPI. Recommended minimum is "+t.minDpi+" DPI"));else if(i<t.minDpi||o<t.minDpi){const e=Math.min(i,o);n.push(Oa("DPI_TOO_LOW","error",`Image DPI (${e}) is below minimum ${t.minDpi} DPI`))}c&&(a>0&&a<t.minWidth&&n.push(Oa("WIDTH_TOO_SMALL","error",`Image width (${a}px) is below minimum ${t.minWidth}px`)),s>0&&s<t.minHeight&&n.push(Oa("HEIGHT_TOO_SMALL","error",`Image height (${s}px) is below minimum ${t.minHeight}px`)));const u={format:r,width:a,height:s,dpiX:i,dpiY:o,fileSize:e.size,fileName:e.name,mimeType:e.type,hasTransparency:"png"===r||"svg"===r||"avif"===r};return{valid:!n.some((e=>"error"===e.severity)),metadata:u,issues:n}}function Ra(e,t,n,r,i,o){return Math.sqrt((e-r)**2+(t-i)**2+(n-o)**2)}function Fa(e,t,n=60){if(0===e.length)return null;const r=new Map;for(const[t,n,i]of e){const e=`${Math.floor(t/24)},${Math.floor(n/24)},${Math.floor(i/24)}`,o=r.get(e);void 0!==o?(o.count++,o.sumR+=t,o.sumG+=n,o.sumB+=i):r.set(e,{count:1,sumR:t,sumG:n,sumB:i})}let i=null;for(const e of r.values())(null===i||e.count>i.count)&&(i=e);if(null===i)return null;const o=Math.round(i.sumR/i.count),a=Math.round(i.sumG/i.count),s=Math.round(i.sumB/i.count);let c=0,u=0,f=0,l=0;for(const[t,r,i]of e)Ra(t,r,i,o,a,s)<=n&&(c++,u+=t,f+=r,l+=i);return c/e.length<t?null:[Math.round(u/c),Math.round(f/c),Math.round(l/c)]}function Ua(e){const{data:t,width:n,height:r}=e,i=[];for(let e=0;e<r;e++)for(let o=0;o<n;o++){const a=4*(e*n+o);if(0===t[a+3])continue;let s=!1;for(let i=-1;i<=1&&!s;i++)for(let a=-1;a<=1&&!s;a++){if(0===a&&0===i)continue;const c=o+a,u=e+i;c>=0&&c<n&&u>=0&&u<r&&0===t[4*(u*n+c)+3]&&(s=!0)}s&&i.push([t[a],t[a+1],t[a+2]])}return i}function Ea(e,t,n){const{data:r}=e,[i,o,a]=t;let s=0;for(let e=0;e<r.length;e+=4)0!==r[e+3]&&Ra(r[e],r[e+1],r[e+2],i,o,a)<=n&&(r[e+3]=0,s++);return s}function Na(e,t,n){const{data:r,width:i,height:o}=e,[a,s,c]=t;let u=0,f=0;for(let e=0;e<o;e++)for(let t=0;t<i;t++){const l=4*(e*i+t);if(0===r[l+3])continue;if(Ra(r[l],r[l+1],r[l+2],a,s,c)<=n)continue;u++;let d=!1;for(let n=-1;n<=1&&!d;n++)for(let a=-1;a<=1&&!d;a++){if(0===a&&0===n)continue;const s=t+a,c=e+n;s>=0&&s<i&&c>=0&&c<o&&0===r[4*(c*i+s)+3]&&(d=!0)}d&&f++}return 0===u?0:f/u}function Ga(e,t,n,r){if(0===r)return 0;const{data:i,width:o,height:a}=e,s=o*a,[c,u,f]=t,l=new Uint8Array(s),d=new Int32Array(s);let p=0;for(let e=0;e<s;e++){if(0!==l[e])continue;l[e]=1;const t=4*e;if(0===i[t+3])continue;if(Ra(i[t],i[t+1],i[t+2],c,u,f)>n)continue;let s=0,h=0;d[h++]=e;let m=1;for(;s<h;){const e=d[s++],t=e%o,r=(e-t)/o;for(let e=-1;e<=1;e++)for(let s=-1;s<=1;s++){if(0===s&&0===e)continue;const p=t+s,g=r+e;if(p<0||p>=o||g<0||g>=a)continue;const b=g*o+p;if(0!==l[b])continue;l[b]=1;const v=4*b;0!==i[v+3]&&(Ra(i[v],i[v+1],i[v+2],c,u,f)>n||(d[h++]=b,m++))}}if(m>p&&(p=m),p>=.8*r)return p/r}return p/r}async function La(e,t=800){if(function(e){return e.startsWith("data:image/svg+xml")}(e))return e;if(void 0===globalThis.Image||"undefined"==typeof document)return e;const n=await(r=e,new Promise(((e,t)=>{const n=new Image;n.onload=()=>e(n),n.onerror=()=>t(new Error("Failed to load image for preview generation")),n.src=r})));var r;const{width:i,height:o}=n;if(i<=t&&o<=t)return e;const a=t/Math.max(i,o),s=Math.round(i*a),c=Math.round(o*a),u=document.createElement("canvas");u.width=s,u.height=c;const f=u.getContext("2d");return null===f?e:(f.drawImage(n,0,0,s,c),u.toDataURL("image/png"))}const Ba=class{constructor(n){e(this,n),this.wtpLogoValidated=t(this,"wtpLogoValidated"),this.wtpLogoRejected=t(this,"wtpLogoRejected"),this.wtpLogoProcessing=t(this,"wtpLogoProcessing"),this.wtpLogoSelected=t(this,"wtpLogoSelected")}config=h;accept="image/png,image/jpeg,image/svg+xml,image/tiff,image/avif";multiple=!1;disabled=!1;enableBackgroundRemoval=!1;bgRemovalConfig={};labels={};getLabels(){return{...g,...this.labels}}isDragOver=!1;previews=[];selectedIndex=-1;rejections=[];isProcessing=!1;pendingChoices=[];urlInput="";urlError=null;isUrlFetching=!1;wtpLogoValidated;wtpLogoRejected;wtpLogoProcessing;wtpLogoSelected;fileInputRef;async buildLogoData(e,t){return{dataUrl:e,previewDataUrl:await La(e),metadata:t}}isRasterFormat(e){return["png","jpeg","tiff","avif"].includes(e)}async processFiles(e){if(this.disabled)return;this.isProcessing=!0,this.rejections=[],this.wtpLogoProcessing.emit(!0);const t=Array.from(e);for(const e of t){const t=await Ma(e,this.config);if(t.valid){const n=await this.fileToDataUrl(e);let r;const i=t.metadata;if("svg"===i.format){r=await d(n);const e=p(r);null!==e&&(i.width=e.width,i.height=e.height)}else r=n;if(this.enableBackgroundRemoval&&this.isRasterFormat(i.format))this.addPendingChoice(r,i,e);else{const e=await this.buildLogoData(r,i);this.previews=[...this.previews,e],this.selectedIndex=this.previews.length-1,this.wtpLogoValidated.emit(e),this.wtpLogoSelected.emit(e)}}else this.rejections=[...this.rejections,{fileName:e.name,issues:t.issues}],this.wtpLogoRejected.emit({file:e,issues:t.issues})}this.isProcessing=!1,this.wtpLogoProcessing.emit(!1)}addPendingChoice(e,t,n){this.pendingChoices=[...this.pendingChoices,{originalDataUrl:e,removedBgDataUrl:null,removedBgWidth:null,removedBgHeight:null,metadata:t,status:"processing",errorMessage:null}],this.performBackgroundRemoval(n,this.pendingChoices.length-1)}async performBackgroundRemoval(e,t){try{const n=await async function(e,t){const{tolerance:n,minEdgeRatio:r,autoCrop:i,autoCropPadding:o}={...m,...t},a=await function(e){return new Promise(((t,n)=>{const r=URL.createObjectURL(e),i=new Image;i.onload=()=>{URL.revokeObjectURL(r),t(i)},i.onerror=()=>{URL.revokeObjectURL(r),n(new Error("Failed to load image"))},i.src=r}))}(e),s=document.createElement("canvas");s.width=a.naturalWidth,s.height=a.naturalHeight;const c=s.getContext("2d");if(null===c)throw new Error("Could not get canvas 2d context");c.drawImage(a,0,0);const u=c.getImageData(0,0,s.width,s.height),f={data:u.data,width:s.width,height:s.height},l=function(e){const{data:t,width:n,height:r}=e,i=[],o=(e,r)=>{const o=4*(r*n+e);0!==t[o+3]&&i.push([t[o],t[o+1],t[o+2]])};for(let e=0;e<n;e++)o(e,0),o(e,r-1);for(let e=1;e<r-1;e++)o(0,e),o(n-1,e);return i}(f),d=2*f.width+2*Math.max(0,f.height-2);let p=null;(d>0?l.length/d:0)>=.5&&(p=Fa(l,r,n)),null!==p&&(function(e,t,n){const{data:r,width:i,height:o}=e,a=i*o,s=new Uint8Array(a),c=new Int32Array(a);let u=0,f=0;const[l,d,p]=t,h=(e,t)=>{const o=t*i+e;if(0!==s[o])return;s[o]=1;const a=4*o;0!==r[a+3]&&Ra(r[a],r[a+1],r[a+2],l,d,p)<=n&&(c[f++]=o)};for(let e=0;e<i;e++)h(e,0),h(e,o-1);for(let e=1;e<o-1;e++)h(0,e),h(i-1,e);for(;u<f;){const e=c[u++];r[4*e+3]=0;const t=e%i,n=(e-t)/i;t>0&&h(t-1,n),t<i-1&&h(t+1,n),n>0&&h(t,n-1),n<o-1&&h(t,n+1),t>0&&n>0&&h(t-1,n-1),t<i-1&&n>0&&h(t+1,n-1),t>0&&n<o-1&&h(t-1,n+1),t<i-1&&n<o-1&&h(t+1,n+1)}}(f,p,n),function(e,t,n){const{data:r,width:i,height:o}=e,a=i*o,[s,c,u]=t,f=new Uint8Array(a);for(let e=0;e<a;e++){const t=4*e;r[t+3]>0&&Ra(r[t],r[t+1],r[t+2],s,c,u)<=n&&(f[e]=1)}const l=new Int32Array(a).fill(-1),d=[];let p=0;for(let e=0;e<a;e++){if(1!==f[e]||-1!==l[e])continue;const t=p++;d.push(!1);const n=[e];for(l[e]=t;n.length>0;){const e=n.pop(),a=e%i,s=(e-a)/i;for(let e=-1;e<=1;e++)for(let c=-1;c<=1;c++){if(0===c&&0===e)continue;const u=a+c,p=s+e;if(u<0||u>=i||p<0||p>=o)continue;const h=p*i+u;0!==r[4*h+3]?1===f[h]&&-1===l[h]&&(l[h]=t,n.push(h)):d[t]=!0}}}for(let e=0;e<a;e++)-1===l[e]||d[l[e]]||(r[4*e+3]=0)}(f,p,n));let h=!1;for(let e=0;e<f.data.length;e+=4)if(0===f.data[e+3]){h=!0;break}if(!h)throw new Error("No dominant background color detected");let g=p??[255,255,255];for(let e=0;e<3;e++){const e=Ua(f),t=Fa(e,r,n);if(null===t)break;let i=0,o=0,a=f.width,s=0,c=f.height,u=0;for(let e=0;e<f.data.length;e+=4)if(f.data[e+3]>0&&(i++,Ra(f.data[e],f.data[e+1],f.data[e+2],t[0],t[1],t[2])<=n)){o++;const t=e/4,n=t%f.width,r=(t-n)/f.width;n<a&&(a=n),n>s&&(s=n),r<c&&(c=r),r>u&&(u=r)}if(0===i||o/i>.9)break;if(o/i>.4&&Na(f,t,n)>.5)break;let l=0;for(const[r,i,o]of e)Ra(r,i,o,t[0],t[1],t[2])<=n&&l++;if(o>0&&l/o>.7)break;const d=(s-a+1)*(u-c+1);if(d>0&&o/d<.45)break;if(Ga(f,t,n,o)<.8)break;if(0===Ea(f,t,n))break;g=t}!function(e,t,n){const{data:r,width:i,height:o}=e,[a,s,c]=t,u=[];for(let e=0;e<o;e++)for(let t=0;t<i;t++){const n=e*i+t;if(0===r[4*n+3])continue;let a=!1;for(let n=-1;n<=1&&!a;n++)for(let s=-1;s<=1&&!a;s++){if(0===s&&0===n)continue;const c=t+s,u=e+n;c>=0&&c<i&&u>=0&&u<o&&0===r[4*(u*i+c)+3]&&(a=!0)}a&&u.push(n)}for(const e of u){const t=4*e,i=Ra(r[t],r[t+1],r[t+2],a,s,c),o=Math.min(255,Math.round(i/n*255));r[t+3]=o}}(f,g,n),c.putImageData(u,0,0);let b=s;if(i){const e=function(e,t=0){const{data:n,width:r,height:i}=e;let o=r,a=i,s=-1,c=-1;for(let e=0;e<i;e++)for(let i=0;i<r;i++)n[4*(e*r+i)+3]>t&&(i<o&&(o=i),i>s&&(s=i),e<a&&(a=e),e>c&&(c=e));return-1===s?null:[o,a,s,c]}(f);if(null!==e){const[t,n,r,i]=e,a=Math.max(0,t-o),c=Math.max(0,n-o),u=Math.min(s.width,r+1+o)-a,f=Math.min(s.height,i+1+o)-c;if(u<s.width||f<s.height){const e=document.createElement("canvas");e.width=u,e.height=f;const t=e.getContext("2d");null!==t&&(t.drawImage(s,a,c,u,f,0,0,u,f),b=e)}}}return{blob:await new Promise(((e,t)=>{b.toBlob((n=>{null!==n?e(n):t(new Error("Canvas toBlob failed"))}),"image/png")})),dataUrl:b.toDataURL("image/png"),width:b.width,height:b.height}}(e,this.bgRemovalConfig);this.pendingChoices=this.pendingChoices.map(((e,r)=>r===t?{...e,removedBgDataUrl:n.dataUrl,removedBgWidth:n.width,removedBgHeight:n.height,status:"ready"}:e))}catch(e){const n=e instanceof Error?e.message:"Background removal failed";this.pendingChoices=this.pendingChoices.map(((e,r)=>r===t?{...e,status:"error",errorMessage:n}:e))}}async selectChoice(e,t){const n=this.pendingChoices[e];if(void 0===n)return;const r=t&&null!==n.removedBgDataUrl?n.removedBgDataUrl:n.originalDataUrl,i=t&&null!==n.removedBgWidth&&null!==n.removedBgHeight?{...n.metadata,width:n.removedBgWidth,height:n.removedBgHeight}:n.metadata,o=await this.buildLogoData(r,i);this.previews=[...this.previews,o],this.selectedIndex=this.previews.length-1,this.wtpLogoValidated.emit(o),this.wtpLogoSelected.emit(o),this.pendingChoices=this.pendingChoices.filter(((t,n)=>n!==e))}extractFileNameFromUrl(e){try{const t=new URL(e).pathname.split("/"),n=t[t.length-1];return void 0!==n&&""!==n&&n.includes(".")?decodeURIComponent(n):"downloaded-image"}catch{return"downloaded-image"}}async handleUrlSubmit(){const e=this.urlInput.trim(),t=this.getLabels();if(this.urlError=null,""===e)return void(this.urlError=t.urlErrorEmpty);let n;try{n=new URL(e)}catch{return void(this.urlError=t.urlErrorInvalid)}if("https:"===n.protocol){this.isUrlFetching=!0;try{const n=await fetch(e,{mode:"cors"});if(!n.ok)return void(this.urlError=t.urlErrorHttp(n.status,n.statusText));const r=await n.blob(),i=this.extractFileNameFromUrl(e),o=new File([r],i,{type:r.type});this.urlInput="",await this.processFiles([o])}catch(e){const n=e instanceof Error?e.message:t.urlErrorFetch;this.urlError=n.includes("Failed to fetch")||n.includes("NetworkError")?t.urlErrorNetwork:n}finally{this.isUrlFetching=!1}}else this.urlError=t.urlErrorProtocol}fileToDataUrl(e){return new Promise(((t,n)=>{const r=new FileReader;r.onload=()=>t(r.result),r.onerror=()=>n(new Error("Failed to read file")),r.readAsDataURL(e)}))}handleDragOver=e=>{e.preventDefault(),e.stopPropagation(),this.disabled||(this.isDragOver=!0)};handleDragLeave=e=>{e.preventDefault(),e.stopPropagation(),this.isDragOver=!1};handleDrop=e=>{e.preventDefault(),e.stopPropagation(),this.isDragOver=!1,void 0!==e.dataTransfer?.files&&this.processFiles(e.dataTransfer.files)};handleInputChange=e=>{const t=e.target;null!==t.files&&this.processFiles(t.files)};handleClick=()=>{this.disabled||this.fileInputRef?.click()};handleKeyDown=e=>{"Enter"!==e.key&&" "!==e.key||(e.preventDefault(),this.handleClick())};handleUrlInput=e=>{this.urlInput=e.target.value};handleUrlInputKeyDown=e=>{"Enter"===e.key&&(e.preventDefault(),this.handleUrlSubmit())};handleUrlSubmitClick=()=>{this.handleUrlSubmit()};handleSelectOriginal=e=>{const t=e.currentTarget.closest("[data-index]");null!==t&&this.selectChoice(Number(t.dataset.index),!1)};handleSelectRemoved=e=>{const t=e.currentTarget.closest("[data-index]");null!==t&&this.selectChoice(Number(t.dataset.index),!0)};handleSelectPreview=e=>{const t=e.currentTarget.closest("[data-index]");if(null===t)return;const n=Number(t.dataset.index);this.selectedIndex=n,this.wtpLogoSelected.emit(this.previews[n])};handleRemovePreview=e=>{e.stopPropagation();const t=e.currentTarget.closest("[data-index]");if(null===t)return;const n=Number(t.dataset.index);this.previews=this.previews.filter(((e,t)=>t!==n)),this.selectedIndex===n?(this.selectedIndex=this.previews.length>0?0:-1,this.selectedIndex>=0&&this.wtpLogoSelected.emit(this.previews[this.selectedIndex])):this.selectedIndex>n&&this.selectedIndex--};render(){const e=this.getLabels();return r("div",{key:"605b0b0f0e3d523fad548c8e250deb586fa047cd",class:"wtp-logo-upload",part:"root"},r("div",{key:"206c52a14ba4bf1ca88361298ea1dd34ede33abe",class:"url-input-section"},r("div",{key:"8bbe6a257f53d3aaf40566b1686c77352a571182",class:"url-input-wrapper"},r("input",{key:"88f87e7772bf404088a1978a3964af098362d2fd",type:"url",class:"url-input",part:"url-input",placeholder:e.urlPlaceholder,value:this.urlInput,disabled:this.disabled||this.isUrlFetching,onInput:this.handleUrlInput,onKeyDown:this.handleUrlInputKeyDown}),r("button",{key:"77b0b04012be3869fcad0841542ff6ba65175b69",class:"url-submit-btn",part:"url-submit-btn",disabled:this.disabled||this.isUrlFetching||""===this.urlInput.trim(),onClick:this.handleUrlSubmitClick},this.isUrlFetching?r("span",{class:"spinner-sm"}):e.urlSubmit)),null!==this.urlError&&r("p",{key:"21af070e82a88911b00cfb35c21c9f4a0b1f9537",class:"url-error",part:"url-error"},this.urlError)),r("div",{key:"40ea61275f84ea49bde47d4a2d7df6b48733b8df",class:"divider",part:"divider"},r("span",{key:"617d48c410b5166efbe38902fbc36a537f98f359",class:"divider-text"},e.dividerText)),r("div",{key:"56aebdb221b17ed365e8e1b780f643d2985a0a76",class:{"upload-zone":!0,"drag-over":this.isDragOver,disabled:this.disabled},part:`upload-zone${this.isDragOver?" drag-over":""}${this.disabled?" disabled":""}`,onDragOver:this.handleDragOver,onDragLeave:this.handleDragLeave,onDrop:this.handleDrop,onClick:this.handleClick,onKeyDown:this.handleKeyDown,role:"button",tabindex:this.disabled?-1:0,"aria-label":e.uploadAriaLabel,"aria-disabled":this.disabled?"true":void 0},r("input",{key:"b4dd839c3d9dfa26f7e22058ca8d88d1b5128a78",type:"file",ref:e=>this.fileInputRef=e,accept:this.accept,multiple:this.multiple,onChange:this.handleInputChange,class:"file-input",tabindex:-1}),r("slot",{key:"77c9c469ed07b881d8e09d15ba6ab39938c8685e",name:"prompt"},r("div",{key:"1dc98ac4ee1f0a830fff45c420dcdb83d5e51e08",class:"default-prompt"},r("svg",{key:"6b0b37518c24f7af3d69df7cfb00a367ceeed172",class:"upload-icon",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("path",{key:"7f8c88dc1022380127cac7dc278b6363013293f8",d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),r("polyline",{key:"0ae415e56725fa3e35229dd95824c69c35b8b157",points:"17 8 12 3 7 8"}),r("line",{key:"4aceb053d8f82b24b01c250337d17787435b93a2",x1:"12",y1:"3",x2:"12",y2:"15"})),r("p",{key:"dbc8e47dc04b7f1c03053e244c7d8c5d5e70b533",class:"prompt-text",part:"prompt-text"},e.dropPromptText),r("p",{key:"f3c1d7b332ce6439725dcf15eda5732a8f6d45e2",class:"prompt-hint",part:"prompt-hint"},e.dropPromptHint))),this.isProcessing&&r("div",{key:"4f5730a0bfd918788c851dd7b4e0282643e782cc",class:"processing-overlay"},r("span",{key:"d1f7e503dd250b7125132790976554c3b91a0aba",class:"spinner"}))),this.rejections.length>0&&r("div",{key:"5f2aa8bb1b64d70db7138ff2eddda68ed7aa62e3",class:"rejections",part:"rejections"},this.rejections.map((e=>r("div",{class:"rejection-item",part:"rejection-item"},r("strong",null,e.fileName),r("ul",null,e.issues.filter((e=>"error"===e.severity)).map((e=>r("li",{class:"error"},e.message))),e.issues.filter((e=>"warning"===e.severity)).map((e=>r("li",{class:"warning"},e.message)))))))),this.pendingChoices.length>0&&r("div",{key:"c1c43dfeb2d32a66261c70d3c4edd0339c88f098",class:"pending-choices",part:"pending-choices"},this.pendingChoices.map(((t,n)=>r("div",{class:"choice-card",part:"choice-card"},r("p",{class:"choice-title"},t.metadata.fileName),r("div",{class:"choice-options"},r("button",{class:"choice-option",part:"choice-option","data-index":n,onClick:this.handleSelectOriginal},r("img",{src:t.originalDataUrl,alt:"Original",class:"choice-image"}),r("span",{class:"choice-label"},e.bgRemovalUseOriginal)),r("button",{class:{"choice-option":!0,"choice-option--disabled":"processing"===t.status},part:"choice-option",disabled:"processing"===t.status,"data-index":n,onClick:this.handleSelectRemoved},"processing"===t.status&&r("div",{class:"choice-image choice-image--loading"},r("span",{class:"spinner-sm"}),r("span",{class:"choice-loading-text"},e.bgRemovalProcessing)),"ready"===t.status&&null!==t.removedBgDataUrl&&r("img",{src:t.removedBgDataUrl,alt:"Background removed",class:"choice-image choice-image--transparent"}),"error"===t.status&&r("div",{class:"choice-image choice-image--error"},r("span",{class:"choice-error-text"},t.errorMessage)),r("span",{class:"choice-label"},"error"===t.status?e.bgRemovalFailed:e.bgRemovalUseRemoved))))))),this.previews.length>0&&r("div",{key:"69d0dab6c5377d471b8802d7ba92c640785e3d52",class:"previews",part:"previews"},this.previews.map(((t,n)=>r("div",{class:{"preview-item":!0,"preview-item--selected":n===this.selectedIndex},part:"preview-item"+(n===this.selectedIndex?" selected":""),"data-index":n,onClick:this.handleSelectPreview,role:"button",tabindex:0},r("img",{src:t.previewDataUrl??t.dataUrl,alt:t.metadata.fileName,class:"preview-image"}),r("div",{class:"preview-info"},r("span",{class:"preview-name"},t.metadata.fileName),r("span",{class:"preview-dims"},t.metadata.width," x ",t.metadata.height,"px"),null!==t.metadata.dpiX&&r("span",{class:"preview-dpi"},t.metadata.dpiX," ",e.rejectionDpiUnit)),r("button",{class:"remove-btn",part:"remove-btn","data-index":n,onClick:this.handleRemovePreview,"aria-label":e.removeAriaLabel(t.metadata.fileName)},r("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2"},r("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),r("line",{x1:"6",y1:"6",x2:"18",y2:"18"}))))))))}};Ba.style='*,*::before,*::after{box-sizing:border-box}:host{font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);color:var(--wtp-color-text, #1e293b);line-height:1.5}.wtp-logo-upload{display:flex;flex-direction:column;gap:16px;width:100%}.url-input-section{display:flex;flex-direction:column;gap:4px}.url-input-wrapper{display:flex;gap:8px}.url-input{flex:1;padding:8px 16px;font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);font-size:14px;border:1px solid var(--wtp-color-border, #e2e8f0);border-radius:8px;background:var(--wtp-color-bg, #ffffff);color:var(--wtp-color-text, #1e293b);transition-property:border-color;transition-duration:250ms;transition-timing-function:ease}.url-input::placeholder{color:var(--wtp-color-text-muted, #64748b)}.url-input:focus{outline:none;border-color:var(--wtp-color-primary, #2563eb)}.url-input:disabled{opacity:0.5;cursor:not-allowed}.url-submit-btn{display:inline-flex;align-items:center;gap:8px;padding:8px 16px;font-family:var(--wtp-font-family, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif);font-size:14px;font-weight:500;border-radius:8px;border:1px solid var(--wtp-color-border, #e2e8f0);background:var(--wtp-color-bg, #ffffff);color:var(--wtp-color-text, #1e293b);cursor:pointer;transition-property:all;transition-duration:250ms;transition-timing-function:ease}.url-submit-btn:hover{background:var(--wtp-color-bg-muted, #f8fafc)}.url-submit-btn:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.url-submit-btn:disabled{opacity:0.5;cursor:not-allowed}.url-submit-btn{background:var(--wtp-color-primary, #2563eb);color:var(--wtp-color-bg, #ffffff);border-color:var(--wtp-color-primary, #2563eb);min-width:72px;justify-content:center}.url-submit-btn:hover:not(:disabled){background:var(--wtp-color-primary-hover, #1d4ed8);border-color:var(--wtp-color-primary-hover, #1d4ed8)}.url-submit-btn:disabled{opacity:0.5;cursor:not-allowed}.url-error{margin:0;font-size:12px;color:var(--wtp-color-error, #dc2626)}.divider{display:flex;align-items:center;gap:16px}.divider::before,.divider::after{content:"";flex:1;height:1px;background:var(--wtp-color-border, #e2e8f0)}.divider-text{font-size:14px;color:var(--wtp-color-text-muted, #64748b);text-transform:lowercase}.upload-zone{display:flex;align-items:center;justify-content:center;position:relative;min-height:160px;padding:32px;border:2px dashed var(--wtp-color-border, #e2e8f0);border-radius:12px;background:var(--wtp-color-bg-muted, #f8fafc);cursor:pointer;transition-property:border-color background-color;transition-duration:250ms;transition-timing-function:ease}.upload-zone:hover{border-color:var(--wtp-color-primary, #2563eb);background:var(--wtp-color-primary-light, #dbeafe)}.upload-zone:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.upload-zone.drag-over{border-color:var(--wtp-color-primary, #2563eb);background:var(--wtp-color-primary-light, #dbeafe);border-style:solid}.upload-zone.disabled{opacity:0.5;cursor:not-allowed;pointer-events:none}.file-input{position:absolute;width:0;height:0;opacity:0;overflow:hidden}.default-prompt{display:flex;flex-direction:column;align-items:center;gap:8px;text-align:center}.upload-icon{width:40px;height:40px;color:var(--wtp-color-secondary, #64748b)}.prompt-text{margin:0;font-size:16px;font-weight:500;color:var(--wtp-color-text, #1e293b)}.prompt-hint{margin:0;font-size:14px;color:var(--wtp-color-text-muted, #64748b)}.processing-overlay{display:flex;align-items:center;justify-content:center;position:absolute;inset:0;background:rgba(255, 255, 255, 0.8);border-radius:12px}.spinner{display:block;width:32px;height:32px;border:3px solid var(--wtp-color-border, #e2e8f0);border-top-color:var(--wtp-color-primary, #2563eb);border-radius:50%;animation:wtp-spin 0.8s linear infinite}.spinner-sm{display:inline-block;width:16px;height:16px;border:2px solid var(--wtp-color-border, #e2e8f0);border-top-color:var(--wtp-color-primary, #2563eb);border-radius:50%;animation:wtp-spin 0.8s linear infinite}@keyframes wtp-spin{to{transform:rotate(360deg)}}.rejections{display:flex;flex-direction:column;gap:8px}.rejection-item{padding:8px 16px;border-radius:8px;background:var(--wtp-color-error-light, #fee2e2);font-size:14px}.rejection-item strong{color:var(--wtp-color-error, #dc2626)}.rejection-item ul{margin:4px 0 0;padding-left:24px}.rejection-item .error{color:var(--wtp-color-error, #dc2626)}.rejection-item .warning{color:var(--wtp-color-warning, #d97706)}.pending-choices{display:flex;flex-direction:column;gap:16px}.choice-card{border:1px solid var(--wtp-color-border, #e2e8f0);border-radius:12px;padding:16px;background:var(--wtp-color-bg, #ffffff)}.choice-title{margin:0 0 8px;font-size:14px;font-weight:500;color:var(--wtp-color-text, #1e293b);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.choice-options{display:grid;grid-template-columns:1fr 1fr;gap:16px}.choice-option{display:flex;flex-direction:column;align-items:center;gap:8px;padding:8px;border:2px solid var(--wtp-color-border, #e2e8f0);border-radius:8px;background:var(--wtp-color-bg, #ffffff);cursor:pointer;transition-property:border-color;transition-duration:250ms;transition-timing-function:ease}.choice-option:hover:not(:disabled){border-color:var(--wtp-color-primary, #2563eb)}.choice-option:focus-visible{outline:2px solid var(--wtp-color-primary, #2563eb);outline-offset:2px}.choice-option--disabled{opacity:0.7;cursor:wait}.choice-image{width:100%;height:120px;object-fit:contain;border-radius:4px}.choice-image--transparent{background:repeating-conic-gradient(#e2e8f0 0% 25%, #fff 0% 50%) 50%/12px 12px}.choice-image--loading{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:4px;background:var(--wtp-color-bg-muted, #f8fafc)}.choice-image--error{display:flex;align-items:center;justify-content:center;background:var(--wtp-color-error-light, #fee2e2);padding:8px}.choice-loading-text{font-size:12px;color:var(--wtp-color-text-muted, #64748b)}.choice-error-text{font-size:12px;color:var(--wtp-color-error, #dc2626);text-align:center}.choice-label{font-size:14px;font-weight:500;color:var(--wtp-color-text, #1e293b)}.previews{display:grid;grid-template-columns:repeat(auto-fill, minmax(140px, 1fr));gap:16px}.preview-item{display:flex;flex-direction:column;position:relative;border:2px solid var(--wtp-color-border, #e2e8f0);border-radius:8px;overflow:hidden;background:var(--wtp-color-bg, #ffffff);cursor:pointer;transition-property:border-color box-shadow;transition-duration:250ms;transition-timing-function:ease}.preview-item:hover{border-color:var(--wtp-color-secondary, #64748b)}.preview-item--selected{border-color:var(--wtp-color-primary, #2563eb);box-shadow:0 0 0 2px var(--wtp-color-primary-fade, rgba(37, 99, 235, 0.2))}.preview-image{width:100%;height:100px;object-fit:contain;background:var(--wtp-color-bg-muted, #f8fafc);padding:8px}.preview-info{display:flex;flex-direction:column;padding:8px;gap:2px;font-size:12px;color:var(--wtp-color-text-muted, #64748b)}.preview-name{font-weight:500;color:var(--wtp-color-text, #1e293b);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.remove-btn{position:absolute;top:4px;right:4px;display:flex;align-items:center;justify-content:center;width:24px;height:24px;padding:0;border:none;border-radius:9999px;background:rgba(0, 0, 0, 0.5);color:white;cursor:pointer;transition-property:all;transition-duration:250ms;transition-timing-function:ease}.remove-btn:hover{background:rgba(0, 0, 0, 0.7)}.remove-btn svg{width:14px;height:14px}';export{v as wtp_editor,Ba as wtp_logo_upload}
|