1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,177964,673394,e=>{"use strict";var t=e.i(583555),r=e.i(298296);e.s(["bigint",0,function(e){return t._coercedBigint(r.ZodBigInt,e)},"boolean",0,function(e){return t._coercedBoolean(r.ZodBoolean,e)},"date",0,function(e){return t._coercedDate(r.ZodDate,e)},"number",0,function(e){return t._coercedNumber(r.ZodNumber,e)},"string",0,function(e){return t._coercedString(r.ZodString,e)}],361780);var n=e.i(361780),n=n,i=e.i(280053);class o{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 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 a(e,t,r){try{return new DataView(e,t,r)}catch(n){return new o(e,t,r)}}function s(e,t,r){let n=[];for(let i=0;i<r&&t+i<e.byteLength;i++)n.push(e.getUint8(t+i));return f(n)}function u(e,t){let r=[],n=0;for(;t+n<e.byteLength;){let i=e.getUint8(t+n);if(0===i)break;r.push(i),n++}return f(r)}function l(e,t){let r=e.getUint8(t),n=s(e,t+1,r);return[r,n]}function f(e){return e.map(e=>String.fromCharCode(e)).join("")}function c(e,t,r,n){e&&t&&e.push({type:t,start:r,end:n})}function p(){if("u"<typeof Promise)throw Error("Promise is required when async mode is enabled.")}function d(){for(let e=1;e<arguments.length;e++)for(let t in arguments[e])arguments[0][t]=arguments[e][t];return arguments[0]}function m(e,t,r){let n=!1;Object.defineProperty(e,t,{get:()=>(n||(n=!0,Object.defineProperty(e,t,{configurable:!0,enumerable:!0,value:r.apply(e),writable:!0})),e[t]),configurable:!0,enumerable:!0})}function g(e){return"u">typeof btoa?"string"==typeof e?btoa(e):btoa(Array.prototype.reduce.call(new Uint8Array(e),(e,t)=>e+String.fromCharCode(t),"")):void 0!==i.Buffer?void 0!==i.Buffer.from?i.Buffer.from(e).toString("base64"):new i.Buffer(e).toString("base64"):void 0}function h(e){let t=e.substring(e.indexOf(",")+1);if(-1!==e.indexOf(";base64"))return"u">typeof atob?Uint8Array.from(atob(t),e=>e.charCodeAt(0)).buffer:void 0===i.Buffer?void 0:void 0!==i.Buffer.from?i.Buffer.from(t,"base64"):new i.Buffer(t,"base64");let r=decodeURIComponent(t);return void 0!==i.Buffer?void 0!==i.Buffer.from?i.Buffer.from(r):new i.Buffer(r):Uint8Array.from(r,e=>e.charCodeAt(0)).buffer}function y(e,t){return Array(t+1).join(e)}let b,v="brotli";function x(e,t,r,n="string",i){var o;let a=(o=i)&&"number"==typeof o.maxDecompressedSize?o.maxDecompressedSize:0x8000000;if(i&&t!==b){let o=i[0===t?"deflate":"brotli"];if("function"==typeof o)return Promise.resolve(o(new Uint8Array(e.buffer,e.byteOffset,e.byteLength))).then(e=>{var t;return((t=e)&&"number"==typeof t.byteLength?t.byteLength:0)>a?A(a):"dataview"===n?e instanceof DataView?e:e instanceof ArrayBuffer?new DataView(e):new DataView(e.buffer,e.byteOffset,e.byteLength):new TextDecoder(r).decode(e)})}if(0===t&&"function"==typeof DecompressionStream)return S(e,"deflate",a).then(e=>w(e,n,r));if(t===v){if("function"==typeof DecompressionStream)try{return S(e,"brotli",a).then(e=>w(e,n,r))}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"===n)try{return new TextDecoder(r).decode(e)}catch(t){return Array.from(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),e=>String.fromCharCode(e)).join("")}return e}function S(e,t,r){let n=new DecompressionStream(t),i=new Blob([e]).stream().pipeThrough(n).getReader(),o=[],a=0;return function e(){return i.read().then(({done:t,value:n})=>t?function(e,t){let r=new Uint8Array(t),n=0;for(let t=0;t<e.length;t++)r.set(e[t],n),n+=e[t].byteLength;return r.buffer}(o,a):(a+=n.byteLength)>r?i.cancel().then(()=>A(r)):(o.push(n),e()))}()}function w(e,t,r){return"dataview"===t?new DataView(e):new TextDecoder(r).decode(e)}function A(e){return"u">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.`)}function P(e){return"string"==typeof e}function C(e){return"u">typeof File&&e instanceof File}function I(e){return/^data:[^;,]*(;base64)?,/.test(e)}function U(e,t){return/^\w+:\/\//.test(e)?"u">typeof fetch?k(e,R(t)).then(e=>e.buffer):O(e,R(t)).then(e=>e.buffer):I(e)?Promise.resolve(h(e)):F(e,R(t)).then(e=>e.buffer)}function T(e,t){return _(e,R(t)).then(e=>e.buffer)}function R(e){return e&&Number.isInteger(e.length)&&e.length>=0?{start:0,end:e.length}:{start:0}}function k(e,{start:t=0,end:r}={}){let n={method:"GET"};return(t>0||void 0!==r&&r!==1/0)&&(n.headers={range:M(t,r)}
1),fetch(e,n).then(e=>{var t;let r=e&&"number"==typeof e.status?e.status:void 0;if(void 0!==r&&!((t=r)>=200&&t<=299||416===t)){let t=e.statusText||"";return Promise.reject(Error(`Could not fetch file: ${r} ${t}`.trim()))}let n=function(e){if(e&&e.headers&&"function"==typeof e.headers.get)return N(e.headers.get("Content-Range"),e.headers.get("Content-Length"))}(e);return Promise.resolve(e.arrayBuffer()).then(e=>({buffer:e,totalSize:n,status:r}))})}function M(e,t){return void 0===t||t===1/0?`bytes=${e}-`:`bytes=${e}-${t-1}`}function O(e,{start:t=0,end:r}={}){return new Promise((n,o)=>{var a;let s={};(t>0||void 0!==r&&r!==1/0)&&(s.headers={range:M(t,r)}),(a=e,/^https:\/\//.test(a)?__non_webpack_require__("https").get:__non_webpack_require__("http").get)(e,s,e=>{if(e.statusCode>=200&&e.statusCode<=299){let t=L(e),r=[];e.on("data",e=>r.push(i.Buffer.from(e))),e.on("error",e=>o(e)),e.on("end",()=>n({buffer:i.Buffer.concat(r),totalSize:t,status:e.statusCode}))}else 416===e.statusCode?(e.resume(),n({buffer:i.Buffer.alloc(0),totalSize:L(e),status:e.statusCode})):(o(Error(`Could not fetch file: ${e.statusCode} ${e.statusMessage}`)),e.resume())}).on("error",e=>o(e))})}function L(e){if(e&&e.headers)return N(e.headers["content-range"],e.headers["content-length"])}function N(e,t){if(e){let t=/\/(\d+|\*)$/.exec(e);if(t&&"*"!==t[1])return parseInt(t[1],10)}if(t){let e=parseInt(t,10);if(Number.isFinite(e))return e}}function F(e,{start:t=0,end:r,totalSize:n}={}){return new Promise((o,a)=>{let s=function(){try{return __non_webpack_require__("fs")}catch(e){return}}();s.open(e,(u,l)=>{if(u)return a(u);!function(e,t,r,n){if(void 0!==r)return n(null,r);e.stat(t,(e,t)=>n(e,e?void 0:t.size))}(s,e,n,(n,u)=>{if(n)return s.close(l,()=>a(n));let f=void 0===r||r===1/0||r>u?u:r,c=Math.min(Math.max(0,t),f),p=f-c,d=i.Buffer.alloc(p);if(0===p)return s.close(l,t=>D(e,t,d,u,o));s.read(l,{buffer:d,length:p,position:c},t=>{if(t)return s.close(l,()=>a(t));s.close(l,t=>D(e,t,d,u,o))})})})})}function D(e,t,r,n,i){t&&console.warn(`Could not close file ${e}:`,t),i({buffer:r,totalSize:n})}function _(e,{start:t=0,end:r}={}){return new Promise((n,i)=>{let o=new FileReader,a="number"==typeof e.size?e.size:void 0;if(o.onload=e=>n({buffer:e.target.result,totalSize:a}),o.onerror=()=>i(o.error),e&&"function"==typeof e.slice&&(t>0||void 0!==r&&r!==1/0)){let n=void 0===r||r===1/0?a:r;o.readAsArrayBuffer(e.slice(t,n))}else o.readAsArrayBuffer(e)})}function E(e){return e instanceof ArrayBuffer?new Uint8Array(e):void 0!==i.Buffer&&i.Buffer.isBuffer(e)||ArrayBuffer.isView(e)?new Uint8Array(e.buffer,e.byteOffset,e.byteLength):new Uint8Array(e)}let G='length: "auto" could not locate metadata in this file (no metadata blocks found after reading the file â e.g. plain TIFF, bare JPEG XL codestream, or a file with no recognizable metadata).';function j(e,t){if(200===t.status&&e.fetched>0){e.buffer=t.buffer,e.fetched=z(e.buffer),void 0!==t.totalSize&&(e.totalSize=t.totalSize);return}void 0!==t.totalSize&&void 0===e.totalSize&&(e.totalSize=t.totalSize),e.buffer=function(e,t){if(!e)return t;if(!t)return e;if(void 0!==i.Buffer&&i.Buffer.isBuffer(e)&&i.Buffer.isBuffer(t))return i.Buffer.concat([e,t]);let r=E(e),n=E(t),o=new Uint8Array(r.byteLength+n.byteLength);return o.set(r,0),o.set(n,r.byteLength),o.buffer}(e.buffer,t.buffer),e.fetched=z(e.buffer)}function B(e,t,r,n){var o,a;let s=e.metadataRange.end;return e.metadataRange.buffer=(o=t,a=s,!o||"number"!=typeof a||a<0?o:void 0!==i.Buffer&&i.Buffer.isBuffer(o)?i.Buffer.from(o.subarray(0,Math.min(a,o.length))):o instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&o instanceof SharedArrayBuffer?o.slice(0,Math.min(a,o.byteLength)):o),e.metadataRange.fetched=r,e.metadataRange.requests=n,e}function z(e){return e?"number"==typeof e.byteLength?e.byteLength:"number"==typeof e.length?e.length:0:0}function $(e){if(e.length>=8){let t=f(e.slice(0,8));if("ASCII\0\0\0"===t)return f(e.slice(8));if("JIS\0\0\0\0\0"===t)return"[JIS encoded text]";if("UNICODE\0"===t)return"[Unicode encoded text]";else if("\0\0\0\0\0\0\0\0"===t){let t=f(e.slice(8));return/[\x20-\x7e]/.test(t)?t:"[Undefined encoding]"}}return"Undefined"}function V(e){return e[0][0]/e[0][1]+e[1][0]/e[1][1]/60+e[2][0]/e[2][1]/3600}let W=function(e,t){if(18761===e.getUint16(t))return 18761;if(19789===e.getUint16(t))return 19789;throw Error("Illegal byte order value. Faulty image.")};function H(e,t,r){return t+r<=e.byteLength}function K(e,t,r){if(4===r)return e.getUint32(t);if(8===r)return console.warn("This file uses an 8-bit offset which is currently not supported by ExifReader. Contact the maintainer to get it fixed."),e.getUint32(t+4);return 0}function X(e,t){if(H(e,t,8))try{var r,n,i,o,a,l,f,c,p,d,m,g,h,y,b,v,x,S,w,A,P,C,I,U,T,R,k,M,O,L;let{length:N,contentOffset:F}=q(e,t);if(N<8)return;let D=e.getUint32(t+4);if(0x66747970===D){return r=e,n=F,i=N,{type:"ftyp",majorBrand:s(r,n,4),length:i}}if(0x69707270===D){return o=e,a=t,l=F,f=N,{type:"iprp",subBoxes:eo(o,l,f-(l-a)),length:f}}if(0x6970636f===D){return c=e,p=t,d=F,m=N,{type:"ipco",properties:eo(c,d,m-(d-p)),length:m}}if(0x636f6c72===D){return g=e,h=F,y=N,{type:"colr",icc:function(e,t){let r=s(e,t,4);if("prof"===r||"rICC"===r)return{offset:t+4,length:e.getUint32(t+4),chunkNumber:1,chunksTotal:1}}(g,h),length:y}}if(0x69646174===D){return b=F,v=N,{type:"idat",contentOffset:b,length:v}}if(!H(e,F,1))return;let _=e.getUint8(F);if(0x6d657461===D){return x=e,S=t,w=F+1,A=N,{type:"meta",subBoxes:eo(x,w+3,A-(w+3-S)),length:A}}if(0x696c6f63===D)return function(e,t,r,n){var i,o,a,s,u;let l,f,{offsets:c,sizes:p}=(i=t,o=r+3,l={item:{dataReferenceIndex:2,extentCount:2,extent:{}}},i<2?(l.itemCount=2,l.item.itemId=2):2===i&&(l.itemCount=4,l.item.itemId=4),1===i||2===i?l.item.constructionMethod=2:l.item.constructionMethod=0,(f={offsetSize:o,lengthSize:o,baseOffsetSize:o+1,indexSize:o+1}).itemCount=o+2,f.items=f.itemCount+l.itemCount,f.item={itemId:0},f.item.constructionMethod=f.item.itemId+l.item.itemId,f.item.dataReferenceIndex=f.item.constructionMethod+l.item.constructionMethod,{offsets:f,sizes:l}),d=e.getUint8(c.offsetSize)>>4;p.item.extent.extentOffset=d;let m=15&e.getUint8(c.lengthSize);p.item.extent.extentLength=m;let g=e.getUint8(c.baseOffsetSize)>>4;p.item.baseOffset=g;let h=function(e,t,r){if(1===r||2===r)return 15&e.getUint8(t)}(e,c.indexSize,t);p.item.extent.extentIndex=void 0!==h?h:0;let y=(a=e,s=c.itemCount,(u=t)<2?a.getUint16(s):2===u?a.getUint32(s):void 0);
1return{type:"iloc",items:function(e,t,r,n,i,o,a,s){if(void 0===s)return[];let u=[],l=r.items,f=n.item.extent.extentIndex+n.item.extent.extentOffset+n.item.extent.extentLength,c=n.item.itemId+n.item.constructionMethod+n.item.dataReferenceIndex+n.item.baseOffset+n.item.extentCount,p=0;for(let r=0;r<s&&H(e,l,c);r++){var d,m,g,h,y,b,v,x;let r={extents:[]};d=e,m=l,r.itemId=(g=t)<2?d.getUint16(m):2===g?d.getUint32(m):void 0,l+=n.item.itemId,r.constructionMethod=1===t||2===t?15&e.getUint16(l):void 0,l+=n.item.constructionMethod,r.dataReferenceIndex=e.getUint16(l),r.baseOffset=K(e,l+=n.item.dataReferenceIndex,n.item.baseOffset),l+=n.item.baseOffset,r.extentCount=e.getUint16(l),l+=n.item.extentCount;let s=(h=r.extentCount,y=f,b=l,v=e.byteLength,x=1048576-p,0===y?0:Math.max(0,Math.min(h,Math.floor((v-b)/y),x)));for(let u=0;u<s;u++){let s={};s.extentIndex=function(e,t,r,n){if((1===t||2===t)&&n>0)return K(e,r,n)}(e,t,l,a),s.extentOffset=K(e,l+=n.item.extent.extentIndex,i),s.extentLength=K(e,l+=n.item.extent.extentOffset,o),l+=n.item.extent.extentLength,r.extents.push(s)}p+=s,u.push(r)}return u}(e,t,c,p,d,m,h,y),length:n}}(e,_,F+1,N);if(0x69696e66===D){let r;return P=e,C=t,I=_,U=F+1,T=N,r=U+3+(0===I?2:4),{type:"iinf",itemInfos:eo(P,r,T-(r-C)),length:T}}if(0x696e6665===D){let r;return R=e,k=t,M=_,O=F+1,L=N,O+=3,r={type:"infe",length:L},(0===M||1===M)&&(r.itemId=R.getUint16(O),O+=2,r.itemProtectionIndex=R.getUint16(O),r.itemName=u(R,O+=2),O+=r.itemName.length+1),M>=2&&(2===M?(r.itemId=R.getUint16(O),O+=2):3===M&&(r.itemId=R.getUint32(O),O+=4),r.itemProtectionIndex=R.getUint16(O),O+=2,r.itemType=R.getUint32(O),r.itemName=u(R,O+=4),O+=r.itemName.length+1,0x6d696d65===r.itemType?(r.contentType=u(R,O),k+L>(O+=r.contentType.length+1)&&(r.contentEncoding=u(R,O),O+=r.contentEncoding.length+1)):0x75726920===r.itemType&&(r.itemUri=u(R,O),O+=r.itemUri.length+1)),r}return{type:void 0,length:N}}catch(e){return}}function J(e,t){if(!e)return!1;try{let r=X(e,0);return void 0!==r&&-1!==t.indexOf(r.majorBrand)}catch(e){return!1}}function q(e,t){let r=e.getUint32(t);if(0===r)return{length:e.byteLength-t,contentOffset:t+4+4};if(1===r){var n,i;if(!H(e,t,16))return{length:0,contentOffset:t+4+4};if(n=e,i=t,0===n.getUint32(i+8))return{length:e.getUint32(t+12),contentOffset:t+4+4+8}}return{length:r,contentOffset:t+4+4}}function Y(e,t){1;{let r={},n=function(e){let t=0;for(;t+4+4<=e.byteLength;){let r=X(e,t);if(void 0===r)break;if("meta"===r.type)return r;t+=r.length}}(e);if(!n)return{hasAppMarkers:!1};1;{let i=function(e,t,r){try{let n=t.subBoxes.find(e=>"iinf"===e.type).itemInfos.find(e=>0x45786966===e.itemType).itemId,i=en(t,n);et(i);let o=ee(t);if(Z(r,i,"exif",o),i.extents.length>1){let t=er(e,i,o);if(void 0===t)return;return{tiffHeaderOffset:ei(t,0),dataView:t}}let a=Q(i,i.extents[0],o);if(void 0===a)return;return{tiffHeaderOffset:ei(e,a)}}catch(e){return}}(e,n,t);void 0!==i&&(r.tiffHeaderOffset=i.tiffHeaderOffset,void 0!==i.dataView&&(r.exifDataView=i.dataView))}1;{let i=function(e,t,r){try{let n=t.subBoxes.find(e=>"iinf"===e.type).itemInfos.find(e=>0x6d696d65===e.itemType&&"application/rdf+xml"===e.contentType).itemId,i=en(t,n);et(i);let o=ee(t);if(Z(r,i,"xmp",o),i.extents.length>1){let t=er(e,i,o);if(void 0===t)return;return{chunks:[{dataOffset:0,length:t.byteLength}],dataView:t}}let a=i.extents[0],s=Q(i,a,o);if(void 0===s)return;return{chunks:[{dataOffset:s,length:a.extentLength}]}}catch(e){return}}(e,n,t);void 0!==i&&(r.xmpChunks=i.chunks,void 0!==i.dataView&&(r.xmpDataView=i.dataView))}return r.iccChunks=function(e,t){try{let r=e.subBoxes.find(e=>"iprp"===e.type).subBoxes.find(e=>"ipco"===e.type).properties.find(e=>"colr"===e.type).icc;if(r)return c(t,"icc",r.offset,r.offset+r.length),[r]}catch(e){}}(n,t),r.hasAppMarkers=void 0!==r.tiffHeaderOffset||void 0!==r.xmpChunks||void 0!==r.iccChunks,r}}function Z(e,t,r,n){if(e)for(let i=0;i<t.extents.length;i++){let o=t.extents[i],a=Q(t,o,n);void 0!==a&&c(e,r,a,a+o.extentLength)}}function Q(e,t,r){let n=e.constructionMethod;return void 0===n||0===n?e.baseOffset+t.extentOffset:1===n&&void 0!==r?r+e.baseOffset+t.extentOffset:void 0}function ee(e){let t=e.subBoxes.find(e=>"idat"===e.type);return t?t.contentOffset:void 0}function et(e){2===e.constructionMethod&&console.warn("This file uses iloc constructionMethod 2 (item_offset) which is currently not supported by ExifReader. Contact the maintainer to get it fixed.")}function er(e,t,r){let n=[],i=0;for(let o=0;o<t.extents.length;o++){let a=t.extents[o],s=Q(t,a,r);if(void 0===s||s+a.extentLength>e.byteLength||(n.push({start:s,length:a.extentLength}),(i+=a.extentLength)>e.byteLength))return}let o=new Uint8Array(i),a=0;for(let t=0;t<n.length;t++){let{start:r,length:i}=n[t];for(let t=0;t<i;t++)o[a+t]=e.getUint8(r+t);a+=i}return new DataView(o.buffer)}function en(e,t){return e.subBoxes.find(e=>"iloc"===e.type).items.find(e=>e.itemId===t)}function ei(e,t){return t+4+e.getUint32(t)}function eo(e,t,r){let n=[0x45786966,0x6d696d65],i=[],o=t;for(;o<t+r;){let t=X(e,o);if(void 0===t)break;void 0!==t.type&&(void 0===t.itemType||-1!==n.indexOf(t.itemType))&&i.push(t),o+=t.length}return i}let ea=function(e){var t;let r;return!!e&&e.byteLength>=4&&(r=18761===(t=e).getUint16(0),42===t.getUint16(2,r))},es=function(e,t){var r,n,i,o,a,u,l;let f,p,d,m,g,h,y,b,v,x,S=2,w=0,A=!1;for(;S+4+5<=e.byteLength;){let l;if(65498===e.getUint16(S)&&(A=!0),r=e,n=S,65472!==r.getUint16(n)){if(i=e,o=S,65474!==i.getUint16(o))if(function(e,t){let r=ep.length;return 65504===e.getUint16(t)&&s(e,t+4,r)===ep&&0===e.getUint8(t+4+r)}(e,S))f=e.getUint16(S+2),m=S+2,l="jfif";else if(function(e,t){let r=ed.length;return 65505===e.getUint16(t)&&s(e,t+4,r)===ed&&0===e.getUint8(t+4+r)}(e,S)){f=e.getUint16(S+2);let t=S+10;if(1==++w)x={appMarkerPosition:S,fieldLength:f,tiffHeaderOffset:t,score:void 0};else{void 0===x.score&&(x.score=eb(e,x.appMarkerPosition,x.fieldLength,x.tiffHeaderOffset));let r=eb(e,S,f,t);r>x.score&&(x={appMarkerPosition:S,fieldLength:f,tiffHeaderOffset:t,score:r})}g=x.tiffHeaderOffset,l="exif"}else if(function(e,t){return 65505===e.getUint16(t)&&s(e,t+4,em.length)===em}(e,S))y||(y=[]),f=e.getUint16(S+2),y.push({dataOffset:S+33,length:f-31}),l="xmp";else if(function(e,t){return 65505===e.getUint16(t)&&s(e,t+4,eg.length)===eg}(e,S))y||(y=[]),f=e.getUint16(S+2),y.push({dataOffset:S+79,length:f-77}),l="xmp";else if(function(e,t){let r=eh.length,n=ey.length;return 65517===e.getUint16(t)&&s(e,t+4,r)===eh&&0===e.getUint8(t+4+r)&&s(e,t+4+r+1,n)===ey}(e,S))f=e.getUint16(S+2),h=S+18,l="iptc";else if(function(e,t){let r=eu.length;return 65506===e.getUint16(t)&&s(e,t+4,r)===eu}(e,S)){f=e.getUint16(S+2);let t=S+18,r=f-16,n=e.getUint8(S+el),i=e.getUint8(S+ef);b||(b=[]),b.push({offset:t,length:r,chunkNumber:n,chunksTotal:i}),l="icc"}else if(function(e,t){let r=ec.length;return 65506===e.getUint16(t)&&s(e,t+4,r)===ec}(e,S))f=e.getUint16(S+2),v=S+8,l="mpf";else if(function(e,t){let r=e.getUint16(t);return r>=65504&&r<=65519||65534===r||65472===r||65474===r||65476===r||65499===r||65501===r||65498===r}(e,S))f=e.getUint16(S+2);else{if(a=e,u=S,65535===a.getUint16(u)){S++;continue}else break}else f=e.getUint16(S+2),d=S+2,l="file"}else f=e.getUint16(S+2),p=S+2,l="file";c(t,l,S,S+2+f),S+=2+f}return w>1&&(l=w,"u">typeof console&&"function"==typeof console.warn&&console.warn(`ExifReader: Found ${l} Exif segments (APP1). Will pick the best candidate segment.`)),t&&(!A&&S+2<=e.byteLength&&65498===e.getUint16(S)&&(A=!0),t.truncated=!A),{hasAppMarkers:S>2,fileDataOffset:p||d,jfifDataOffset:m,tiffHeaderOffset:g,iptcDataOffset:h,xmpChunks:y,iccChunks:b,mpfDataOffset:v}},eu="ICC_PROFILE\0",el=4+eu.length,ef=el+1,ec="MPF\0",ep="JFIF",ed="Exif",em="http://ns.adobe.com/xap/1.0/\0",eg="http://ns.adobe.com/xmp/extension/\0",eh="Photoshop 3.0",ey="8BIM";function eb(e,t,r,n){let i=function(e,t,r){try{if(t+8>r)return;let n=e.getUint16(t+0),i=18761===n;if(!i&&19789!==n||42!==e.getUint16(t+2,i))return;let o=e.getUint32(t+4,i),a=t+o;if(a+2>r)return;let s=e.getUint16(a,i),u=a+(2+12*s+4)<=r;return{ifdEntries:s,isValid:u&&s>0}}catch(e){return}}(e,n,t+2+r);if(!i)return 0;let o=Number.isInteger(i.ifdEntries)?i.ifdEntries:0;return 1e9*!!i.isValid+1e6*o+r}let ev=function(e,t,r){let n={hasAppMarkers:!1},i=ex.length,o=!1;for(;i+4+4<=e.byteLength;){let f,p=e.getUint32(i+0);if(r&&"IEND"===s(e,i+4,4)&&(o=!0),"IHDR"!==s(e,i+4,4)){var a,l;if(s(a=e,(l=i)+4,4)!==eP||s(a,l+eS,ew.length)!==ew)if(function(e,t,r){let n=s(e,t+4,4);return n===eA||n===eP||n===eC&&r}(e,i,t)){n.hasAppMarkers=!0;let t=s(e,i+4,4);n.pngTextChunks||(n.pngTextChunks=[]),n.pngTextChunks.push({length:p,type:t,offset:i+eS}),f="png"}else if("eXIf"===s(e,i+4,4))n.hasAppMarkers=!0,n.tiffHeaderOffset=i+eS,f="exif";else if(t&&"iCCP"===s(e,i+4,4)){let t=i+eS,r=function(e,t){let r=u(e,t);if(!((t+=r.length+1)+1>e.byteLength))return{profileName:r,compressionMethod:e.getUint8(t),compressedProfileOffset:t+=1}}(e,t);void 0!==r&&(n.hasAppMarkers=!0,n.iccChunks||(n.iccChunks=[]),n.iccChunks.push({offset:r.compressedProfileOffset,length:p-(r.compressedProfileOffset-t),chunkNumber:1,chunksTotal:1,profileName:r.profileName,compressionMethod:r.compressionMethod}),f="icc")}else[eI,eU].includes(s(e,i+4,4))&&(n.hasAppMarkers=!0,n.pngChunkOffsets||(n.pngChunkOffsets=[]),n.pngChunkOffsets.push(i+0),f="png");else{let t=function(e,t){t+=eS+ew.length+1+1;let r=0;for(;r<2&&t<e.byteLength;)0===e.getUint8(t)&&r++,t++;if(!(r<2))return t}(e,i);void 0!==t&&(n.hasAppMarkers=!0,n.xmpChunks=[{dataOffset:t,length:p-(t-(i+eS))}],f="xmp")}}else n.hasAppMarkers=!0,n.pngHeaderOffset=i+eS,f="file";let d=p+4+4+4;c(r,f,i,i+d),i+=d}return r&&(r.truncated=!o),n},ex="ÂPNG\r\n\x1a\n",eS=8,ew="XML:com.adobe.xmp\0",eA="tEXt",eP="iTXt",eC="zTXt",eI="pHYs",eU="tIME",eT=["heic","heix","hevc","hevx","heim","heis","hevm","hevs","mif1"],eR=["avif"],ek=function(e){try{return function(e){if(!e||e.byteLength<eO.length)return!1;for(let t=0;t<eO.length;t++)if(e.getUint8(t)!==eO[t])return!1;return!0}(e)||eN(e)}catch(e){return!1}},eM=function(e,t){let r,n,i,o,a,s=0;if(eN(e))return{hasAppMarkers:!0,tiffHeaderOffset:void 0,xmpChunks:void 0,brobExifChunk:void 0,brobXmpChunk:void 0,jxlCodestreamOffset:0};for(;s+8<=e.byteLength;){let u,{length:l,contentOffset:f}=q(e,s);if(l<8)break;let p=e.getUint32(s+4);
1if(0x45786966===p){try{r=ei(e,f)}catch(e){}u="exif"}if(0x786d6c20===p&&(n=[{dataOffset:f,length:l-(f-s)}],u="xmp"),0x6a786c63===p&&void 0===a&&(a=f),0x6a786c70===p&&void 0===a&&f+4<=e.byteLength&&0==(0x7fffffff&e.getUint32(f))&&(a=f+4),0x62726f62===p&&f+4<=e.byteLength){let t=e.getUint32(f),a=f+4,c=l-(a-s);0x45786966===t&&(u="exif",void 0!==r||i||(i={dataOffset:a,length:c})),0x786d6c20===t&&(u="xmp",n||o||(o={dataOffset:a,length:c}))}c(t,u,s,s+l),s+=l}return{hasAppMarkers:void 0!==r||void 0!==n||void 0!==i||void 0!==o||void 0!==a,tiffHeaderOffset:r,xmpChunks:n,brobExifChunk:i,brobXmpChunk:o,jxlCodestreamOffset:a}},eO=[0,0,0,12,74,88,76,32,13,10,135,10],eL=[255,10];function eN(e){return!!e&&!(e.byteLength<eL.length)&&e.getUint8(0)===eL[0]&&e.getUint8(1)===eL[1]}let eF=function(e){let t="RIFF",r="WEBP";return!!e&&s(e,0,t.length)===t&&s(e,8,r.length)===r},eD=function(e,t){let r,n,i,o,a="Exif\0\0",u=12,l=!1;for(;u+8<e.byteLength;){let f,p=s(e,u,4),d=e.getUint32(u+4,!0);"EXIF"===p?(l=!0,r=s(e,u+8,a.length)===a?u+8+a.length:u+8,f="exif"):"XMP "===p?(l=!0,n=[{dataOffset:u+8,length:d}],f="xmp"):"ICCP"===p?(l=!0,i=[{offset:u+8,length:d,chunkNumber:1,chunksTotal:1}],f="icc"):"VP8X"===p&&(l=!0,o=u+8,f="riff");let m=8+(d%2==0?d:d+1);c(t,f,u,u+m),u+=m}return{hasAppMarkers:l,tiffHeaderOffset:r,xmpChunks:n,iccChunks:i,vp8xChunkOffset:o}},e_=["GIF87a","GIF89a"],eE=function(e,t){let r=[];return r.push({dataOffset:0,length:e.byteLength}),c(t,"xmp",0,e.byteLength),t&&(t.truncated=!function(e){let t=s(e,0,e.byteLength);for(let e=0;e<ej.length;e++)if(-1!==t.indexOf(ej[e]))return!0;return!1}(e)),{xmpChunks:r}},eG="<?xpacket begin",ej=["<?xpacket end=","</x:xmpmeta>"],eB=function(e,t,r){var n,i,o,a;let u=r?[]:void 0;if(ea(e))return ez({hasAppMarkers:!0,tiffHeaderOffset:0},"tiff","TIFF",u);if((n=e)&&n.byteLength>=2&&65496===n.getUint16(0))return ez(es(e,u),"jpeg","JPEG",u);if((i=e)&&s(i,0,ex.length)===ex)return ez(ev(e,t,u),"png","PNG",u);if(J(e,eT))return ez(Y(e,u),"heic","HEIC",u);if(J(e,eR))return ez(Y(e,u),"avif","AVIF",u);if(ek(e))return ez(eM(e,u),"jxl","JPEG XL",u);if(eF(e))return ez(eD(e,u),"webp","WebP",u);if((o=e)&&e_.includes(s(o,0,6)))return ez((c(u,"gif",0,13),{gifHeaderOffset:0}),"gif","GIF",u);if((a=e)&&s(a,0,eG.length)===eG)return ez(eE(e,u),"xml","XML",u);throw Error("Invalid image format")};function ez(e,t,r,n){let i=d({},e,{fileType:{value:t,description:r}});return void 0!==n&&(i.metadataBlocks=n,i.metadataTruncated=!!n.truncated),i}let e$={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=>{if(49===e)return"Y";if(50===e)return"Cb";if(51===e)return"Cr";if(52===e)return"R";if(53===e)return"G";else if(54===e)return"B"}).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){if(0===e)return"Undefined";if(1===e)return"Manual";if(2===e)return"Normal program";if(3===e)return"Aperture priority";if(4===e)return"Shutter priority";else if(5===e)return"Creative program";else if(6===e)return"Action program";else if(7===e)return"Portrait mode";else if(8===e)return"Landscape mode";else if(9===e)return"Bulb";return"Unknown"},ExposureTime(e){if(e[0]/e[1]>.25){let 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=>{if(1===e)return"Daylight";if(2===e)return"Fluorescent";if(3===e)return"Tungsten (incandescent light)";if(4===e)return"Flash";if(9===e)return"Fine weather";else if(10===e)return"Cloudy weather";else if(11===e)return"Shade";else if(12===e)return"Daylight fluorescent (D 5700 â 7100K)";else if(13===e)return"Day white fluorescent (N 4600 â 5400K)";else if(14===e)return"Cool white fluorescent (W 3900 â 4500K)";else if(15===e)return"White fluorescent (WW 3200 â 3700K)";else if(17===e)return"Standard light A";else if(18===e)return"Standard light B";else if(19===e)return"Standard light C";else if(20===e)return"D55";else if(21===e)return"D65";else if(22===e)return"D75";else if(23===e)return"D50";else if(24===e)return"ISO studio tungsten";else if(255===e)return"Other light source";return"Unknown"},MeteringMode(e){if(1===e)return"Average";if(2===e)return"CenterWeightedAverage";if(3===e)return"Spot";if(4===e)return"MultiSpot";if(5===e)return"Pattern";else if(6===e)return"Partial";else if(255===e)return"Other";return"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=>
10===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){let 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])},eV={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",0xffffffff:"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:e$.XResolution},283:{name:"YResolution",description:e$.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:e$.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=>{let 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:eW},40092:{name:"XPComment",description:eW},40093:{name:"XPAuthor",description:eW},40094:{name:"XPKeywords",description:eW},40095:{name:"XPSubject",description:eW},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:e$.LightSource},50779:{name:"CalibrationIlluminant2",description:e$.LightSource},50781:"RawDataUniqueID",50827:"OriginalRawFileName",50828:"OriginalRawFileData",50831:"AsShotICCProfile",50832:"AsShotPreProfileMatrix",50833:"CurrentICCProfile",50834:"CurrentPreProfileMatrix",50879:"C
1olorimetricReference",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 eW(e){return new TextDecoder("utf-16").decode(new Uint8Array(e)).replace(/\u0000+$/,"")}let eH=d({},eV,{33434:{name:"ExposureTime",description:e$.ExposureTime},33437:{name:"FNumber",description:e$.FNumber},34850:{name:"ExposureProgram",description:e$.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=>f(e)},36867:"DateTimeOriginal",36868:"DateTimeDigitized",36873:"GooglePlusUploadCode",36880:"OffsetTime",36881:"OffsetTimeOriginal",36882:"OffsetTimeDigitized",37121:{name:"ComponentsConfiguration",description:e$.ComponentsConfiguration},37122:"CompressedBitsPerPixel",37377:{name:"ShutterSpeedValue",description:e$.ShutterSpeedValue},37378:{name:"ApertureValue",description:e$.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:e$.MeteringMode},37384:{name:"LightSource",description:e$.LightSource},37385:{name:"Flash",description:e=>{if(0===e)return"Flash did not fire";if(1===e)return"Flash fired";if(5===e)return"Strobe return light not detected";if(7===e)return"Strobe return light detected";if(9===e)return"Flash fired, compulsory flash mode";else if(13===e)return"Flash fired, compulsory flash mode, return light not detected";else if(15===e)return"Flash fired, compulsory flash mode, return light detected";else if(16===e)return"Flash did not fire, compulsory flash mode";else if(24===e)return"Flash did not fire, auto mode";else if(25===e)return"Flash fired, auto mode";else if(29===e)return"Flash fired, auto mode, return light not detected";else if(31===e)return"Flash fired, auto mode, return light detected";else if(32===e)return"No flash function";else if(65===e)return"Flash fired, red-eye reduction mode";else if(69===e)return"Flash fired, red-eye reduction mode, return light not detected";else if(71===e)return"Flash fired, red-eye reduction mode, return light detected";
1else if(73===e)return"Flash fired, compulsory flash mode, red-eye reduction mode";else if(77===e)return"Flash fired, compulsory flash mode, red-eye reduction mode, return light not detected";else if(79===e)return"Flash fired, compulsory flash mode, red-eye reduction mode, return light detected";else if(89===e)return"Flash fired, auto mode, red-eye reduction mode";else if(93===e)return"Flash fired, auto mode, return light not detected, red-eye reduction mode";else if(95===e)return"Flash fired, auto mode, return light detected, red-eye reduction mode";return"Unknown"}},37386:{name:"FocalLength",description:e$.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:$},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:e$.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:e$.FocalPlaneResolutionUnit},41492:{name:"SubjectLocation",description:([e,t])=>`X: ${e}, Y: ${t}`},41493:"ExposureIndex",41495:{name:"SensingMethod",description:e=>{if(1===e)return"Undefined";if(2===e)return"One-chip color area sensor";if(3===e)return"Two-chip color area sensor";if(4===e)return"Three-chip color area sensor";if(5===e)return"Color sequential area sensor";else if(7===e)return"Trilinear sensor";else if(8===e)return"Color sequential linear sensor";return"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:e$.CustomRendered},41986:{name:"ExposureMode",description:e$.ExposureMode},41987:{name:"WhiteBalance",description:e$.WhiteBalance},41988:{name:"DigitalZoomRatio",description:e=>0===e[0]?"Digital zoom was not used":""+e[0]/e[1]},41989:{name:"FocalLengthIn35mmFilm",description:e$.FocalLengthIn35mmFilm},41990:{name:"SceneCaptureType",description:e$.SceneCaptureType},41991:{name:"GainControl",description:e=>{if(0===e)return"None";if(1===e)return"Low gain up";if(2===e)return"High gain up";if(3===e)return"Low gain down";if(4===e)return"High gain down";return"Unknown"}},41992:{name:"Contrast",description:e$.Contrast},41993:{name:"Saturation",description:e$.Saturation},41994:{name:"Sharpness",description:e$.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=>{let t=parseFloat((e[0][0]/e[0][1]).toFixed(5)),r=parseFloat((e[1][0]/e[1][1]).toFixed(5)),n=`${t}-${r} mm`;if(0===e[3][1])return`${n} f/?`;let i=1/(e[2][1]/e[2][1]/(e[3][0]/e[3][1]));return`${n} f/${parseFloat(i.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"}),eK="exif",eX="interoperability",eJ="canon",eq="pentax",eY={"0th":eH,"1st":eV,[eK]:eH,gps:{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=>{let t=e.join("");return"N"===t?"North latitude":"S"===t?"South latitude":"Unknown"}},2:{name:"GPSLatitude",description:V},3:{name:"GPSLongitudeRef",description:e=>{let t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}},4:{name:"GPSLongitude",description:V},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])=>{let r=e/t;return/^\d(\.|$)/.test(`${r}`)?`0${r}`:r}).join(":")},8:"GPSSatellites",9:{name:"GPSStatus",description:e=>{let t=e.join("");return"A"===t?"Measurement in progress":"V"===t?"Measurement Interoperability":"Unknown"}},10:{name:"GPSMeasureMode",description:e=>{let t=e.join("");return"2"===t?"2-dimensional measurement":"3"===t?"3-dimensional measurement":"Unknown"}},11:"GPSDOP",12:{name:"GPSSpeedRef",description:e=>{let 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=>{let t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},15:"GPSTrack",16:{name:"GPSImgDirectionRef",description:e=>{let t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},17:"GPSImgDirection",18:"GPSMapDatum",19:{name:"GPSDestLatitudeRef",description:e=>{let 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=>{let t=e.join("");return"E"===t?"East longitude":"W"===t?"West longitude":"Unknown"}}
1,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=>{let t=e.join("");return"T"===t?"True direction":"M"===t?"Magnetic direction":"Unknown"}},24:"GPSDestBearing",25:{name:"GPSDestDistanceRef",description:e=>{let t=e.join("");return"K"===t?"Kilometers":"M"===t?"Miles":"N"===t?"Knots":"Unknown"}},26:"GPSDestDistance",27:{name:"GPSProcessingMethod",description:$},28:{name:"GPSAreaInformation",description:$},29:"GPSDateStamp",30:{name:"GPSDifferential",description:e=>0===e?"Measurement without differential correction":1===e?"Differential correction applied":"Unknown"},31:"GPSHPositioningError"},[eX]:{1:"InteroperabilityIndex",2:{name:"InteroperabilityVersion",description:e=>f(e)},4096:"RelatedImageFileFormat",4097:"RelatedImageWidth",4098:"RelatedImageHeight"},mpf:{45056:{name:"MPFVersion",description:e=>f(e)},45057:"NumberOfImages",45058:"MPEntry",45059:"ImageUIDList",45060:"TotalFrames"},[eJ]:{1:{name:"CameraSettings",description:e=>e},4:{name:"ShotInfo",description:e=>e},149:"LensModel"},[eq]:{0:{name:"PentaxVersion",description:e=>e.join(".")},5:"PentaxModelID",555:"LevelInfo"}},eZ={1:1,2:1,3:2,4:4,5:8,7:1,9:4,10:8,13:4},eQ={BYTE:1,ASCII:2,SHORT:3,LONG:4,RATIONAL:5,UNDEFINED:7,SLONG:9,SRATIONAL:10,IFD:13},e0=e5,e1=function(e,t,r){return e.getUint16(t,18761===r)},e2=e8,e3=function(e){if(void 0===eQ[e])throw Error("No such type found.");return eZ[eQ[e]]};function e5(e,t){return e.getUint8(t)}function e8(e,t,r){return e.getUint32(t,18761===r)}function e6(e,t,r){return e.getInt32(t,18761===r)}let e4={exif:!0,iptc:!0,photoshop:!0,mpf:!0,makerNotes:!0},e7={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},e9="Exif IFD Pointer",te="GPS Info IFD Pointer",tt="Interoperability IFD Pointer",tr={thumbnail:["JPEGInterchangeFormat","JPEGInterchangeFormatLength"],iptc:["IPTC-NAA"],xmp:["ApplicationNotes"],icc:["ICC_Profile"],photoshop:["ImageSourceData","PhotoshopSettings"],makerNotes:["MakerNote","Make"],gps:["GPSLatitude","GPSLatitudeRef","GPSLongitude","GPSLongitudeRef","GPSAltitude","GPSAltitudeRef"]},tn=["Image Width","Image Height"],ti=["FocalLength","FocalPlaneXResolution","FocalPlaneYResolution","FocalPlaneResolutionUnit","FocalLengthIn35mmFilm"];function to(e){return!0===e||Array.isArray(e)&&e.length>0}function ta(){return{isActive:!1,shouldReturnGroup:e,shouldParseGroup:e,shouldReturnTag:e,shouldParseTag:e};function e(){return!0}}let ts=ta();function tu(e,t){if(!e||!Object.prototype.hasOwnProperty.call(e,t))return!1;let r=e[t];return!0===r||Array.isArray(r)&&r.length>0}function tl({groupKey:e,includeValue:t,excludeValue:r,extraIncludeNames:n}){let i=!!e4[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++)!function(e,t){if("number"==typeof t&&e.includeIds){e.includeIds[String(t)]=!0;return}"string"==typeof t&&(e.includeNames[t.toLowerCase()]=!0)}(o,t[e]);for(let e in n)o.includeNames[e.toLowerCase()]=!0}else if(n&&Object.keys(n).length>0)for(let e in o.includeNames=Object.create(null),n)o.includeNames[e.toLowerCase()]=!0;if(!0===r)return o.excludeAll=!0,o;if(Array.isArray(r)){o.excludeNames=Object.create(null),i&&(o.excludeIds=Object.create(null));for(let e=0;e<r.length;e++)!function(e,t){if("number"==typeof t&&e.excludeIds){e.excludeIds[String(t)]=!0;return}"string"==typeof t&&(e.excludeNames[t.toLowerCase()]=!0)}(o,r[e])}return o}function tf(e,t,r){var n,i,o;return!e.excludeAll&&!!(e.includeAll||!e.includeNames&&!e.includeIds||(n=e,i=t,void 0!==(o=r)&&n.includeIds&&n.includeIds[String(o)]||i&&n.includeNames&&n.includeNames[String(i).toLowerCase()]))&&!function(e,t,r){return void 0!==r&&!!e.excludeIds&&!!e.excludeIds[String(r)]||!!t&&!!e.excludeNames&&!!e.excludeNames[String(t).toLowerCase()]}(e,t,r)}let tc={1:e0,2:function(e,t){return e.getUint8(t)},3:e1,4:e2,5:function(e,t,r){return[e8(e,t,r),e8(e,t+4,r)]},7:function(e,t){return e5(e,t)},9:e6,10:function(e,t,r){return[e6(e,t,r),e6(e,t+4,r)]},13:function(e,t,r){return e8(e,t,r)}};function tp(e,t,r){let n=t+4;if(!(n+e3("LONG")>e.byteLength))return t+e2(e,n,r)}function td(e,t,r,n,i,o,a=!1,s=ts,u="exif"){var l,f,c;let p=e3("SHORT"),d={},m=(l=e,f=n,c=i,f+e3("SHORT")<=l.byteLength?e1(l,f,c):0);n+=p;for(let l=0;l<m&&!(n+12>e.byteLength);l++){let l=function(e,t,r,n,i,o=!1,a=ts,s="exif"){var u,l,f,c,p,d,m;let g,h,y=e3("SHORT"),b=y+e3("SHORT"),v=b+e3("LONG"),x=e1(e,n,i),S=e1(e,n+y,i),w=e2(e,n+b,i);if(void 0===eZ[S]||!o&&void 0===eY[t][x])return;let A=function(e,t){if(void 0!==eY[e][t]){if("string"==typeof eY[e][t])return eY[e][t];if(eY[e][t].name)return eY[e][t].name}return`undefined-${t}`}(t,x);if(!a.shouldParseTag(s,A,x))return;(u=S,l=w,eZ[u]*l<=e3("LONG"))?g=tm(e,h=n+v,S,w,i):(h=e2(e,n+v,i),f=e,c=r,p=h,d=S,m=w,g=c+p+eZ[d]*m<=f.byteLength?tm(e,r+h,S,w,i,33723===x):"<faulty value>"),S===eQ.ASCII&&(g=function(e){try{return e.map(e=>decodeURIComponent(escape(e)))}catch(t){return e}}(g=function(e){let t=[],r=0;for(let n=0;n<e.length;n++){if("\0"===e[n]){r++;continue}void 0===t[r]&&(t[r]=""),t[r]+=e[n]}return t}(g)));let P=g;if(void 0!==eY[t][x])if(void 0!==eY[t][x].name&&void 0!==eY[t][x].description)try{P=eY[t][x].description(g)}catch(e){P=tg(g)}else P=S===eQ.RATIONAL||S===eQ.SRATIONAL?""+g[0]/g[1]:tg(g);return{id:x,name:A,value:g,description:P,tagType:S,__offset:h}}(e,t,r,n,i,o,s,u);void 0!==l&&(d[l.name]={id:l.id,value:l.value,description:l.description},a&&(d[l.name].computed=function(e,t){if(e===eQ.ASCII)return Array.isArray(t)&&1===t.length?t[0]:t;if(e===eQ.RATIONAL||e===eQ.SRATIONAL){var r;if(Array.isArray(r=t)&&2===r.length&&"number"==typeof r[0]&&"number"==typeof r[1])return th(t);if(Array.isArray(t))return t.map(e=>th(e))}return t}(l.tagType,l.value)),("MakerNote"===l.name||t===eq&&"LevelInfo"===l.name)&&(d[l.name].__offset=l.__offset)),n+=12}if(n<e.byteLength-e3("LONG")){let u=e2(e,n,i);0!==u&&"0th"===t&&s.shouldParseGroup("thumbnail")&&(d.Thumbnail=td(e,"1st",r,r+u,i,o,a,s,"thumbnail"))}return d}function tm(e,t,r,n,i,o=!1){let a=[];o&&(n*=eZ[r],r=eQ.BYTE);for(let o=0;o<n;o++)a.push(tc[r](e,t,i)),t+=eZ[r];return r===eQ.ASCII?a=a.map(e=>String.fromCharCode(e)):1===a.length&&(a=a[0]),a}function tg(e){return e instanceof Array?e.join(", "):e}function th(e){if(!Array.isArray(e)||2!==e.length)return e;let t=e[0],r=e[1];return Number.isFinite(t)&&Number.isFinite(r)?0===r?null:t/r:e}let ty=[{pointerKey:"Exif IFD Pointer",ifdType:eK},{pointerKey:"GPS Info IFD Pointer",ifdType:"gps"},{pointerKey:"Interoperability IFD Pointer",ifdType:eX}],tb=function(e,t,r,n=!1,i){var o,a,s,u,l,f;let c,p=W(e,t),m=(o=e,a=t,s=p,u=r,l=n,f=i,void 0===(c=tp(o,a,s))?{}:td(o,"0th",a,c,s,u,l,f,"exif"));for(let o=0;o<ty.length;o++)m=function(e,t,r,n,i,o,a,s){let u=t[e.pointerKey];return void 0===u?t:d(t,td(r,e.ifdType,n,n+u.value,i,o,a,s,"exif"))}(ty[o],m,e,t,p,r,n,i);return{tags:m,byteOrder:p}},tv=function(e,t,r,n=!1,i){try{let o=W(e,t),a=tp(e,t,o);if(void 0===a)return{};let s=td(e,"mpf",t,a,o,r,n,i,"mpf");return function(e,t,r,n){if(!r.MPEntry)return r;let i=[];for(let o=0;o<Math.ceil(r.MPEntry.value.length/16);o++){i[o]={};let a=tx(r.MPEntry.value,16*o,e3("LONG"),n);i[o].ImageFlags=function(e){let t=[e>>31&1,e>>30&1,e>>29&1],r=[];return t[0]&&r.push("Dependent Parent Image"),t[1]&&r.push("Dependent Child Image"),t[2]&&r.push("Representative Image"),{value:t,description:r.join(", ")||"None"}}(a),i[o].ImageFormat=function(e){let t=e>>24&7;return{value:t,description:0===t?"JPEG":"Unknown"}}(a),i[o].ImageType=function(e){let t=0xffffff&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:"Undef
1ined"})[t]||"Unknown"}}(a);let s=tx(r.MPEntry.value,16*o+4,e3("LONG"),n);i[o].ImageSize={value:s,description:""+s};let u=function(e,t,r,n){var i;return(i=e,0===i)?0:tx(t.value,16*e+8,e3("LONG"),r)+n}(o,r.MPEntry,n,t);i[o].ImageOffset={value:u,description:""+u};let l=tx(r.MPEntry.value,16*o+12,e3("SHORT"),n);i[o].DependentImage1EntryNumber={value:l,description:""+l};let f=tx(r.MPEntry.value,16*o+14,e3("SHORT"),n);i[o].DependentImage2EntryNumber={value:f,description:""+f},i[o].image=e.buffer.slice(u,u+s),m(i[o],"base64",function(){return g(this.image)})}return r.Images=i,r}(e,t,s,o)}catch(e){return{}}};function tx(e,t,r,n){if(18761===n){let n=0;for(let i=0;i<r;i++)n+=e[t+i]<<8*i;return n}let i=0;for(let n=0;n<r;n++)i+=e[t+n]<<8*(r-1-n);return i}let tS=function(e,t){let r=e1(e,t),n=function(e,t,r){if(8>r)return;let n=e0(e,t+7);return{value:n,description:""+n}}(e,t,r);return{"Bits Per Sample":function(e,t,r){if(3>r)return;let n=e0(e,t+2);return{value:n,description:""+n}}(e,t,r),"Image Height":function(e,t,r){if(5>r)return;let n=e1(e,t+3);return{value:n,description:`${n}px`}}(e,t,r),"Image Width":function(e,t,r){if(7>r)return;let n=e1(e,t+5);return{value:n,description:`${n}px`}}(e,t,r),"Color Components":n,Subsampling:n&&function(e,t,r,n){var i;let o,a;if(8+3*r>n)return;let s=[];for(let n=0;n<r;n++){let r=t+8+3*n;s.push([e0(e,r),e0(e,r+1),e0(e,r+2)])}return{value:s,description:s.length>1?(o={1:"Y",2:"Cb",3:"Cr",4:"I",5:"Q"},s.map(e=>o[e[0]]).join("")+(a={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)"},0===(i=s).length||void 0===i[0][1]||void 0===a[i[0][1]]?"":a[i[0][1]])):""}}(e,t,n.value,r)}},tw=function(e,t){let r={};try{var n;let i,o,a=(n=e,i=t+2,o=0,{readBits(e){let t=0;for(let r=0;r<e;r++){if(i>=n.byteLength)throw Error("Unexpected end of data");t|=(n.getUint8(i)>>o&1)<<r,++o>=8&&(o=0,i++)}return t}}),{height:s,width:u}=function(e){let t,r;if(e.readBits(1)){t=(e.readBits(5)+1)*8;let n=e.readBits(3);r=0===n?(e.readBits(5)+1)*8:Math.ceil(t*tP[n])}else{t=tC(e);let n=e.readBits(3);r=0===n?tC(e):Math.ceil(t*tP[n])}return{height:t,width:r}}(a);r["Image Height"]={value:s,description:`${s}px`},r["Image Width"]={value:u,description:`${u}px`}}catch(e){}return r},tA=[9,13,18,30],tP=[0,1,1.2,4/3,1.5,16/9,5/4,2];function tC(e){let t=e.readBits(2);return 1+e.readBits(tA[t])}let tI=function(e,t){let r=e1(e,t),n=function(e,t,r){if(15>r)return;let n=e0(e,t+14);return{value:n,description:`${n}px`}}(e,t,r),i=function(e,t,r){if(16>r)return;let n=e0(e,t+15);return{value:n,description:`${n}px`}}(e,t,r),o={"JFIF Version":function(e,t,r){if(9>r)return;let n=e0(e,t+7),i=e0(e,t+7+1);return{value:256*n+i,description:n+"."+i}}(e,t,r),"Resolution Unit":function(e,t,r){var n;if(10>r)return;let i=e0(e,t+9);return{value:i,description:0===(n=i)?"None":1===n?"inches":2===n?"cm":"Unknown"}}(e,t,r),XResolution:function(e,t,r){if(12>r)return;let n=e1(e,t+10);return{value:n,description:""+n}}(e,t,r),YResolution:function(e,t,r){if(14>r)return;let n=e1(e,t+12);return{value:n,description:""+n}}(e,t,r),"JFIF Thumbnail Width":n,"JFIF Thumbnail Height":i};if(void 0!==n&&void 0!==i){let a=function(e,t,r,n){if(0!==r&&!(16+r>n))return{value:e.buffer.slice(t+16,t+16+r),description:"<24-bit RGB pixel data>"}}(e,t,3*n.value*i.value,r);a&&(o["JFIF Thumbnail"]=a)}for(let e in o)void 0===o[e]&&delete o[e];return o},tU={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:tT},336:{name:"Time Sent",description:tR},346:{name:"Coded Character Set",description:tk,encoding_name:tk},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"===f(e)?"Additional Language":"Unknown"},522:"Urgency",524:{name:"Subject Reference",repeatable:!0,description:e=>{let t=f(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=>{let t=f(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:tT},572:{name:"Time Created",description:tR},574:{name:"Digital Creation Date",description:tT},575:{name:"Digital Creation Time",description:tR},577:"Originating Program",582:"Program Version",587:{name:"Object Cycle",description:e=>{let t=f(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:{n
1ame:"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=>{let t=f(e);return"P"===t?"Portrait":"L"===t?"Landscape":"S"===t?"Square":"Unknown"}},647:"Language Identifier",662:{name:"Audio Type",description:e=>{let t=f(e),r=t.charAt(0),n=t.charAt(1),i="";return("1"===r?i+="Mono":"2"===r&&(i+="Stereo"),"A"===n?i+=", actuality":"C"===n?i+=", question and answer session":"M"===n?i+=", music, transmitted by itself":"Q"===n?i+=", response to a question":"R"===n?i+=", raw sound":"S"===n?i+=", scener":"V"===n?i+=", voicer":"W"===n&&(i+=", wrap"),""!==i)?i:t}},663:{name:"Audio Sampling Rate",description:e=>parseInt(f(e),10)+" Hz"},664:{name:"Audio Sampling Resolution",description:e=>{let t=parseInt(f(e),10);return t+(1===t?" bit":" bits")}},665:{name:"Audio Duration",description:e=>{let t=f(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){let t=(e[0]<<8)+e[1];if(0===t)return"No ObjectData";if(1===t)return"IPTC-NAA Digital Newsphoto Parameter Record";if(2===t)return"IPTC7901 Recommended Message Format";else if(3===t)return"Tagged Image File Format (Adobe/Aldus Image data)";else if(4===t)return"Illustrator (Adobe Graphics data)";else if(5===t)return"AppleSingle (Apple Computer Inc)";else if(6===t)return"NAA 89-3 (ANPA 1312)";else if(7===t)return"MacBinary II";else if(8===t)return"IPTC Unstructured Character Oriented File Format (UCOFF)";else if(9===t)return"United Press International ANPA 1312 variant";else if(10===t)return"United Press International Down-Load Message";else if(11===t)return"JPEG File Interchange (JFIF)";else if(12===t)return"Photo-CD Image-Pac (Eastman Kodak)";else if(13===t)return"Microsoft Bit Mapped Graphics File [*.BMP]";else if(14===t)return"Digital Audio File [*.WAV] (Microsoft & Creative Labs)";else if(15===t)return"Audio plus Moving Video [*.AVI] (Microsoft)";else if(16===t)return"PC DOS/Windows Executable Files [*.COM][*.EXE]";else if(17===t)return"Compressed Binary File [*.ZIP] (PKWare Inc)";else if(18===t)return"Audio Interchange File Format AIFF (Apple Computer Inc)";else if(19===t)return"RIFF Wave (Microsoft Corporation)";else if(20===t)return"Freehand (Macromedia/Aldus)";else if(21===t)return'Hypertext Markup Language "HTML" (The Internet Society)';else if(22===t)return"MPEG 2 Audio Layer 2 (Musicom), ISO/IEC";else if(23===t)return"MPEG 2 Audio Layer 3, ISO/IEC";else if(24===t)return"Portable Document File (*.PDF) Adobe";else if(25===t)return"News Industry Text Format (NITF)";else if(26===t)return"Tape Archive (*.TAR)";else if(27===t)return"Tidningarnas Telegrambyrå NITF version (TTNITF DTD)";else if(28===t)return"Ritzaus Bureau NITF version (RBNITF DTD)";else if(29===t)return"Corel Draw [*.CDR]";return`Unknown format ${t}`}return f(e)}},713:{name:"ObjectData Preview File Format Version",description:(e,t)=>{let r={"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"}},n=f(e);if(t["ObjectData Preview File Format"]){let e=f(t["ObjectData Preview File Format"].value);if(r[e]&&r[e][n])return r[e][n]}return n}},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 r=0;r<e.length;r++)t=(t<<8)+e[r];return t.toString()}},1882:{name:"ObjectData Size Announced",description:e=>{let t=0;for(let r=0;r<e.length;r++)t=(t<<8)+e[r];return t.toString()}},1887:{name:"Maximum ObjectData Size",description:e=>{let t=0;for(let r=0;r<e.length;r++)t=(t<<8)+e[r];return t.toString()}}};function tT(e){let t=f(e);return t.length>=8?t.substr(0,4)+"-"+t.substr(4,2)+"-"+t.substr(6,2):t}function tR(e){let t=f(e),r=t;return t.length>=6&&(r=t.substr(0,2)+":"+t.substr(2,2)+":"+t.substr(4,2),11===t.length&&(r+=t.substr(6,1)+t.substr(7,2)+":"+t.substr(9,2))),r}function tk(e){let t=f(e);
1if("\x1b%G"===t)return"UTF-8";if("\x1b%5"===t)return"Windows-1252";if("\x1b%/G"===t)return"UTF-8 Level 1";if("\x1b%/H"===t)return"UTF-8 Level 2";if("\x1b%/I"===t)return"UTF-8 Level 3";else if("\x1b/A"===t)return"ISO-8859-1";else if("\x1b/B"===t)return"ISO-8859-2";else if("\x1b/C"===t)return"ISO-8859-3";else if("\x1b/D"===t)return"ISO-8859-4";else if("\x1b/@"===t)return"ISO-8859-5";else if("\x1b/G"===t)return"ISO-8859-6";else if("\x1b/F"===t)return"ISO-8859-7";else if("\x1b/H"===t)return"ISO-8859-8";return"Unknown"}let tM=function(){if("u">typeof TextDecoder)return TextDecoder},tO={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},tL=function(e,t){if("string"==typeof t){var r=t;try{return decodeURIComponent(escape(r))}catch(e){return r}}let n=tM();if(void 0!==n&&void 0!==e)try{return new n(e).decode(t instanceof DataView?t.buffer:Uint8Array.from(t))}catch(e){}let i=t.map(e=>String.fromCharCode(e)).join("");try{return decodeURIComponent(escape(i))}catch(e){return function(e){let t=e instanceof DataView,r=t?e.byteLength:e.length,n=t?t=>e.getUint8(t):t=>e[t],i=Array(r);for(let e=0;e<r;e++){let t=n(e),r=tO[t];i[e]=void 0!==r?r:t}return String.fromCharCode.apply(null,i)}(t)}},tN=function(e,t,r,n=ts){try{if(Array.isArray(e))return tF(new DataView(Uint8Array.from(e).buffer),{size:e.length},0,r,n);let{naaBlock:i,dataOffset:o}=function(e,t){for(;t+12<=e.byteLength;){var r,n;let i=function(e,t){if(0x3842494d!==e.getUint32(t,!1))throw Error("Not an IPTC resource block.");let r=e.getUint8(t+4+2),n=(r%2==0?r+1:r)+1;return{headerSize:6+n+4,type:e.getUint16(t+4),size:e.getUint32(t+4+2+n)}}(e,t);if(r=i,1028===r.type)return{naaBlock:i,dataOffset:t+i.headerSize};t+=i.headerSize+i.size+(n=i,+(n.size%2!=0))}throw Error("No IPTC NAA resource block.")}(e,t);return tF(e,i,o,r,n)}catch(e){return{}}};function tF(e,t,r,n,i){let o,a={},s=r+t.size;for(;r<s&&r<e.byteLength;){let{tag:t,tagSize:s}=function(e,t,r={},n,i=!1,o=ts){var a,s,u,l;if(a=e,s=t,28!==a.getUint8(s))return{tag:null,tagSize:0};let f=e.getUint16(t+1),c=e.getUint16(t+3);if(!i&&!tU[f]||!o.shouldParseTag("iptc",function(e,t){let r=tU[e];return r?"string"==typeof r?r:r&&"string"==typeof r.name?r.name:void 0:t?`undefined-${e}`:void 0}(f,i),f))return{tag:void 0,tagSize:c};let p=function(e,t,r){let n=[];for(let i=0;i<r;i++)n.push(e.getUint8(t+i));return n}(e,t+5,c),d={id:f,name:function(e,t,r){return e?"string"==typeof e?e:"function"==typeof e.name?e.name(r):e.name:`undefined-${t}`}(tU[f],f,p),value:p,description:function(e,t,r,n){var i,o,a;if((i=e)&&void 0!==i.description)try{return e.description(t,r)}catch(e){}return(o=e,a=t,o&&a instanceof Array)?tL(n,t):t}(tU[f],p,r,n)};return tU[u=f]&&tU[u].repeatable&&(d.repeatable=!0),tU[l=f]&&void 0!==tU[l].encoding_name&&(d.encoding=tU[f].encoding_name(p)),{tag:d,tagSize:c}}(e,r,a,o,n,i);if(null===t)break;t&&("encoding"in t&&(o=t.encoding),void 0===a[t.name]||void 0===t.repeatable?a[t.name]={id:t.id,value:t.value,description:t.description}:(a[t.name]instanceof Array||(a[t.name]=[{id:a[t.name].id,value:a[t.name].value,description:a[t.name].description}]),a[t.name].push({id:t.id,value:t.value,description:t.description}))),r+=5+s}return a}let tD={"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=>e$.ResolutionUnit(parseInt(e,10)),"tiff:XResolution":e=>t_(e$.XResolution,e),"tiff:YResolution":e=>t_(e$.YResolution,e),"exif:ApertureValue":e=>t_(e$.ApertureValue,e),"exif:GPSLatitude":tG,"exif:GPSLongitude":tG,"exif:FNumber":e=>t_(e$.FNumber,e),"exif:FocalLength":e=>t_(e$.FocalLength,e),"exif:FocalPlaneResolutionUnit":e=>e$.FocalPlaneResolutionUnit(parseInt(e,10)),"exif:ColorSpace":e=>{var t;return e$.ColorSpace("0x"===(t=e).substring(0,2)?parseInt(t.substring(2),16):parseInt(t,10))},"exif:ComponentsConfiguration"(e,t){if(/^\d, \d, \d, \d$/.test(t)){let e=t.split(", ").map(e=>e.charCodeAt(0));return e$.ComponentsConfiguration(e)}return t},"exif:Contrast":e=>e$.Contrast(parseInt(e,10)),"exif:CustomRendered":e=>e$.CustomRendered(parseInt(e,10)),"exif:ExposureMode":e=>e$.ExposureMode(parseInt(e,10)),"exif:ExposureProgram":e=>e$.ExposureProgram(parseInt(e,10)),"exif:ExposureTime":e=>tE(e)?e$.ExposureTime(e.split("/").map(e=>parseInt(e,10))):e,"exif:MeteringMode":e=>e$.MeteringMode(parseInt(e,10)),"exif:Saturation":e=>e$.Saturation(parseInt(e,10)),"exif:SceneCaptureType":e=>e$.SceneCaptureType(parseInt(e,10)),"exif:Sharpness":e=>e$.Sharpness(parseInt(e,10)),"exif:ShutterSpeedValue":e=>t_(e$.ShutterSpeedValue,e),"exif:WhiteBalance":e=>e$.WhiteBalance(parseInt(e,10))};function t_(e,t){return tE(t)?e(t.split("/")):t}function tE(e){return/^-?\d+\/-?\d+$/.test(e)}function tG(e){let[t,r]=e.split(",");if(void 0!==t&&void 0!==r){let e=parseFloat(t),n=parseFloat(r),i=r.charAt(r.length-1);if(!Number.isNaN(e)&&!Number.isNaN(n))return""+(e+n/60)+i}return e}let tj=function(e){if(e)return e;if("u">typeof DOMParser)return new DOMParser;try{let{DOMParser:e,onErrorStopParsing:t}=__non_webpack_require__("@xmldom/xmldom");return new e({onError:t})}catch(e){return}},tB={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/",
1stEvt:"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/"},tz=function(e,t,r){let n={};if("string"==typeof e)return tW(n,e,r),n;let[i,o]=function(e,t){if(0===t.length)return[];let r=[tV(e,t.slice(0,1))];return t.length>1&&r.push(tV(e,t.slice(1))),r}(e,t),a=tW(n,i,r);if(o){let i=tW(n,o,r);a||i||(delete n._raw,tW(n,tV(e,t),r))}return n};class t$ extends Error{constructor(e){super(e),this.name="ParseError"}}function tV(e,t){let r=new Uint8Array(t.reduce((e,t)=>e+t.length,0)),n=0;for(let i=0;i<t.length;i++){let o=t[i],a=e.buffer.slice(o.dataOffset,o.dataOffset+o.length);r.set(new Uint8Array(a),n),n+=o.length}return new DataView(r.buffer)}function tW(e,t,r){try{let{doc:n,raw:i}=function(e,t){let r=tj(t);if(!r)throw console.warn("Warning: DOMParser is not available. It is needed to be able to parse XMP tags."),Error();let n="string"==typeof e?e:s(e,0,e.byteLength);return{doc:function e(t,r,n=!1){try{let e=t.parseFromString(r,"application/xml"),n=e.getElementsByTagName("parsererror");if(n.length>0)throw new t$(n[0].textContent);return e}catch(i){if("ParseError"===i.name&&function(e){let 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 r=0;r<t.length;r++)if(new RegExp(t[r]).test(e.message))return!0;return!1}(i)&&!n)return e(t,function(e){var t,r,n;let i,o=e.match(/<([A-Za-z_][A-Za-z0-9._-]*)([^>]*)>/);if(!o)return e;let a=o[1],s=function(e){let t,r=[],n=/xmlns:([\w-]+)=["'][^"']+["']/g;for(;null!==(t=n.exec(e));)-1===r.indexOf(t[1])&&r.push(t[1]);return r}(e),u=(function(e){let t,r=[],n=/\b([A-Za-z_][A-Za-z0-9._-]*):[A-Za-z_][A-Za-z0-9._-]*\b/g;for(;null!==(t=n.exec(e));){let e=t[1];"xmlns"!==e&&"xml"!==e&&-1===r.indexOf(e)&&r.push(e)}return r})(e).filter(e=>-1===s.indexOf(e));return 0===u.length?e:(t=e,r=a,n=function(e){let t=[];for(let r=0;r<e.length;r++){let n=e[r],i=tB[n]||"http://fallback.namespace/"+n;t.push(" xmlns:"+n+'="'+i+'"')}return t.join("")}(u),i=RegExp("<"+r+"([^>]*)>"),t.replace(i,"<"+r+"$1"+n+">"))}(r),!0);throw i}}(r,n.replace(/^.+(<\?xpacket begin)/,"$1").replace(/(<\?xpacket end=".*"\?>).+$/,"$1")),raw:n}}(t,r);e._raw=(e._raw||"")+i;let o=function e(t){for(let r=0;r<t.childNodes.length;r++){if("x:xmpmeta"===t.childNodes[r].tagName)return e(t.childNodes[r]);if("rdf:RDF"===t.childNodes[r].tagName)return t.childNodes[r]}throw Error()}(n);return d(e,tH(function e(t,r=!1){var n;let i,o=function(e){let t=[];for(let r=0;r<e.childNodes.length;r++)t.push(e.childNodes[r]);return t}(t);if(1===(n=o).length&&"#text"===n[0].nodeName)return r?{}:o[0].nodeValue;return i={},o.forEach(t=>{var r,n;if((r=t).nodeName&&"#text"!==r.nodeName){let r={attributes:function(e){let t={};for(let r=0;r<e.attributes.length;r++)t[e.attributes[r].nodeName]=decodeURIComponent(escape(e.attributes[r].value));return t}(n=t),value:e(n)};void 0!==i[t.nodeName]?(Array.isArray(i[t.nodeName])||(i[t.nodeName]=[i[t.nodeName]]),i[t.nodeName].push(r)):i[t.nodeName]=r}}),i}(o,!0))),!0}catch(e){return!1}}function tH(e){let t={};if("string"==typeof e)return e;for(let r in e){let n=e[r];Array.isArray(n)||(n=[n]),n.forEach(e=>{d(t,tK(e.attributes)),"object"==typeof e.value&&d(t,tY(e.value))})}return t}function tK(e){let t={};for(let n in e)try{var r;r=n,"rdf:parseType"===r||tX(r)||(t[tJ(n)]={value:e[n],attributes:{},description:tq(e[n],n)})}catch(e){}return t}function tX(e){return"xmlns"===e.split(":")[0]}function tJ(e){return/^MicrosoftPhoto(_\d+_)?:Rating$/i.test(e)?"RatingPercent":e.split(":")[1]}function tq(e,t){if(Array.isArray(e)){let r=e.map(e=>void 0!==e.value?tq(e.value):tq(e)).join(", ");return t&&"function"==typeof tD[t]?tD[t](e,r):r}if("object"==typeof e){var r,n=e;let t=[];for(let e in n){t.push(`${"CiAdrCity"===(r=e)?"CreatorCity":"CiAdrCtry"===r?"CreatorCountry":"CiAdrExtadr"===r?"CreatorAddress":"CiAdrPcode"===r?"CreatorPostalCode":"CiAdrRegion"===r?"CreatorRegion":"CiEmailWork"===r?"CreatorWorkEmail":"CiTelWork"===r?"CreatorWorkPhone":"CiUrlWork"===r?"CreatorWorkUrl":r}: ${tq(n[e].value)}`)}return t.join("; ")}
1try{if(t&&"function"==typeof tD[t])return tD[t](e);return decodeURIComponent(escape(e))}catch(t){return e}}function tY(e){let t={};for(let r in e)try{tX(r)||(t[tJ(r)]=function(e,t){var r,n,i,o,a;return(r=e,Array.isArray(r))?(n=e,i=t,t6(n[n.length-1],i)):(o=e,"Resource"===o.attributes["rdf:parseType"]&&"string"==typeof o.value&&""===o.value.trim())?{value:"",attributes:{},description:""}:tZ(e)?tQ(e,t):t1(e)?t2(e,t):t3(e)?t5(e,t):(a=e,void 0!==t8(a.value))?function(e,t){let r=t8(e.value).value["rdf:li"],n=t0(e),i=[];return void 0===r?r=[]:Array.isArray(r)||(r=[r]),r.forEach(e=>{var t;i.push((t=e,tZ(t)?tQ(t):t1(t)?t2(t).value:t3(t)?t5(t).value:t6(t)))}),{value:i,attributes:n,description:tq(i,t)}}(e,t):t6(e,t)}(e[r],r))}catch(e){}return t}function tZ(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 tQ(e,t){var r;let n=t0(e);void 0!==e.value["rdf:Description"]&&(e=e.value["rdf:Description"]),d(n,t0(e),function(e){let t={};for(let r in e.value)"rdf:value"===r||tX(r)||(t[tJ(r)]=e.value[r].value);return t}(e));let i=t4((r=e).value["rdf:value"])||r.value["rdf:value"].value;return{value:i,attributes:n,description:tq(i,t)}}function t0(e){let t={};for(let r in e.attributes)"rdf:parseType"===r||"rdf:resource"===r||tX(r)||(t[tJ(r)]=e.attributes[r]);return t}function t1(e){return"Resource"===e.attributes["rdf:parseType"]||void 0!==e.value["rdf:Description"]&&void 0===e.value["rdf:Description"].value["rdf:value"]}function t2(e,t){let r={value:{},attributes:{}};return void 0!==e.value["rdf:Description"]&&(d(r.value,tK(e.value["rdf:Description"].attributes)),d(r.attributes,t0(e)),e=e.value["rdf:Description"]),d(r.value,tY(e.value)),r.description=tq(r.value,t),r}function t3(e){return 0===Object.keys(e.value).length&&void 0===e.attributes["xml:lang"]&&void 0===e.attributes["rdf:resource"]}function t5(e,t){let r=tK(e.attributes);return{value:r,attributes:{},description:tq(r,t)}}function t8(e){return e["rdf:Bag"]||e["rdf:Seq"]||e["rdf:Alt"]}function t6(e,t){let r=t4(e)||tH(e.value);return{value:r,attributes:t0(e),description:tq(r,t)}}function t4(e){return e.attributes&&e.attributes["rdf:resource"]}let t7={2e3:{name:"PathInformation",description:function(e){let t={},r=[];for(let n=0;n<e.byteLength;n+=26){let i=e1(e,n);t9[i]&&(t[i]||(t[i]=t9[i].description),r.push({type:i,path:t9[i].path(e,n+2)}))}return JSON.stringify({types:t,paths:r})}},2999:{name:"ClippingPathName",description(e){let[,t]=l(e,0);return t}}},t9={0:{description:"Closed subpath length",path:(e,t)=>[e1(e,t)]},1:{description:"Closed subpath Bezier knot, linked",path:re},2:{description:"Closed subpath Bezier knot, unlinked",path:re},3:{description:"Open subpath length",path:(e,t)=>[e1(e,t)]},4:{description:"Open subpath Bezier knot, linked",path:re},5:{description:"Open subpath Bezier knot, unlinked",path:re},6:{description:"Path fill rule",path:()=>[]},8:{description:"Initial fill rule",path:(e,t)=>[e1(e,t)]},7:{description:"Clipboard",path:function(e,t){return[[rt(e,t,8),rt(e,t+4,8),rt(e,t+8,8),rt(e,t+12,8)],rt(e,t+16,8)]}}};function re(e,t){let r=[];for(let n=0;n<24;n+=8)r.push(function(e,t){let r=rt(e,t,8);return[rt(e,t+4,8),r]}(e,t+n));return r}function rt(e,t,r){var n,i;let o=e2(e,t),a=o&parseInt(y("1",32-r),2);return(o>>>31==0?1:-1)*(parseInt((i=((0x7f000000&o)>>>32-r).toString(2)+"."+(y("0",32-r-(n=a.toString(2)).length)+n)).replace(".",""),2)/Math.pow(2,(i.split(".")[1]||"").length))}let rr=function(e,t,r=ts){let n=a(new Uint8Array(e).buffer),i={},o=0;for(;o<e.length;){let e=s(n,o,ri),p=e1(n,o+=ri),{tagName:d,tagNameSize:m}=function(e,t){let[r,n]=l(e,t);return{tagName:n,tagNameSize:1+r+ +(r%2==0)}}(n,o+=2),g=e2(n,o+=m);if(o+=4,e===rn){var u,f,c;let e=(u=p,f=d,c=t,f||(t7[u]&&t7[u].name?t7[u].name:c?`undefined-${u}`:void 0));if(!r.shouldParseTag("photoshop",e,p)){o+=g+g%2;continue}let l=a(n.buffer,o,g),m={id:p,value:s(l,0,g)};
1if(t7[p]){try{m.description=t7[p].description(l)}catch(e){m.description="<no description formatter>"}i[d||t7[p].name]=m}else t&&(i[`undefined-${p}`]=m)}o+=g+g%2}return i},rn="8BIM",ri=rn.length,ro={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"}},ra={4:{name:"Preferred CMM type",value:(e,t)=>s(e,t,4),description:e=>null!==e?ru(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)=>s(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)=>s(e,t,4)},20:{name:"Connection Space",value:(e,t)=>s(e,t,4)},24:{name:"ICC Profile Date",value:(e,t)=>{var r,n;return(r=e,n=t,new Date(Date.UTC(r.getUint16(n),r.getUint16(n+2)-1,r.getUint16(n+4),r.getUint16(n+6),r.getUint16(n+8),r.getUint16(n+10)))).toISOString()}},36:{name:"ICC Signature",value:(e,t)=>rs(e.buffer.slice(t,t+4))},40:{name:"Primary Platform",value:(e,t)=>s(e,t,4),description:e=>ru(e)},48:{name:"Device Manufacturer",value:(e,t)=>s(e,t,4),description:e=>ru(e)},52:{name:"Device Model Number",value:(e,t)=>s(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)=>s(e,t,4)}};function rs(e){return String.fromCharCode.apply(null,new Uint8Array(e))}function ru(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}}let rl=function(e,t,r,n){var i,o,a;return r&&t[0].compressionMethod!==b?(i=e,o=t,a=n,0!==o[0].compressionMethod?{}:x(new DataView(i.buffer.slice(o[0].offset,o[0].offset+o[0].length)),o[0].compressionMethod,"utf-8","dataview",a).then(rf).catch(()=>({}))):function(e,t){try{var r;let n=t.reduce((e,t)=>e+t.length,0),i=new Uint8Array(n),o=0,a=(r=e,Array.isArray(r)?new DataView(Uint8Array.from(r).buffer).buffer:r.buffer);for(let e=1;e<=t.length;e++){let r=t.find(t=>t.chunkNumber===e);if(!r)throw Error(`ICC chunk ${e} not found`);let n=a.slice(r.offset,r.offset+r.length),s=new Uint8Array(n);i.set(s,o),o+=s.length}return rf(new DataView(i.buffer))}catch(e){return{}}}(e,t)};function rf(e){let t=e.buffer,r=e.getUint32();if(e.byteLength!==r)throw Error("ICC profile length not matching");if(e.byteLength<84)throw Error("ICC profile too short");let n={},i=Object.keys(ra);for(let t=0;t<i.length;t++){let r=i[t],o=ra[r],a=o.value(e,parseInt(r,10)),s=a;o.description&&(s=o.description(a)),n[o.name]={value:a,description:s}}if("acsp"!==rs(t.slice(36,40)))throw Error("ICC profile: missing signature");if(e.byteLength<132)return n;let o=e.getUint32(128),a=132,u=e.byteLength;for(let r=0;r<o;r++){var l;if(l=a,e.byteLength<l+12)break;let r=s(e,a,4),i=e.getUint32(a+4),o=e.getUint32(a+8);if(i>e.byteLength)break;let c=s(e,i,4);if("desc"===c){let a=e.getUint32(i+8);if(a>o)return n;rc(n,r,rs(t.slice(i+12,i+a+11)))}else if("mluc"===c){let t=e.getUint32(i+8),a=e.getUint32(i+12);if(a<12||t>1e3||t*a>e.byteLength-i-16)return n;let l=Math.min(o,e.byteLength-i),c=i+16,p=[];for(let r=0;r<t;r++){let t=s(e,c+0,2),r=s(e,c+2,2),n=e.getUint32(c+4),o=e.getUint32(c+8),d=Math.min(n,Math.max(0,l-o),u);u-=d;let m=function(e,t,r){let n=[];for(let i=0;i+2<=r&&t+i+2<=e.byteLength;i+=2)n.push(e.getUint16(t+i));return 0===n[n.length-1]&&n.pop(),f(n)}(e,i+o,d);p.push({languageCode:t,countryCode:r,text:m}),c+=a}if(1===t)rc(n,r,p[0].text);else{let e={};for(let t=0;t<p.length;t++)e[`${p[t].languageCode}-${p[t].countryCode}`]=p[t].text;rc(n,r,e)}}else"text"===c?rc(n,r,rs(t.slice(i+8,i+o-7))):"sig "===c&&rc(n,r,rs(t.slice(i+8,i+12)));a+=12}return n}function rc(e,t,r){ro[t]?e[ro[t].name]={value:r,description:r}:e[t]={value:r,description:r}}let rp=function(e,t,r,n,i,o=!1,a){var s,u;let l,f=td(e,eJ,t,t+r,n,i,o,a,"makerNotes");return f.ShotInfo&&(f=d({},f,(s=f.ShotInfo.value,l={},void 0!==s[27]&&(l.AutoRotate={value:s[27],description:0===(u=s[27])?"None":1===u?"Rotate 90 CW":2===u?"Rotate 180":3===u?"Rotate 270 CW":"Unknown"}),l)),delete f.ShotInfo),f.CameraSettings&&(f=d({},f,function(e){let t={};if(!Array.isArray(e))return t;let r=e[22];return Number.isFinite(r)&&(t.LensType={value:r,description:`${r}`}),t}(f.CameraSettings.value)),delete f.CameraSettings),f},rd=78420,rm=1,rg=3,rh=5,ry=function(e,t,r,n,i=!1,o){try{var a;let s=W(e,t+r+8),u=t+r,l=td(e,eq,u,u+10,s,n,i,o,"makerNotes");return(a=l).PentaxModelID&&a.PentaxModelID.value===rd&&a.LevelInfo&&(l=d({},l,function(e,t,r){var n,i,o;let a={};if(t+7>e.byteLength)return a;let s=e.getInt8(t+rm);a.CameraOrientation={value:s,description:(n=s,0===n?"Horizontal (normal)":1===n?"Rotate 270 CW":2===n?"Rotate 180":3===n?"Rotate 90 CW":4===n?"Upwards":5===n?"Downwards":"Unknown")};let u=e.getInt16(t+rg,18761===r);a.RollAngle={value:u,description:(i=u,""+-.5*i)};let l=e.getInt16(t+rh,18761===r);return a.PitchAngle={value:l,description:(o=l,""+-.5*o)},a}(e,u+l.LevelInfo.__offset,s)),delete l.LevelInfo),l}catch(e){return{}}},rb=function(e,t){let r={};for(let n=0;n<rS.length;n++)r[rS[n].name]=function(e,t,r){if(t+r.offset+r.size>e.byteLength)return;let n=r.read(e,t+r.offset);return{value:n,description:r.description(n)}}(e,t,rS[n]);return r},rv={0:"Grayscale",2:"RGB",3:"Palette",4:"Grayscale with Alpha",6:"RGB with Alpha"},rx={0:"Noninterlaced",1:"Adam7 Interlace"},rS=[{name:"Image Width",offset:0,size:4,read:e2,description:e=>`${e}px`},{name:"Image Height",offset:4,size:4,read:e2,description:e=>`${e}px`},{name:"Bit Depth",offset:8,size:1,read:e0,description:e=>`${e}`},{name:"Color Type",offset:9,size:1,read:e0,description:e=>rv[e]||"Unknown"},{name:"Compression",offset:10,size:1,read:e0,description:e=>0===e?"Deflate/Inflate":"Unknown"},{name:"Filter",offset:11,size:1,read:e0,description:e=>0===e?"Adaptive":"Unknown"},{name:"Interlace",offset:12,size:1,read:e0,description:e=>rx[e]||"Unknown"}],rw=function(e,t,r,n,i=!1,o=ts,a){let s={},u=[];for(let l=0;l<t.length;l++){let{offset:f,length:c,type:p}=t[l],d=function(e,t,r,n,i,o){var a;let s,u=[],l=[],f=[],c=rA,p=b;
1for(let i=0;i<r&&t+i<e.byteLength;i++){if(c===rP){p=function({type:e,dataView:t,offset:r}){if(e===eP){if(1===t.getUint8(r))return t.getUint8(r+1)}else if(e===eC)return t.getUint8(r);return b}({type:n,dataView:e,offset:t+i}),n===eP&&(i+=1),c=rT(n,c);continue}if(c===rU){s=new DataView(e.buffer.slice(t+i,t+r));break}let o=e.getUint8(t+i);0===o?c=rT(n,c):c===rA?u.push(o):c===rC?l.push(o):c===rI&&f.push(o)}if(p!==b&&!i)return{};let d=x(s,p,(a=n)===eA||a===eC?"latin1":"utf-8","string",o);return d instanceof Promise?d.then(e=>rR(e,n,l,u)).catch(()=>rR("<text using unknown compression>".split(""),n,l,u)):rR(d,n,l,u)}(e,f,c,p,r,a);if(d instanceof Promise)u.push(d.then(({name:e,value:t,description:r})=>{try{if(rk(e,t)){if(!o.shouldParseGroup("exif"))return{};return{__exif:tb(rO(t),6,n,i,o).tags}}if(rM(e,t)){if(!o.shouldParseGroup("iptc"))return{};return{__iptc:tN(rO(t),0,n,o)}}if(e&&!rk(e,t)&&!rM(e,t)){if(!o.shouldParseGroup("png"))return{};return{[e]:{value:t,description:r}}}}catch(e){}return{}}));else{let{name:e,value:t,description:r}=d;e&&o.shouldParseGroup("png")&&(s[e]={value:t,description:r})}}return{readTags:s,readTagsPromise:u.length>0?Promise.all(u):void 0}},rA="STATE_KEYWORD",rP="STATE_COMPRESSION",rC="STATE_LANG",rI="STATE_TRANSLATED_KEYWORD",rU="STATE_TEXT";function rT(e,t){return t===rA&&[eP,eC].includes(e)?rP:t===rP?e===eP?rC:rU:t===rC?rI:rU}function rR(e,t,r,n){var i;let o=(i=e)instanceof DataView?s(i,0,i.byteLength):i;return{name:function(e,t,r){let n=f(r);if(e===eA||0===t.length)return n;let i=f(t);return`${n} (${i})`}(t,r,n),value:o,description:t===eP?tL("UTF-8",e):o}}function rk(e,t){return"raw profile type exif"===e.toLowerCase()&&"exif"===t.substring(1,5)}function rM(e,t){return"raw profile type iptc"===e.toLowerCase()&&"iptc"===t.substring(1,5)}function rO(e){var t=e.match(/\n(exif|iptc)\n\s*\d+\n([\s\S]*)$/)[2].replace(/\n/g,"");let r=new DataView(new ArrayBuffer(t.length/2));for(let e=0;e<t.length;e+=2)r.setUint8(e/2,parseInt(t.substring(e,e+2),16));return r}let rL=function(e,t){let r={};for(let n=0;n<t.length;n++){let i=e2(e,t[n]+0),o=s(e,t[n]+4,4);o===eI?(r["Pixels Per Unit X"]=function(e,t,r){if(!rN(e,t,r,0,4))return;let n=e2(e,t+eS+0);return{value:n,description:""+n}}(e,t[n],i),r["Pixels Per Unit Y"]=function(e,t,r){if(!rN(e,t,r,4,4))return;let n=e2(e,t+eS+4);return{value:n,description:""+n}}(e,t[n],i),r["Pixel Units"]=function(e,t,r){if(!rN(e,t,r,8,1))return;let n=e0(e,t+eS+8);return{value:n,description:1===n?"meters":"Unknown"}}(e,t[n],i)):o===eU&&(r["Modify Date"]=function(e,t,r){if(!rN(e,t,r,0,7))return;let n=e1(e,t+eS),i=e0(e,t+eS+2),o=e0(e,t+eS+3),a=e0(e,t+eS+4),s=e0(e,t+eS+5),u=e0(e,t+eS+6);return{value:[n,i,o,a,s,u],description:`${rF(n,4)}-${rF(i,2)}-${rF(o,2)} ${rF(a,2)}:${rF(s,2)}:${rF(u,2)}`}}(e,t[n],i))}return r};function rN(e,t,r,n,i){return n+i<=r&&t+eS+n+i<=e.byteLength}function rF(e,t){return`${"0".repeat(t-(""+e).length)}${e}`}let rD=function(e,t){let r,n,i={};if(t+10>e.byteLength)return i;let o=e0(e,t);return i.Alpha={value:+!!(r=16&o),description:r?"Yes":"No"},i.Animation={value:+!!(n=2&o),description:n?"Yes":"No"},i.ImageWidth=r_(e,t+4),i.ImageHeight=r_(e,t+7),i};function r_(e,t){let r=e0(e,t)+256*e0(e,t+1)+65536*e0(e,t+2)+1;return{value:r,description:r+"px"}}let rE=function(e){let t={};for(let r=0;r<rj.length;r++)t[rj[r].name]=function(e,t){if(t.offset+t.size>e.byteLength)return;let r=t.getValue(e,t.offset);return{value:r,description:t.description(r)}}(e,rj[r]);return t},rG=e=>`${e} ${1===e?"bit":"bits"}`,rj=[{name:"GIF Version",offset:3,size:3,getValue:(e,t)=>s(e,t,3),description:e=>e},{name:"Image Width",offset:6,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:"Image Height",offset:8,size:2,getValue:(e,t)=>e.getUint16(t,!0),description:e=>`${e}px`},{name:"Global Color Map",offset:10,size:1,getValue:(e,t)=>(128&e.getUint8(t))>>>7,description:e=>1===e?"Yes":"No"},{name:"Bits Per Pixel",offset:10,size:1,getValue:(e,t)=>(7&e.getUint8(t))+1,description:rG},{name:"Color Resolution Depth",offset:10,size:1,getValue:(e,t)=>((112&e.getUint8(t))>>>4)+1,description:rG}],rB=[6,7,99],rz={get:function(e,t,r){var n;if((n=t)&&(void 0===n.Compression||rB.includes(n.Compression.value))&&n.JPEGInterchangeFormat&&n.JPEGInterchangeFormat.value&&n.JPEGInterchangeFormatLength&&n.JPEGInterchangeFormatLength.value){t.type="image/jpeg";let n=r+t.JPEGInterchangeFormat.value;t.image=e.buffer.slice(n,n+t.JPEGInterchangeFormatLength.value),m(t,"base64",function(){return g(this.image)})}return t}},r$={get:function(e,t){let r={},n=!1,i=rV(e,"exif","FocalLength",t),o=rV(e,"exif","FocalPlaneXResolution",t),a=rV(e,"exif","FocalPlaneYResolution",t),s=rV(e,"exif","FocalPlaneResolutionUnit",t),u=rV(e,"file","Image Width",t),l=rV(e,"file","Image Height",t),f=rV(e,"exif","FocalLengthIn35mmFilm",t)||function(e,t,r,n,i,o){if(e&&t&&r&&n&&i&&o)try{let a;switch(r){case 2:a=25.4;break;case 3:a=10;break;case 4:a=1;break;default:return}let s=e[0]/e[1]*a,u=t[0]/t[1]*a,l=Math.sqrt((n/s)**2+(i/u)**2);return o[0]/o[1]*(43.27/l)}catch(e){}}(o,a,s,u,l,i);f&&(r.FocalLength35efl={value:f,description:e$.FocalLengthIn35mmFilm(f)},n=!0);let c=function(e,t){if(e&&t)try{let r=t/(e[0]/e[1]);return{value:r,description:r.toFixed(1)}}catch(e){}}(i,f);c&&(r.ScaleFactorTo35mmEquivalent=c,n=!0);let p=function(e){if(e)try{let t=2*Math.atan(36/(2*e))*(180/Math.PI);return{value:t,description:t.toFixed(1)+" deg"}}catch(e){}}(f);if(p&&(r.FieldOfView=p,n=!0),n)return r}};function rV(e,t,r,n){return n&&e[t]&&e[t][r]?e[t][r].value:!n&&e[r]?e[r].value:void 0}function rW({mergeSteps:e,deferredResults:t,parsedGroups:r,expanded:n,tagFilter:i,dataView:o,tiffHeaderOffset:a,exifDataView:s,fileType:u,pngTextChunks:l,pngTextIsAsync:f,thumbnailIfdTags:c,deps:p}){let d={};for(let l=0;l<e.length;l++)d=function({step:e,deferredResults:t,parsedGroups:r,expanded:n,tagFilter:i,dataView:o,tiffHeaderOffset:a,exifDataView:s,fileType:u,thumbnailIfdTags:l,tags:f,deps:c}){if("mergeGroupAssign"===e.type){let t=c.filterTagsForReturn(e.groupKey,e.parsedTags,i);return rH(f,e.groupKey,t,n,c)}if("mergeGroupMerge"===e.type){var p,d,m,g,h;let t=c.filterTagsForReturn(e.groupKey,e.parsedTags,i);return p=f,d=e.groupKey,m=t,g=n,h=c,g?(p[d]?p[d]=h.objectAssign({},p[d],m):p[d]=m,p):h.objectAssign({},p,m)}if("mergeXmpGroupAssign"===e.type)return rK(f,c.filterTagsForReturn("xmp",e.parsedTags,i),n,c);if("mergeIccDeferred"===e.type){let o=t[e.deferredKey],a=c.filterTagsForParse("icc",o,i);return(r.icc=a,i.shouldReturnGroup("icc"))?rH(f,"icc",c.filterTagsForReturn("icc",a,i),n,c):f}if("mergeBrobExifDeferred"===e.type){let o=t[e.deferredKey];if(!o||0===Object.keys(o).length)return f;let a=c.filterTagsForParse("exif",o,i);return(r.exif=r.exif?c.objectAssign({},r.exif,a):a,i.shouldReturnGroup("exif"))?rH(f,"exif",c.filterTagsForReturn("exif",a,i),n,c):f}if("mergeBrobXmpDeferred"===e.type){let o=t[e.deferredKey];if(!o||0===Object.keys(o).length)return f;let a=c.filterTagsForParse("xmp",o,i);return(r.xmp=a,i.shouldReturnGroup("xmp"))?rK(f,c.filterTagsForReturn("xmp",a,i),n,c):f}if("mergePngFile"===e.type){let t=c.filterTagsForReturn("png",e.parsedTags,i);return i.shouldReturnGroup("png")?n?(f.png=f.png?c.objectAssign({},f.png,t):t,f.pngFile=t,f):c.objectAssign({},f,t):f}if("mergePngChunk"===e.type){let t=c.filterTagsForReturn("png",e.parsedTags,i);return i.shouldReturnGroup("png")?n?(f.png=f.png?c.objectAssign({},f.png,t):t,f):c.objectAssign({},f,t):f}if("processPngTextReadTags"===e.type)return rX({readTags:e.readTags,parsedGroups:r,expanded:n,tagFilter:i,tags:f,deps:c});if("processPngTextReadTagsDeferredList"===e.type){let o=t[e.deferredKey]||[];for(let e=0;e<o.length;e++)f=rX({readTags:o[e],parsedGroups:r,expanded:n,tagFilter:i,tags:f,deps:c});return f}if("gps"===e.type){if(n&&i.shouldReturnGroup("gps")&&r.exif){let e=c.getGpsGroupFromExifTags(r.exif);if(e){let t=c.filterTagsForReturn("gps",e,i);f.gps=t}}return f}
1if("composite"===e.type){if(!i.shouldReturnGroup("composite"))return f;let e=f,t=n;i.isActive&&(e={exif:r.exif,file:r.file},t=!0);let o=c.Composite.get(e,t);return o?rH(f,"composite",c.filterTagsForReturn("composite",o,i),n,c):f}if("thumbnail"===e.type){if(!i.shouldReturnGroup("thumbnail")||!i.shouldReturnTag("thumbnail","Thumbnail"))return delete f.Thumbnail,f;if(!l)return f;let e=l?c.filterTagsForParse("thumbnail",l,i):void 0;e&&(r.thumbnail=e);let t=c.Thumbnail.get(s||o,e,a);return t?f.Thumbnail=t:delete f.Thumbnail,f}if("metadataRange"===e.type){if(!n)return f;let t=function(e,t,r,n){let i=(e||[]).slice();if(n&&n.mpf&&Array.isArray(n.mpf.Images))for(let e=0;e<n.mpf.Images.length;e++){let t=n.mpf.Images[e];if(!t||!t.ImageOffset||!t.ImageSize)continue;let r=t.ImageOffset.value,o=t.ImageSize.value;"number"!=typeof r||r<=0||"number"!=typeof o||o<=0||i.push({type:"mpfImage",start:r,end:r+o})}if(0===i.length)return;i.sort((e,t)=>e.start-t.start);let o=i[0].start,a=i[0].end;for(let e=1;e<i.length;e++)i[e].end>a&&(a=i[e].end);let s=r&&"number"==typeof r.byteLength?r.byteLength:0,u=!t&&a<=s;return{start:o,end:a,complete:u,blocks:i}}(e.metadataBlocks,e.metadataTruncated,o,r);return t&&(f.metadataRange=t),f}return"fileType"===e.type&&u&&i.shouldReturnGroup("file")&&i.shouldReturnTag("file","FileType")&&(n?(f.file||(f.file={}),f.file.FileType=u):f.FileType=u),f}({step:e[l],deferredResults:t,parsedGroups:r,expanded:n,tagFilter:i,dataView:o,tiffHeaderOffset:a,exifDataView:s,fileType:u,thumbnailIfdTags:c,tags:d,deps:p});return n&&f&&i.shouldReturnGroup("png")&&d.png&&(d.pngText=p.objectAssign({},d.png)),n&&i.shouldReturnGroup("png")&&p.hasPngTextData(l)&&d.png&&!d.pngText&&(d.pngText=p.objectAssign({},d.png)),d}function rH(e,t,r,n,i){return n?(e[t]=r,e):i.objectAssign({},e,r)}function rK(e,t,r,n){if(r)return e.xmp=t,e;let i=n.objectAssign({},t);return delete i._raw,n.objectAssign({},e,i)}function rX({readTags:e,parsedGroups:t,expanded:r,tagFilter:n,tags:i,deps:o}){let a=e.__exif,s=e.__iptc;if(delete e.__exif,delete e.__iptc,a){let e=o.filterTagsForParse("exif",a,n);if(t.exif=t.exif?o.objectAssign({},t.exif,e):e,n.shouldReturnGroup("exif")){let t=o.filterTagsForReturn("exif",e,n);r?i.exif=i.exif?o.objectAssign({},i.exif,t):t:i=o.objectAssign({},i,t)}}if(s){let e=o.filterTagsForParse("iptc",s,n);if(t.iptc=t.iptc?o.objectAssign({},t.iptc,e):e,n.shouldReturnGroup("iptc")){let t=o.filterTagsForReturn("iptc",e,n);r?i.iptc=i.iptc?o.objectAssign({},i.iptc,t):t:i=o.objectAssign({},i,t)}}if(n.shouldReturnGroup("png")){let a=o.filterTagsForParse("png",e,n),s=o.filterTagsForReturn("png",a,n);t.pngText=a,r?(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 rJ(e){this.name="MetadataMissingError",this.message=e||"No Exif data",this.stack=Error().stack}rJ.prototype=Error();let rq=rJ,rY=function(e,t={}){if("auto"===t.length){if(!0!==t.expanded||!0!==t.includeOffsets)throw Error('length: "auto" requires both expanded: true and includeOffsets: true.');return(function(e){return function(e,n){var i,o,a;p();let s=d({},n,{async:!0});return P(e)?(i=e,o=s,/^\w+:\/\//.test(i)?"u">typeof fetch?r({readRange:(e,t)=>
1k(i,{start:e,end:t}),options:o}):r({readRange:(e,t)=>O(i,{start:e,end:t}),options:o}):I(i)?t(h(i),o):r({readRange:(e,t,r)=>F(i,{start:e,end:t,totalSize:r?r.totalSize:void 0}),options:o})):C(e)?(a=e,r({readRange:(e,t)=>_(a,{start:e,end:t}),options:s})):t(e,s)};function t(t,r){return Promise.resolve().then(()=>e(t,r)).then(e=>{var r,n;if(!e||!e.metadataRange)throw Error('length: "auto" is not supported for this file type (no leading metadata container â e.g. plain TIFF or bare JPEG XL codestream).');let o=e.metadataRange.end;return e.metadataRange.buffer=(r=t,n=o,void 0!==i.Buffer&&i.Buffer.isBuffer(r)?i.Buffer.from(r.subarray(0,n)):r instanceof ArrayBuffer||"u">typeof SharedArrayBuffer&&r instanceof SharedArrayBuffer?r.slice(0,n):ArrayBuffer.isView(r)?r.buffer.slice(r.byteOffset,r.byteOffset+n):r),e.metadataRange.fetched=z(e.metadataRange.buffer),e.metadataRange.requests=0,e})}function r({readRange:t,options:i}){return function t(r){return r.iter>=4||(void 0!==r.totalSize&&(r.need=Math.min(r.need,r.totalSize)),r.need<=r.fetched)?n(r):r.readRange(r.fetched,r.need,{totalSize:r.totalSize}).then(n=>{var i;return(r.requests++,416===n.status)?(i=r).readRange(0,1/0,{totalSize:void 0}).then(t=>(i.requests++,i.buffer=t.buffer,i.fetched=z(i.buffer),void 0!==t.totalSize&&(i.totalSize=t.totalSize),Promise.resolve(e(i.buffer,i.options)))).then(e=>{if(!e||!e.metadataRange)throw Error(G);return B(e,i.buffer,i.fetched,i.requests)}):(j(r,n),Promise.resolve(e(r.buffer,r.options)).then(e=>(function(e,r){let n=r&&r.metadataRange;if(n&&n.complete)return B(r,e.buffer,e.fetched,e.requests);let i=void 0!==e.totalSize&&e.fetched>=e.totalSize;if(!n&&i)throw Error(G);let o=function({range:e,totalSize:t,fetched:r}){return e?Math.min(Math.max(e.end,2*r),void 0!==t?t:1/0):void 0!==t?t:2*r}({range:n,totalSize:e.totalSize,fetched:e.fetched});if(o<=e.fetched){if(n)return B(r,e.buffer,e.fetched,e.requests);throw Error(G)}return e.need=o,e.iter++,t(e)})(r,e)))})}({readRange:t,options:i,buffer:null,fetched:0,requests:0,totalSize:void 0,need:131072,iter:0})}function n(t){return console.warn('ExifReader: length:"auto" did not converge in 4 iterations; falling back to full read.'),(void 0!==t.totalSize&&t.fetched<t.totalSize?t.readRange(t.fetched,t.totalSize,{totalSize:t.totalSize}).then(e=>{t.requests++,j(t,e)}):void 0===t.totalSize?t.readRange(t.fetched,1/0,{totalSize:t.totalSize}).then(e=>{t.requests++,j(t,e)}):Promise.resolve()).then(()=>Promise.resolve(e(t.buffer,t.options))).then(e=>{if(!e||!e.metadataRange)throw Error(G);return B(e,t.buffer,t.fetched,t.requests)})}})(rZ)(e,t)}if(P(e)||C(e)){p();let r=P(e)?U:T,n=d({},t,{async:!0});return r(e,n).then(e=>rZ(e,n))}return rZ(e,t)};function rZ(e,t){return function(e){try{return i.Buffer.isBuffer(e)}catch(e){return!1}}(e)&&(e=new Uint8Array(e).buffer),function(e,{expanded:t=!1,async:r=!1,computed:n=!1,includeUnknown:i=!1,includeOffsets:o=!1,domParser:a,includeTags:s,excludeTags:u,decompress:l}={}){let c,m,g=function({includeTags:e,excludeTags:t}={}){var r,n;let i,o=!!e,a=!!t,s=o||a,u=Object.create(null),l=Object.create(null),f=Object.create(null);if(!s)return ta();let c=o&&(tu(e,"iptc")||tu(e,"xmp")||tu(e,"icc")||tu(e,"photoshop")||tu(e,"makerNotes")||tu(e,"thumbnail")||tu(e,"gps")||tu(e,"composite")),p=o&&tu(e,"composite"),d=Object.create(null);o&&(i=function(e){let t=Object.create(null);if(!e)return t;for(let r in Array.isArray(e.exif)&&e.exif.length>0&&(t[e9]=!0,function(e,t){for(let r=0;r<t.length;r++){let n=t[r];if("string"!=typeof n)continue;let i=n.toLowerCase();0===i.indexOf("gps")&&(e[te]=!0),(0===i.indexOf("interoperability")||0===i.indexOf("relatedimage"))&&(e[tt]=!0)}}(t,e.exif)),tr)if(to(e[r])){let e=tr[r];for(let r=0;r<e.length;r++)t[e[r]]=!0;t[e9]=!0}return to(e.gps)&&(t[te]=!0,t[e9]=!0),t}(r=e),tu(r,"composite")&&function(e,t){for(let r=0;r<t.length;r++)e[t[r]]=!0}(i,ti),d=i);let m=Object.create(null);for(let r in o&&p&&(m=function(e){let t=Object.create(null);for(let r=0;r<e.length;r++)t[e[r].toLowerCase()]=!0;return t}(tn)),e7){let i,s=o&&Object.prototype.hasOwnProperty.call(e,r);a&&Object.prototype.hasOwnProperty.call(t,r)&&!s&&(i=t[r]);let g=tl({groupKey:r,includeValue:s?e[r]:void 0,excludeValue:i,extraIncludeNames:Object.create(null)});u[r]=!o||s,s&&Array.isArray(n=e[r])&&0===n.length&&(u[r]=!1),g.excludeAll&&(u[r]=!1),l[r]=g;let h=tl({groupKey:r,includeValue:function({groupKey:e,hasIncludeTags:t,hasIncludeEntry:r,includeTags:n,shouldParseExif:i,shouldParseFile:o}){return!t||(r?!!("thumbnail"===e&&Array.isArray(n[e]))||n[e]:"exif"===e&&i||"file"===e&&o?[]:void 0)}({groupKey:r,hasIncludeTags:o,hasIncludeEntry:s,includeTags:e,shouldParseExif:c,shouldParseFile:p}),excludeValue:i,extraIncludeNames:function({groupKey:e,hasIncludeTags:t,hasIncludeEntry:r,shouldParseExif:n,shouldParseFile:i,exifIncludeDepen
1dencies:o,fileIncludeDependencies:a}){return t?"exif"===e&&(n||r&&Object.keys(o).length>0)?o:"file"===e&&i?a:Object.create(null):Object.create(null)}({groupKey:r,hasIncludeTags:o,hasIncludeEntry:s,shouldParseExif:c,shouldParseFile:p,exifIncludeDependencies:d,fileIncludeDependencies:m})});f[r]=h}return{isActive:s,shouldReturnGroup:g,shouldParseGroup:h,shouldReturnTag:function(e,t,r){return!e7[e]||!!g(e)&&tf(l[e],t,r)},shouldParseTag:function(e,t,r){return!e7[e]||!!h(e)&&tf(f[e],t,r)}};function g(e){return!e7[e]||!!u[e]}function h(e){return!!(!e7[e]||g(e))||("exif"===e?c:"file"===e&&p)}}({includeTags:s,excludeTags:u}),h=Object.create(null),y=[],b=Object.create(null),S=[],w=!1,{fileType:A,fileDataOffset:P,jfifDataOffset:C,tiffHeaderOffset:I,iptcDataOffset:U,xmpChunks:T,iccChunks:R,mpfDataOffset:k,pngHeaderOffset:M,pngTextChunks:O,pngChunkOffsets:L,vp8xChunkOffset:N,gifHeaderOffset:F,brobExifChunk:D,brobXmpChunk:_,jxlCodestreamOffset:E,metadataBlocks:G,metadataTruncated:j,exifDataView:B,xmpDataView:z}=eB(e,r,t&&o),$=function({fileType:e,fileDataOffset:t,jfifDataOffset:r,tiffHeaderOffset:n,iptcDataOffset:i,xmpChunks:o,iccChunks:a,mpfDataOffset:s,pngHeaderOffset:u,pngTextChunks:l,pngChunkOffsets:f,vp8xChunkOffset:c,gifHeaderOffset:p,jxlCodestreamOffset:d}){return!!e||void 0!==t||void 0!==r||void 0!==n||void 0!==i||r3(o)||r5(a)||void 0!==s||void 0!==u||r8(l)||void 0!==f||void 0!==c||void 0!==p||void 0!==d}({fileType:A,fileDataOffset:P,jfifDataOffset:C,tiffHeaderOffset:I,iptcDataOffset:U,xmpChunks:T,iccChunks:R,mpfDataOffset:k,pngHeaderOffset:M,pngTextChunks:O,pngChunkOffsets:L,vp8xChunkOffset:N,gifHeaderOffset:F,jxlCodestreamOffset:E});if(void 0!==P&&g.shouldParseGroup("file")&&function(e){if(!e)return!0;let{composite:t,file:r}=e;return!!(!0===t||Array.isArray(t)&&t.length>0)||!(Array.isArray(r)&&1===r.length&&"FileType"===r[0])}(s)){let t=rQ("file",tS(e,P),g);h.file=t,g.shouldReturnGroup("file")&&y.push({type:"mergeGroupAssign",groupKey:"file",parsedTags:t})}if(void 0!==C&&g.shouldParseGroup("jfif")){let t=rQ("jfif",tI(e,C),g);h.jfif=t,g.shouldReturnGroup("jfif")&&y.push({type:"mergeGroupAssign",groupKey:"jfif",parsedTags:t})}if(void 0!==I&&g.shouldParseGroup("exif")){let{tags:r,byteOrder:o}=function(e,t,r,n,i){try{return tb(e,t,r,n,i)}catch(e){return{tags:{},byteOrder:19789}}}(B||e,I,i,n,g);r.Thumbnail&&(c=r.Thumbnail,delete r.Thumbnail);let s=rQ("exif",r,g);if(h.exif=s,s["IPTC-NAA"]&&void 0===U&&g.shouldParseGroup("iptc")){let e=rQ("iptc",tN(s["IPTC-NAA"].value,0,i,g),g);h.iptc=e,g.shouldReturnGroup("iptc")&&y.push({type:"mergeGroupAssign",groupKey:"iptc",parsedTags:e})}if(0,s.ApplicationNotes&&!r3(T)&&g.shouldParseGroup("xmp")){let e=rQ("xmp",tz(f(s.ApplicationNotes.value),void 0,a),g);if(h.xmp=e,g.shouldReturnGroup("xmp")){let r={type:"mergeXmpGroupAssign",parsedTags:e};t?y.push(r):m=r}}if(0,s.ImageSourceData&&s.PhotoshopSettings&&g.shouldParseGroup("photoshop")){let e=rQ("photoshop",rr(s.PhotoshopSettings.value,i,g),g);h.photoshop=e,g.shouldReturnGroup("photoshop")&&y.push({type:"mergeGroupAssign",groupKey:"photoshop",parsedTags:e})}if(0,s.ICC_Profile&&!r5(R)&&g.shouldParseGroup("icc")){let e=rQ("icc",rl(s.ICC_Profile.value,[{offset:0,length:s.ICC_Profile.value.length,chunkNumber:1,chunksTotal:1}]),g);h.icc=e,g.shouldReturnGroup("icc")&&y.push({type:"mergeGroupAssign",groupKey:"icc",parsedTags:e})}if(0,s.MakerNote&&g.shouldParseGroup("makerNotes")){var V,W;if((V=s).Make&&V.Make.value&&Array.isArray(V.Make.value)&&"Canon"===V.Make.value[0]&&V.MakerNote&&V.MakerNote.__offset){let t=rp(B||e,I,s.MakerNote.__offset,o,i,n,g);h.makerNotes=t,g.shouldReturnGroup("makerNotes")&&y.push({type:"mergeGroupAssign",groupKey:"makerNotes",parsedTags:t})}else{let t;if(t="PENTAX ",(W=s).MakerNote.value.length>t.length&&f(W.MakerNote.value.slice(0,t.length))===t&&W.MakerNote.__offset){let t=ry(B||e,I,s.MakerNote.__offset,i,n,g);h.makerNotes=t,g.shouldReturnGroup("makerNotes")&&y.push({type:"mergeGroupAssign",groupKey:"makerNotes",parsedTags:t})}}}s.MakerNote&&delete s.MakerNote.__offset,g.shouldReturnGroup("exif")&&y.push({type:"mergeGroupAssign",groupKey:"exif",parsedTags:s}),!t&&m&&(y.push(m),m=void 0)}if(void 0!==U&&g.shouldParseGroup("iptc")){let t=rQ("iptc",tN(e,U,i,g),g);h.iptc=t,g.shouldReturnGroup("iptc")&&y.push({type:"mergeGroupAssign",groupKey:"iptc",parsedTags:t})}if(r3(T)&&g.shouldParseGroup("xmp")){let t=rQ("xmp",tz(z||e,T,a),g);h.xmp=t,g.shouldReturnGroup("xmp")&&y.push({type:"mergeXmpGroupAssign",parsedTags:t})}if(D&&void 0===I&&g.shouldParseGroup("exif")&&r){let t=new DataView(e.buffer,e.byteOffset+D.dataOffset,D.length);S.push(x(t,v,void 0,"dataview",l).then(e=>{let t=ei(e,0),{tags:r}=tb(e,t,i,n,g);r.Thumbnail&&delete r.Thumbnail,b.brobExif=r}).catch(()=>{b.brobExif={}})),y.push({type:"mergeBrobExifDeferred",deferredKey:"brobExif"})}if(_&&!r3(T)&&g.shouldParseGroup("xmp")&&r){let t=new DataView(e.buffer,e.byteOffset+_.dataOffset,_.length);S.push(x(t,v,void 0,"dataview",l).then(e=>{b.brobXmp=tz(e,[{dataOffset:0,length:e.byteLength}],a)}).catch(()=>{b.brobXmp={}})),y.push({type:"mergeBrobXmpDeferred",deferredKey:"brobXmp"})}if(r5(R)&&g.shouldParseGroup("icc")){let t=rl(e,R,r,l);if(t&&"function"==typeof t.then){if(!r)throw Error("Promise is required when async mode is enabled.");S.push(t.then(e=>{b.iccApp=e})),y.push({type:"mergeIccDeferred",deferredKey:"iccApp"})}else{let e=rQ("icc",t,g);h.icc=e,g.shouldReturnGroup("icc")&&y.push({type:"mergeGroupAssign",groupKey:"icc",parsedTags:e})}}if(void 0!==k&&g.shouldParseGroup("mpf")){let t=rQ("mpf",tv(e,k,i,n,g),g);h.mpf=t,g.shouldReturnGroup("mpf")&&y.push({type:"mergeGroupAssign",groupKey:"mpf",parsedTags:t})}if(void 0!==M&&g.shouldParseGroup("png")){let t=rQ("png",rb(e,M),g);h.pngFile=t,g.shouldReturnGroup("png")&&y.push({type:"mergePngFile",parsedTags:t})}if(r8(O)&&(g.shouldParseGroup("png")||g.shouldParseGroup("exif")||g.shouldParseGroup("iptc"))){let{readTags:t,readTagsPromise:o}=rw(e,O,r,i,n,g,l);w=!!o,y.push({type:"processPngTextReadTags",readTags:t}),o&&(S.push(o.then(e=>{b.pngTextTagList=e})),y.push({type:"processPngTextReadTagsDeferredList",deferredKey:"pngTextTagList"}))}if(void 0!==L&&g.shouldParseGroup("png")){let t=rQ("png",rL(e,L),g);h.pngChunk=t,g.shouldReturnGroup("png")&&y.push({type:"mergePngChunk",parsedTags:t})}if(void 0!==N&&g.shouldParseGroup("riff")){let t=rQ("riff",rD(e,N),g);h.riff=t,g.shouldReturnGroup("riff")&&y.push({type:"mergeGroupMerge",groupKey:"riff",parsedTags:t})}if(void 0!==F&&g.shouldParseGroup("gif")){let t=rQ("gif",rE(e),g);h.gif=t,g.shouldReturnGroup("gif")&&y.push({type:"mergeGroupMerge",groupKey:"gif",parsedTags:t})}if(void 0!==E&&g.shouldParseGroup("file")){let t=rQ("file",tw(e,E),g);h.file=t,g.shouldReturnGroup("file")&&y.push({type:"mergeGroupAssign",groupKey:"file",parsedTags:t})}if(y.push({type:"gps"}),y.push({type:"composite"}),y.push({type:"thumbnail"}),y.push({type:"fileType"}),t&&o&&y.push({type:"metadataRange",metadataBlocks:G,metadataTruncated:!!j}),!$)throw new rq;let H={objectAssign:d,hasPngTextData:r8,filterTagsForParse:rQ,filterTagsForReturn:r0,getGpsGroupFromExifTags:r2,Composite:r$,Thumbnail:rz};return r?(p(),Promise.all(S).then(()=>rW({mergeSteps:y,deferredResults:b,parsedGroups:h,expanded:t,tagFilter:g,dataView:e,tiffHeaderOffset:I,exifDataView:B,fileType:A,pngTextChunks:O,pngTextIsAsync:w,thumbnailIfdTags:c,deps:H}))):rW({mergeSteps:y,deferredResults:b,parsedGroups:h,expanded:t,tagFilter:g,dataView:e,tiffHeaderOffset:I,exifDataView:B,fileType:A,pngTextChunks:O,pngTextIsAsync:w,thumbnailIfdTags:c,deps:H})}(a(e),t)}function rQ(e,t,r){return r.isActive?r1(e,t,r.shouldParseTag):t}function r0(e,t,r){return r.isActive?r1(e,t,r.shouldReturnTag):t}function r1(e,t,r){if(!t)return t;let n={};for(let i in t){let o=t[i];r(e,i,function(e){if(e){if(Array.isArray(e)){if(0===e.length)return;return e[0].id}return e.id}}(o))&&(n[i]=o)}return n}function r2(e){let t;if(e.GPSLatitude&&e.GPSLatitudeRef){t=t||{};try{t.Latitude=V(e.GPSLatitude.value),"S"===e.GPSLatitudeRef.value.join("")&&(t.Latitude=-t.Latitude)}catch(e){}}if(e.GPSLongitude&&e.GPSLongitudeRef){t=t||{};try{t.Longitude=V(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 r3(e){return Array.isArray(e)&&e.length>0}function r5(e){return Array.isArray(e)&&e.length>0}function r8(e){return Array.isArray(e)&&e.length>0}function r6(e){if(e.length<8)return"";let t=new TextDecoder("ascii").decode(e.subarray(0,8)),r=e.subarray(8);if(t.startsWith("ASCII"))return new TextDecoder("ascii").decode(r);if(t.startsWith("UTF8"))return new TextDecoder("utf-8").decode(r);if(r.length>=2){if(254===r[0]&&255===r[1])return new TextDecoder("utf-16be").decode(r.subarray(2)).replace(/\0/g,"");if(255===r[0]&&254===r[1])return new TextDecoder("utf-16le").decode(r.subarray(2)).replace(/\0/g,"")}let n=0,i=0,o=Math.min(r.length,1e3);for(let e=0;e+1<o;e+=2)0===r[e]&&n++,0===r[e+1]&&i++;return new TextDecoder(i>n?"utf-16le":"utf-16be").decode(r).replace(/\0/g,"")}var r4=[85,78,73,67,79,68,69,0];function r7(e){let t=[];for(let r=0;r<e.length;r++){let n=e.charCodeAt(r);t.push(n>>8&255),t.push(255&n)}return new Uint8Array(r4.concat(t))}var r9=new Map([["Seed","seed"],["CFG scale","cfgScale"],["Sampler","sampler"],["Steps","steps"],["Clip skip","clipSkip"]]);function ne(e){return r9.get(e.trim())??e.trim()}function nt(e){if(!e)return"";let t=e.replace(/^Parameters\s*:\s*/,"");return/(^|\n)Steps: ?\d/.test(t)?t:t.replace(/[ \t\r]{0,7}[.,][ \t\r.,]{0,7}(Negative prompt:)/gi,"\n$1").replace(/[ \t\r]{0,7}[.,][ \t\r.,]{0,7}(Steps:)(?=\s*\d)/gi,"\n$1")}function nr(e,t){let r=e.indexOf(t);if(-1===r)return null;let n=e.indexOf("{",r+t.length);if(-1===n)return null;let i=0,o=!1,a=!1;for(let t=n;t<e.length;t++){let s=e[t];if(a){a=!1;continue}if("\\"===s){a=!0;continue}if('"'===s){o=!o;continue}if(!o){if("{"===s)i++;else if("}"===s&&0==--i)return{json:e.substring(n,t+1),start:r,end:t+1}}}return null}var nn=/^[\w][\w\s.+-]*: /,ni=/^(lora|ti|hypernet|checkpoint)? ?hashes$|^controlnet \d+$|^addnet /i;function no(e){let t={};if(!e)return t;let r="",n="",i=!1,o=!1;for(let s=0;s<e.length;s++){let u=e[s];if("\\"===u&&i)n+=u+(e[s+1]??""),s++;else if('"'===u)i&&(r&&(t[r]=function(e,t){if(ni.test(t)||nn.test(e))return no(e);try{return JSON.parse(`"${e}"`)}catch{return e}}(n.trim(),r)),r=""),i=!i;else if(":"!==u||i||o)","!==u||i?n+=u:(o&&(o=!1),r&&(t[r]=n.trim()),r="",n="");else{var a;14===(a=n).length&&"T"===a[11]?o=!0:(r=ne(n),n="")}}return r&&(t[r]=n.trim()),t}var na=["Resources: ","Hashed prompt: ","Hashed Negative prompt: "],ns=["Template: ","Negative Template: "],nu=/<(lora|hypernet):([a-zA-Z0-9_.-]+):([0-9.]+)>/g,nl=/([a-zA-Z0-9_.]+)\(([a-zA-Z0-9]+)\)/,nf={generator:"automatic1111",detect(e){let t=null;return("string"==typeof e.parameters?t=e.parameters:e.userComment instanceof Uint8Array&&(t=r6(e.userComment)),t?.includes("Steps: "))?{generationDetail
1s:nt(t)}:null},parse(e,t){let r={};if(!e.generationDetails)return r;let n=nt(e.generationDetails).split("\n").filter(e=>""!==e.trim());for(let e of ns){let t=n.findIndex(t=>t.startsWith(e));if(-1!==t)for(n.splice(t,1);t<n.length&&!/[\w\s]+: /.test(n[t]);)n.splice(t,1)}let i=function(e){let t=e.find(e=>e.startsWith("Steps: "))?.replace(/,\s*$/,"");for(let r of(t&&e.splice(e.indexOf(t),1),na))t?.includes(r)&&(t=t.split(r)[0]);return t}(n);if(i)for(let e of t.a1111DetailExtractors)i=e(i,r,t);for(let[e,n]of Object.entries(no(i))){let i=ne(e);t.a1111ExcludedKeys.includes(i)||(r[i]=n)}!function(e,t){let[r,...n]=e.join("\n").split("Negative prompt:").map(e=>e.trim());t.prompt=r,t.negativePrompt=n.join(" ").trim()}(n,r);let o=function(e){let t=[...e.prompt.matchAll(nu)].map(([,e,t,r])=>({type:e,name:t,weight:parseFloat(r)}));if(e["Lora hashes"]){for(let[r,n]of(e.hashes||(e.hashes={}),Object.entries("string"==typeof e["Lora hashes"]?no(e["Lora hashes"]):e["Lora hashes"]))){e.hashes[`lora:${r}`]=n;let i=t.find(e=>e.name===r);i?i.hash=n:t.push({type:"lora",name:r,hash:n})}delete e["Lora hashes"]}if(e["VAE hash"]&&(e.hashes||(e.hashes={}),e.hashes.vae=e["VAE hash"],delete e["VAE hash"]),e.Model&&e["Model hash"]&&(e.hashes||(e.hashes={}),e.hashes.model||(e.hashes.model=e["Model hash"]),t.push({type:"model",name:e.Model,hash:e["Model hash"]})),e.Refiner&&e["Refiner hash"]&&(e.hashes||(e.hashes={}),e.hashes.refiner||(e.hashes.refiner=e["Refiner hash"]),t.push({type:"model",name:e.Refiner.replace(/\.[^/.]+$/,""),hash:e["Refiner hash"]})),e.Hypernet&&e["Hypernet strength"]&&t.push({type:"hypernet",name:e.Hypernet,weight:parseFloat(e["Hypernet strength"])}),"True"===e["AddNet Enabled"])for(let r=1;e[`AddNet Model ${r}`];r++){let[,n,i]=e[`AddNet Model ${r}`].match(nl)??[],o=parseFloat(e[`AddNet Weight A ${r}`]??e[`AddNet Weight ${r}`]);t.push({type:e[`AddNet Module ${r}`].toLowerCase(),name:n,hash:i,weight:Number.isFinite(o)?o:void 0})}return t}(r);return!function(e){if(!e.Size||"string"!=typeof e.Size)return;let[t,r]=e.Size.split("x").map(Number);t&&r&&(e.width=t,e.height=r),delete e.Size}(r),r.resources=o,r},encode(e,t){let{prompt:r,negativePrompt:n,resources:i,steps:o,...a}=e,s=[r];n&&s.push(`Negative prompt: ${n}`);let u=[];for(let[e,r]of(o&&u.push(`Steps: ${o}`),Object.entries(a))){if(null==r||"object"==typeof r)continue;let n=function(e){for(let[t,r]of r9)if(r===e)return t;return e}(e);if(!t.a1111ExcludedKeys.includes(n)){var l;u.push(`${n}: ${(l=String(r),/[,\n:"]/.test(l)?JSON.stringify(l):l)}`)}}return u.length>0&&s.push(u.join(", ")),s.join("\n")}};function nc(e,t){for(let[r,n]of e)if(n.includes(t))return r}function np(e){let t={};for(let[r,n]of Object.entries(e))null!=n&&(Array.isArray(n)&&0===n.length||(t[r]=n));return t}function nd(e){return null!=e}function nm(e,t,r){let n,i=e.sampler;r?.preserveOriginal&&(e.originalSampler=i),"karras"==e.scheduler&&(n=nc(t,i+"_karras")),n||(n=nc(t,i)),n&&(e.sampler=n);let o=e.models;o&&o.length>0&&(e.Model=o[0].replace(/\.[^/.]+$/,""))}function ng(e){return e.replace(/\[NaN\]/g,"[]").replace(/\bNaN\b/g,"0").replace(/\[Infinity\]/g,"[]")}var nh=["value","string"];function ny(e,t="positive",r,n={path:new Set,budget:512}){return function e(t,r,n,i,o){if(!(!t||i.path.has(t))&&!(i.budget<=0)){i.budget--,i.path.add(t);try{return function(t,r,n,i,o){if("ControlNetApply"===t.class_type||"FluxGuidance"===t.class_type)return e(t.inputs.conditioning,r,n,i,!1);t.inputs?.populated_text&&(t.inputs.text=t.inputs.populated_text);let a=t.inputs?.text,s=!1;if("string"==typeof a){if(a)return a;s=!0}else if(a&&void 0!==a.class_type){let t=e(a,r,n,i,!0);if(t)return t;void 0!==t&&(s=!0)}if(t.inputs?.text_g)return t.inputs?.text_l&&t.inputs?.text_l!==t.inputs?.text_g?`${t.inputs.text_g}, ${t.inputs.text_l}`:t.inputs.text_g;if(t.inputs?.[`text_${r}`])return t.inputs[`text_${r}`];if(o)for(let e of nh){let r=t.inputs?.[e];if("string"==typeof r)return r}if(t.inputs?.string_a!==void 0||t.inputs?.string_b!==void 0){let o=[],a=!1;
1for(let s of[t.inputs.string_a,t.inputs.string_b]){let t;"string"==typeof s?t=s:s&&"string"==typeof s.class_type&&(t=e(s,r,n,i,!0)),void 0!==t&&(a=!0,t.length&&o.push(t))}if(o.length){let e="string"==typeof t.inputs.delimiter?t.inputs.delimiter:"";return o.join(e)}if(a)return""}return s?"":n?.(t,r)}(t,r,n,i,o)}finally{i.path.delete(t)}}}(e,t,r,n,!1)??""}function nb(e,t=["Value"]){if("number"==typeof e)return e;let r=nA(e);if(void 0!==r)return r;if(!e||"object"!=typeof e||!e.inputs)return 0;for(let r of t)if(void 0!==e.inputs[r])return e.inputs[r];return 0}var nv=["ckpt_name","unet_name","model_name","vae_name","control_net_name","lora_name"],nx=["value","string"],nS=/<lora:([^>]+)>/gi;function nw(e){if("string"!=typeof e||!/<lora:/i.test(e))return[];let t=[];for(let r of e.matchAll(nS)){let e,n=r[1].split(":");for(;n.length>1;){let t=nA(n[n.length-1].trim());if(void 0===t)break;n.pop(),e=t}let i=n.join(":").trim();i&&t.push({name:i,strength:e})}return t}function nA(e){let t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isFinite(t)?t:void 0}var nP=["positive","negative","latent_image","sampler_name"];function nC(e,t,r){let n=e.inputs.noise;n?.class_type==="RandomNoise"&&(t.seed=n.inputs.noise_seed);let i=e.inputs.sampler;i?.class_type==="KSamplerSelect"?t.sampler=i.inputs.sampler_name:i?.class_type==="ODESamplerSelect"&&(t.sampler=i.inputs.solver);let o=e.inputs.guider;e:if(o?.class_type==="BasicGuider"){let e,n=o.inputs.conditioning;if(n?.class_type==="CLIPTextEncode"?e=n:n?.class_type==="FluxGuidance"&&(e=n.inputs.conditioning,t.cfgScale=n.inputs.guidance),e?.class_type!=="CLIPTextEncode")break e;if("string"==typeof e.inputs.text){t.prompt=e.inputs.text;break e}let i=e.inputs.text;i?.class_type==="ImpactWildcardProcessor"?t.prompt=i.inputs.populated_text:i?.class_type==="String Literal"&&(t.prompt=i.inputs.string),t.prompt||(t.prompt=r?.(e,"positive"))}let a=e.inputs.sigmas;a?.class_type==="BasicScheduler"&&(t.steps=a.inputs.steps,t.scheduler=a.inputs.scheduler,t.denoise=a.inputs.denoise);let s=e.inputs.latent_image;s?.class_type==="EmptyLatentImage"&&(t.width=nb(s.inputs.width,["int"]),t.height=nb(s.inputs.height,["int"]))}function nI(e){let t;if(e.prompt||e.workflow)return{prompt:e.prompt,workflow:e.workflow,extraMetadata:e.extraMetadata};let r=e.Model;if(!Array.isArray(r)||"string"!=typeof r[0]||!r[0].startsWith("prompt:"))return null;let n=r[0].replace(/^prompt:/,"");if(e.userComment instanceof Uint8Array)try{t=JSON.parse(r6(e.userComment))?.extraMetadata,"string"==typeof t&&(t=JSON.parse(t))}catch{t=void 0}return{prompt:n,workflow:n,extraMetadata:t}}function nU(e,t){let r=t.samplerNodes.length?t.samplerNodes:t.inferredSamplerNodes??[],n=r.find(e=>e.latent_image?.class_type==="EmptyLatentImage")??r[0];if(!n)return;e.prompt=ny(n.positive,"positive",t.promptTextFallback),e.negativePrompt=ny(n.negative,"negative",t.promptTextFallback),e.cfgScale=n.cfg,e.steps=n.steps;let i=n.seed??n.noise_seed;void 0!==i&&(e.seed=nb(i,["Value","seed"])),e.sampler=n.sampler_name,e.scheduler=n.scheduler,e.denoise=n.denoise,e.width=nT(n.latent_image?.inputs?.width,"width"),e.height=nT(n.latent_image?.inputs?.height,"height")}function nT(e,t){if("number"==typeof e)return e;if("string"==typeof e)return nR(e);let r=e?.inputs;if(r)for(let e of["value","int","Value",t]){let t=nR(r[e]);if(void 0!==t)return t}}function nR(e){let t="string"==typeof e?Number(e):e;return"number"==typeof t&&Number.isFinite(t)?t:void 0}var nk=/textencode/i;function nM(e){return e&&"object"==typeof e&&!Array.isArray(e)?e:void 0}function nO(e){return"string"==typeof e&&e.trim().length>0?e:void 0}function nL(e,t,r){let n=JSON.parse(ng(e.prompt));t.onDebug?.("nodeJson",n);let i=function(e,t){let r={samplerNodes:[],inferredSamplerNodes:[],models:[],upscalers:[],vaes:[],controlNets:[],additionalResources:[],customAdvancedSampler:void 0},n=(e,r,n)=>{let i=t(r,n);i&&e.push(i)},i=(e,t,n)=>{if(!e||"none"===e.toLowerCase())return;let i=nA(t);null!=i&&i<.001&&i>-.001||r.additionalResources.push({name:e,type:"lora",strength:i,strengthClip:nA(n)})},o=Object.values(e);for(let a of o){for(let[t,r]of Object.entries(a.inputs))Array.isArray(r)&&!nv.includes(t)&&e[r[0]]&&(a.inputs[t]=e[r[0]]);switch(a.class_type){case"KSamplerAdvanced":{let e={...a.inputs};e.steps=nb(e.steps),e.cfg=nb(e.cfg),r.samplerNodes.push(e);break}case"KSampler":case"KSampler (Efficient)":r.samplerNodes.push(a.inputs);break;case"LoraLoader":case"LoraLoaderModelOnly":case"LoraLoader|pysssss":case"LoraLoaderModelOnly|pysssss":i(t(a.inputs.lora_name,"lora_name"),a.inputs.strength_model,a.inputs.strength_clip);break;case"Power Lora Loader (rgthree)":for(let[e,t]of Object.entries(a.inputs))/^lora_\d+$/.test(e)&&t&&!1!==t.on&&i(t.lora,t.strength,t.strengthTwo);break;case"Lora Loader Stack (rgthree)":for(let e of Object.keys(a.inputs)){let r=/^lora_(\d+)$/.exec(e);r&&i(t(a.inputs[e],e),nA(a.inputs[`strength_${r[1]}`]),void 0)}break;case"Lora Loader (LoraManager)":case"Lora Stacker (LoraManager)":{let e=function(e){if(Array.isArray(e))return e;let t=e?.__value__;return Array.isArray(t)?t:[]}(a.inputs.loras);for(let t of e)t?.active!==!1&&i(t?.name,nA(t?.strength),nA(t?.clipStrength));if(!e.length)for(let e of nw(a.inputs.text))i(e.name,e.strength,void 0);break}case"AnimaLoRARemapTagLoader":for(let e of nw(a.inputs.text))i(e.name,e.strength??nA(a.inputs.default_weight),void 0);break;case"CheckpointLoaderSimple":case"CheckpointLoader":case"CheckpointLoader|pysssss":case"CheckpointLoaderSimple|pysssss":n(r.models,a.inputs.ckpt_name,"ckpt_name");break;case"easy fullLoader":case"easy a1111Loader":case"easy comfyLoader":n(r.models,a.inputs.ckpt_name,"ckpt_name"),i(t(
1a.inputs.lora_name,"lora_name"),nA(a.inputs.lora_model_strength),nA(a.inputs.lora_clip_strength));break;case"UNETLoader":case"UnetLoaderGGUF":n(r.models,a.inputs.unet_name,"unet_name");break;case"UpscaleModelLoader":n(r.upscalers,a.inputs.model_name,"model_name");break;case"VAELoader":n(r.vaes,a.inputs.vae_name,"vae_name");break;case"ControlNetLoader":n(r.controlNets,a.inputs.control_net_name,"control_net_name");break;default:(function(e){return!!e&&"object"==typeof e&&nP.every(t=>t in e)})(a.inputs)&&(r.inferredSamplerNodes??=[]).push(function(e){let t={...e};return null!=t.steps&&(t.steps=nb(t.steps)),null!=t.cfg&&(t.cfg=nb(t.cfg)),t}(a.inputs))}}return r.customAdvancedSampler=o.find(e=>"SamplerCustomAdvanced"===e.class_type),r}(n,(e,t)=>(function e(t,i,o=0){if("string"==typeof t)return t;if(o>=5||null==t)return;if(Array.isArray(t)){let a=n[t[0]];if(!a)return;let s=r?.(a,t[1]);return s||e(a,i,o+1)}if("object"!=typeof t)return;let a=r?.(t,void 0);if(a)return a;let s=t.content;if("string"==typeof s)return s;for(let r of[i,...nx]){let n=e(t.inputs?.[r],i,o+1);if(n)return n}})(e,t));return i.promptTextFallback=function(e,t){let r;if(!e)return;try{r=JSON.parse(ng(e)).nodes??[]}catch{return}if(!r.length)return;let n=new Map,i=new Set;for(let e of r){if(e?.id==null)continue;let t=String(e.id);n.has(t)&&i.add(t),n.set(t,e)}for(let e of i)n.delete(e);let o=new Map;for(let[e,r]of Object.entries(t))o.set(r,e);return(e,t)=>{if(!nk.test(e.class_type??""))return;let r=o.get(e),i=void 0!==r?n.get(r):void 0;if(i&&i.type===e.class_type){let e=nM(i.widgets_values_named)??nM(i.widgets_values);if(e){for(let r of["text",`text_${t}`,"text_g","populated_text"])if(nO(e[r]))return e[r];return}return Array.isArray(i.widgets_values)?nO(i.widgets_values[0]):void 0}}}(e.workflow,n),{prompt:n,scan:i}}function nN(e,t){return{engine:"ComfyUI",models:t.models,upscalers:t.upscalers,vaes:t.vaes,additionalResources:t.additionalResources,controlNets:t.controlNets,comfy:`{"prompt": ${e.prompt}, "workflow": ${e.workflow}}`}}function nF(e){let t="string"==typeof e.comfy?function(e){try{return JSON.parse(e,(e,t)=>"string"==typeof t&&/^\d+n$/.test(t)?BigInt(t.slice(0,-1)):t)}catch{return null}}(e.comfy):e.comfy;return t&&t.workflow?JSON.stringify(t.workflow):""}var nD=[nf,{generator:"swarmui",detect(e){let t=e.parameters;return"string"==typeof t&&t.includes("sui_image_params")?{params:t}:null},parse(e,t){let r=JSON.parse(e.params.replace(/\[NaN\]/g,"[]").replace(/\bNaN\b/g,"0").replace(/\[Infinity\]/g,"[]")),n=r.sui_image_params??{};t.onDebug?.("nodeJson",n);let i=np({prompt:n.prompt,negativePrompt:n.negativeprompt,cfgScale:n.cfgscale,steps:n.steps,seed:n.seed,width:n.width,height:n.height,sampler:n.sampler,scheduler:n.scheduler,version:n.swarm_version??n.swarmVersion,Model:n.model,resources:function({sui_image_params:e={},sui_models:t=[]}){let r=e.loras??[];return t.map(({name:t,param:n,hash:i,weight:o})=>{let a=t.split(".")[0],s=n;"loras"===s&&(s="lora");let u=r.findIndex(e=>e===a);return np({name:a,type:s,hash:i?.replace("0x","").slice(0,12),weight:o??(u>-1?Number(e.loraweights[u]):void 0)})})}(r)});return nm(i,t.samplerMap,{preserveOriginal:!0}),i},encode:e=>JSON.stringify({sui_image_params:{prompt:e.prompt,negativeprompt:e.negativePrompt,cfgscale:e.cfgScale,steps:e.steps,seed:e.seed,width:e.width,height:e.height,aspectratio:"custom",sampler:e.originalSampler??e.sampler,scheduler:e.scheduler,model:e.Model,swarm_version:e.version},sui_models:e.resources?.map(({type:e,name:t,weight:r,hash:n})=>({name:t,weight:r,hash:n,param:e}))})},{generator:"ruinedfooocus",detect(e){let t=e.parameters;return"string"==typeof t&&/"software":\s*"RuinedFooocus"/.test(t)?{parameters:t}:null},parse(e,t){let{Prompt:r,Negative:n,cfg:i,steps:o,seed:a,scheduler:s,denoise:u,width:l,height:f,base_model_hash:c,software:p,...d}=JSON.parse(e.parameters),m={prompt:r,negativePrompt:n,cfgScale:i,steps:o,seed:a,sampler:d.sampler_name,denoise:u,width:l,height:f,Model:d.base_model_name.split(".").slice(0,-1).join("."),"Model hash":c,software:p,other:d};return"simple"!==s&&(m.scheduler=s),nm(m,t.samplerMap),m},encode:e=>JSON.stringify({Prompt:e.prompt,Negative:e.negativePrompt,cfg:e.cfgScale,steps:e.steps,seed:e.seed,scheduler:e.scheduler??"simple",denoise:e.denoise,width:e.width,height:e.height,base_model_hash:e["Model hash"],softw
1are:e.software,...e.other??{}})},{generator:"comfyui",detect:e=>nI(e),parse(e,t){let{scan:r}=nL(e,t),n=nN(e,r);return r.customAdvancedSampler?nC(r.customAdvancedSampler,n,r.promptTextFallback):nU(n,r),e.extraMetadata&&(n.extra=e.extraMetadata),nm(n,t.samplerMap),np(n)},encode:e=>nF(e)}],n_=new Map([["Euler a",["euler_ancestral"]],["Euler",["euler"]],["LMS",["lms"]],["Heun",["heun"]],["DPM2",["dpm_2"]],["DPM2 a",["dpm_2_ancestral"]],["DPM++ 2S a",["dpmpp_2s_ancestral"]],["DPM++ 2M",["dpmpp_2m"]],["DPM++ SDE",["dpmpp_sde","dpmpp_sde_gpu"]],["DPM++ 2M SDE",["dpmpp_2m_sde"]],["DPM fast",["dpm_fast"]],["DPM adaptive",["dpm_adaptive"]],["LMS Karras",["lms_karras"]],["DPM2 Karras",["dpm_2_karras"]],["DPM2 a Karras",["dpm_2_ancestral_karras"]],["DPM++ 2S a Karras",["dpmpp_2s_ancestral_karras"]],["DPM++ 2M Karras",["dpmpp_2m_karras"]],["DPM++ SDE Karras",["dpmpp_sde_karras"]],["DPM++ 2M SDE Karras",["dpmpp_2m_sde_karras"]],["DDIM",["ddim"]],["PLMS",["plms"]],["UniPC",["uni_pc","uni_pc_bh2"]],["LCM",["lcm"]]]),nE=n.number().optional(),nG=r.preprocess(e=>e||void 0,r.string().optional()).optional(),nj=r.object({prompt:r.looseObject({}),workflow:r.looseObject({nodes:r.looseObject({}).array().optional()})}).partial(),nB=r.object({source:r.object({name:r.string().optional(),homepage:r.url().optional()}).optional(),details:r.record(r.string(),r.union([r.string(),r.number(),r.boolean()])).optional(),createUrl:r.url().optional(),referenceUrl:r.url().optional()}),nz=r.object({type:r.string(),name:r.string().optional(),weight:r.number().optional(),hash:r.string().optional(),unmatched:r.boolean().optional()}),n$=r.object({name:r.string().optional(),type:r.string().optional(),strength:r.number().optional(),strengthClip:r.number().optional(),air:r.string().optional()}),nV=r.object({type:r.string().optional(),weight:r.number().optional(),modelVersionId:r.number()}),nW=r.object({baseModel:r.string().optional(),prompt:nG,negativePrompt:nG,cfgScale:nE,steps:nE,sampler:nG,seed:nE,hashes:r.record(r.string(),r.string()).optional(),clipSkip:n.number().optional(),"Clip skip":n.number().optional(),comfy:r.union([r.string().optional(),nj.optional()]).optional(),external:nB.optional(),effects:r.record(r.string(),r.any()).optional(),engine:r.string().optional(),version:r.string().optional(),process:r.string().optional(),type:r.string().optional(),workflow:r.string().optional(),resources:nz.array().optional(),additionalResources:n$.array().optional(),civitaiResources:nV.array().optional(),extra:r.record(r.string(),r.unknown()).optional().catch(void 0)}),nH=r.looseObject({...nW.shape});function nK(e,t){let r=nr(e,", Hashes: ");return r?(t.hashes=JSON.parse(r.json),e.slice(0,r.start)+e.slice(r.end)):e}var nX=new Set(Object.keys(nW.shape));function nJ(e,t){for(let r=0;r<20;r++){let r=!1;for(let n=0;n<e.length;n++){let i=e[n];if("{"!==i&&"["!==i||!function(e,t){let r=0;for(let n=0;n<t;n++)'"'===e[n]&&r++;return r%2==0}(e,n))continue;let o=e.slice(0,n).match(/(?:^|, )([A-Za-z][^:,"{}[\]]*): $/);if(!o)continue;let a=function(e,t){let r=[],n=!1,i=!1;for(let o=t;o<e.length;o++){let t=e[o];if(i){i=!1;continue}if("\\"===t){i=!0;continue}if('"'===t){n=!n;continue}if(!n){if("{"===t||"["===t)r.push(t);else if("}"===t||"]"===t){let e=r.pop();if("}"===t&&"{"!==e||"]"===t&&"["!==e)return null;if(0===r.length)return o+1}}}return null}(e,n);if(null===a)continue;let s=e.slice(n,a);try{JSON.parse(s)}catch{continue}let u=o[1].trim();nX.has(u)||(t[u]=s),e=e.slice(0,o.index)+e.slice(a),r=!0;break}if(!r)break}return e}var nq=["hashes","civitaiResources","scheduler","vaes","additionalResources","comfy","upscalers","models","controlNets","denoise","other","external"];function nY(e){return{samplerMap:n_,a1111ExcludedKeys:nq,a1111DetailExtractors:[nK,nJ],...e}}function nZ(e,t){let r=t,n={};for(let t of e??[])t.parsers&&(r=t.parsers(r)),t.context&&(n={...n,...t.context});return{parsers:r,context:n}}function nQ(e){return e.length>=3&&255===e[0]&&216===e[1]&&255===e[2]?"jpeg":e.length>=8&&137===e[0]&&80===e[1]&&78===e[2]&&71===e[3]&&13===e[4]&&10===e[5]&&26===e[6]&&10===e[7]?"png":e.length>=12&&82===e[0]&&73===e[1]&&70===e[2]&&70===e[3]&&87===e[8]&&69===e[9]&&66===e[10]&&80===e[11]?"webp":"unknown"}async function n0(e){if("string"==typeof e){let t=await fetch(e,{credentials:"omit"});if(!t.ok)throw Error(`Failed to fetch ${e}: ${t.status}`);return new Uint8Array(await t.arrayBuffer())}if(e instanceof Uint8Array)return e;if(e instanceof ArrayBuffer)return new Uint8Array(e);if("u">typeof Blob&&e instanceof Blob)return new Uint8Array(await e.arrayBuffer());throw Error("Unsupported input type")}async function n1(e,t){let r,n=await n0(e),i=nQ(n),o=function(e){let t={};try{let r=e.buffer.slice(e.byteOffset,e.byteOffset+e.byteLength);t=rY(r,{includeUnknown:!0})}catch{}let r=Object.entries(t).reduce((e,[t,r])=>(e[t]=r.value,e),{});return r.UserComment&&(r.userComment=Uint8Array.from(r.UserComment)),r}(n),a=t?.plugins,{parsers:s,context:u}=nZ(a,t?.parsers??nD),l=nY({...u,...t?.context}),f=null;for(let e of s){let t=null;try{t=e.detect(o,l)}catch{continue}if(t){f=e.generator;try{r=e.parse(t,l)}catch{r=void 0}break}}let c=nH.safeParse(r??{}),p={format:i,generator:f,raw:c.success?c.data:{},exif:o};for(let e of a??[])e.enrich?.(p);return p}e.s(["applyA1111Compat",0,nm,"applyFluxSampler",0,nC,"applyPlugins",0,nZ,"applySamplerNode",0,nU,"automatic1111Parser",0,nf,"baseComfyMetadata",0,nN,"createParserContext",0,nY,"decode
1UserComment",0,r6,"defaultParsers",0,nD,"detectComfy",0,nI,"encodeComfy",0,nF,"encodeUserCommentUTF16BE",0,r7,"extractBalancedJson",0,nr,"findKeyForValue",0,nc,"generationMetadataSchema",0,nH,"hashesDetailExtractor",0,nK,"isDefined",0,nd,"jsonBlockDetailExtractor",0,nJ,"readMetadata",0,n1,"removeEmpty",0,np,"samplerMap",0,n_,"scanComfyState",0,nL,"sniffFormat",0,nQ,"toBytes",0,n0],673394);var n2=e=>[255&e,e>>8&255],n3=e=>[255&e,e>>8&255,e>>16&255,e>>24&255],n5=e=>[e>>>24&255,e>>>16&255,e>>>8&255,255&e];function n8(e){let t=new Uint8Array(e.reduce((e,t)=>e+t.length,0)),r=0;for(let n of e)t.set(n,r),r+=n.length;return t}var n6=(()=>{let e=new Uint32Array(256);for(let t=0;t<256;t++){let r=t;for(let e=0;e<8;e++)r=1&r?0xedb88320^r>>>1:r>>>1;e[t]=r>>>0}return e})();function n4(e,t,r,n){let i=[...n2(e),...n2(t),...n3(r)];if(n instanceof Uint8Array){let e=new Uint8Array(4).fill(0);e.set(n.slice(0,4)),i.push(...e)}else i.push(...n3(n));return i}function n7(e){let t=Array.isArray(e)?e.join(", "):e;return new TextEncoder().encode(t+"\0")}var n9={imageDescription:{tag:270,type:2,encoder:n7},software:{tag:305,type:2,encoder:n7},artist:{tag:315,type:2,encoder:n7},userComment:{tag:37510,type:7,encoder:e=>e instanceof Uint32Array?new Uint8Array(e.buffer):e instanceof Uint8Array?e:r7(e)}};function ie(e){let t=Object.entries(e).map(([e,t])=>{let r=n9[e];return r&&t?{key:e,value:t,...r}:null}).filter(nd).sort((e,t)=>e.tag-t.tag),r=[];for(let{value:e,tag:n,type:i,encoder:o}of t){let t=o(e);r.push({tag:n,type:i,count:t.length,data:t})}let n=[73,73,42,0,8,0,0,0],i=r.length,o=n2(i),a=n3(0),s=n.length+o.length+12*i+a.length,u=[],l=[];for(let e of r)2===e.type&&e.count<=4?u.push(n4(e.tag,e.type,e.count,e.data)):(u.push(n4(e.tag,e.type,e.count,s)),l.push(e.data),s+=e.data.length);return new Uint8Array([...n,...o,...u.flat(),...a,...l.flatMap(e=>[...e])])}var it=[69,120,105,102,0,0],ir=[137,80,78,71,13,10,26,10];function ii(e){for(let t=0;t<ir.length;t++)if(e[t]!==ir[t])throw Error("Not a PNG (bad signature)");let t=[],r=8;for(;r+12<=e.length;){let n=e[r]<<24|e[r+1]<<16|e[r+2]<<8|e[r+3],i=String.fromCharCode(e[r+4],e[r+5],e[r+6],e[r+7]),o=e.subarray(r+8,r+8+n);if(t.push({type:i,data:o}),r+=12+n,"IEND"===i)break}return t}function io(e){let t=[new Uint8Array(ir)];for(let r of e){let e=n8([new TextEncoder().encode(r.type),r.data]);t.push(new Uint8Array(n5(r.data.length)),e,new Uint8Array(n5(function(e){let t=0xffffffff;for(let r=0;r<e.length;r++)t=n6[(t^e[r])&255]^t>>>8;return(0xffffffff^t)>>>0}(e))))}return n8(t)}function ia(e,t,r){let n=ii(e).filter(e=>(function(e){if("tEXt"!==e.type&&"iTXt"!==e.type&&"zTXt"!==e.type)return null;let t=e.data.indexOf(0);return -1===t?null:String.fromCharCode(...e.data.subarray(0,t))})(e)!==t),i=n.findIndex(e=>"IHDR"!==e.type);return n.splice(-1===i?n.length:i,0,function(e,t){let r=Uint8Array.from(e,e=>e.charCodeAt(0));if(function(e){for(let t=0;t<e.length;t++){let r=e.charCodeAt(t);if(r>255||0===r)return!1}return!0}(t)){let e=Uint8Array.from(t,e=>e.charCodeAt(0));return{type:"tEXt",data:n8([r,new Uint8Array([0]),e])}}return{type:"iTXt",data:n8([r,new Uint8Array([0,0,0,0,0]),new TextEncoder().encode(t)])}}(t,r)),io(n)}function is(e){return"string"==typeof e?e:Array.isArray(e)?e.join(", "):void 0}async function iu(e,t){let r=await n0(e),n=nQ(r);if("png"===n){var i,o;let e,n,a=t.parameters;return a||t.prompt||t.workflow||!t.userCommentBytes||(a=r6(t.userCommentBytes)||void 0),a&&(r=ia(r,"parameters",a)),t.prompt&&(r=ia(r,"prompt",t.prompt)),t.workflow&&(r=ia(r,"workflow",t.workflow)),(t.artist||t.software)&&(i=r,o=ie({artist:t.artist,software:t.software}),n=(e=ii(i).filter(e=>"eXIf"!==e.type)).findIndex(e=>"IHDR"!==e.type),e.splice(-1===n?e.length:n,0,{type:"eXIf",data:o}),r=io(e)),r}if("jpeg"===n){let e,n,i=t.userCommentBytes;if(!i&&t.parameters&&(i=t.parameters),!i&&t.prompt)try{i=JSON.stringify({...JSON.parse(t.prompt),extra:{}})}catch{i=void 0}return i||t.artist||t.software?function(e,t){if(255!==e[0]||216!==e[1])throw Error("Not a JPEG (missing SOI)");let r=2,n=2;for(;r+4<=e.length&&255===e[r];){let i=e[r+1];if(218===i)break;let o=e[r+2]<<8|e[r+3],a=r+2+o;if(225===i&&function(e,t){return it.every((r,n)=>e[t+4+n]===r)}(e,r))return n8([e.subarray(0,r),t,e.subarray(a)]);224===i&&(n=a),r=a}return n8([e.subarray(0,n),t,e.subarray(n)])}(r,(n=(e=new Uint8Array([69,120,105,102,0,0,...ie({artist:t.artist,software:t.software,userComment:i})])).length+2,new Uint8Array([255,225,n>>8&255,255&n,...e]))):r}throw Error(`Metadata writing is not supported for format: ${n}`)}async function il(e,t){return iu(t,function(e){let t=e.exif,r={};if("string"==typeof t.parameters&&(r.parameters=t.parameters),"string"==typeof t.prompt&&(r.prompt=t.prompt),"string"==typeof t.workflow&&(r.workflow=t.workflow),t.userComment instanceof Uint8Array&&(r.userCommentBytes=t.userComment),!r.prompt){let e=t.Model;if(Array.isArray(e)&&"string"==typeof e[0]&&e[0].startsWith("prompt:")){let t=e[0].replace(/^prompt:/,"");r.prompt=t,r.workflow??=t}}let n=is(t.Artist);
1n&&(r.artist=n);let i=is(t.Software);return i&&(r.software=i),r}(await n1(e)))}function ic(e){let{context:t}=nZ(e?.plugins,nD);return nY({...t,...e?.context})}e.s(["copyMetadata",0,il,"encodeMetadata",0,function(e,t="automatic1111",r){let{parsers:n}=nZ(r?.plugins,nD),i=n.find(e=>e.generator===t);if(!i){if(r?.throwOnError)throw Error(`No parser registered for generator: ${t}`);return""}try{return i.encode(e,ic(r))}catch(e){if(r?.throwOnError)throw e;return""}},"parseGenerationText",0,function(e,t){let r=nf.parse({generationDetails:e},ic(t)),n=nH.safeParse(r),i=n.success?n.data:{},o={format:"unknown",generator:Object.keys(i).length>0?"automatic1111":null,raw:i,exif:{}};for(let e of t?.plugins??[])e.enrich?.(o);return o}],177964)}]); 2 3//# sourceMappingURL=26f0dtlh3snz6.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.