@gisatcz/deckgl-geolib 1.10.2-dev.0 → 1.10.2-dev.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.js +15 -7245
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.min.js +4 -4
- package/dist/cjs/index.min.js.map +1 -1
- package/dist/cjs/types/geoimage/geoimage.d.ts +2 -2
- package/dist/cjs/types/loaders/CogTerrainLoader.d.ts +26 -1
- package/dist/esm/index.js +7 -7237
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.min.js +4 -4
- package/dist/esm/index.min.js.map +1 -1
- package/dist/esm/types/geoimage/geoimage.d.ts +2 -2
- package/dist/esm/types/loaders/CogTerrainLoader.d.ts +26 -1
- package/package.json +9 -7
- package/rollup.config.mjs +4 -3
- package/src/loaders/CogTerrainLoader.ts +1 -2
package/dist/esm/index.min.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{WebMercatorViewport as e,OrthographicViewport as t,project as i,_LayersPass as r,_PickLayersPass as s,log as n,LayerExtension as a,CompositeLayer as o,createIterable as A,COORDINATE_SYSTEM as l,Layer as h,project32 as c,phongLighting as g,picking as u}from"@deck.gl/core";import{TileLayer as d}from"@deck.gl/geo-layers";import{BitmapLayer as f}from"@deck.gl/layers";import{GL as p}from"@luma.gl/constants";import I from"chroma-js";import{log as m,Buffer as _,getVertexFormatFromAttribute as w,uid as C,assert as B,RenderPipeline as E,ComputePipeline as y,Shader as Q,isObjectEmpty as b,deepEqual as k,UniformStore as x,splitUniformsAndBindings as v,TextureView as D,Texture as S,Sampler as M,getAttributeInfosFromLayouts as U,getTypedArrayFromDataType as G}from"@luma.gl/core";function T(e,t,i,r){return new(i||(i=Promise))((function(s,n){function a(e){try{A(r.next(e))}catch(e){n(e)}}function o(e){try{A(r.throw(e))}catch(e){n(e)}}function A(e){var t;e.done?s(e.value):(t=e.value,t instanceof i?t:new i((function(e){e(t)}))).then(a,o)}A((r=r.apply(e,t||[])).next())}))}function F(e,t){if(!e)throw new Error(t||"shadertools: assertion failed.")}const R={number:{type:"number",validate:(e,t)=>Number.isFinite(e)&&"object"==typeof t&&(void 0===t.max||e<=t.max)&&(void 0===t.min||e>=t.min)},array:{type:"array",validate:(e,t)=>Array.isArray(e)||ArrayBuffer.isView(e)}};function L(e){let t=N(e);if("object"!==t)return{value:e,...R[t],type:t};if("object"==typeof e)return e?void 0!==e.type?{...e,...R[e.type],type:e.type}:void 0===e.value?{type:"object",value:e}:(t=N(e.value),{...e,...R[t],type:t}):{type:"object",value:null};throw new Error("props")}function N(e){return Array.isArray(e)||ArrayBuffer.isView(e)?"array":typeof e}const O={vertex:"#ifdef MODULE_LOGDEPTH\nlogdepth_adjustPosition(gl_Position);\n#endif\n",fragment:"#ifdef MODULE_MATERIAL\ngl_FragColor = material_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_LIGHTING\ngl_FragColor = lighting_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_FOG\ngl_FragColor = fog_filterColor(gl_FragColor);\n#endif\n#ifdef MODULE_PICKING\ngl_FragColor = picking_filterHighlightColor(gl_FragColor);\ngl_FragColor = picking_filterPickingColor(gl_FragColor);\n#endif\n#ifdef MODULE_LOGDEPTH\nlogdepth_setFragDepth();\n#endif\n"},P=/void\s+main\s*\([^)]*\)\s*\{\n?/,z=/}\n?[^{}]*$/,q=[],K="__LUMA_INJECT_DECLARATIONS__";function H(e){const t=e.slice(0,2);switch(t){case"vs":return"vertex";case"fs":return"fragment";default:throw new Error(t)}}function V(e,t,i,r=!1){const s="vertex"===t;for(const t in i){const r=i[t];r.sort(((e,t)=>e.order-t.order)),q.length=r.length;for(let e=0,t=r.length;e<t;++e)q[e]=r[e].injection;const n=`${q.join("\n")}\n`;switch(t){case"vs:#decl":s&&(e=e.replace(K,n));break;case"vs:#main-start":s&&(e=e.replace(P,(e=>e+n)));break;case"vs:#main-end":s&&(e=e.replace(z,(e=>n+e)));break;case"fs:#decl":s||(e=e.replace(K,n));break;case"fs:#main-start":s||(e=e.replace(P,(e=>e+n)));break;case"fs:#main-end":s||(e=e.replace(z,(e=>n+e)));break;default:e=e.replace(t,(e=>e+n))}}return e=e.replace(K,""),r&&(e=e.replace(/\}\s*$/,(e=>e+O[t]))),e}let J=1;class Y{name;vs;fs;getModuleUniforms;dependencies;deprecations;defines;injections;uniforms={};uniformTypes={};static instantiateModules(e){return e.map((e=>{if(e instanceof Y)return e;F("string"!=typeof e,`Shader module use by name is deprecated. Import shader module '${JSON.stringify(e)}' and use it directly.`),e.name||(console.warn("shader module has no name"),e.name="shader-module-"+J++);const t=new Y(e);return t.dependencies=Y.instantiateModules(e.dependencies||[]),t}))}constructor(e){const{name:t,vs:i,fs:r,dependencies:s=[],uniformPropTypes:n={},getUniforms:a,deprecations:o=[],defines:A={},inject:l={}}=e;F("string"==typeof t),this.name=t,this.vs=i,this.fs=r,this.getModuleUniforms=a,this.dependencies=Y.instantiateModules(s),this.deprecations=this._parseDeprecationDefinitions(o),this.defines=A,this.injections=function(e){const t={vertex:{},fragment:{}};for(const i in e){let r=e[i];"string"==typeof r&&(r={order:0,injection:r}),t[H(i)][i]=r}return t}(l),n&&(this.uniforms=function(e){const t={};for(const[i,r]of Object.entries(e))t[i]=L(r);return t}(n))}getModuleSource(e){let t;switch(e){case"vertex":t=this.vs||"";break;case"fragment":t=this.fs||"";break;default:F(!1)}const i=this.name.toUpperCase().replace(/[^0-9a-z]/gi,"_");return`// ----- MODULE ${this.name} ---------------\n\n#define MODULE_${i}\n${t}\n\n`}getUniforms(e,t){return this.getModuleUniforms?this.getModuleUniforms(e,t):function(e,t,i){const r={};for(const[s,n]of Object.entries(t))e&&s in e&&!n.private?(n.validate&&F(n.validate(e[s],n),`${i}: invalid ${s}`),r[s]=e[s]):r[s]=n.value;return r}(e,this.uniforms,this.name)}getDefines(){return this.defines}checkDeprecations(e,t){this.deprecations.forEach((i=>{i.regex?.test(e)&&(i.deprecated?t.deprecated(i.old,i.new)():t.removed(i.old,i.new)())}))}_parseDeprecationDefinitions(e){return e.forEach((e=>{if("function"===e.type)e.regex=new RegExp(`\\b${e.old}\\(`);else e.regex=new RegExp(`${e.type} ${e.old};`)})),e}_defaultGetUniforms(e={}){const t={},i=this.uniforms;for(const r in i){const s=i[r];r in e&&!s.private?(s.validate&&F(s.validate(e[r],s),`${this.name}: invalid ${r}`),t[r]=e[r]):t[r]=s.value}return t}}function j(e){if(e.source&&"webgpu"===e.platformInfo.type){return{...e,vs:void 0,fs:void 0}}if(!e.vs)throw new Error("no vertex shader");const t=Z(e.platformInfo,e.vs);let i;return e.fs&&(i=Z(e.platformInfo,e.fs)),{...e,vs:t,fs:i}}function Z(e,t){if("string"==typeof t)return t;if("webgpu"===e.type){if(t?.wgsl)return t.wgsl;throw new Error("WebGPU does not support GLSL shaders")}if(t?.glsl)return t.glsl;throw new Error("WebGL does not support WGSL shaders")}function W(e){return function(e){const t={},i={};return X({modules:e,level:0,moduleMap:t,moduleDepth:i}),Object.keys(i).sort(((e,t)=>i[t]-i[e])).map((e=>t[e]))}(Y.instantiateModules(e))}function X(e){const{modules:t,level:i,moduleMap:r,moduleDepth:s}=e;if(i>=5)throw new Error("Possible loop in shader dependency graph");for(const e of t)r[e.name]=e,(void 0===s[e.name]||s[e.name]<i)&&(s[e.name]=i);for(const e of t)e.dependencies&&X({modules:e.dependencies,level:i+1,moduleMap:r,moduleDepth:s})}const $=[[/^(#version[ \t]+(100|300[ \t]+es))?[ \t]*\n/,"#version 300 es\n"],[/\btexture(2D|2DProj|Cube)Lod(EXT)?\(/g,"textureLod("],[/\btexture(2D|2DProj|Cube)(EXT)?\(/g,"texture("]],ee=[...$,[re("attribute"),"in $1"],[re("varying"),"out $1"]],te=[...$,[re("varying"),"in $1"]];function ie(e,t){for(const[i,r]of t)e=e.replace(i,r);return e}function re(e){return new RegExp(`\\b${e}[ \\t]+(\\w+[ \\t]+\\w+(\\[\\w+\\])?;)`,"g")}function se(e,t){let i="";for(const r in e){const s=e[r];if(i+=`void ${s.signature} {\n`,s.header&&(i+=` ${s.header}`),t[r]){const e=t[r];e.sort(((e,t)=>e.order-t.order));for(const t of e)i+=` ${t.injection}\n`}s.footer&&(i+=` ${s.footer}`),i+="}\n"}return i}function ne(e){const t={vertex:{},fragment:{}};for(const i of e){let e,r;"string"!=typeof i?(e=i,r=e.hook):(e={},r=i),r=r.trim();const[s,n]=r.split(":"),a=r.replace(/\(.+/,""),o=Object.assign(e,{signature:n});switch(s){case"vs":t.vertex[a]=o;break;case"fs":t.fragment[a]=o;break;default:throw new Error(s)}}return t}function ae(e,t="unnamed"){const i=/#define[^\S\r\n]*SHADER_NAME[^\S\r\n]*([A-Za-z0-9_-]+)\s*/.exec(e);return i?i[1]:t}function oe(e){let t=100;const i=e.match(/[^\s]+/g);if(i&&i.length>=2&&"#version"===i[0]){const e=parseInt(i[1],10);Number.isFinite(e)&&(t=e)}if(100!==t&&300!==t)throw new Error(`Invalid GLSL version ${t}`);return t}const Ae=`\n\n${K}\n`,le="precision highp float;\n";function he(e,t){const{source:i,stage:r,modules:s,hookFunctions:n=[],inject:a={},log:o}=t;F("string"==typeof i,"shader source must be a string");const A=i;let l="";const h=ne(n),c={},g={},u={};for(const e in a){const t="string"==typeof a[e]?{injection:a[e],order:0}:a[e],i=/^(v|f)s:(#)?([\w-]+)$/.exec(e);if(i){const r=i[2],s=i[3];r?"decl"===s?g[e]=[t]:u[e]=[t]:c[e]=[t]}else u[e]=[t]}const d="webgpu"!==e.type?s:[];for(const e of d){o&&e.checkDeprecations(A,o);l+=e.getModuleSource(r,"wgsl");const t=e.injections[r];for(const e in t){const i=/^(v|f)s:#([\w-]+)$/.exec(e);if(i){const r="decl"===i[2]?g:u;r[e]=r[e]||[],r[e].push(t[e])}else c[e]=c[e]||[],c[e].push(t[e])}}return l+=Ae,l=V(l,r,g),l+=se(h[r],c),l+=A,l=V(l,r,u),l}function ce(e,t){const{id:i,source:r,stage:s,language:n="glsl",modules:a,defines:o={},hookFunctions:A=[],inject:l={},prologue:h=!0,log:c}=t;F("string"==typeof r,"shader source must be a string");const g="glsl"===n?function(e,t){return{name:ae(e,t),language:"glsl",version:oe(e)}}(r).version:-1,u=e.shaderLanguageVersion,d=100===g?"#version 100":"#version 300 es",f=r.split("\n").slice(1).join("\n"),p={};a.forEach((e=>{Object.assign(p,e.getDefines())})),Object.assign(p,o);let I="";switch(n){case"wgsl":break;case"glsl":I=h?`${d}\n\n// ----- PROLOGUE -------------------------\n${function(e){const{id:t,source:i,stage:r}=e,s=t&&-1===i.indexOf("SHADER_NAME");return s?`\n#define SHADER_NAME ${t}_${r}\n\n`:""}({id:i,source:r,stage:s})}\n#define SHADER_TYPE_${s.toUpperCase()}\n${function(e){switch(e?.gpu.toLowerCase()){case"apple":return"#define APPLE_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"nvidia":return"#define NVIDIA_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n";case"intel":return"#define INTEL_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n";case"amd":return"#define AMD_GPU\n";default:return"#define DEFAULT_GPU\n#define LUMA_FP64_CODE_ELIMINATION_WORKAROUND 1\n#define LUMA_FP32_TAN_PRECISION_WORKAROUND 1\n#define LUMA_FP64_HIGH_BITS_OVERFLOW_WORKAROUND 1\n"}}(e)}\n${"fragment"===s?le:""}\n\n// ----- APPLICATION DEFINES -------------------------\n\n${function(e={}){let t="";for(const i in e){const r=e[i];(r||Number.isFinite(r))&&(t+=`#define ${i.toUpperCase()} ${e[i]}\n`)}return t}(p)}\n\n`:`${d}\n`}const m=ne(A),_={},w={},C={};for(const e in l){const t="string"==typeof l[e]?{injection:l[e],order:0}:l[e],i=/^(v|f)s:(#)?([\w-]+)$/.exec(e);if(i){const r=i[2],s=i[3];r?"decl"===s?w[e]=[t]:C[e]=[t]:_[e]=[t]}else C[e]=[t]}for(const e of a){c&&e.checkDeprecations(f,c);I+=e.getModuleSource(s);const t=e.injections[s];for(const e in t){const i=/^(v|f)s:#([\w-]+)$/.exec(e);if(i){const r="decl"===i[2]?w:C;r[e]=r[e]||[],r[e].push(t[e])}else _[e]=_[e]||[],_[e].push(t[e])}}return I+="// ----- MAIN SHADER SOURCE -------------------------",I+=Ae,I=V(I,s,w),I+=se(m[s],_),I+=f,I=V(I,s,C),"glsl"===n&&g!==u&&(I=function(e,t){if(300!==Number(e.match(/^#version[ \t]+(\d+)/m)?.[1]||100))throw new Error("luma.gl v9 only supports GLSL 3.00 shader sources");switch(t){case"vertex":return ie(e,ee);case"fragment":return ie(e,te);default:throw new Error(t)}}(I,s)),I.trim()}function ge(e){return function(t){const i={};for(const r of e){const e=r.getUniforms(t,i);Object.assign(i,e)}return i}}class ue{static defaultShaderAssembler;_hookFunctions=[];_defaultModules=[];static getDefaultShaderAssembler(){return ue.defaultShaderAssembler=ue.defaultShaderAssembler||new ue,ue.defaultShaderAssembler}addDefaultModule(e){this._defaultModules.find((t=>t.name===("string"==typeof e?e:e.name)))||this._defaultModules.push(e)}removeDefaultModule(e){const t="string"==typeof e?e:e.name;this._defaultModules=this._defaultModules.filter((e=>e.name!==t))}addShaderHook(e,t){t&&(e=Object.assign(t,{hook:e})),this._hookFunctions.push(e)}assembleShader(e){const t=this._getModuleList(e.modules),i=this._hookFunctions,r=j(e),s=function(e){const t=W(e.modules||[]);return{source:he(e.platformInfo,{...e,source:e.source,stage:"vertex",modules:t}),getUniforms:ge(t)}}({platformInfo:e.platformInfo,...r,modules:t,hookFunctions:i});return{...s,modules:t}}assembleShaderPair(e){const t=j(e),i=this._getModuleList(e.modules),r=this._hookFunctions,{platformInfo:s}=e,n="wgsl"===e.platformInfo.shaderLanguage?function(e){const t=W(e.modules||[]);return{vs:he(e.platformInfo,{...e,source:e.vs,stage:"vertex",modules:t}),fs:he(e.platformInfo,{...e,source:e.fs,stage:"fragment",modules:t}),getUniforms:ge(t)}}({platformInfo:s,...t,modules:i,hookFunctions:r}):function(e){const{vs:t,fs:i}=e,r=W(e.modules||[]);return{vs:ce(e.platformInfo,{...e,source:t,stage:"vertex",modules:r}),fs:ce(e.platformInfo,{...e,source:i,stage:"fragment",modules:r}),getUniforms:ge(r)}}({platformInfo:s,...t,modules:i,hookFunctions:r});return{...n,modules:i}}_getModuleList(e=[]){const t=new Array(this._defaultModules.length+e.length),i={};let r=0;for(let e=0,s=this._defaultModules.length;e<s;++e){const s=this._defaultModules[e],n=s.name;t[r++]=s,i[n]=!0}for(let s=0,n=e.length;s<n;++s){const n=e[s],a=n.name;i[a]||(t[r++]=n,i[a]=!0)}return t.length=r,Y.instantiateModules(t)}}class de{constructor(){this.constants=new Map,this.aliases=new Map,this.structs=new Map}}class fe{constructor(){}get isAstNode(){return!0}get astNodeType(){return""}evaluate(e){throw new Error("Cannot evaluate node")}evaluateString(e){return this.evaluate(e).toString()}}class pe extends fe{constructor(){super()}}class Ie extends pe{constructor(e,t,i,r){super(),this.name=e,this.args=t,this.returnType=i,this.body=r}get astNodeType(){return"function"}}class me extends pe{constructor(e){super(),this.expression=e}get astNodeType(){return"staticAssert"}}class _e extends pe{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"while"}}class we extends pe{constructor(e){super(),this.body=e}get astNodeType(){return"continuing"}}class Ce extends pe{constructor(e,t,i,r){super(),this.init=e,this.condition=t,this.increment=i,this.body=r}get astNodeType(){return"for"}}class Be extends pe{constructor(e,t,i,r,s){super(),this.name=e,this.type=t,this.storage=i,this.access=r,this.value=s}get astNodeType(){return"var"}}class Ee extends pe{constructor(e,t,i){super(),this.name=e,this.type=t,this.value=i}get astNodeType(){return"override"}}class ye extends pe{constructor(e,t,i,r,s){super(),this.name=e,this.type=t,this.storage=i,this.access=r,this.value=s}get astNodeType(){return"let"}}class Qe extends pe{constructor(e,t,i,r,s){super(),this.name=e,this.type=t,this.storage=i,this.access=r,this.value=s}get astNodeType(){return"const"}evaluate(e){return this.value.evaluate(e)}}var be,ke,xe,ve,De;!function(e){e.increment="++",e.decrement="--"}(be||(be={})),function(e){e.parse=function(t){const i=t;if("parse"==i)throw new Error("Invalid value for IncrementOperator");return e[i]}}(be||(be={}));class Se extends pe{constructor(e,t){super(),this.operator=e,this.variable=t}get astNodeType(){return"increment"}}!function(e){e.assign="=",e.addAssign="+=",e.subtractAssin="-=",e.multiplyAssign="*=",e.divideAssign="/=",e.moduloAssign="%=",e.andAssign="&=",e.orAssign="|=",e.xorAssign="^=",e.shiftLeftAssign="<<=",e.shiftRightAssign=">>="}(ke||(ke={})),function(e){e.parse=function(t){const i=t;if("parse"==i)throw new Error("Invalid value for AssignOperator");return e[i]}}(ke||(ke={}));class Me extends pe{constructor(e,t,i){super(),this.operator=e,this.variable=t,this.value=i}get astNodeType(){return"assign"}}class Ue extends pe{constructor(e,t){super(),this.name=e,this.args=t}get astNodeType(){return"call"}}class Ge extends pe{constructor(e,t){super(),this.body=e,this.continuing=t}get astNodeType(){return"loop"}}class Te extends pe{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"body"}}class Fe extends pe{constructor(e,t,i,r){super(),this.condition=e,this.body=t,this.elseif=i,this.else=r}get astNodeType(){return"if"}}class Re extends pe{constructor(e){super(),this.value=e}get astNodeType(){return"return"}}class Le extends pe{constructor(e){super(),this.name=e}get astNodeType(){return"enable"}}class Ne extends pe{constructor(e,t){super(),this.name=e,this.type=t}get astNodeType(){return"alias"}}class Oe extends pe{constructor(){super()}get astNodeType(){return"discard"}}class Pe extends pe{constructor(){super()}get astNodeType(){return"break"}}class ze extends pe{constructor(){super()}get astNodeType(){return"continue"}}class qe extends pe{constructor(e){super(),this.name=e}get astNodeType(){return"type"}get isStruct(){return!1}get isArray(){return!1}}class Ke extends qe{constructor(e,t){super(e),this.members=t}get astNodeType(){return"struct"}get isStruct(){return!0}getMemberIndex(e){for(let t=0;t<this.members.length;t++)if(this.members[t].name==e)return t;return-1}}class He extends qe{constructor(e,t,i){super(e),this.format=t,this.access=i}get astNodeType(){return"template"}}class Ve extends qe{constructor(e,t,i,r){super(e),this.storage=t,this.type=i,this.access=r}get astNodeType(){return"pointer"}}class Je extends qe{constructor(e,t,i,r){super(e),this.attributes=t,this.format=i,this.count=r}get astNodeType(){return"array"}get isArray(){return!0}}class Ye extends qe{constructor(e,t,i){super(e),this.format=t,this.access=i}get astNodeType(){return"sampler"}}class je extends fe{constructor(){super()}}class Ze extends je{constructor(e){super(),this.value=e}get astNodeType(){return"stringExpr"}toString(){return this.value}evaluateString(){return this.value}}class We extends je{constructor(e,t){super(),this.type=e,this.args=t}get astNodeType(){return"createExpr"}}class Xe extends je{constructor(e,t){super(),this.name=e,this.args=t}get astNodeType(){return"callExpr"}evaluate(e){switch(this.name){case"abs":return Math.abs(this.args[0].evaluate(e));case"acos":return Math.acos(this.args[0].evaluate(e));case"acosh":return Math.acosh(this.args[0].evaluate(e));case"asin":return Math.asin(this.args[0].evaluate(e));case"asinh":return Math.asinh(this.args[0].evaluate(e));case"atan":return Math.atan(this.args[0].evaluate(e));case"atan2":return Math.atan2(this.args[0].evaluate(e),this.args[1].evaluate(e));case"atanh":return Math.atanh(this.args[0].evaluate(e));case"ceil":return Math.ceil(this.args[0].evaluate(e));case"clamp":return Math.min(Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e)),this.args[2].evaluate(e));case"cos":return Math.cos(this.args[0].evaluate(e));case"degrees":return 180*this.args[0].evaluate(e)/Math.PI;case"distance":return Math.sqrt(Math.pow(this.args[0].evaluate(e)-this.args[1].evaluate(e),2));case"dot":case"exp":return Math.exp(this.args[0].evaluate(e));case"exp2":return Math.pow(2,this.args[0].evaluate(e));case"floor":return Math.floor(this.args[0].evaluate(e));case"fma":return this.args[0].evaluate(e)*this.args[1].evaluate(e)+this.args[2].evaluate(e);case"fract":case"modf":return this.args[0].evaluate(e)-Math.floor(this.args[0].evaluate(e));case"inverseSqrt":return 1/Math.sqrt(this.args[0].evaluate(e));case"log":return Math.log(this.args[0].evaluate(e));case"log2":return Math.log2(this.args[0].evaluate(e));case"max":return Math.max(this.args[0].evaluate(e),this.args[1].evaluate(e));case"min":return Math.min(this.args[0].evaluate(e),this.args[1].evaluate(e));case"mix":return this.args[0].evaluate(e)*(1-this.args[2].evaluate(e))+this.args[1].evaluate(e)*this.args[2].evaluate(e);case"pow":return Math.pow(this.args[0].evaluate(e),this.args[1].evaluate(e));case"radians":return this.args[0].evaluate(e)*Math.PI/180;case"round":return Math.round(this.args[0].evaluate(e));case"sign":return Math.sign(this.args[0].evaluate(e));case"sin":return Math.sin(this.args[0].evaluate(e));case"sinh":return Math.sinh(this.args[0].evaluate(e));case"saturate":return Math.min(Math.max(this.args[0].evaluate(e),0),1);case"smoothstep":return this.args[0].evaluate(e)*this.args[0].evaluate(e)*(3-2*this.args[0].evaluate(e));case"sqrt":return Math.sqrt(this.args[0].evaluate(e));case"step":return this.args[0].evaluate(e)<this.args[1].evaluate(e)?0:1;case"tan":return Math.tan(this.args[0].evaluate(e));case"tanh":return Math.tanh(this.args[0].evaluate(e));case"trunc":return Math.trunc(this.args[0].evaluate(e));default:throw new Error("Non const function: "+this.name)}}}class $e extends je{constructor(e){super(),this.name=e}get astNodeType(){return"varExpr"}}class et extends je{constructor(e,t){super(),this.name=e,this.initializer=t}get astNodeType(){return"constExpr"}evaluate(e){var t,i;if(this.initializer instanceof We){const r=null===(t=this.postfix)||void 0===t?void 0:t.evaluateString(e),s=null===(i=this.initializer.type)||void 0===i?void 0:i.name,n=e.structs.get(s),a=null==n?void 0:n.getMemberIndex(r);if(-1!=a){return this.initializer.args[a].evaluate(e)}console.log(a)}return this.initializer.evaluate(e)}}class tt extends je{constructor(e){super(),this.value=e}get astNodeType(){return"literalExpr"}evaluate(){return this.value}}class it extends je{constructor(e,t){super(),this.type=e,this.value=t}get astNodeType(){return"bitcastExpr"}}class rt extends je{constructor(e,t){super(),this.type=e,this.args=t}get astNodeType(){return"typecastExpr"}evaluate(e){return this.args[0].evaluate(e)}}class st extends je{constructor(e){super(),this.contents=e}get astNodeType(){return"groupExpr"}evaluate(e){return this.contents[0].evaluate(e)}}class nt extends je{constructor(){super()}}class at extends nt{constructor(e,t){super(),this.operator=e,this.right=t}get astNodeType(){return"unaryOp"}evaluate(e){switch(this.operator){case"+":return this.right.evaluate(e);case"-":return-this.right.evaluate(e);case"!":return this.right.evaluate(e)?0:1;case"~":return~this.right.evaluate(e);default:throw new Error("Unknown unary operator: "+this.operator)}}}class ot extends nt{constructor(e,t,i){super(),this.operator=e,this.left=t,this.right=i}get astNodeType(){return"binaryOp"}evaluate(e){switch(this.operator){case"+":return this.left.evaluate(e)+this.right.evaluate(e);case"-":return this.left.evaluate(e)-this.right.evaluate(e);case"*":return this.left.evaluate(e)*this.right.evaluate(e);case"/":return this.left.evaluate(e)/this.right.evaluate(e);case"%":return this.left.evaluate(e)%this.right.evaluate(e);case"==":return this.left.evaluate(e)==this.right.evaluate(e)?1:0;case"!=":return this.left.evaluate(e)!=this.right.evaluate(e)?1:0;case"<":return this.left.evaluate(e)<this.right.evaluate(e)?1:0;case">":return this.left.evaluate(e)>this.right.evaluate(e)?1:0;case"<=":return this.left.evaluate(e)<=this.right.evaluate(e)?1:0;case">=":return this.left.evaluate(e)>=this.right.evaluate(e)?1:0;case"&&":return this.left.evaluate(e)&&this.right.evaluate(e)?1:0;case"||":return this.left.evaluate(e)||this.right.evaluate(e)?1:0;default:throw new Error(`Unknown operator ${this.operator}`)}}}class At extends fe{constructor(){super()}}class lt extends At{constructor(e,t){super(),this.selector=e,this.body=t}get astNodeType(){return"case"}}class ht extends At{constructor(e){super(),this.body=e}get astNodeType(){return"default"}}class ct extends fe{constructor(e,t,i){super(),this.name=e,this.type=t,this.attributes=i}get astNodeType(){return"argument"}}class gt extends fe{constructor(e,t){super(),this.condition=e,this.body=t}get astNodeType(){return"elseif"}}class ut extends fe{constructor(e,t,i){super(),this.name=e,this.type=t,this.attributes=i}get astNodeType(){return"member"}}class dt extends fe{constructor(e,t){super(),this.name=e,this.value=t}get astNodeType(){return"attribute"}}!function(e){e[e.token=0]="token",e[e.keyword=1]="keyword",e[e.reserved=2]="reserved"}(ve||(ve={}));class ft{constructor(e,t,i){this.name=e,this.type=t,this.rule=i}toString(){return this.name}}class pt{}xe=pt,pt.none=new ft("",ve.reserved,""),pt.eof=new ft("EOF",ve.token,""),pt.reserved={asm:new ft("asm",ve.reserved,"asm"),bf16:new ft("bf16",ve.reserved,"bf16"),do:new ft("do",ve.reserved,"do"),enum:new ft("enum",ve.reserved,"enum"),f16:new ft("f16",ve.reserved,"f16"),f64:new ft("f64",ve.reserved,"f64"),handle:new ft("handle",ve.reserved,"handle"),i8:new ft("i8",ve.reserved,"i8"),i16:new ft("i16",ve.reserved,"i16"),i64:new ft("i64",ve.reserved,"i64"),mat:new ft("mat",ve.reserved,"mat"),premerge:new ft("premerge",ve.reserved,"premerge"),regardless:new ft("regardless",ve.reserved,"regardless"),typedef:new ft("typedef",ve.reserved,"typedef"),u8:new ft("u8",ve.reserved,"u8"),u16:new ft("u16",ve.reserved,"u16"),u64:new ft("u64",ve.reserved,"u64"),unless:new ft("unless",ve.reserved,"unless"),using:new ft("using",ve.reserved,"using"),vec:new ft("vec",ve.reserved,"vec"),void:new ft("void",ve.reserved,"void")},pt.keywords={array:new ft("array",ve.keyword,"array"),atomic:new ft("atomic",ve.keyword,"atomic"),bool:new ft("bool",ve.keyword,"bool"),f32:new ft("f32",ve.keyword,"f32"),i32:new ft("i32",ve.keyword,"i32"),mat2x2:new ft("mat2x2",ve.keyword,"mat2x2"),mat2x3:new ft("mat2x3",ve.keyword,"mat2x3"),mat2x4:new ft("mat2x4",ve.keyword,"mat2x4"),mat3x2:new ft("mat3x2",ve.keyword,"mat3x2"),mat3x3:new ft("mat3x3",ve.keyword,"mat3x3"),mat3x4:new ft("mat3x4",ve.keyword,"mat3x4"),mat4x2:new ft("mat4x2",ve.keyword,"mat4x2"),mat4x3:new ft("mat4x3",ve.keyword,"mat4x3"),mat4x4:new ft("mat4x4",ve.keyword,"mat4x4"),ptr:new ft("ptr",ve.keyword,"ptr"),sampler:new ft("sampler",ve.keyword,"sampler"),sampler_comparison:new ft("sampler_comparison",ve.keyword,"sampler_comparison"),struct:new ft("struct",ve.keyword,"struct"),texture_1d:new ft("texture_1d",ve.keyword,"texture_1d"),texture_2d:new ft("texture_2d",ve.keyword,"texture_2d"),texture_2d_array:new ft("texture_2d_array",ve.keyword,"texture_2d_array"),texture_3d:new ft("texture_3d",ve.keyword,"texture_3d"),texture_cube:new ft("texture_cube",ve.keyword,"texture_cube"),texture_cube_array:new ft("texture_cube_array",ve.keyword,"texture_cube_array"),texture_multisampled_2d:new ft("texture_multisampled_2d",ve.keyword,"texture_multisampled_2d"),texture_storage_1d:new ft("texture_storage_1d",ve.keyword,"texture_storage_1d"),texture_storage_2d:new ft("texture_storage_2d",ve.keyword,"texture_storage_2d"),texture_storage_2d_array:new ft("texture_storage_2d_array",ve.keyword,"texture_storage_2d_array"),texture_storage_3d:new ft("texture_storage_3d",ve.keyword,"texture_storage_3d"),texture_depth_2d:new ft("texture_depth_2d",ve.keyword,"texture_depth_2d"),texture_depth_2d_array:new ft("texture_depth_2d_array",ve.keyword,"texture_depth_2d_array"),texture_depth_cube:new ft("texture_depth_cube",ve.keyword,"texture_depth_cube"),texture_depth_cube_array:new ft("texture_depth_cube_array",ve.keyword,"texture_depth_cube_array"),texture_depth_multisampled_2d:new ft("texture_depth_multisampled_2d",ve.keyword,"texture_depth_multisampled_2d"),texture_external:new ft("texture_external",ve.keyword,"texture_external"),u32:new ft("u32",ve.keyword,"u32"),vec2:new ft("vec2",ve.keyword,"vec2"),vec3:new ft("vec3",ve.keyword,"vec3"),vec4:new ft("vec4",ve.keyword,"vec4"),bitcast:new ft("bitcast",ve.keyword,"bitcast"),block:new ft("block",ve.keyword,"block"),break:new ft("break",ve.keyword,"break"),case:new ft("case",ve.keyword,"case"),continue:new ft("continue",ve.keyword,"continue"),continuing:new ft("continuing",ve.keyword,"continuing"),default:new ft("default",ve.keyword,"default"),discard:new ft("discard",ve.keyword,"discard"),else:new ft("else",ve.keyword,"else"),enable:new ft("enable",ve.keyword,"enable"),fallthrough:new ft("fallthrough",ve.keyword,"fallthrough"),false:new ft("false",ve.keyword,"false"),fn:new ft("fn",ve.keyword,"fn"),for:new ft("for",ve.keyword,"for"),function:new ft("function",ve.keyword,"function"),if:new ft("if",ve.keyword,"if"),let:new ft("let",ve.keyword,"let"),const:new ft("const",ve.keyword,"const"),loop:new ft("loop",ve.keyword,"loop"),while:new ft("while",ve.keyword,"while"),private:new ft("private",ve.keyword,"private"),read:new ft("read",ve.keyword,"read"),read_write:new ft("read_write",ve.keyword,"read_write"),return:new ft("return",ve.keyword,"return"),storage:new ft("storage",ve.keyword,"storage"),switch:new ft("switch",ve.keyword,"switch"),true:new ft("true",ve.keyword,"true"),alias:new ft("alias",ve.keyword,"alias"),type:new ft("type",ve.keyword,"type"),uniform:new ft("uniform",ve.keyword,"uniform"),var:new ft("var",ve.keyword,"var"),override:new ft("override",ve.keyword,"override"),workgroup:new ft("workgroup",ve.keyword,"workgroup"),write:new ft("write",ve.keyword,"write"),r8unorm:new ft("r8unorm",ve.keyword,"r8unorm"),r8snorm:new ft("r8snorm",ve.keyword,"r8snorm"),r8uint:new ft("r8uint",ve.keyword,"r8uint"),r8sint:new ft("r8sint",ve.keyword,"r8sint"),r16uint:new ft("r16uint",ve.keyword,"r16uint"),r16sint:new ft("r16sint",ve.keyword,"r16sint"),r16float:new ft("r16float",ve.keyword,"r16float"),rg8unorm:new ft("rg8unorm",ve.keyword,"rg8unorm"),rg8snorm:new ft("rg8snorm",ve.keyword,"rg8snorm"),rg8uint:new ft("rg8uint",ve.keyword,"rg8uint"),rg8sint:new ft("rg8sint",ve.keyword,"rg8sint"),r32uint:new ft("r32uint",ve.keyword,"r32uint"),r32sint:new ft("r32sint",ve.keyword,"r32sint"),r32float:new ft("r32float",ve.keyword,"r32float"),rg16uint:new ft("rg16uint",ve.keyword,"rg16uint"),rg16sint:new ft("rg16sint",ve.keyword,"rg16sint"),rg16float:new ft("rg16float",ve.keyword,"rg16float"),rgba8unorm:new ft("rgba8unorm",ve.keyword,"rgba8unorm"),rgba8unorm_srgb:new ft("rgba8unorm_srgb",ve.keyword,"rgba8unorm_srgb"),rgba8snorm:new ft("rgba8snorm",ve.keyword,"rgba8snorm"),rgba8uint:new ft("rgba8uint",ve.keyword,"rgba8uint"),rgba8sint:new ft("rgba8sint",ve.keyword,"rgba8sint"),bgra8unorm:new ft("bgra8unorm",ve.keyword,"bgra8unorm"),bgra8unorm_srgb:new ft("bgra8unorm_srgb",ve.keyword,"bgra8unorm_srgb"),rgb10a2unorm:new ft("rgb10a2unorm",ve.keyword,"rgb10a2unorm"),rg11b10float:new ft("rg11b10float",ve.keyword,"rg11b10float"),rg32uint:new ft("rg32uint",ve.keyword,"rg32uint"),rg32sint:new ft("rg32sint",ve.keyword,"rg32sint"),rg32float:new ft("rg32float",ve.keyword,"rg32float"),rgba16uint:new ft("rgba16uint",ve.keyword,"rgba16uint"),rgba16sint:new ft("rgba16sint",ve.keyword,"rgba16sint"),rgba16float:new ft("rgba16float",ve.keyword,"rgba16float"),rgba32uint:new ft("rgba32uint",ve.keyword,"rgba32uint"),rgba32sint:new ft("rgba32sint",ve.keyword,"rgba32sint"),rgba32float:new ft("rgba32float",ve.keyword,"rgba32float"),static_assert:new ft("static_assert",ve.keyword,"static_assert")},pt.tokens={decimal_float_literal:new ft("decimal_float_literal",ve.token,/((-?[0-9]*\.[0-9]+|-?[0-9]+\.[0-9]*)((e|E)(\+|-)?[0-9]+)?f?)|(-?[0-9]+(e|E)(\+|-)?[0-9]+f?)|([0-9]+f)/),hex_float_literal:new ft("hex_float_literal",ve.token,/-?0x((([0-9a-fA-F]*\.[0-9a-fA-F]+|[0-9a-fA-F]+\.[0-9a-fA-F]*)((p|P)(\+|-)?[0-9]+f?)?)|([0-9a-fA-F]+(p|P)(\+|-)?[0-9]+f?))/),int_literal:new ft("int_literal",ve.token,/-?0x[0-9a-fA-F]+|0i?|-?[1-9][0-9]*i?/),uint_literal:new ft("uint_literal",ve.token,/0x[0-9a-fA-F]+u|0u|[1-9][0-9]*u/),ident:new ft("ident",ve.token,/[a-zA-Z][0-9a-zA-Z_]*/),and:new ft("and",ve.token,"&"),and_and:new ft("and_and",ve.token,"&&"),arrow:new ft("arrow ",ve.token,"->"),attr:new ft("attr",ve.token,"@"),attr_left:new ft("attr_left",ve.token,"[["),attr_right:new ft("attr_right",ve.token,"]]"),forward_slash:new ft("forward_slash",ve.token,"/"),bang:new ft("bang",ve.token,"!"),bracket_left:new ft("bracket_left",ve.token,"["),bracket_right:new ft("bracket_right",ve.token,"]"),brace_left:new ft("brace_left",ve.token,"{"),brace_right:new ft("brace_right",ve.token,"}"),colon:new ft("colon",ve.token,":"),comma:new ft("comma",ve.token,","),equal:new ft("equal",ve.token,"="),equal_equal:new ft("equal_equal",ve.token,"=="),not_equal:new ft("not_equal",ve.token,"!="),greater_than:new ft("greater_than",ve.token,">"),greater_than_equal:new ft("greater_than_equal",ve.token,">="),shift_right:new ft("shift_right",ve.token,">>"),less_than:new ft("less_than",ve.token,"<"),less_than_equal:new ft("less_than_equal",ve.token,"<="),shift_left:new ft("shift_left",ve.token,"<<"),modulo:new ft("modulo",ve.token,"%"),minus:new ft("minus",ve.token,"-"),minus_minus:new ft("minus_minus",ve.token,"--"),period:new ft("period",ve.token,"."),plus:new ft("plus",ve.token,"+"),plus_plus:new ft("plus_plus",ve.token,"++"),or:new ft("or",ve.token,"|"),or_or:new ft("or_or",ve.token,"||"),paren_left:new ft("paren_left",ve.token,"("),paren_right:new ft("paren_right",ve.token,")"),semicolon:new ft("semicolon",ve.token,";"),star:new ft("star",ve.token,"*"),tilde:new ft("tilde",ve.token,"~"),underscore:new ft("underscore",ve.token,"_"),xor:new ft("xor",ve.token,"^"),plus_equal:new ft("plus_equal",ve.token,"+="),minus_equal:new ft("minus_equal",ve.token,"-="),times_equal:new ft("times_equal",ve.token,"*="),division_equal:new ft("division_equal",ve.token,"/="),modulo_equal:new ft("modulo_equal",ve.token,"%="),and_equal:new ft("and_equal",ve.token,"&="),or_equal:new ft("or_equal",ve.token,"|="),xor_equal:new ft("xor_equal",ve.token,"^="),shift_right_equal:new ft("shift_right_equal",ve.token,">>="),shift_left_equal:new ft("shift_left_equal",ve.token,"<<=")},pt.storage_class=[xe.keywords.function,xe.keywords.private,xe.keywords.workgroup,xe.keywords.uniform,xe.keywords.storage],pt.access_mode=[xe.keywords.read,xe.keywords.write,xe.keywords.read_write],pt.sampler_type=[xe.keywords.sampler,xe.keywords.sampler_comparison],pt.sampled_texture_type=[xe.keywords.texture_1d,xe.keywords.texture_2d,xe.keywords.texture_2d_array,xe.keywords.texture_3d,xe.keywords.texture_cube,xe.keywords.texture_cube_array],pt.multisampled_texture_type=[xe.keywords.texture_multisampled_2d],pt.storage_texture_type=[xe.keywords.texture_storage_1d,xe.keywords.texture_storage_2d,xe.keywords.texture_storage_2d_array,xe.keywords.texture_storage_3d],pt.depth_texture_type=[xe.keywords.texture_depth_2d,xe.keywords.texture_depth_2d_array,xe.keywords.texture_depth_cube,xe.keywords.texture_depth_cube_array,xe.keywords.texture_depth_multisampled_2d],pt.texture_external_type=[xe.keywords.texture_external],pt.any_texture_type=[...xe.sampled_texture_type,...xe.multisampled_texture_type,...xe.storage_texture_type,...xe.depth_texture_type,...xe.texture_external_type],pt.texel_format=[xe.keywords.r8unorm,xe.keywords.r8snorm,xe.keywords.r8uint,xe.keywords.r8sint,xe.keywords.r16uint,xe.keywords.r16sint,xe.keywords.r16float,xe.keywords.rg8unorm,xe.keywords.rg8snorm,xe.keywords.rg8uint,xe.keywords.rg8sint,xe.keywords.r32uint,xe.keywords.r32sint,xe.keywords.r32float,xe.keywords.rg16uint,xe.keywords.rg16sint,xe.keywords.rg16float,xe.keywords.rgba8unorm,xe.keywords.rgba8unorm_srgb,xe.keywords.rgba8snorm,xe.keywords.rgba8uint,xe.keywords.rgba8sint,xe.keywords.bgra8unorm,xe.keywords.bgra8unorm_srgb,xe.keywords.rgb10a2unorm,xe.keywords.rg11b10float,xe.keywords.rg32uint,xe.keywords.rg32sint,xe.keywords.rg32float,xe.keywords.rgba16uint,xe.keywords.rgba16sint,xe.keywords.rgba16float,xe.keywords.rgba32uint,xe.keywords.rgba32sint,xe.keywords.rgba32float],pt.const_literal=[xe.tokens.int_literal,xe.tokens.uint_literal,xe.tokens.decimal_float_literal,xe.tokens.hex_float_literal,xe.keywords.true,xe.keywords.false],pt.literal_or_ident=[xe.tokens.ident,xe.tokens.int_literal,xe.tokens.uint_literal,xe.tokens.decimal_float_literal,xe.tokens.hex_float_literal],pt.element_count_expression=[xe.tokens.int_literal,xe.tokens.uint_literal,xe.tokens.ident],pt.template_types=[xe.keywords.vec2,xe.keywords.vec3,xe.keywords.vec4,xe.keywords.mat2x2,xe.keywords.mat2x3,xe.keywords.mat2x4,xe.keywords.mat3x2,xe.keywords.mat3x3,xe.keywords.mat3x4,xe.keywords.mat4x2,xe.keywords.mat4x3,xe.keywords.mat4x4,xe.keywords.atomic,xe.keywords.bitcast,...xe.any_texture_type],pt.attribute_name=[xe.tokens.ident,xe.keywords.block],pt.assignment_operators=[xe.tokens.equal,xe.tokens.plus_equal,xe.tokens.minus_equal,xe.tokens.times_equal,xe.tokens.division_equal,xe.tokens.modulo_equal,xe.tokens.and_equal,xe.tokens.or_equal,xe.tokens.xor_equal,xe.tokens.shift_right_equal,xe.tokens.shift_left_equal],pt.increment_operators=[xe.tokens.plus_plus,xe.tokens.minus_minus];class It{constructor(e,t,i){this.type=e,this.lexeme=t,this.line=i}toString(){return this.lexeme}isTemplateType(){return-1!=pt.template_types.indexOf(this.type)}isArrayType(){return this.type==pt.keywords.array}isArrayOrTemplateType(){return this.isArrayType()||this.isTemplateType()}}class mt{constructor(e){this._tokens=[],this._start=0,this._current=0,this._line=1,this._source=null!=e?e:""}scanTokens(){for(;!this._isAtEnd();)if(this._start=this._current,!this.scanToken())throw`Invalid syntax at line ${this._line}`;return this._tokens.push(new It(pt.eof,"",this._line)),this._tokens}scanToken(){let e=this._advance();if("\n"==e)return this._line++,!0;if(this._isWhitespace(e))return!0;if("/"==e){if("/"==this._peekAhead()){for(;"\n"!=e;){if(this._isAtEnd())return!0;e=this._advance()}return this._line++,!0}if("*"==this._peekAhead()){this._advance();let t=1;for(;t>0;){if(this._isAtEnd())return!0;if(e=this._advance(),"\n"==e)this._line++;else if("*"==e){if("/"==this._peekAhead()&&(this._advance(),t--,0==t))return!0}else"/"==e&&"*"==this._peekAhead()&&(this._advance(),t++)}return!0}}let t=pt.none;for(;;){let i=this._findType(e);const r=this._peekAhead();if(">"==e&&(">"==r||"="==r)){let e=!1,t=this._tokens.length-1;for(let i=0;i<5&&t>=0;++i,--t)if(this._tokens[t].type===pt.tokens.less_than){t>0&&this._tokens[t-1].isArrayOrTemplateType()&&(e=!0);break}if(e)return this._addToken(i),!0}if(i===pt.none){let r=e,s=0;const n=2;for(let e=0;e<n;++e)if(r+=this._peekAhead(e),i=this._findType(r),i!==pt.none){s=e;break}if(i===pt.none)return t!==pt.none&&(this._current--,this._addToken(t),!0);e=r,this._current+=s+1}if(t=i,this._isAtEnd())break;e+=this._advance()}return t!==pt.none&&(this._addToken(t),!0)}_findType(e){for(const t in pt.keywords){const i=pt.keywords[t];if(this._match(e,i.rule))return i}for(const t in pt.tokens){const i=pt.tokens[t];if(this._match(e,i.rule))return i}return pt.none}_match(e,t){if("string"==typeof t){if(t==e)return!0}else{const i=t.exec(e);if(i&&0==i.index&&i[0]==e)return!0}return!1}_isAtEnd(){return this._current>=this._source.length}_isWhitespace(e){return" "==e||"\t"==e||"\r"==e}_advance(e=0){let t=this._source[this._current];return e=e||0,e++,this._current+=e,t}_peekAhead(e=0){return e=e||0,this._current+e>=this._source.length?"\0":this._source[this._current+e]}_addToken(e){const t=this._source.substring(this._start,this._current);this._tokens.push(new It(e,t,this._line))}}class _t{constructor(){this._tokens=[],this._current=0,this._context=new de}parse(e){this._initialize(e);let t=[];for(;!this._isAtEnd();){const e=this._global_decl_or_directive();if(!e)break;t.push(e)}return t}_initialize(e){if(e)if("string"==typeof e){const t=new mt(e);this._tokens=t.scanTokens()}else this._tokens=e;else this._tokens=[];this._current=0}_error(e,t){return console.error(e,t),{token:e,message:t,toString:function(){return`${t}`}}}_isAtEnd(){return this._current>=this._tokens.length||this._peek().type==pt.eof}_match(e){if(e instanceof ft)return!!this._check(e)&&(this._advance(),!0);for(let t=0,i=e.length;t<i;++t){const i=e[t];if(this._check(i))return this._advance(),!0}return!1}_consume(e,t){if(this._check(e))return this._advance();throw this._error(this._peek(),t)}_check(e){if(this._isAtEnd())return!1;const t=this._peek();if(e instanceof Array){let i=t.type;return-1!=e.indexOf(i)}return t.type==e}_advance(){return this._isAtEnd()||this._current++,this._previous()}_peek(){return this._tokens[this._current]}_previous(){return this._tokens[this._current-1]}_global_decl_or_directive(){for(;this._match(pt.tokens.semicolon)&&!this._isAtEnd(););if(this._match(pt.keywords.alias)){const e=this._type_alias();return this._consume(pt.tokens.semicolon,"Expected ';'"),e}if(this._match(pt.keywords.enable)){const e=this._enable_directive();return this._consume(pt.tokens.semicolon,"Expected ';'"),e}const e=this._attribute();if(this._check(pt.keywords.var)){const t=this._global_variable_decl();return null!=t&&(t.attributes=e),this._consume(pt.tokens.semicolon,"Expected ';'."),t}if(this._check(pt.keywords.override)){const t=this._override_variable_decl();return null!=t&&(t.attributes=e),this._consume(pt.tokens.semicolon,"Expected ';'."),t}if(this._check(pt.keywords.let)){const t=this._global_let_decl();return null!=t&&(t.attributes=e),this._consume(pt.tokens.semicolon,"Expected ';'."),t}if(this._check(pt.keywords.const)){const t=this._global_const_decl();return null!=t&&(t.attributes=e),this._consume(pt.tokens.semicolon,"Expected ';'."),t}if(this._check(pt.keywords.struct)){const t=this._struct_decl();return null!=t&&(t.attributes=e),t}if(this._check(pt.keywords.fn)){const t=this._function_decl();return null!=t&&(t.attributes=e),t}return null}_function_decl(){if(!this._match(pt.keywords.fn))return null;const e=this._consume(pt.tokens.ident,"Expected function name.").toString();this._consume(pt.tokens.paren_left,"Expected '(' for function arguments.");const t=[];if(!this._check(pt.tokens.paren_right))do{if(this._check(pt.tokens.paren_right))break;const e=this._attribute(),i=this._consume(pt.tokens.ident,"Expected argument name.").toString();this._consume(pt.tokens.colon,"Expected ':' for argument type.");const r=this._attribute(),s=this._type_decl();null!=s&&(s.attributes=r,t.push(new ct(i,s,e)))}while(this._match(pt.tokens.comma));this._consume(pt.tokens.paren_right,"Expected ')' after function arguments.");let i=null;if(this._match(pt.tokens.arrow)){const e=this._attribute();i=this._type_decl(),null!=i&&(i.attributes=e)}const r=this._compound_statement();return new Ie(e,t,i,r)}_compound_statement(){const e=[];for(this._consume(pt.tokens.brace_left,"Expected '{' for block.");!this._check(pt.tokens.brace_right);){const t=this._statement();null!==t&&e.push(t)}return this._consume(pt.tokens.brace_right,"Expected '}' for block."),e}_statement(){for(;this._match(pt.tokens.semicolon)&&!this._isAtEnd(););if(this._check(pt.keywords.if))return this._if_statement();if(this._check(pt.keywords.switch))return this._switch_statement();if(this._check(pt.keywords.loop))return this._loop_statement();if(this._check(pt.keywords.for))return this._for_statement();if(this._check(pt.keywords.while))return this._while_statement();if(this._check(pt.keywords.continuing))return this._continuing_statement();if(this._check(pt.keywords.static_assert))return this._static_assert_statement();if(this._check(pt.tokens.brace_left))return this._compound_statement();let e=null;return e=this._check(pt.keywords.return)?this._return_statement():this._check([pt.keywords.var,pt.keywords.let,pt.keywords.const])?this._variable_statement():this._match(pt.keywords.discard)?new Oe:this._match(pt.keywords.break)?new Pe:this._match(pt.keywords.continue)?new ze:this._increment_decrement_statement()||this._func_call_statement()||this._assignment_statement(),null!=e&&this._consume(pt.tokens.semicolon,"Expected ';' after statement."),e}_static_assert_statement(){if(!this._match(pt.keywords.static_assert))return null;let e=this._optional_paren_expression();return new me(e)}_while_statement(){if(!this._match(pt.keywords.while))return null;let e=this._optional_paren_expression();const t=this._compound_statement();return new _e(e,t)}_continuing_statement(){if(!this._match(pt.keywords.continuing))return null;const e=this._compound_statement();return new we(e)}_for_statement(){if(!this._match(pt.keywords.for))return null;this._consume(pt.tokens.paren_left,"Expected '('.");const e=this._check(pt.tokens.semicolon)?null:this._for_init();this._consume(pt.tokens.semicolon,"Expected ';'.");const t=this._check(pt.tokens.semicolon)?null:this._short_circuit_or_expression();this._consume(pt.tokens.semicolon,"Expected ';'.");const i=this._check(pt.tokens.paren_right)?null:this._for_increment();this._consume(pt.tokens.paren_right,"Expected ')'.");const r=this._compound_statement();return new Ce(e,t,i,r)}_for_init(){return this._variable_statement()||this._func_call_statement()||this._assignment_statement()}_for_increment(){return this._func_call_statement()||this._increment_decrement_statement()||this._assignment_statement()}_variable_statement(){if(this._check(pt.keywords.var)){const e=this._variable_decl();if(null===e)throw this._error(this._peek(),"Variable declaration expected.");let t=null;return this._match(pt.tokens.equal)&&(t=this._short_circuit_or_expression()),new Be(e.name,e.type,e.storage,e.access,t)}if(this._match(pt.keywords.let)){const e=this._consume(pt.tokens.ident,"Expected name for let.").toString();let t=null;if(this._match(pt.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}this._consume(pt.tokens.equal,"Expected '=' for let.");const i=this._short_circuit_or_expression();return new ye(e,t,null,null,i)}if(this._match(pt.keywords.const)){const e=this._consume(pt.tokens.ident,"Expected name for const.").toString();let t=null;if(this._match(pt.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}this._consume(pt.tokens.equal,"Expected '=' for const.");const i=this._short_circuit_or_expression();return new Qe(e,t,null,null,i)}return null}_increment_decrement_statement(){const e=this._current,t=this._unary_expression();if(null==t)return null;if(!this._check(pt.increment_operators))return this._current=e,null;const i=this._consume(pt.increment_operators,"Expected increment operator");return new Se(i.type===pt.tokens.plus_plus?be.increment:be.decrement,t)}_assignment_statement(){let e=null;if(this._check(pt.tokens.brace_right))return null;let t=this._match(pt.tokens.underscore);if(t||(e=this._unary_expression()),!t&&null==e)return null;const i=this._consume(pt.assignment_operators,"Expected assignment operator."),r=this._short_circuit_or_expression();return new Me(ke.parse(i.lexeme),e,r)}_func_call_statement(){if(!this._check(pt.tokens.ident))return null;const e=this._current,t=this._consume(pt.tokens.ident,"Expected function name."),i=this._argument_expression_list();return null===i?(this._current=e,null):new Ue(t.lexeme,i)}_loop_statement(){if(!this._match(pt.keywords.loop))return null;this._consume(pt.tokens.brace_left,"Expected '{' for loop.");const e=[];let t=this._statement();for(;null!==t;){if(Array.isArray(t))for(let i of t)e.push(i);else e.push(t);t=this._statement()}let i=null;return this._match(pt.keywords.continuing)&&(i=this._compound_statement()),this._consume(pt.tokens.brace_right,"Expected '}' for loop."),new Ge(e,i)}_switch_statement(){if(!this._match(pt.keywords.switch))return null;const e=this._optional_paren_expression();this._consume(pt.tokens.brace_left,"Expected '{' for switch.");const t=this._switch_body();if(null==t||0==t.length)throw this._error(this._previous(),"Expected 'case' or 'default'.");return this._consume(pt.tokens.brace_right,"Expected '}' for switch."),new Te(e,t)}_switch_body(){const e=[];if(this._match(pt.keywords.case)){const t=this._case_selectors();this._match(pt.tokens.colon),this._consume(pt.tokens.brace_left,"Exected '{' for switch case.");const i=this._case_body();this._consume(pt.tokens.brace_right,"Exected '}' for switch case."),e.push(new lt(t,i))}if(this._match(pt.keywords.default)){this._match(pt.tokens.colon),this._consume(pt.tokens.brace_left,"Exected '{' for switch default.");const t=this._case_body();this._consume(pt.tokens.brace_right,"Exected '}' for switch default."),e.push(new ht(t))}if(this._check([pt.keywords.default,pt.keywords.case])){const t=this._switch_body();e.push(t[0])}return e}_case_selectors(){var e,t,i,r;const s=[null!==(t=null===(e=this._shift_expression())||void 0===e?void 0:e.evaluate(this._context).toString())&&void 0!==t?t:""];for(;this._match(pt.tokens.comma);)s.push(null!==(r=null===(i=this._shift_expression())||void 0===i?void 0:i.evaluate(this._context).toString())&&void 0!==r?r:"");return s}_case_body(){if(this._match(pt.keywords.fallthrough))return this._consume(pt.tokens.semicolon,"Expected ';'"),[];let e=this._statement();if(null==e)return[];e instanceof Array||(e=[e]);const t=this._case_body();return 0==t.length?e:[...e,t[0]]}_if_statement(){if(!this._match(pt.keywords.if))return null;const e=this._optional_paren_expression(),t=this._compound_statement();let i=[];this._match_elseif()&&(i=this._elseif_statement(i));let r=null;return this._match(pt.keywords.else)&&(r=this._compound_statement()),new Fe(e,t,i,r)}_match_elseif(){return this._tokens[this._current].type===pt.keywords.else&&this._tokens[this._current+1].type===pt.keywords.if&&(this._advance(),this._advance(),!0)}_elseif_statement(e=[]){const t=this._optional_paren_expression(),i=this._compound_statement();return e.push(new gt(t,i)),this._match_elseif()&&this._elseif_statement(e),e}_return_statement(){if(!this._match(pt.keywords.return))return null;const e=this._short_circuit_or_expression();return new Re(e)}_short_circuit_or_expression(){let e=this._short_circuit_and_expr();for(;this._match(pt.tokens.or_or);)e=new ot(this._previous().toString(),e,this._short_circuit_and_expr());return e}_short_circuit_and_expr(){let e=this._inclusive_or_expression();for(;this._match(pt.tokens.and_and);)e=new ot(this._previous().toString(),e,this._inclusive_or_expression());return e}_inclusive_or_expression(){let e=this._exclusive_or_expression();for(;this._match(pt.tokens.or);)e=new ot(this._previous().toString(),e,this._exclusive_or_expression());return e}_exclusive_or_expression(){let e=this._and_expression();for(;this._match(pt.tokens.xor);)e=new ot(this._previous().toString(),e,this._and_expression());return e}_and_expression(){let e=this._equality_expression();for(;this._match(pt.tokens.and);)e=new ot(this._previous().toString(),e,this._equality_expression());return e}_equality_expression(){const e=this._relational_expression();return this._match([pt.tokens.equal_equal,pt.tokens.not_equal])?new ot(this._previous().toString(),e,this._relational_expression()):e}_relational_expression(){let e=this._shift_expression();for(;this._match([pt.tokens.less_than,pt.tokens.greater_than,pt.tokens.less_than_equal,pt.tokens.greater_than_equal]);)e=new ot(this._previous().toString(),e,this._shift_expression());return e}_shift_expression(){let e=this._additive_expression();for(;this._match([pt.tokens.shift_left,pt.tokens.shift_right]);)e=new ot(this._previous().toString(),e,this._additive_expression());return e}_additive_expression(){let e=this._multiplicative_expression();for(;this._match([pt.tokens.plus,pt.tokens.minus]);)e=new ot(this._previous().toString(),e,this._multiplicative_expression());return e}_multiplicative_expression(){let e=this._unary_expression();for(;this._match([pt.tokens.star,pt.tokens.forward_slash,pt.tokens.modulo]);)e=new ot(this._previous().toString(),e,this._unary_expression());return e}_unary_expression(){return this._match([pt.tokens.minus,pt.tokens.bang,pt.tokens.tilde,pt.tokens.star,pt.tokens.and])?new at(this._previous().toString(),this._unary_expression()):this._singular_expression()}_singular_expression(){const e=this._primary_expression(),t=this._postfix_expression();return t&&(e.postfix=t),e}_postfix_expression(){if(this._match(pt.tokens.bracket_left)){const e=this._short_circuit_or_expression();this._consume(pt.tokens.bracket_right,"Expected ']'.");const t=this._postfix_expression();return t&&(e.postfix=t),e}if(this._match(pt.tokens.period)){const e=this._consume(pt.tokens.ident,"Expected member name."),t=this._postfix_expression(),i=new Ze(e.lexeme);return t&&(i.postfix=t),i}return null}_getStruct(e){if(this._context.aliases.has(e)){return this._context.aliases.get(e).type}if(this._context.structs.has(e)){return this._context.structs.get(e)}return null}_primary_expression(){if(this._match(pt.tokens.ident)){const e=this._previous().toString();if(this._check(pt.tokens.paren_left)){const t=this._argument_expression_list(),i=this._getStruct(e);return null!=i?new We(i,t):new Xe(e,t)}if(this._context.constants.has(e)){const t=this._context.constants.get(e);return new et(e,t.value)}return new $e(e)}if(this._match(pt.const_literal))return new tt(parseFloat(this._previous().toString()));if(this._check(pt.tokens.paren_left))return this._paren_expression();if(this._match(pt.keywords.bitcast)){this._consume(pt.tokens.less_than,"Expected '<'.");const e=this._type_decl();this._consume(pt.tokens.greater_than,"Expected '>'.");const t=this._paren_expression();return new it(e,t)}const e=this._type_decl(),t=this._argument_expression_list();return new rt(e,t)}_argument_expression_list(){if(!this._match(pt.tokens.paren_left))return null;const e=[];do{if(this._check(pt.tokens.paren_right))break;const t=this._short_circuit_or_expression();e.push(t)}while(this._match(pt.tokens.comma));return this._consume(pt.tokens.paren_right,"Expected ')' for agument list"),e}_optional_paren_expression(){this._match(pt.tokens.paren_left);const e=this._short_circuit_or_expression();return this._match(pt.tokens.paren_right),new st([e])}_paren_expression(){this._consume(pt.tokens.paren_left,"Expected '('.");const e=this._short_circuit_or_expression();return this._consume(pt.tokens.paren_right,"Expected ')'."),new st([e])}_struct_decl(){if(!this._match(pt.keywords.struct))return null;const e=this._consume(pt.tokens.ident,"Expected name for struct.").toString();this._consume(pt.tokens.brace_left,"Expected '{' for struct body.");const t=[];for(;!this._check(pt.tokens.brace_right);){const e=this._attribute(),i=this._consume(pt.tokens.ident,"Expected variable name.").toString();this._consume(pt.tokens.colon,"Expected ':' for struct member type.");const r=this._attribute(),s=this._type_decl();null!=s&&(s.attributes=r),this._check(pt.tokens.brace_right)?this._match(pt.tokens.comma):this._consume(pt.tokens.comma,"Expected ',' for struct member."),t.push(new ut(i,s,e))}this._consume(pt.tokens.brace_right,"Expected '}' after struct body.");const i=new Ke(e,t);return this._context.structs.set(e,i),i}_global_variable_decl(){const e=this._variable_decl();return e&&this._match(pt.tokens.equal)&&(e.value=this._const_expression()),e}_override_variable_decl(){const e=this._override_decl();return e&&this._match(pt.tokens.equal)&&(e.value=this._const_expression()),e}_global_const_decl(){if(!this._match(pt.keywords.const))return null;const e=this._consume(pt.tokens.ident,"Expected variable name");let t=null;if(this._match(pt.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}let i=null;if(this._match(pt.tokens.equal)){const e=this._short_circuit_or_expression();if(e instanceof We)i=e;else if(e instanceof et&&e.initializer instanceof We)i=e.initializer;else try{const t=e.evaluate(this._context);i=new tt(t)}catch(t){i=e}}const r=new Qe(e.toString(),t,"","",i);return this._context.constants.set(r.name,r),r}_global_let_decl(){if(!this._match(pt.keywords.let))return null;const e=this._consume(pt.tokens.ident,"Expected variable name");let t=null;if(this._match(pt.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}let i=null;return this._match(pt.tokens.equal)&&(i=this._const_expression()),new ye(e.toString(),t,"","",i)}_const_expression(){if(this._match(pt.const_literal))return new Ze(this._previous().toString());const e=this._type_decl();this._consume(pt.tokens.paren_left,"Expected '('.");let t=[];for(;!this._check(pt.tokens.paren_right)&&(t.push(this._const_expression()),this._check(pt.tokens.comma));)this._advance();return this._consume(pt.tokens.paren_right,"Expected ')'."),new We(e,t)}_variable_decl(){if(!this._match(pt.keywords.var))return null;let e="",t="";this._match(pt.tokens.less_than)&&(e=this._consume(pt.storage_class,"Expected storage_class.").toString(),this._match(pt.tokens.comma)&&(t=this._consume(pt.access_mode,"Expected access_mode.").toString()),this._consume(pt.tokens.greater_than,"Expected '>'."));const i=this._consume(pt.tokens.ident,"Expected variable name");let r=null;if(this._match(pt.tokens.colon)){const e=this._attribute();r=this._type_decl(),null!=r&&(r.attributes=e)}return new Be(i.toString(),r,e,t,null)}_override_decl(){if(!this._match(pt.keywords.override))return null;const e=this._consume(pt.tokens.ident,"Expected variable name");let t=null;if(this._match(pt.tokens.colon)){const e=this._attribute();t=this._type_decl(),null!=t&&(t.attributes=e)}return new Ee(e.toString(),t,null)}_enable_directive(){const e=this._consume(pt.tokens.ident,"identity expected.");return new Le(e.toString())}_type_alias(){const e=this._consume(pt.tokens.ident,"identity expected.");this._consume(pt.tokens.equal,"Expected '=' for type alias.");let t=this._type_decl();if(null===t)throw this._error(this._peek(),"Expected Type for Alias.");this._context.aliases.has(t.name)&&(t=this._context.aliases.get(t.name).type);const i=new Ne(e.toString(),t);return this._context.aliases.set(i.name,i),i}_type_decl(){if(this._check([pt.tokens.ident,...pt.texel_format,pt.keywords.bool,pt.keywords.f32,pt.keywords.i32,pt.keywords.u32])){const e=this._advance(),t=e.toString();return this._context.structs.has(t)?this._context.structs.get(t):this._context.aliases.has(t)?this._context.aliases.get(t).type:new qe(e.toString())}let e=this._texture_sampler_types();if(e)return e;if(this._check(pt.template_types)){let e=this._advance().toString(),t=null,i=null;return this._match(pt.tokens.less_than)&&(t=this._type_decl(),i=null,this._match(pt.tokens.comma)&&(i=this._consume(pt.access_mode,"Expected access_mode for pointer").toString()),this._consume(pt.tokens.greater_than,"Expected '>' for type.")),new He(e,t,i)}if(this._match(pt.keywords.ptr)){let e=this._previous().toString();this._consume(pt.tokens.less_than,"Expected '<' for pointer.");const t=this._consume(pt.storage_class,"Expected storage_class for pointer");this._consume(pt.tokens.comma,"Expected ',' for pointer.");const i=this._type_decl();let r=null;return this._match(pt.tokens.comma)&&(r=this._consume(pt.access_mode,"Expected access_mode for pointer").toString()),this._consume(pt.tokens.greater_than,"Expected '>' for pointer."),new Ve(e,t.toString(),i,r)}const t=this._attribute();if(this._match(pt.keywords.array)){let e=null,i=-1;const r=this._previous();if(this._match(pt.tokens.less_than)){e=this._type_decl(),this._context.aliases.has(e.name)&&(e=this._context.aliases.get(e.name).type);let t="";if(this._match(pt.tokens.comma)){t=this._shift_expression().evaluate(this._context).toString()}this._consume(pt.tokens.greater_than,"Expected '>' for array."),i=t?parseInt(t):0}return new Je(r.toString(),t,e,i)}return null}_texture_sampler_types(){if(this._match(pt.sampler_type))return new Ye(this._previous().toString(),null,null);if(this._match(pt.depth_texture_type))return new Ye(this._previous().toString(),null,null);if(this._match(pt.sampled_texture_type)||this._match(pt.multisampled_texture_type)){const e=this._previous();this._consume(pt.tokens.less_than,"Expected '<' for sampler type.");const t=this._type_decl();return this._consume(pt.tokens.greater_than,"Expected '>' for sampler type."),new Ye(e.toString(),t,null)}if(this._match(pt.storage_texture_type)){const e=this._previous();this._consume(pt.tokens.less_than,"Expected '<' for sampler type.");const t=this._consume(pt.texel_format,"Invalid texel format.").toString();this._consume(pt.tokens.comma,"Expected ',' after texel format.");const i=this._consume(pt.access_mode,"Expected access mode for storage texture type.").toString();return this._consume(pt.tokens.greater_than,"Expected '>' for sampler type."),new Ye(e.toString(),t,i)}return null}_attribute(){let e=[];for(;this._match(pt.tokens.attr);){const t=this._consume(pt.attribute_name,"Expected attribute name"),i=new dt(t.toString(),null);if(this._match(pt.tokens.paren_left)){if(i.value=this._consume(pt.literal_or_ident,"Expected attribute value").toString(),this._check(pt.tokens.comma)){this._advance();do{const e=this._consume(pt.literal_or_ident,"Expected attribute value").toString();i.value instanceof Array||(i.value=[i.value]),i.value.push(e)}while(this._match(pt.tokens.comma))}this._consume(pt.tokens.paren_right,"Expected ')'")}e.push(i)}for(;this._match(pt.tokens.attr_left);){if(!this._check(pt.tokens.attr_right))do{const t=this._consume(pt.attribute_name,"Expected attribute name"),i=new dt(t.toString(),null);if(this._match(pt.tokens.paren_left)){if(i.value=[this._consume(pt.literal_or_ident,"Expected attribute value").toString()],this._check(pt.tokens.comma)){this._advance();do{const e=this._consume(pt.literal_or_ident,"Expected attribute value").toString();i.value.push(e)}while(this._match(pt.tokens.comma))}this._consume(pt.tokens.paren_right,"Expected ')'")}e.push(i)}while(this._match(pt.tokens.comma));this._consume(pt.tokens.attr_right,"Expected ']]' after attribute declarations")}return 0==e.length?null:e}}class wt{constructor(e,t){this.name=e,this.attributes=t,this.size=0}get isArray(){return!1}get isStruct(){return!1}get isTemplate(){return!1}}class Ct{constructor(e,t,i){this.name=e,this.type=t,this.attributes=i,this.offset=0,this.size=0}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class Bt extends wt{constructor(e,t){super(e,t),this.members=[],this.align=0}get isStruct(){return!0}}class Et extends wt{constructor(e,t){super(e,t),this.count=0,this.stride=0}get isArray(){return!0}}class yt extends wt{constructor(e,t,i,r){super(e,i),this.format=t,this.access=r}get isTemplate(){return!0}}!function(e){e[e.Uniform=0]="Uniform",e[e.Storage=1]="Storage",e[e.Texture=2]="Texture",e[e.Sampler=3]="Sampler",e[e.StorageTexture=4]="StorageTexture"}(De||(De={}));class Qt{constructor(e,t,i,r,s,n,a){this.name=e,this.type=t,this.group=i,this.binding=r,this.attributes=s,this.resourceType=n,this.access=a}get isArray(){return this.type.isArray}get isStruct(){return this.type.isStruct}get isTemplate(){return this.type.isTemplate}get size(){return this.type.size}get align(){return this.type.isStruct?this.type.align:0}get members(){return this.type.isStruct?this.type.members:null}get format(){return this.type.isArray||this.type.isTemplate?this.type.format:null}get count(){return this.type.isArray?this.type.count:0}get stride(){return this.type.isArray?this.type.stride:this.size}}class bt{constructor(e,t){this.name=e,this.type=t}}class kt{constructor(e,t){this.align=e,this.size=t}}class xt{constructor(e,t,i,r){this.name=e,this.type=t,this.locationType=i,this.location=r,this.interpolation=null}}class vt{constructor(e,t,i,r){this.name=e,this.type=t,this.locationType=i,this.location=r}}class Dt{constructor(e,t=null){this.stage=null,this.inputs=[],this.outputs=[],this.name=e,this.stage=t}}class St{constructor(){this.vertex=[],this.fragment=[],this.compute=[]}}class Mt{constructor(e,t,i,r){this.name=e,this.type=t,this.attributes=i,this.id=r}}class Ut{constructor(e){this.uniforms=[],this.storage=[],this.textures=[],this.samplers=[],this.aliases=[],this.overrides=[],this.structs=[],this.entry=new St,this._types=new Map,e&&this.update(e)}_isStorageTexture(e){return"texture_storage_1d"==e.name||"texture_storage_2d"==e.name||"texture_storage_2d_array"==e.name||"texture_storage_3d"==e.name}update(e){const t=(new _t).parse(e);for(const e of t)if(e instanceof Ke){const t=this._getTypeInfo(e,null);t instanceof Bt&&this.structs.push(t)}else if(e instanceof Ne)this.aliases.push(this._getAliasInfo(e));else if(e instanceof Ee){const t=e,i=this._getAttributeNum(t.attributes,"id",0),r=null!=t.type?this._getTypeInfo(t.type,t.attributes):null;this.overrides.push(new Mt(t.name,r,t.attributes,i))}else if(this._isUniformVar(e)){const t=e,i=this._getAttributeNum(t.attributes,"group",0),r=this._getAttributeNum(t.attributes,"binding",0),s=this._getTypeInfo(t.type,t.attributes),n=new Qt(t.name,s,i,r,t.attributes,De.Uniform,t.access);this.uniforms.push(n)}else if(this._isStorageVar(e)){const t=e,i=this._getAttributeNum(t.attributes,"group",0),r=this._getAttributeNum(t.attributes,"binding",0),s=this._getTypeInfo(t.type,t.attributes),n=this._isStorageTexture(s),a=new Qt(t.name,s,i,r,t.attributes,n?De.StorageTexture:De.Storage,t.access);this.storage.push(a)}else if(this._isTextureVar(e)){const t=e,i=this._getAttributeNum(t.attributes,"group",0),r=this._getAttributeNum(t.attributes,"binding",0),s=this._getTypeInfo(t.type,t.attributes),n=this._isStorageTexture(s),a=new Qt(t.name,s,i,r,t.attributes,n?De.StorageTexture:De.Texture,t.access);n?this.storage.push(a):this.textures.push(a)}else if(this._isSamplerVar(e)){const t=e,i=this._getAttributeNum(t.attributes,"group",0),r=this._getAttributeNum(t.attributes,"binding",0),s=this._getTypeInfo(t.type,t.attributes),n=new Qt(t.name,s,i,r,t.attributes,De.Sampler,t.access);this.samplers.push(n)}else if(e instanceof Ie){const t=this._getAttribute(e,"vertex"),i=this._getAttribute(e,"fragment"),r=this._getAttribute(e,"compute"),s=t||i||r;if(s){const t=new Dt(e.name,s.name);t.inputs=this._getInputs(e.args),t.outputs=this._getOutputs(e.returnType),this.entry[s.name].push(t)}}else;}getBindGroups(){const e=[];function t(t,i){t>=e.length&&(e.length=t+1),void 0===e[t]&&(e[t]=[]),i>=e[t].length&&(e[t].length=i+1)}for(const i of this.uniforms){t(i.group,i.binding);e[i.group][i.binding]=i}for(const i of this.storage){t(i.group,i.binding);e[i.group][i.binding]=i}for(const i of this.textures){t(i.group,i.binding);e[i.group][i.binding]=i}for(const i of this.samplers){t(i.group,i.binding);e[i.group][i.binding]=i}return e}_getOutputs(e,t=undefined){if(void 0===t&&(t=[]),e instanceof Ke)this._getStructOutputs(e,t);else{const i=this._getOutputInfo(e);null!==i&&t.push(i)}return t}_getStructOutputs(e,t){for(const i of e.members)if(i.type instanceof Ke)this._getStructOutputs(i.type,t);else{const e=this._getAttribute(i,"location")||this._getAttribute(i,"builtin");if(null!==e){const r=this._getTypeInfo(i.type,i.type.attributes),s=this._parseInt(e.value),n=new vt(i.name,r,e.name,s);t.push(n)}}}_getOutputInfo(e){const t=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(null!==t){const i=this._getTypeInfo(e,e.attributes),r=this._parseInt(t.value);return new vt("",i,t.name,r)}return null}_getInputs(e,t=undefined){void 0===t&&(t=[]);for(const i of e)if(i.type instanceof Ke)this._getStructInputs(i.type,t);else{const e=this._getInputInfo(i);null!==e&&t.push(e)}return t}_getStructInputs(e,t){for(const i of e.members)if(i.type instanceof Ke)this._getStructInputs(i.type,t);else{const e=this._getInputInfo(i);null!==e&&t.push(e)}}_getInputInfo(e){const t=this._getAttribute(e,"location")||this._getAttribute(e,"builtin");if(null!==t){const i=this._getAttribute(e,"interpolation"),r=this._getTypeInfo(e.type,e.attributes),s=this._parseInt(t.value),n=new xt(e.name,r,t.name,s);return null!==i&&(n.interpolation=this._parseString(i.value)),n}return null}_parseString(e){return e instanceof Array&&(e=e[0]),e}_parseInt(e){e instanceof Array&&(e=e[0]);const t=parseInt(e);return isNaN(t)?e:t}_getAlias(e){for(const t of this.aliases)if(t.name==e)return t.type;return null}_getAliasInfo(e){return new bt(e.name,this._getTypeInfo(e.type,null))}_getTypeInfo(e,t){if(this._types.has(e))return this._types.get(e);if(e instanceof Je){const i=e,r=this._getTypeInfo(i.format,i.attributes),s=new Et(i.name,t);return s.format=r,s.count=i.count,this._types.set(e,s),this._updateTypeInfo(s),s}if(e instanceof Ke){const i=e,r=new Bt(i.name,t);for(const e of i.members){const t=this._getTypeInfo(e.type,e.attributes);r.members.push(new Ct(e.name,t,e.attributes))}return this._types.set(e,r),this._updateTypeInfo(r),r}if(e instanceof Ye){const i=e,r=i.format instanceof qe,s=i.format?r?this._getTypeInfo(i.format,null):new wt(i.format,null):null,n=new yt(i.name,s,t,i.access);return this._types.set(e,n),this._updateTypeInfo(n),n}if(e instanceof He){const i=e,r=i.format?this._getTypeInfo(i.format,null):null,s=new yt(i.name,r,t,i.access);return this._types.set(e,s),this._updateTypeInfo(s),s}const i=new wt(e.name,t);return this._types.set(e,i),this._updateTypeInfo(i),i}_updateTypeInfo(e){var t,i;const r=this._getTypeSize(e);if(e.size=null!==(t=null==r?void 0:r.size)&&void 0!==t?t:0,e instanceof Et){const t=this._getTypeSize(e.format);e.stride=null!==(i=null==t?void 0:t.size)&&void 0!==i?i:0,this._updateTypeInfo(e.format)}e instanceof Bt&&this._updateStructInfo(e)}_updateStructInfo(e){var t;let i=0,r=0,s=0,n=0;for(let a=0,o=e.members.length;a<o;++a){const o=e.members[a],A=this._getTypeSize(o);if(!A)continue;null!==(t=this._getAlias(o.type.name))&&void 0!==t||o.type;const l=A.align,h=A.size;i=this._roundUp(l,i+r),r=h,s=i,n=Math.max(n,l),o.offset=i,o.size=h,this._updateTypeInfo(o.type)}e.size=this._roundUp(n,s+r),e.align=n}_getTypeSize(e){var t;if(null==e)return null;const i=this._getAttributeNum(e.attributes,"size",0),r=this._getAttributeNum(e.attributes,"align",0);if(e instanceof Ct&&(e=e.type),e instanceof wt){const t=this._getAlias(e.name);null!==t&&(e=t)}{const t=Ut._typeInfo[e.name];if(void 0!==t){const s="f16"===e.format?2:1;return new kt(Math.max(r,t.align/s),Math.max(i,t.size/s))}}{const t=Ut._typeInfo[e.name.substring(0,e.name.length-1)];if(t){const s="h"===e.name[e.name.length-1]?2:1;return new kt(Math.max(r,t.align/s),Math.max(i,t.size/s))}}if(e instanceof Et){let s=e,n=8,a=8;const o=this._getTypeSize(s.format);null!==o&&(a=o.size,n=o.align);return a=s.count*this._getAttributeNum(null!==(t=null==e?void 0:e.attributes)&&void 0!==t?t:null,"stride",this._roundUp(n,a)),i&&(a=i),new kt(Math.max(r,n),Math.max(i,a))}if(e instanceof Bt){let t=0,s=0,n=0,a=0,o=0;for(const i of e.members){const e=this._getTypeSize(i.type);null!==e&&(t=Math.max(e.align,t),n=this._roundUp(e.align,n+a),a=e.size,o=n)}return s=this._roundUp(t,o+a),new kt(Math.max(r,t),Math.max(i,s))}return null}_isUniformVar(e){return e instanceof Be&&"uniform"==e.storage}_isStorageVar(e){return e instanceof Be&&"storage"==e.storage}_isTextureVar(e){return e instanceof Be&&null!==e.type&&-1!=Ut._textureTypes.indexOf(e.type.name)}_isSamplerVar(e){return e instanceof Be&&null!==e.type&&-1!=Ut._samplerTypes.indexOf(e.type.name)}_getAttribute(e,t){const i=e;if(!i||!i.attributes)return null;const r=i.attributes;for(let e of r)if(e.name==t)return e;return null}_getAttributeNum(e,t,i){if(null===e)return i;for(let r of e)if(r.name==t){let e=null!==r&&null!==r.value?r.value:i;return e instanceof Array&&(e=e[0]),"number"==typeof e?e:"string"==typeof e?parseInt(e):i}return i}_roundUp(e,t){return Math.ceil(t/e)*e}}function Gt(e){const t={attributes:[],bindings:[]};let i;try{i=function(e){try{return new Ut(e)}catch(e){if(e instanceof Error)throw e;let t="WGSL parse error";throw"object"==typeof e&&e?.message&&(t+=`: ${e.message} `),"object"==typeof e&&e?.token&&(t+=e.token.line||""),new Error(t,{cause:e})}}(e)}catch(e){return m.error(e.message)(),t}for(const e of i.uniforms){const i=[];for(const t of e.type.members)i.push({name:t.name,type:Tt(t.type)});t.bindings.push({type:"uniform",name:e.name,location:e.binding,group:e.group,members:i})}const r=i.entry.vertex[0],s=r?.inputs.length||0;for(let e=0;e<s;e++){const i=r.inputs[e];if("location"===i.locationType){const e=Tt(i.type);t.attributes.push({name:i.name,location:i.location,type:e})}}return t}function Tt(e){return e.format?`${e.name}<${e.format.name}>`:e.name}Ut._typeInfo={f16:{align:2,size:2},i32:{align:4,size:4},u32:{align:4,size:4},f32:{align:4,size:4},atomic:{align:4,size:4},vec2:{align:8,size:8},vec3:{align:16,size:12},vec4:{align:16,size:16},mat2x2:{align:8,size:16},mat3x2:{align:8,size:24},mat4x2:{align:8,size:32},mat2x3:{align:16,size:32},mat3x3:{align:16,size:48},mat4x3:{align:16,size:64},mat2x4:{align:16,size:32},mat3x4:{align:16,size:48},mat4x4:{align:16,size:64}},Ut._textureTypes=pt.any_texture_type.map((e=>e.name)),Ut._samplerTypes=pt.sampler_type.map((e=>e.name));class Ft{id;userData={};topology;bufferLayout=[];vertexCount;indices;attributes;constructor(e){this.id=e.id||C("geometry"),this.topology=e.topology,this.indices=e.indices||null,this.attributes=e.attributes,this.vertexCount=e.vertexCount,this.bufferLayout=e.bufferLayout||[],this.indices&&B(this.indices.usage===_.INDEX)}destroy(){this.indices?.destroy();for(const e of Object.values(this.attributes))e.destroy()}getVertexCount(){return this.vertexCount}getAttributes(){return this.attributes}getIndexes(){return this.indices}_calculateVertexCount(e){return e.byteLength/12}}function Rt(e,t){if(t instanceof Ft)return t;const i=function(e,t){if(!t.indices)return;const i=t.indices.value;return e.createBuffer({usage:_.INDEX,data:i})}(e,t),{attributes:r,bufferLayout:s}=function(e,t){const i=[],r={};for(const[s,n]of Object.entries(t.attributes)){let t=s;switch(s){case"POSITION":t="positions";break;case"NORMAL":t="normals";break;case"TEXCOORD_0":t="texCoords";break;case"COLOR_0":t="colors"}r[t]=e.createBuffer({data:n.value,id:`${s}-buffer`});const{value:a,size:o,normalized:A}=n;i.push({name:t,format:w(a,o,A)})}const s=t._calculateVertexCount(t.attributes,t.indices);return{attributes:r,bufferLayout:i,vertexCount:s}}(e,t);return new Ft({topology:t.topology||"triangle-list",bufferLayout:s,vertexCount:t.vertexCount,indices:i,attributes:r})}class Lt{modules;moduleUniforms;moduleBindings;moduleUniformsChanged;constructor(e){const t=W(Object.values(e));m.log(1,"Creating ShaderInputs with modules",t.map((e=>e.name)))(),this.modules=e,this.moduleUniforms={},this.moduleBindings={};for(const[t,i]of Object.entries(e)){const e=t;this.moduleUniforms[e]=i.defaultUniforms||{},this.moduleBindings[e]={}}}destroy(){}setProps(e){for(const t of Object.keys(e)){const i=t,r=e[i],s=this.modules[i];if(!s){m.warn(`Module ${t} not found`)();continue}const n=this.moduleUniforms[i],a=s.getUniforms?.(r,this.moduleUniforms[i])||r;this.moduleUniforms[i]={...n,...a}}}getModules(){return Object.values(this.modules)}getUniformValues(){return this.moduleUniforms}getBindings(){const e={};for(const t of Object.values(this.moduleBindings))Object.assign(e,t);return e}getDebugTable(){const e={};for(const[t,i]of Object.entries(this.moduleUniforms))for(const[r,s]of Object.entries(i))e[`${t}.${r}`]={type:this.modules[t].uniformTypes?.[r],value:String(s)};return e}}class Nt{static defaultProps={...E.defaultProps};device;_hashCounter=0;_hashes={};_renderPipelineCache={};_computePipelineCache={};static getDefaultPipelineFactory(e){return e._lumaData.defaultPipelineFactory=e._lumaData.defaultPipelineFactory||new Nt(e),e._lumaData.defaultPipelineFactory}constructor(e){this.device=e}createRenderPipeline(e){const t={...E.defaultProps,...e},i=this._hashRenderPipeline(t);if(!this._renderPipelineCache[i]){const e=this.device.createRenderPipeline({...t,id:t.id?`${t.id}-cached`:void 0});e.hash=i,this._renderPipelineCache[i]={pipeline:e,useCount:0}}return this._renderPipelineCache[i].useCount++,this._renderPipelineCache[i].pipeline}createComputePipeline(e){const t={...y.defaultProps,...e},i=this._hashComputePipeline(t);if(!this._computePipelineCache[i]){const e=this.device.createComputePipeline({...t,id:t.id?`${t.id}-cached`:void 0});e.hash=i,this._computePipelineCache[i]={pipeline:e,useCount:0}}return this._computePipelineCache[i].useCount++,this._computePipelineCache[i].pipeline}release(e){const t=e.hash,i=e instanceof y?this._computePipelineCache:this._renderPipelineCache;i[t].useCount--,0===i[t].useCount&&(i[t].pipeline.destroy(),delete i[t])}_hashComputePipeline(e){return`${this._getHash(e.shader.source)}`}_hashRenderPipeline(e){const t=this._getHash(e.vs.source),i=e.fs?this._getHash(e.fs.source):0,r=this._getHash(JSON.stringify(e.bufferLayout));if("webgl"===this.device.type)return`${t}/${i}V-BL${r}`;{const s=this._getHash(JSON.stringify(e.parameters));return`${t}/${i}V-T${e.topology}P${s}BL${r}`}}_getHash(e){return void 0===this._hashes[e]&&(this._hashes[e]=this._hashCounter++),this._hashes[e]}}class Ot{static defaultProps={...Q.defaultProps};device;_cache={};static getDefaultShaderFactory(e){return e._lumaData.defaultShaderFactory||=new Ot(e),e._lumaData.defaultShaderFactory}constructor(e){this.device=e}createShader(e){const t=this._hashShader(e);let i=this._cache[t];if(!i){const r=this.device.createShader({...e,id:e.id?`${e.id}-cached`:void 0});this._cache[t]=i={shader:r,useCount:0}}return i.useCount++,i.shader}release(e){const t=this._hashShader(e),i=this._cache[t];i&&(i.useCount--,0===i.useCount&&(delete this._cache[t],i.shader.destroy()))}_hashShader(e){return`${e.stage}:${e.source}`}}let Pt=null,zt=null;class qt{static defaultProps={...E.defaultProps,source:null,vs:null,fs:null,id:"unnamed",handle:void 0,userData:{},defines:{},modules:[],moduleSettings:void 0,geometry:null,indexBuffer:null,attributes:{},constantAttributes:{},varyings:[],shaderInputs:void 0,pipelineFactory:void 0,shaderFactory:void 0,transformFeedback:void 0,shaderAssembler:ue.getDefaultShaderAssembler(),debugShaders:void 0,disableWarnings:void 0};device;id;source;vs;fs;pipelineFactory;shaderFactory;userData={};parameters;topology;bufferLayout;vertexCount;instanceCount=0;indexBuffer=null;bufferAttributes={};constantAttributes={};bindings={};uniforms={};vertexArray;transformFeedback=null;pipeline;shaderInputs;_uniformStore;_attributeInfos={};_gpuGeometry=null;_getModuleUniforms;props;_pipelineNeedsUpdate="newly created";_needsRedraw="initializing";_destroyed=!1;_lastDrawTimestamp=-1;constructor(e,t){this.props={...qt.defaultProps,...t},t=this.props,this.id=t.id||C("model"),this.device=e,Object.assign(this.userData,t.userData);const i=Object.fromEntries(this.props.modules?.map((e=>[e.name,e]))||[]);this.setShaderInputs(t.shaderInputs||new Lt(i));const r=function(e){return{type:e.type,shaderLanguage:e.info.shadingLanguage,shaderLanguageVersion:e.info.shadingLanguageVersion,gpu:e.info.gpu,features:e.features}}(e),s=(this.props.modules?.length>0?this.props.modules:this.shaderInputs?.getModules())||[];if("webgpu"===this.device.type&&this.props.source){this.props.shaderLayout||=Gt(this.props.source);const{source:e,getUniforms:t}=this.props.shaderAssembler.assembleShader({platformInfo:r,...this.props,modules:s});this.source=e,this._getModuleUniforms=t}else{const{vs:e,fs:t,getUniforms:i}=this.props.shaderAssembler.assembleShaderPair({platformInfo:r,...this.props,modules:s});this.vs=e,this.fs=t,this._getModuleUniforms=i}this.vertexCount=this.props.vertexCount,this.instanceCount=this.props.instanceCount,this.topology=this.props.topology,this.bufferLayout=this.props.bufferLayout,this.parameters=this.props.parameters,t.geometry&&this.setGeometry(t.geometry),this.pipelineFactory=t.pipelineFactory||Nt.getDefaultPipelineFactory(this.device),this.shaderFactory=t.shaderFactory||Ot.getDefaultShaderFactory(this.device),this.pipeline=this._updatePipeline(),this.vertexArray=e.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry),t.vertexCount&&this.setVertexCount(t.vertexCount),t.instanceCount&&this.setInstanceCount(t.instanceCount),t.indexBuffer&&this.setIndexBuffer(t.indexBuffer),t.attributes&&this.setAttributes(t.attributes),t.constantAttributes&&this.setConstantAttributes(t.constantAttributes),t.bindings&&this.setBindings(t.bindings),t.uniforms&&this.setUniforms(t.uniforms),t.moduleSettings&&this.updateModuleSettings(t.moduleSettings),t.transformFeedback&&(this.transformFeedback=t.transformFeedback),Object.seal(this)}destroy(){this._destroyed||(this.pipelineFactory.release(this.pipeline),this.shaderFactory.release(this.pipeline.vs),this.pipeline.fs&&this.shaderFactory.release(this.pipeline.fs),this._uniformStore.destroy(),this._gpuGeometry?.destroy(),this._destroyed=!0)}needsRedraw(){this._getBindingsUpdateTimestamp()>this._lastDrawTimestamp&&this.setNeedsRedraw("contents of bound textures or buffers updated");const e=this._needsRedraw;return this._needsRedraw=!1,e}setNeedsRedraw(e){this._needsRedraw||=e}predraw(){this.updateShaderInputs(),this.pipeline=this._updatePipeline()}draw(e){let t;this.predraw();try{this._logDrawCallStart(),this.pipeline=this._updatePipeline(),this.pipeline.setBindings(this.bindings,{disableWarnings:this.props.disableWarnings}),b(this.uniforms)||this.pipeline.setUniformsWebGL(this.uniforms);const{indexBuffer:i}=this.vertexArray,r=i?i.byteLength/("uint32"===i.indexType?4:2):void 0;t=this.pipeline.draw({renderPass:e,vertexArray:this.vertexArray,vertexCount:this.vertexCount,instanceCount:this.instanceCount,indexCount:r,transformFeedback:this.transformFeedback||void 0,parameters:this.parameters,topology:this.topology})}finally{this._logDrawCallEnd()}return this._logFramebuffer(e),t?(this._lastDrawTimestamp=this.device.timestamp,this._needsRedraw=!1):this._needsRedraw="waiting for resource initialization",t}setGeometry(e){this._gpuGeometry?.destroy();const t=e&&Rt(this.device,e);t&&(this.setTopology(t.topology||"triangle-list"),this.bufferLayout=Kt(t.bufferLayout,this.bufferLayout),this.vertexArray&&this._setGeometryAttributes(t)),this._gpuGeometry=t}setTopology(e){e!==this.topology&&(this.topology=e,this._setPipelineNeedsUpdate("topology"))}setBufferLayout(e){this.bufferLayout=this._gpuGeometry?Kt(e,this._gpuGeometry.bufferLayout):e,this._setPipelineNeedsUpdate("bufferLayout"),this.pipeline=this._updatePipeline(),this.vertexArray=this.device.createVertexArray({renderPipeline:this.pipeline}),this._gpuGeometry&&this._setGeometryAttributes(this._gpuGeometry)}setParameters(e){k(e,this.parameters,2)||(this.parameters=e,this._setPipelineNeedsUpdate("parameters"))}setVertexCount(e){this.vertexCount=e,this.setNeedsRedraw("vertexCount")}setInstanceCount(e){this.instanceCount=e,this.setNeedsRedraw("instanceCount")}setShaderInputs(e){this.shaderInputs=e,this._uniformStore=new x(this.shaderInputs.modules);for(const e of Object.keys(this.shaderInputs.modules)){const t=this._uniformStore.getManagedUniformBuffer(this.device,e);this.bindings[`${e}Uniforms`]=t}this.setNeedsRedraw("shaderInputs")}updateShaderInputs(){this._uniformStore.setUniforms(this.shaderInputs.getUniformValues()),this.setNeedsRedraw("shaderInputs")}setBindings(e){Object.assign(this.bindings,e),this.setNeedsRedraw("bindings")}setTransformFeedback(e){this.transformFeedback=e,this.setNeedsRedraw("transformFeedback")}setIndexBuffer(e){this.vertexArray.setIndexBuffer(e),this.setNeedsRedraw("indexBuffer")}setAttributes(e,t){e.indices&&m.warn(`Model:${this.id} setAttributes() - indexBuffer should be set using setIndexBuffer()`)();for(const[i,r]of Object.entries(e)){const e=this.bufferLayout.find((e=>Ht(e).includes(i)));if(!e){m.warn(`Model(${this.id}): Missing layout for buffer "${i}".`)();continue}const s=Ht(e);let n=!1;for(const e of s){const t=this._attributeInfos[e];t&&(this.vertexArray.setBuffer(t.location,r),n=!0)}n||(t?.disableWarnings??this.props.disableWarnings)||m.warn(`Model(${this.id}): Ignoring buffer "${r.id}" for unknown attribute "${i}"`)()}this.setNeedsRedraw("attributes")}setConstantAttributes(e,t){for(const[i,r]of Object.entries(e)){const e=this._attributeInfos[i];e?this.vertexArray.setConstantWebGL(e.location,r):(t?.disableWarnings??this.props.disableWarnings)||m.warn(`Model "${this.id}: Ignoring constant supplied for unknown attribute "${i}"`)()}this.setNeedsRedraw("constants")}setUniforms(e){b(e)||(this.pipeline.setUniformsWebGL(e),Object.assign(this.uniforms,e)),this.setNeedsRedraw("uniforms")}updateModuleSettings(e){const{bindings:t,uniforms:i}=v(this._getModuleUniforms(e));Object.assign(this.bindings,t),Object.assign(this.uniforms,i),this.setNeedsRedraw("moduleSettings")}_getBindingsUpdateTimestamp(){let e=0;for(const t of Object.values(this.bindings))t instanceof D?e=Math.max(e,t.texture.updateTimestamp):t instanceof _||t instanceof S?e=Math.max(e,t.updateTimestamp):t instanceof M||(e=Math.max(e,t.buffer.updateTimestamp));return e}_setGeometryAttributes(e){const t={...e.attributes};for(const[e]of Object.entries(t))this.pipeline.shaderLayout.attributes.find((t=>t.name===e))||"positions"===e||delete t[e];this.vertexCount=e.vertexCount,this.setIndexBuffer(e.indices||null),this.setAttributes(e.attributes,{disableWarnings:!0}),this.setAttributes(t,{disableWarnings:this.props.disableWarnings}),this.setNeedsRedraw("geometry attributes")}_setPipelineNeedsUpdate(e){this._pipelineNeedsUpdate||=e,this.setNeedsRedraw(e)}_updatePipeline(){if(this._pipelineNeedsUpdate){let e=null,t=null;this.pipeline&&(m.log(1,`Model ${this.id}: Recreating pipeline because "${this._pipelineNeedsUpdate}".`)(),e=this.pipeline.vs,t=this.pipeline.fs),this._pipelineNeedsUpdate=!1;const i=this.shaderFactory.createShader({id:`${this.id}-vertex`,stage:"vertex",source:this.source||this.vs,debug:this.props.debugShaders});let r=null;this.source?r=i:this.fs&&(r=this.shaderFactory.createShader({id:`${this.id}-fragment`,stage:"fragment",source:this.source||this.fs,debug:this.props.debugShaders})),this.pipeline=this.pipelineFactory.createRenderPipeline({...this.props,bufferLayout:this.bufferLayout,topology:this.topology,parameters:this.parameters,vs:i,fs:r}),this._attributeInfos=U(this.pipeline.shaderLayout,this.bufferLayout),e&&this.shaderFactory.release(e),t&&this.shaderFactory.release(t)}return this.pipeline}_lastLogTime=0;_logOpen=!1;_logDrawCallStart(){const e=m.level>3?0:1e4;m.level<2||Date.now()-this._lastLogTime<e||(this._lastLogTime=Date.now(),this._logOpen=!0,m.group(2,`>>> DRAWING MODEL ${this.id}`,{collapsed:m.level<=2})())}_logDrawCallEnd(){if(this._logOpen){const e=function(e,t){const i={},r="Values";if(0===e.attributes.length&&!e.varyings?.length)return{"No attributes or varyings":{[r]:"N/A"}};for(const t of e.attributes)t&&(i[`in ${t.location} ${t.name}: ${t.type}`]={[r]:t.stepMode||"vertex"});for(const t of e.varyings||[])i[`out ${t.location} ${t.name}`]={[r]:JSON.stringify(t.accessor)};return i}(this.pipeline.shaderLayout,this.id);m.table(2,e)();const t=this.shaderInputs.getDebugTable();for(const[e,i]of Object.entries(this.uniforms))t[e]={value:i};m.table(2,t)();const i=this._getAttributeDebugTable();m.table(2,this._attributeInfos)(),m.table(2,i)(),m.groupEnd(2)(),this._logOpen=!1}}_drawCount=0;_logFramebuffer(e){const t=m.get("framebuffer");if(this._drawCount++,!t||this._drawCount++>3&&this._drawCount%60)return;const i=e.props.framebuffer;i&&function(e,{id:t,minimap:i,opaque:r,top:s="0",left:n="0",rgbaScale:a=1}){Pt||(Pt=document.createElement("canvas"),Pt.id=t,Pt.title=t,Pt.style.zIndex="100",Pt.style.position="absolute",Pt.style.top=s,Pt.style.left=n,Pt.style.border="blue 1px solid",Pt.style.transform="scaleY(-1)",document.body.appendChild(Pt),zt=Pt.getContext("2d")),Pt.width===e.width&&Pt.height===e.height||(Pt.width=e.width/2,Pt.height=e.height/2,Pt.style.width="400px",Pt.style.height="400px");const o=e.device.readPixelsToArrayWebGL(e),A=zt.createImageData(e.width,e.height);for(let e=0;e<o.length;e+=4)A.data[0+e+0]=o[e+0]*a,A.data[0+e+1]=o[e+1]*a,A.data[0+e+2]=o[e+2]*a,A.data[0+e+3]=r?255:o[e+3]*a;zt.putImageData(A,0,0)}(i,{id:i.id,minimap:!0})}_getAttributeDebugTable(){const e={};for(const[t,i]of Object.entries(this._attributeInfos))e[i.location]={name:t,type:i.shaderType,values:this._getBufferOrConstantValues(this.vertexArray.attributes[i.location],i.bufferDataType)};if(this.vertexArray.indexBuffer){const{indexBuffer:t}=this.vertexArray,i="uint32"===t.indexType?new Uint32Array(t.debugData):new Uint16Array(t.debugData);e.indices={name:"indices",type:t.indexType,values:i.toString()}}return e}_getBufferOrConstantValues(e,t){const i=G(t);return(e instanceof _?new i(e.debugData):e).toString()}}function Kt(e,t){const i=[...e];for(const e of t){const t=i.findIndex((t=>t.name===e.name));t<0?i.push(e):i[t]=e}return i}function Ht(e){return e.attributes?e.attributes?.map((e=>e.attribute)):[e.name]}class Vt{id;topology;vertexCount;indices;attributes;userData={};constructor(e){const{attributes:t={},indices:i=null,vertexCount:r=null}=e;this.id=e.id||C("geometry"),this.topology=e.topology,i&&(this.indices=ArrayBuffer.isView(i)?{value:i,size:1}:i),this.attributes={};for(const[e,i]of Object.entries(t)){const t=ArrayBuffer.isView(i)?{value:i}:i;B(ArrayBuffer.isView(t.value),`${this._print(e)}: must be typed array or object with value as typed array`),"POSITION"!==e&&"positions"!==e||t.size||(t.size=3),"indices"===e?(B(!this.indices),this.indices=t):this.attributes[e]=t}this.indices&&void 0!==this.indices.isIndexed&&(this.indices=Object.assign({},this.indices),delete this.indices.isIndexed),this.vertexCount=r||this._calculateVertexCount(this.attributes,this.indices)}getVertexCount(){return this.vertexCount}getAttributes(){return this.indices?{indices:this.indices,...this.attributes}:this.attributes}_print(e){return`Geometry ${this.id} attribute ${e}`}_setAttributes(e,t){return this}_calculateVertexCount(e,t){if(t)return t.value.length;let i=1/0;for(const t of Object.values(e)){const{value:e,size:r,constant:s}=t;!s&&e&&r>=1&&(i=Math.min(i,e.length/r))}return B(Number.isFinite(i)),i}}function Jt(e,t){const i=[1/0,1/0,-1/0,-1/0];for(const r of e){const e=r.getBounds();if(e){const s=r.projectPosition(e[0],{viewport:t,autoOffset:!1}),n=r.projectPosition(e[1],{viewport:t,autoOffset:!1});i[0]=Math.min(i[0],s[0]),i[1]=Math.min(i[1],s[1]),i[2]=Math.max(i[2],n[0]),i[3]=Math.max(i[3],n[1])}}return Number.isFinite(i[0])?i:null}function Yt(i){const{bounds:r,viewport:s,border:n=0}=i,{isGeospatial:a}=s;if(r[2]<=r[0]||r[3]<=r[1])return null;const o=s.unprojectPosition([(r[0]+r[2])/2,(r[1]+r[3])/2,0]);let{width:A,height:l,zoom:h}=i;if(void 0===h){A-=2*n,l-=2*n;const e=Math.min(A/(r[2]-r[0]),l/(r[3]-r[1]));h=Math.min(Math.log2(e),20)}else if(!A||!l){const e=2**h;A=Math.round(Math.abs(r[2]-r[0])*e),l=Math.round(Math.abs(r[3]-r[1])*e);const t=2048-2*n;if(A>t||l>t){const e=t/Math.max(A,l);A=Math.round(A*e),l=Math.round(l*e),h+=Math.log2(e)}}return a?new e({id:s.id,x:n,y:n,width:A,height:l,longitude:o[0],latitude:o[1],zoom:h,orthographic:!0}):new t({id:s.id,x:n,y:n,width:A,height:l,target:o,zoom:h,flipY:!1})}function jt(e,t,i){if(!e)return[0,0,1,1];const r=function(e,t){let i;if(t&&2===t.length){const[r,s]=t,n=e.getBounds({z:r}),a=e.getBounds({z:s});i=[Math.min(n[0],a[0]),Math.min(n[1],a[1]),Math.max(n[2],a[2]),Math.max(n[3],a[3])]}else i=e.getBounds();const r=e.projectPosition(i.slice(0,2)),s=e.projectPosition(i.slice(2,4));return[r[0],r[1],s[0],s[1]]}(t,i),s=function(e){const t=e[2]-e[0],i=e[3]-e[1],r=(e[0]+e[2])/2,s=(e[1]+e[3])/2;return[r-t,s-i,r+t,s+i]}(r);return e[2]-e[0]<=s[2]-s[0]&&e[3]-e[1]<=s[3]-s[1]?e:[Math.max(e[0],s[0]),Math.max(e[1],s[1]),Math.min(e[2],s[2]),Math.min(e[3],s[3])]}const Zt={NONE:0,WRITE_HEIGHT_MAP:1,USE_HEIGHT_MAP:2,USE_COVER:3,USE_COVER_ONLY:4,SKIP:5},Wt=Object.keys(Zt).map((e=>`const float TERRAIN_MODE_${e} = ${Zt[e]}.0;`)).join("\n"),Xt={name:"terrain",dependencies:[i],inject:{"vs:#decl":"\nuniform float terrain_mode;\nuniform sampler2D terrain_map;\nuniform vec4 terrain_bounds;\nout vec3 commonPos;\n"+Wt,"vs:#main-start":"\nif (terrain_mode == TERRAIN_MODE_SKIP) {\ngl_Position = vec4(0.0);\nreturn;\n}\n","vs:DECKGL_FILTER_GL_POSITION":"\ncommonPos = geometry.position.xyz;\nif (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {\nvec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;\nposition = vec4(texCoords * 2.0 - 1.0, 0.0, 1.0);\ncommonPos.z += project_uCommonOrigin.z;\n}\nif (terrain_mode == TERRAIN_MODE_USE_HEIGHT_MAP) {\nvec3 anchor = geometry.worldPosition;\nanchor.z = 0.0;\nvec3 anchorCommon = project_position(anchor);\nvec2 texCoords = (anchorCommon.xy - terrain_bounds.xy) / terrain_bounds.zw;\nif (texCoords.x >= 0.0 && texCoords.y >= 0.0 && texCoords.x <= 1.0 && texCoords.y <= 1.0) {\nfloat terrainZ = texture(terrain_map, texCoords).r;\ngeometry.position.z += terrainZ;\nposition = project_common_position_to_clipspace(geometry.position);\n}\n}\n","fs:#decl":"\nuniform float terrain_mode;\nuniform sampler2D terrain_map;\nuniform vec4 terrain_bounds;\nin vec3 commonPos;\n"+Wt,"fs:#main-start":"\nif (terrain_mode == TERRAIN_MODE_WRITE_HEIGHT_MAP) {\nfragColor = vec4(commonPos.z, 0.0, 0.0, 1.0);\nreturn;\n}\n","fs:DECKGL_FILTER_COLOR":"\nif ((terrain_mode == TERRAIN_MODE_USE_COVER) || (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY)) {\nvec2 texCoords = (commonPos.xy - terrain_bounds.xy) / terrain_bounds.zw;\nvec4 pixel = texture(terrain_map, texCoords);\nif (terrain_mode == TERRAIN_MODE_USE_COVER_ONLY) {\ncolor = pixel;\n} else {\ncolor = pixel + color * (1.0 - pixel.a);\n}\nreturn;\n}\n"},getUniforms:(e={},t)=>{if("dummyHeightMap"in e){const{drawToTerrainHeightMap:i,heightMap:r,heightMapBounds:s,dummyHeightMap:n,terrainCover:a,useTerrainHeightMap:o,terrainSkipRender:A}=e,{project_uCommonOrigin:l}=t;let h=A?Zt.SKIP:Zt.NONE,c=n,g=null;if(i)h=Zt.WRITE_HEIGHT_MAP,g=s;else if(o&&r)h=Zt.USE_HEIGHT_MAP,c=r,g=s;else if(a){const t=e.picking?.isActive,i=t?a.getPickingFramebuffer():a.getRenderFramebuffer();c=i?.colorAttachments[0].texture,t&&(h=Zt.SKIP),c?(h=h===Zt.SKIP?Zt.USE_COVER_ONLY:Zt.USE_COVER,g=a.bounds):c=n}return{terrain_mode:h,terrain_map:c,terrain_bounds:g?[g[0]-l[0],g[1]-l[1],g[2]-g[0],g[3]-g[1]]:[0,0,0,0]}}return null}};function $t(e,t){return e.createFramebuffer({id:t.id,colorAttachments:[e.createTexture({id:t.id,...t.float&&{format:"rgba32float",type:5126},mipmaps:!1,sampler:{minFilter:"linear",magFilter:"linear",addressModeU:"clamp-to-edge",addressModeV:"clamp-to-edge"}})]})}class ei{constructor(e){this.isDirty=!0,this.renderViewport=null,this.bounds=null,this.layers=[],this.targetBounds=null,this.targetBoundsCommon=null,this.targetLayer=e,this.tile=ti(e)}get id(){return this.targetLayer.id}get isActive(){return Boolean(this.targetLayer.getCurrentLayer())}shouldUpdate({targetLayer:e,viewport:t,layers:i,layerNeedsRedraw:r}){e&&(this.targetLayer=e);const s=!!t&&this._updateViewport(t);let n=!!i&&this._updateLayers(i);if(r)for(const e of this.layers)if(r[e]){n=!0;break}return n||s}_updateLayers(e){let t=!1;if((e=this.tile?function(e,t){return t.filter((t=>{const i=ti(t);return!i||function(e,t){if(e&&t)return e[0][0]<t[1][0]&&t[0][0]<e[1][0]&&e[0][1]<t[1][1]&&t[0][1]<e[1][1];return!1}(e.boundingBox,i.boundingBox)}))}(this.tile,e):e).length!==this.layers.length)t=!0;else for(let i=0;i<e.length;i++){if(e[i].id!==this.layers[i]){t=!0;break}}return t&&(this.layers=e.map((e=>e.id))),t}_updateViewport(e){const t=this.targetLayer;let i=!1;if(this.tile&&"boundingBox"in this.tile){if(!this.targetBounds){i=!0,this.targetBounds=this.tile.boundingBox;const t=e.projectPosition(this.targetBounds[0]),r=e.projectPosition(this.targetBounds[1]);this.targetBoundsCommon=[t[0],t[1],r[0],r[1]]}}else this.targetBounds!==t.getBounds()&&(i=!0,this.targetBounds=t.getBounds(),this.targetBoundsCommon=Jt([t],e));if(!this.targetBoundsCommon)return!1;const r=Math.ceil(e.zoom+.5);if(this.tile)this.bounds=this.targetBoundsCommon;else{const t=this.renderViewport?.zoom;i=i||r!==t;const s=jt(this.targetBoundsCommon,e),n=this.bounds;i=i||!n||s.some(((e,t)=>e!==n[t])),this.bounds=s}return i&&(this.renderViewport=Yt({bounds:this.bounds,zoom:r,viewport:e})),i}getRenderFramebuffer(){return this.renderViewport&&0!==this.layers.length?(this.fbo||(this.fbo=$t(this.targetLayer.context.device,{id:this.id})),this.fbo):null}getPickingFramebuffer(){return!this.renderViewport||0===this.layers.length&&!this.targetLayer.props.pickable?null:(this.pickingFbo||(this.pickingFbo=$t(this.targetLayer.context.device,{id:`${this.id}-picking`})),this.pickingFbo)}filterLayers(e){return e.filter((({id:e})=>this.layers.includes(e)))}delete(){const{fbo:e,pickingFbo:t}=this;e&&(e.colorAttachments[0].destroy(),e.destroy()),t&&(t.colorAttachments[0].destroy(),t.destroy())}}function ti(e){for(;e;){const{tile:t}=e.props;if(t)return t;e=e.parent}return null}const ii={blendColorOperation:"max",blendColorSrcFactor:"one",blendColorDstFactor:"one",blendAlphaOperation:"max",blendAlphaSrcFactor:"one",blendAlphaDstFactor:"one"};class ri extends r{getRenderableLayers(e,t){const{layers:i}=t,r=[],s=this._getDrawLayerParams(e,t,!0);for(let e=0;e<i.length;e++){const t=i[e];!t.isComposite&&s[e].shouldDrawLayer&&r.push(t)}return r}renderHeightMap(e,t){const i=e.getRenderFramebuffer(),r=e.renderViewport;i&&r&&(i.resize(r),this.render({...t,target:i,pass:"terrain-height-map",layers:t.layers,viewports:[r],effects:[],clearColor:[0,0,0,0]}))}renderTerrainCover(e,t){const i=e.getRenderFramebuffer(),r=e.renderViewport;if(!i||!r)return;const s=e.filterLayers(t.layers);i.resize(r),this.render({...t,target:i,pass:`terrain-cover-${e.id}`,layers:s,effects:[],viewports:[r],clearColor:[0,0,0,0]})}getLayerParameters(e,t,i){return{...e.props.parameters,blend:!0,depthTest:!1,...e.props.operation.includes("terrain")&&ii}}}class si extends s{constructor(){super(...arguments),this.drawParameters={}}getRenderableLayers(e,t){const{layers:i}=t,r=[];this.drawParameters={},this._resetColorEncoder(t.pickZ);const s=this._getDrawLayerParams(e,t);for(let e=0;e<i.length;e++){const t=i[e];!t.isComposite&&s[e].shouldDrawLayer&&(r.push(t),this.drawParameters[t.id]=s[e].layerParameters)}return r}renderTerrainCover(e,t){const i=e.getPickingFramebuffer(),r=e.renderViewport;if(!i||!r)return;const s=e.filterLayers(t.layers),n=e.targetLayer;n.props.pickable&&s.unshift(n),i.resize(r),this.render({...t,pickingFBO:i,pass:`terrain-cover-picking-${e.id}`,layers:s,effects:[],viewports:[r],cullRect:void 0,deviceRect:r,pickZ:!1})}getLayerParameters(e,t,i){let r;return this.drawParameters[e.id]?r=this.drawParameters[e.id]:(r=super.getLayerParameters(e,t,i),r.blend=!0),{...r,depthTest:!1}}}class ni{static isSupported(e){return e.isTextureFormatRenderable("rgba32float")}constructor(e){this.renderViewport=null,this.bounds=null,this.layers=[],this.layersBounds=[],this.layersBoundsCommon=null,this.lastViewport=null,this.device=e}getRenderFramebuffer(){return this.renderViewport?(this.fbo||(this.fbo=$t(this.device,{id:"height-map",float:!0})),this.fbo):null}shouldUpdate({layers:e,viewport:t}){const i=e.length!==this.layers.length||e.some(((e,t)=>e!==this.layers[t]||e.props.transitions||e.getBounds()!==this.layersBounds[t]));i&&(this.layers=e,this.layersBounds=e.map((e=>e.getBounds())),this.layersBoundsCommon=Jt(e,t));const r=!this.lastViewport||!t.equals(this.lastViewport);if(this.layersBoundsCommon){if(i||r){const e=jt(this.layersBoundsCommon,t);if(e[2]<=e[0]||e[3]<=e[1])return this.renderViewport=null,!1;this.bounds=e,this.lastViewport=t;const i=t.scale,r=(e[2]-e[0])*i,s=(e[3]-e[1])*i;return this.renderViewport=r>0||s>0?Yt({bounds:[t.center[0]-1,t.center[1]-1,t.center[0]+1,t.center[1]+1],zoom:t.zoom,width:Math.min(r,2048),height:Math.min(s,2048),viewport:t}):null,!0}}else this.renderViewport=null;return!1}delete(){this.fbo&&(this.fbo.colorAttachments[0].delete(),this.fbo.delete())}}class ai{constructor(){this.id="terrain-effect",this.props=null,this.useInPicking=!0,this.isPicking=!1,this.isDrapingEnabled=!1,this.terrainCovers=new Map}setup({device:e,deck:t}){this.dummyHeightMap=e.createTexture({width:1,height:1,data:new Uint8Array([0,0,0,0])}),this.terrainPass=new ri(e,{id:"terrain"}),this.terrainPickingPass=new si(e,{id:"terrain-picking"}),ni.isSupported(e)?this.heightMap=new ni(e):n.warn("Terrain offset mode is not supported by this browser")(),t._addDefaultShaderModule(Xt)}preRender(e){if(e.pickZ)return void(this.isDrapingEnabled=!1);const{viewports:t}=e,i=e.pass.startsWith("picking");this.isPicking=i,this.isDrapingEnabled=!0;const r=t[0],s=(i?this.terrainPickingPass:this.terrainPass).getRenderableLayers(r,e),n=s.filter((e=>e.props.operation.includes("terrain")));if(0===n.length)return;if(!i){s.filter((e=>"offset"===e.state.terrainDrawMode)).length>0&&this._updateHeightMap(n,r,e)}const a=s.filter((e=>"drape"===e.state.terrainDrawMode));this._updateTerrainCovers(n,a,r,e)}getModuleParameters(e){const{terrainDrawMode:t}=e.state;return{heightMap:this.heightMap?.getRenderFramebuffer()?.colorAttachments[0].texture||null,heightMapBounds:this.heightMap?.bounds,dummyHeightMap:this.dummyHeightMap,terrainCover:this.isDrapingEnabled?this.terrainCovers.get(e.id):null,useTerrainHeightMap:"offset"===t,terrainSkipRender:"drape"===t||!e.props.operation.includes("draw")}}cleanup({deck:e}){this.dummyHeightMap&&(this.dummyHeightMap.delete(),this.dummyHeightMap=void 0),this.heightMap&&(this.heightMap.delete(),this.heightMap=void 0);for(const e of this.terrainCovers.values())e.delete();this.terrainCovers.clear(),e._removeDefaultShaderModule(Xt)}_updateHeightMap(e,t,i){if(!this.heightMap)return;this.heightMap.shouldUpdate({layers:e,viewport:t})&&this.terrainPass.renderHeightMap(this.heightMap,{...i,layers:e,moduleParameters:{heightMapBounds:this.heightMap.bounds,dummyHeightMap:this.dummyHeightMap,devicePixelRatio:1,drawToTerrainHeightMap:!0}})}_updateTerrainCovers(e,t,i,r){const s={};for(const e of t)e.state.terrainCoverNeedsRedraw&&(s[e.id]=!0,e.state.terrainCoverNeedsRedraw=!1);for(const e of this.terrainCovers.values())e.isDirty=e.isDirty||e.shouldUpdate({layerNeedsRedraw:s});for(const s of e)this._updateTerrainCover(s,t,i,r);this.isPicking||this._pruneTerrainCovers()}_updateTerrainCover(e,t,i,r){const s=this.isPicking?this.terrainPickingPass:this.terrainPass;let n=this.terrainCovers.get(e.id);n||(n=new ei(e),this.terrainCovers.set(e.id,n));try{const a=n.shouldUpdate({targetLayer:e,viewport:i,layers:t});(this.isPicking||n.isDirty||a)&&(s.renderTerrainCover(n,{...r,layers:t,moduleParameters:{dummyHeightMap:this.dummyHeightMap,terrainSkipRender:!1,devicePixelRatio:1}}),this.isPicking||(n.isDirty=!1))}catch(t){e.raiseError(t,`Error rendering terrain cover ${n.id}`)}}_pruneTerrainCovers(){const e=[];for(const[t,i]of this.terrainCovers)i.isActive||e.push(t);for(const t of e)this.terrainCovers.delete(t)}}const oi={terrainDrawMode:void 0};class Ai extends a{static{this.defaultProps=oi}static{this.extensionName="TerrainExtension"}getShaders(){return{modules:[Xt]}}initializeState(){this.context.deck?._addDefaultEffect(new ai)}updateState(e){const{props:t,oldProps:i}=e;if(this.state.terrainDrawMode&&t.terrainDrawMode===i.terrainDrawMode&&t.extruded===i.extruded)return;let{terrainDrawMode:r}=t;if(!r){const e=this.props.extruded,t=this.getAttributeManager()?.attributes;r=e||t&&"instancePositions"in t?"offset":"drape"}this.setState({terrainDrawMode:r})}onNeedsRedraw(){const e=this.state;"drape"===e.terrainDrawMode&&(e.terrainCoverNeedsRedraw=!0)}}var li,hi,ci,gi,ui,di,fi,pi,Ii,mi,_i,wi,Ci,Bi;!function(e){e[e.Big=19789]="Big",e[e.Little=18761]="Little"}(li||(li={})),function(e){e[e.ReducedImage=1]="ReducedImage",e[e.Page=2]="Page",e[e.Mask=4]="Mask"}(hi||(hi={})),function(e){e[e.TopLeft=1]="TopLeft",e[e.TopRight=2]="TopRight",e[e.BottomRight=3]="BottomRight",e[e.BottomLeft=4]="BottomLeft",e[e.LeftTop=5]="LeftTop",e[e.RightTOP=6]="RightTOP",e[e.RightBottom=7]="RightBottom",e[e.LeftBottom=8]="LeftBottom"}(ci||(ci={})),function(e){e[e.PixelIsArea=1]="PixelIsArea",e[e.PixelIsPoint=2]="PixelIsPoint"}(gi||(gi={})),function(e){e[e.Unknown=0]="Unknown",e[e.Projected=1]="Projected",e[e.Geographic=2]="Geographic",e[e.Geocentric=3]="Geocentric",e[e.UserDefined=32767]="UserDefined"}(ui||(ui={})),function(e){e[e.Image=1]="Image",e[e.ReducedImage=2]="ReducedImage",e[e.Page=3]="Page"}(di||(di={})),function(e){e[e.None=1]="None",e[e.Lzw=5]="Lzw",e[e.Jpeg6=6]="Jpeg6",e[e.Jpeg=7]="Jpeg",e[e.DeflateOther=8]="DeflateOther",e[e.Deflate=32946]="Deflate",e[e.Jp2000=3417]="Jp2000",e[e.Lerc=34887]="Lerc",e[e.Lzma=34925]="Lzma",e[e.Zstd=5e4]="Zstd",e[e.Webp=50001]="Webp",e[e.JpegXl=50002]="JpegXl"}(fi||(fi={})),function(e){e[e.Contig=1]="Contig",e[e.Separate=2]="Separate"}(pi||(pi={})),function(e){e[e.Uint=1]="Uint",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Void=4]="Void",e[e.ComplexInt=5]="ComplexInt",e[e.ComplexFloat=6]="ComplexFloat"}(Ii||(Ii={})),function(e){e[e.MinIsWhite=0]="MinIsWhite",e[e.MinIsBlack=1]="MinIsBlack",e[e.Rgb=2]="Rgb",e[e.Palette=3]="Palette",e[e.Mask=4]="Mask",e[e.Separated=5]="Separated",e[e.Ycbcr=6]="Ycbcr",e[e.Cielab=8]="Cielab",e[e.Icclab=9]="Icclab",e[e.Itulab=10]="Itulab",e[e.Cfa=32803]="Cfa",e[e.Logl=32844]="Logl",e[e.Logluv=32845]="Logluv"}(mi||(mi={})),function(e){e[e.SubFileType=254]="SubFileType",e[e.OldSubFileType=255]="OldSubFileType",e[e.ImageWidth=256]="ImageWidth",e[e.ImageHeight=257]="ImageHeight",e[e.BitsPerSample=258]="BitsPerSample",e[e.SampleFormat=339]="SampleFormat",e[e.Compression=259]="Compression",e[e.Photometric=262]="Photometric",e[e.TileWidth=322]="TileWidth",e[e.TileHeight=323]="TileHeight",e[e.TileOffsets=324]="TileOffsets",e[e.TileByteCounts=325]="TileByteCounts",e[e.JpegTables=347]="JpegTables",e[e.StripOffsets=273]="StripOffsets",e[e.StripByteCounts=279]="StripByteCounts",e[e.GdalMetadata=42112]="GdalMetadata",e[e.GdalNoData=42113]="GdalNoData",e[e.ModelPixelScale=33550]="ModelPixelScale",e[e.ModelTiePoint=33922]="ModelTiePoint",e[e.ModelTransformation=34744]="ModelTransformation",e[e.GeoKeyDirectory=34735]="GeoKeyDirectory",e[e.GeoDoubleParams=34736]="GeoDoubleParams",e[e.GeoAsciiParams=34737]="GeoAsciiParams",e[e.LercParameters=50674]="LercParameters",e[e.PlanarConfiguration=284]="PlanarConfiguration",e[e.CellLength=265]="CellLength",e[e.CellWidth=264]="CellWidth",e[e.ColorMap=320]="ColorMap",e[e.Copyright=33432]="Copyright",e[e.DateTime=306]="DateTime",e[e.ExtraSamples=338]="ExtraSamples",e[e.FillOrder=266]="FillOrder",e[e.FreeByteCounts=289]="FreeByteCounts",e[e.FreeOffsets=288]="FreeOffsets",e[e.GrayResponseCurve=291]="GrayResponseCurve",e[e.GrayResponseUnit=290]="GrayResponseUnit",e[e.HostComputer=316]="HostComputer",e[e.ImageDescription=270]="ImageDescription",e[e.Make=271]="Make",e[e.MaxSampleValue=281]="MaxSampleValue",e[e.MinSampleValue=280]="MinSampleValue",e[e.Model=272]="Model",e[e.Orientation=274]="Orientation",e[e.ResolutionUnit=296]="ResolutionUnit",e[e.RowsPerStrip=278]="RowsPerStrip",e[e.SamplesPerPixel=277]="SamplesPerPixel",e[e.Software=305]="Software",e[e.Threshholding=263]="Threshholding",e[e.XResolution=282]="XResolution",e[e.YResolution=283]="YResolution",e[e.BadFaxLines=326]="BadFaxLines",e[e.CleanFaxData=327]="CleanFaxData",e[e.ClipPath=343]="ClipPath",e[e.ConsecutiveBadFaxLines=328]="ConsecutiveBadFaxLines",e[e.Decode=433]="Decode",e[e.DefaultImageColor=434]="DefaultImageColor",e[e.DocumentName=269]="DocumentName",e[e.DotRange=336]="DotRange",e[e.HalftoneHints=321]="HalftoneHints",e[e.Indexed=346]="Indexed",e[e.PageName=285]="PageName",e[e.PageNumber=297]="PageNumber",e[e.Predictor=317]="Predictor",e[e.PrimaryChromaticities=319]="PrimaryChromaticities",e[e.ReferenceBlackWhite=532]="ReferenceBlackWhite",e[e.SMinSampleValue=340]="SMinSampleValue",e[e.SMaxSampleValue=341]="SMaxSampleValue",e[e.StripRowCounts=559]="StripRowCounts",e[e.SubIFDs=330]="SubIFDs",e[e.T4Options=292]="T4Options",e[e.T6Options=293]="T6Options",e[e.TransferFunction=301]="TransferFunction",e[e.WhitePoint=318]="WhitePoint",e[e.XClipPathUnits=344]="XClipPathUnits",e[e.XPosition=286]="XPosition",e[e.YCbCrCoefficients=529]="YCbCrCoefficients",e[e.YCbCrPositioning=531]="YCbCrPositioning",e[e.YCbCrSubSampling=530]="YCbCrSubSampling",e[e.YClipPathUnits=345]="YClipPathUnits",e[e.YPosition=287]="YPosition",e[e.ApertureValue=37378]="ApertureValue",e[e.ColorSpace=40961]="ColorSpace",e[e.DateTimeDigitized=36868]="DateTimeDigitized",e[e.DateTimeOriginal=36867]="DateTimeOriginal",e[e.ExifIFD=34665]="ExifIFD",e[e.ExifVersion=36864]="ExifVersion",e[e.ExposureTime=33434]="ExposureTime",e[e.FileSource=41728]="FileSource",e[e.Flash=37385]="Flash",e[e.FlashpixVersion=40960]="FlashpixVersion",e[e.FNumber=33437]="FNumber",e[e.ImageUniqueID=42016]="ImageUniqueID",e[e.LightSource=37384]="LightSource",e[e.MakerNote=37500]="MakerNote",e[e.ShutterSpeedValue=37377]="ShutterSpeedValue",e[e.UserComment=37510]="UserComment",e[e.IPTC=33723]="IPTC",e[e.ICCProfile=34675]="ICCProfile",e[e.XMP=700]="XMP"}(_i||(_i={})),function(e){e[e.GTModelTypeGeoKey=1024]="GTModelTypeGeoKey",e[e.GTRasterTypeGeoKey=1025]="GTRasterTypeGeoKey",e[e.GTCitationGeoKey=1026]="GTCitationGeoKey",e[e.GeodeticCRSGeoKey=2048]="GeodeticCRSGeoKey",e[e.GeodeticCitationGeoKey=2049]="GeodeticCitationGeoKey",e[e.GeodeticDatumGeoKey=2050]="GeodeticDatumGeoKey",e[e.PrimeMeridianGeoKey=2051]="PrimeMeridianGeoKey",e[e.GeogLinearUnitsGeoKey=2052]="GeogLinearUnitsGeoKey",e[e.GeogLinearUnitSizeGeoKey=2053]="GeogLinearUnitSizeGeoKey",e[e.GeogAngularUnitsGeoKey=2054]="GeogAngularUnitsGeoKey",e[e.GeogAngularUnitSizeGeoKey=2055]="GeogAngularUnitSizeGeoKey",e[e.EllipsoidGeoKey=2056]="EllipsoidGeoKey",e[e.EllipsoidSemiMajorAxisGeoKey=2057]="EllipsoidSemiMajorAxisGeoKey",e[e.EllipsoidSemiMinorAxisGeoKey=2058]="EllipsoidSemiMinorAxisGeoKey",e[e.EllipsoidInvFlatteningGeoKey=2059]="EllipsoidInvFlatteningGeoKey",e[e.PrimeMeridianLongitudeGeoKey=2061]="PrimeMeridianLongitudeGeoKey",e[e.GeogTOWGS84GeoKey=2062]="GeogTOWGS84GeoKey",e[e.GeogAzimuthUnitsGeoKey=2060]="GeogAzimuthUnitsGeoKey",e[e.ProjectedCRSGeoKey=3072]="ProjectedCRSGeoKey",e[e.ProjectedCitationGeoKey=3073]="ProjectedCitationGeoKey",e[e.ProjectionGeoKey=3074]="ProjectionGeoKey",e[e.ProjMethodGeoKey=3075]="ProjMethodGeoKey",e[e.ProjLinearUnitsGeoKey=3076]="ProjLinearUnitsGeoKey",e[e.ProjLinearUnitSizeGeoKey=3077]="ProjLinearUnitSizeGeoKey",e[e.ProjStdParallel1GeoKey=3078]="ProjStdParallel1GeoKey",e[e.ProjStdParallel2GeoKey=3079]="ProjStdParallel2GeoKey",e[e.ProjNatOriginLongGeoKey=3080]="ProjNatOriginLongGeoKey",e[e.ProjNatOriginLatGeoKey=3081]="ProjNatOriginLatGeoKey",e[e.ProjFalseEastingGeoKey=3082]="ProjFalseEastingGeoKey",e[e.ProjFalseNorthingGeoKey=3083]="ProjFalseNorthingGeoKey",e[e.ProjFalseOriginLongGeoKey=3084]="ProjFalseOriginLongGeoKey",e[e.ProjFalseOriginLatGeoKey=3085]="ProjFalseOriginLatGeoKey",e[e.ProjFalseOriginEastingGeoKey=3086]="ProjFalseOriginEastingGeoKey",e[e.ProjFalseOriginNorthingGeoKey=3087]="ProjFalseOriginNorthingGeoKey",e[e.ProjCenterLongGeoKey=3088]="ProjCenterLongGeoKey",e[e.ProjCenterLatGeoKey=3089]="ProjCenterLatGeoKey",e[e.ProjCenterEastingGeoKey=3090]="ProjCenterEastingGeoKey",e[e.ProjCenterNorthingGeoKey=3091]="ProjCenterNorthingGeoKey",e[e.ProjScaleAtNatOriginGeoKey=3092]="ProjScaleAtNatOriginGeoKey",e[e.ProjScaleAtCenterGeoKey=3093]="ProjScaleAtCenterGeoKey",e[e.ProjAzimuthAngleGeoKey=3094]="ProjAzimuthAngleGeoKey",e[e.ProjStraightVertPoleLongGeoKey=3095]="ProjStraightVertPoleLongGeoKey",e[e.ProjRectifiedGridAngleGeoKey=3096]="ProjRectifiedGridAngleGeoKey",e[e.VerticalGeoKey=4096]="VerticalGeoKey",e[e.VerticalCitationGeoKey=4097]="VerticalCitationGeoKey",e[e.VerticalDatumGeoKey=4098]="VerticalDatumGeoKey",e[e.VerticalUnitsGeoKey=4099]="VerticalUnitsGeoKey"}(wi||(wi={})),function(e){e[e.Radian=9101]="Radian",e[e.Degree=9102]="Degree",e[e.ArcMinute=9103]="ArcMinute",e[e.ArcDegree=9104]="ArcDegree",e[e.Grad=9105]="Grad",e[e.Gon=9106]="Gon",e[e.Dms=9107]="Dms"}(Ci||(Ci={})),function(e){e[e.Metre=9001]="Metre",e[e.Foot=9002]="Foot",e[e.FootUsSurvey=9003]="FootUsSurvey",e[e.FootModifiedAmerican=9004]="FootModifiedAmerican",e[e.FootClarke=9005]="FootClarke",e[e.FootIndian=9006]="FootIndian",e[e.Link=9007]="Link",e[e.LinkBenoit=9008]="LinkBenoit",e[e.LinkSears=9009]="LinkSears",e[e.ChainBenoit=9010]="ChainBenoit",e[e.ChainSears=9011]="ChainSears",e[e.YardSears=9012]="YardSears",e[e.YardIndian=9013]="YardIndian",e[e.Fathom=9014]="Fathom",e[e.MileInternationalNautical=9015]="MileInternationalNautical"}(Bi||(Bi={}));const Ei={[_i.TileByteCounts]:!0,[_i.TileOffsets]:!0,[_i.StripOffsets]:!0,[_i.StripByteCounts]:!0,[_i.BitsPerSample]:!0,[_i.SampleFormat]:!0,[_i.GeoKeyDirectory]:!0,[_i.GeoDoubleParams]:!0};var yi;!function(e){e.None="application/octet-stream",e.Jpeg="image/jpeg",e.Jp2000="image/jp2",e.JpegXl="image/jpegxl",e.Webp="image/webp",e.Zstd="application/zstd",e.Lzw="application/lzw",e.Deflate="application/deflate",e.Lerc="application/lerc",e.Lzma="application/x-lzma"}(yi||(yi={}));const Qi={[fi.None]:yi.None,[fi.Lzw]:yi.Lzw,[fi.Jpeg6]:yi.Jpeg,[fi.Jpeg]:yi.Jpeg,[fi.DeflateOther]:yi.Deflate,[fi.Deflate]:yi.Deflate,[fi.Lerc]:yi.Lerc,[fi.Lzma]:yi.Lzma,[fi.Jp2000]:yi.Jp2000,[fi.Zstd]:yi.Zstd,[fi.Webp]:yi.Webp,[fi.JpegXl]:yi.JpegXl};var bi,ki,xi,vi;function Di(e){switch(e){case bi.Uint8:case bi.Ascii:case bi.Int8:case bi.Undefined:return 1;case bi.Uint16:case bi.Int16:return 2;case bi.Uint32:case bi.Int32:case bi.Float32:return 4;case bi.Rational:case bi.SignedRational:case bi.Float64:case bi.Uint64:case bi.Int64:case bi.Ifd8:return 8;default:throw new Error(`Invalid fieldType ${e}`)}}!function(e){e[e.Uint8=1]="Uint8",e[e.Ascii=2]="Ascii",e[e.Uint16=3]="Uint16",e[e.Uint32=4]="Uint32",e[e.Rational=5]="Rational",e[e.Int8=6]="Int8",e[e.Undefined=7]="Undefined",e[e.Int16=8]="Int16",e[e.Int32=9]="Int32",e[e.SignedRational=10]="SignedRational",e[e.Float32=11]="Float32",e[e.Float64=12]="Float64",e[e.Uint64=16]="Uint64",e[e.Int64=17]="Int64",e[e.Ifd8=18]="Ifd8"}(bi||(bi={})),function(e){e[e.BigTiff=43]="BigTiff",e[e.Tiff=42]="Tiff"}(ki||(ki={})),function(e){e[e.Double=8]="Double",e[e.Float32=4]="Float32"}(xi||(xi={})),function(e){e[e.UInt64=8]="UInt64",e[e.UInt32=4]="UInt32",e[e.UInt16=2]="UInt16",e[e.UInt8=1]="UInt8"}(vi||(vi={}));const Si=2**32;function Mi(e,t,i){const r=e.getUint32(t,i),s=e.getUint32(t+4,i),n=i?r+Si*s:Si*r+s;if(!Number.isSafeInteger(n))throw new Error(n+" exceeds MAX_SAFE_INTEGER. Precision may is lost");return n}function Ui(e,t,i,r){switch(i){case vi.UInt8:return e.getUint8(t);case vi.UInt16:return e.getUint16(t,r);case vi.UInt32:return e.getUint32(t,r);case vi.UInt64:return Mi(e,t,r)}}function Gi(e,t,i){return!(t<e.sourceOffset)&&!(e.sourceOffset+e.byteLength<t+i)}function Ti(e,t,i,r){switch(e){case bi.Ascii:return String.fromCharCode(t.getUint8(i));case bi.Undefined:case bi.Uint8:return t.getUint8(i);case bi.Int8:return t.getInt8(i);case bi.Uint16:return t.getUint16(i,r);case bi.Int16:return t.getInt16(i,r);case bi.Uint32:return t.getUint32(i,r);case bi.Int32:return t.getInt32(i,r);case bi.Rational:return[t.getUint32(i,r),t.getUint32(i+4,r)];case bi.SignedRational:return[t.getInt32(i,r),t.getInt32(i+4,r)];case bi.Float64:return t.getFloat64(i,r);case bi.Float32:return t.getFloat32(i,r);case bi.Uint64:return Mi(t,i,r);default:throw new Error(`Unknown read type "${e}" "${bi[e]}"`)}}function Fi(e,t,i,r,s,n){const a=Di(s),o=n*a;if(1===n){const n=Ti(s,i,r,e.isLittleEndian);return t&&Ei[t]?[n]:n}if(s===bi.Ascii)return String.fromCharCode.apply(null,new Uint8Array(i.buffer,r,o-1));const A=[];for(let t=0;t<o;t+=a)A.push(Ti(s,i,r+t,e.isLittleEndian));return A}function Ri(e,t,i){const r=t.getUint16(i+0,e.isLittleEndian),s=t.getUint16(i+2,e.isLittleEndian),n=Ui(t,i+4,e.ifdConfig.pointer,e.isLittleEndian),a=Di(s)*n;if(a<=e.ifdConfig.pointer){const a=Fi(e,r,t,i+4+e.ifdConfig.pointer,s,n);return{type:"inline",id:r,name:_i[r],count:n,value:a,dataType:s,tagOffset:i}}const o=Ui(t,i+4+e.ifdConfig.pointer,e.ifdConfig.pointer,e.isLittleEndian);switch(r){case _i.TileOffsets:case _i.TileByteCounts:case _i.StripByteCounts:case _i.StripOffsets:const e={type:"offset",id:r,name:_i[r],count:n,dataType:s,dataOffset:o,isLoaded:!1,value:[],tagOffset:i};return r===_i.TileOffsets&&Gi(t,o,a)&&function(e,t){const i=Di(e.dataType),r=t.byteOffset+e.dataOffset-t.sourceOffset;e.view=new DataView(t.buffer.slice(r,r+i*e.count)),e.view.sourceOffset=e.dataOffset}(e,t),e}if(Gi(t,o,a)){const a=Fi(e,r,t,o-t.sourceOffset,s,n);return{type:"inline",id:r,name:_i[r],count:n,value:a,dataType:s,tagOffset:i}}return{type:"lazy",id:r,name:_i[r],count:n,dataOffset:o,dataType:s,tagOffset:i}}new Set([_i.Compression,_i.ImageHeight,_i.ImageWidth,_i.ModelPixelScale,_i.ModelTiePoint,_i.ModelTransformation,_i.TileHeight,_i.TileWidth,_i.GeoKeyDirectory,_i.GeoAsciiParams,_i.GeoDoubleParams,_i.TileOffsets]);class Li{constructor(e,t,i){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tiff",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isGeoTagsLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tagsGeo",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tiff=e,this.id=t,this.tags=i}async init(e=!0){const t=[this.fetch(_i.Compression),this.fetch(_i.ImageHeight),this.fetch(_i.ImageWidth),this.fetch(_i.ModelPixelScale),this.fetch(_i.ModelTiePoint),this.fetch(_i.ModelTransformation),this.fetch(_i.TileHeight),this.fetch(_i.TileWidth)];e&&(t.push(this.fetch(_i.GeoKeyDirectory)),t.push(this.fetch(_i.GeoAsciiParams)),t.push(this.fetch(_i.GeoDoubleParams))),await Promise.all(t),e&&await this.loadGeoTiffTags()}value(e){const t=this.tags.get(e);return null==t||"offset"===t.type&&!1===t.isLoaded?null:t.value}has(e){return this.tags.has(e)}async fetch(e){const t=this.tags.get(e);if(null==t)return null;if("inline"===t.type)return t.value;if("lazy"===t.type)return async function(e,t){if(null!=e.value)return e.value;const i=Di(e.dataType)*e.count,r=await t.source.fetch(e.dataOffset,i),s=new DataView(r);return e.value=Fi(t,e.id,s,0,e.dataType,e.count),e.value}(t,this.tiff);if(t.isLoaded)return t.value;if("offset"===t.type)return async function(e,t){const i=Di(t.dataType);if(null==t.view){const r=await e.source.fetch(t.dataOffset,i*t.count);t.view=new DataView(r),t.view.sourceOffset=t.dataOffset}return t.value=Fi(e,t.id,t.view,0,t.dataType,t.count),t.isLoaded=!0,t.value}(this.tiff,t);throw new Error("Cannot fetch:"+e)}valueGeo(e){if(!1===this.isGeoTagsLoaded)throw new Error("loadGeoTiffTags() has not been called");return this.tagsGeo.get(e)}get noData(){const e=this.tags.get(_i.GdalNoData);if(null==e)return null;if(e.value)return Number(e.value);throw new Error("GdalNoData tag is not loaded")}async loadGeoTiffTags(){if(this.isGeoTagsLoaded)return;const e=this.tags.get(_i.GeoKeyDirectory);if(null==e)return void(this.isGeoTagsLoaded=!0);if("lazy"===e.type&&null==e.value&&await Promise.all([this.fetch(_i.GeoKeyDirectory),this.fetch(_i.GeoAsciiParams),this.fetch(_i.GeoDoubleParams)]),this.isGeoTagsLoaded=!0,null==e.value)return;const t=e.value;if("number"==typeof t)throw new Error("Invalid geo tags found");for(let e=4;e<=4*t[3];e+=4){const i=t[e],r=t[e+1],s=t[e+3];if(0===r){this.tagsGeo.set(i,s);continue}const n=this.tags.get(r);if(null==n||null==n.value)continue;const a=t[e+2];if("string"==typeof n.value)this.tagsGeo.set(i,n.value.slice(s,s+a-1).trim());else{if(!Array.isArray(n.value))throw new Error("Failed to extract GeoTiffTags");1===a?this.tagsGeo.set(i,n.value[s]):this.tagsGeo.set(i,n.value.slice(s,s+a))}}}get origin(){const e=this.value(_i.ModelTiePoint);if(null!=e&&6===e.length)return[e[3],e[4],e[5]];const t=this.value(_i.ModelTransformation);if(null!=t)return[t[3],t[7],t[11]];if(this.value(_i.SubFileType)===hi.ReducedImage&&0!==this.id)return this.tiff.images[0].origin;throw new Error("Image does not have a geo transformation.")}get isGeoLocated(){return!(null==this.value(_i.ModelPixelScale)&&null==this.value(_i.ModelTransformation))||!(!this.isSubImage||0===this.id)&&this.tiff.images[0].isGeoLocated}get resolution(){const e=this.value(_i.ModelPixelScale);if(null!=e)return[e[0],-e[1],e[2]];const t=this.value(_i.ModelTransformation);if(null!=t)return[t[0],t[5],t[10]];if(this.isSubImage&&0!==this.id){const e=this.tiff.images[0],[t,i,r]=e.resolution,s=e.size,n=this.size;return[t*s.width/n.width,i*s.height/n.height,r]}throw new Error("Image does not have a geo transformation.")}get isSubImage(){return this.value(_i.SubFileType)===hi.ReducedImage}get bbox(){const e=this.size,t=this.origin,i=this.resolution;if(null==t||null==e||null==i)throw new Error("Unable to calculate bounding box");const r=t[0],s=t[1],n=r+i[0]*e.width,a=s+i[1]*e.height;return[Math.min(r,n),Math.min(s,a),Math.max(r,n),Math.max(s,a)]}get compression(){const e=this.value(_i.Compression);return null==e?null:Qi[e]}get epsg(){const e=this.valueGeo(wi.ProjectionGeoKey);if(null!=e&&32767!==e)return e;let t=null;switch(this.valueGeo(wi.GTModelTypeGeoKey)){case ui.Unknown:return null;case ui.Projected:t=this.valueGeo(wi.ProjectedCRSGeoKey);break;case ui.Geographic:case ui.Geocentric:t=this.valueGeo(wi.GeodeticCRSGeoKey);break;case ui.UserDefined:return null}return 32767===t?null:t}get size(){const e=this.value(_i.ImageWidth),t=this.value(_i.ImageHeight);if(null==e||null==t)throw new Error("Tiff has no height or width");return{width:e,height:t}}isTiled(){return null!==this.value(_i.TileWidth)}get tileSize(){const e=this.value(_i.TileWidth),t=this.value(_i.TileHeight);if(null==e||null==t)throw new Error("Tiff is not tiled");return{width:e,height:t}}get tileCount(){const e=this.size,t=this.tileSize;return{x:Math.ceil(e.width/t.width),y:Math.ceil(e.height/t.height)}}get tileOffset(){const e=this.tags.get(_i.TileOffsets);if(null==e)throw new Error("No tile offsets found");return e}get stripCount(){return this.tags.get(_i.StripByteCounts)?.count??0}getTileBounds(e,t){const{size:i,tileSize:r}=this,s=t*r.height,n=e*r.width;return{x:n,y:s,width:n+r.width>=i.width?i.width-n:r.width,height:s+r.height>=i.height?i.height-s:r.height}}async getStrip(e){if(this.isTiled())throw new Error("Cannot read stripes, tiff is tiled: "+e);const t=this.tags.get(_i.StripByteCounts),i=this.tags.get(_i.StripOffsets);if(e>=t.count)throw new Error("Cannot read strip, index out of bounds");const[r,s]=await Promise.all([Ni(this.tiff,i,e),Ni(this.tiff,t,e)]);return this.getBytes(r,s)}getJpegHeader(e){const t=this.value(_i.JpegTables);if(null==t)throw new Error("Unable to find Jpeg header");const i=t.slice(0,t.length-2),r=new Uint8Array(e.byteLength+i.length-2);return r.set(i,0),r.set(new Uint8Array(e).slice(2),i.length),r}async getBytes(e,t){if(0===t)return null;const i=await this.tiff.source.fetch(e,t);if(i.byteLength<t)throw new Error(`Failed to fetch bytes from offset:${e} wanted:${t} got:${i.byteLength}`);let r=this.value(_i.Compression);null==r&&(r=fi.None);const s=(null==(n=r)?null:Qi[n])??yi.None;var n;return r===fi.Jpeg?{mimeType:s,bytes:this.getJpegHeader(i),compression:r}:{mimeType:s,bytes:i,compression:r}}async getTile(e,t){const i=this.size,r=this.tileSize;if(null==r)throw new Error("Tiff is not tiled");const s=Math.ceil(i.height/r.height),n=Math.ceil(i.width/r.width);if(e>=n||t>=s)throw new Error(`Tile index is outside of range x:${e} >= ${n} or y:${t} >= ${s}`);const a=t*n+e,o=n*s;if(a>=o)throw new Error(`Tile index is outside of tile range: ${a} >= ${o}`);const{offset:A,imageSize:l}=await this.getTileSize(a);return this.getBytes(A,l)}async hasTile(e,t){const i=this.tileSize,r=this.size;if(null==i)throw new Error("Tiff is not tiled");const s=Math.ceil(r.height/i.height),n=Math.ceil(r.width/i.width);if(e>=n||t>=s)return!1;const a=t*n+e;return(await this.getTileSize(a)).offset>0}async getTileSize(e){const t=this.tiff.options?.tileLeaderByteSize;if(t){const i=await Ni(this.tiff,this.tileOffset,e);if(0===i)return{offset:0,imageSize:0};const r=await this.tiff.source.fetch(i-t,t);return{offset:i,imageSize:Ui(new DataView(r),0,t,this.tiff.isLittleEndian)}}const i=this.tags.get(_i.TileByteCounts);if(null==i)throw new Error("No tile byte counts found");const[r,s]=await Promise.all([Ni(this.tiff,this.tileOffset,e),Ni(this.tiff,i,e)]);return{offset:r,imageSize:s}}}function Ni(e,t,i){if(i<0)throw new Error(`Tiff: ${e.source.url.href} out of bounds ${_i[t.id]} index:${i} total:${t.count}`);return i>=t.count?0:"inline"===t.type?t.value[i]:async function(e,t,i){if(i>t.count||i<0)throw new Error("TagOffset: out of bounds :"+i);if(null!=t.value[i])return t.value[i];const r=Di(t.dataType);if(null==t.view){const s=await e.source.fetch(t.dataOffset+i*r,r),n=Fi(e,void 0,new DataView(s),0,t.dataType,1);return t.value[i]=n,n}const s=Fi(e,void 0,t.view,i*r,t.dataType,1);return t.value[i]=s,s}(e,t,i)}var Oi,Pi,zi;!function(e){e.GdalStructuralMetadataSize="GDAL_STRUCTURAL_METADATA_SIZE",e.Layout="LAYOUT",e.BlockOrder="BLOCK_ORDER",e.BlockLeader="BLOCK_LEADER",e.BlockTrailer="BLOCK_TRAILER",e.KnownIncompatibleEdition="KNOWN_INCOMPATIBLE_EDITION",e.MaskInterleavedWithImagery="MASK_INTERLEAVED_WITH_IMAGERY"}(Oi||(Oi={})),function(e){e.RowMajor="ROW_MAJOR"}(Pi||(Pi={})),function(e){e.uint32="SIZE_AS_UINT4"}(zi||(zi={}));class qi{constructor(){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}get isCogOptimized(){return!this.isBroken&&"IFDS_BEFORE_DATA"===this.options.get(Oi.Layout)}get isBroken(){return"YES"===this.options.get(Oi.KnownIncompatibleEdition)}process(e,t,i){let r="",s="",n=!1;for(let a=0;a<i;a++){const i=e.getUint8(t+a);if(0===i)break;const o=String.fromCharCode(i);"\n"===o?(this.options.set(r.trim(),s.trim()),r="",s="",n=!1):"="===o?n=!0:n?s+=o:r+=o}}get tileLeaderByteSize(){return this.options.get(Oi.BlockLeader)===zi.uint32?vi.UInt32:null}get isMaskInterleaved(){return"YES"===this.options.get(Oi.MaskInterleavedWithImagery)}}const Ki={version:ki.Tiff,pointer:vi.UInt32,offset:vi.UInt16,ifd:vi.UInt16+vi.UInt16+2*vi.UInt32},Hi={version:ki.BigTiff,pointer:vi.UInt64,offset:vi.UInt64,ifd:vi.UInt16+vi.UInt16+2*vi.UInt64};ki.BigTiff,ki.Tiff;class Vi{constructor(e){Object.defineProperty(this,"defaultReadSize",{enumerable:!0,configurable:!0,writable:!0,value:Vi.DefaultReadSize}),Object.defineProperty(this,"source",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:ki.Tiff}),Object.defineProperty(this,"images",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ifdConfig",{enumerable:!0,configurable:!0,writable:!0,value:Ki}),Object.defineProperty(this,"isLittleEndian",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.source=e}static create(e){return new Vi(e).init()}init(){return this._initPromise||(this._initPromise=this.readHeader()),this._initPromise}getImageByResolution(e){const t=this.images[0],i=t.size,[r]=t.resolution,s=r*i.width;for(let t=this.images.length-1;t>0;t--){const i=this.images[t];if(s/i.size.width-e<=.01)return i}return t}async readHeader(){if(this.isInitialized)return this;const e=new DataView(await this.source.fetch(0,Ji(this.source,0,this.defaultReadSize)));e.sourceOffset=0;let t=0;const i=e.getUint16(t,this.isLittleEndian);if(t+=2,this.isLittleEndian=i===li.Little,!this.isLittleEndian)throw new Error("Only little endian is supported");let r;if(this.version=e.getUint16(t,this.isLittleEndian),t+=2,this.version===ki.BigTiff){this.ifdConfig=Hi;const i=e.getUint16(t,this.isLittleEndian);if(t+=2,8!==i)throw new Error("Only 8byte pointers are supported");const s=e.getUint16(t,this.isLittleEndian);if(t+=2,0!==s)throw new Error("Invalid big tiff header");r=Ui(e,t,this.ifdConfig.pointer,this.isLittleEndian),t+=this.ifdConfig.pointer}else{if(this.version!==ki.Tiff)throw new Error(`Only tiff supported version:${this.version}`);r=Ui(e,t,this.ifdConfig.pointer,this.isLittleEndian),t+=this.ifdConfig.pointer}const s=r-t;for(s>0&&s<16384&&(this.options=new qi,this.options.process(e,t,s));0!==r;){let t=e;if(!Gi(t,r,1024)){const e=await this.source.fetch(r,Ji(this.source,r,this.defaultReadSize));t=new DataView(e),t.sourceOffset=r}r=await this.readIfd(r,t)}return await Promise.all(this.images.map((e=>e.init()))),this.isInitialized=!0,this}async readIfd(e,t){const i=e-t.sourceOffset,r=Ui(t,i,this.ifdConfig.offset,this.isLittleEndian),s=new Map;if(!Gi(t,e,r*this.ifdConfig.ifd))throw new Error("IFD out of range @ "+function(e,t=4,i=!0){const r=e.toString(16).padStart(t,"0");return i?"0x"+r:r}(e)+" IFD"+this.images.length);const n=this.ifdConfig.ifd,a=i+this.ifdConfig.offset;for(let e=0;e<r;e++){const i=Ri(this,t,a+e*n);s.set(i.id,i)}return this.images.push(new Li(this,this.images.length,s)),Ui(t,a+r*n,this.ifdConfig.pointer,this.isLittleEndian)}}function Ji(e,t,i){if(null==e.metadata?.size)return i;const r=e.metadata.size;return t+i>r?r-t:i}Object.defineProperty(Vi,"DefaultReadSize",{enumerable:!0,configurable:!0,writable:!0,value:16384});class Yi extends Error{code;url;source;constructor(e,t,i,r){super(e,{cause:r}),this.code=t,this.url=i.url,this.source=i,Object.defineProperty(this,"_sourceError",{enumerable:!1,value:"SourceError"})}static is(e){return e instanceof Yi||"object"==typeof e&&(null!=e&&("_sourceError"in e&&"SourceError"===e._sourceError))}}const ji={toRange(e,t){if(null==t)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+t-1}`},parseSize(e){const[t,i]=e.split(" ");if("bytes"!==t)throw new Error("Failed to parse content-range: "+e);if(null==i)throw new Error("Failed to parse content-range: "+e);const[,r]=i.split("/"),s=Number(r);if(isNaN(s))throw new Error("Failed to parse content-range: "+e);return s}};function Zi(e){const t={size:-1},i=e.headers.get("content-range");return null!=i&&(t.size=ji.parseSize(i)),t.eTag=e.headers.get("etag")??void 0,t.contentType=e.headers.get("content-type")??void 0,t.contentDisposition=e.headers.get("content-disposition")??void 0,t}class Wi{constructor(e,t){this.type="http",this.url="string"==typeof e?Wi.tryUrl(e):e,this.headers=t}static tryUrl(e){try{return new URL(e)}catch(t){return"undefined"!=typeof document?new URL(e,document.baseURI):new URL(e,import.meta.url)}}head(){return this._head||(this._head=Wi.fetch(this.url,{method:"HEAD",headers:this.headers}).then((e=>{if(!e.ok)throw delete this._head,new Error(`Failed to HEAD ${this.url}`,{cause:{statusCode:e.status,msg:e.statusText}});return this.metadata=Zi(e),this.metadata}))),this._head}async fetch(e,t){try{const i={range:ji.toRange(e,t),...this.headers},r=await Wi.fetch(this.url,{headers:i});if(!r.ok)throw new Yi(`Failed to fetch ${this.url} ${i.range}`,r.status,this,new Error(r.statusText));const s=Zi(r);if(null==this.metadata)this.metadata=s;else if(this.metadata.eTag&&this.metadata.eTag!==s.eTag)throw new Yi(`ETag conflict ${this.url} ${i.range} expected: ${this.metadata.eTag} got: ${s.eTag}`,409,this);return r.arrayBuffer()}catch(e){if(Yi.is(e)&&e.source===this)throw e;throw new Yi(`Failed to fetch: ${this.url}`,500,this,e)}}}Wi.fetch=(e,t)=>fetch(e,t)
|
|
2
|
-
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */;function Xi(e){let t=e.length;for(;--t>=0;)e[t]=0}const $i=256,er=286,tr=30,ir=15,rr=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),sr=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),nr=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),ar=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),or=new Array(576);Xi(or);const Ar=new Array(60);Xi(Ar);const lr=new Array(512);Xi(lr);const hr=new Array(256);Xi(hr);const cr=new Array(29);Xi(cr);const gr=new Array(tr);function ur(e,t,i,r,s){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}let dr,fr,pr;function Ir(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Xi(gr);const mr=e=>e<256?lr[e]:lr[256+(e>>>7)],_r=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},wr=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,_r(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Cr=(e,t,i)=>{wr(e,i[2*t],i[2*t+1])},Br=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Er=(e,t,i)=>{const r=new Array(16);let s,n,a=0;for(s=1;s<=ir;s++)a=a+i[s-1]<<1,r[s]=a;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=Br(r[t]++,t))}},yr=e=>{let t;for(t=0;t<er;t++)e.dyn_ltree[2*t]=0;for(t=0;t<tr;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Qr=e=>{e.bi_valid>8?_r(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},br=(e,t,i,r)=>{const s=2*t,n=2*i;return e[s]<e[n]||e[s]===e[n]&&r[t]<=r[i]},kr=(e,t,i)=>{const r=e.heap[i];let s=i<<1;for(;s<=e.heap_len&&(s<e.heap_len&&br(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!br(t,r,e.heap[s],e.depth));)e.heap[i]=e.heap[s],i=s,s<<=1;e.heap[i]=r},xr=(e,t,i)=>{let r,s,n,a,o=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+o++],r+=(255&e.pending_buf[e.sym_buf+o++])<<8,s=e.pending_buf[e.sym_buf+o++],0===r?Cr(e,s,t):(n=hr[s],Cr(e,n+$i+1,t),a=rr[n],0!==a&&(s-=cr[n],wr(e,s,a)),r--,n=mr(r),Cr(e,n,i),a=sr[n],0!==a&&(r-=gr[n],wr(e,r,a)))}while(o<e.sym_next);Cr(e,256,t)},vr=(e,t)=>{const i=t.dyn_tree,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,n=t.stat_desc.elems;let a,o,A,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<n;a++)0!==i[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):i[2*a+1]=0;for(;e.heap_len<2;)A=e.heap[++e.heap_len]=l<2?++l:0,i[2*A]=1,e.depth[A]=0,e.opt_len--,s&&(e.static_len-=r[2*A+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)kr(e,i,a);A=n;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],kr(e,i,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,i[2*A]=i[2*a]+i[2*o],e.depth[A]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,i[2*a+1]=i[2*o+1]=A,e.heap[1]=A++,kr(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,s=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,A=t.stat_desc.max_length;let l,h,c,g,u,d,f=0;for(g=0;g<=ir;g++)e.bl_count[g]=0;for(i[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)h=e.heap[l],g=i[2*i[2*h+1]+1]+1,g>A&&(g=A,f++),i[2*h+1]=g,h>r||(e.bl_count[g]++,u=0,h>=o&&(u=a[h-o]),d=i[2*h],e.opt_len+=d*(g+u),n&&(e.static_len+=d*(s[2*h+1]+u)));if(0!==f){do{for(g=A-1;0===e.bl_count[g];)g--;e.bl_count[g]--,e.bl_count[g+1]+=2,e.bl_count[A]--,f-=2}while(f>0);for(g=A;0!==g;g--)for(h=e.bl_count[g];0!==h;)c=e.heap[--l],c>r||(i[2*c+1]!==g&&(e.opt_len+=(g-i[2*c+1])*i[2*c],i[2*c+1]=g),h--)}})(e,t),Er(i,l,e.bl_count)},Dr=(e,t,i)=>{let r,s,n=-1,a=t[1],o=0,A=7,l=4;for(0===a&&(A=138,l=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)s=a,a=t[2*(r+1)+1],++o<A&&s===a||(o<l?e.bl_tree[2*s]+=o:0!==s?(s!==n&&e.bl_tree[2*s]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,n=s,0===a?(A=138,l=3):s===a?(A=6,l=3):(A=7,l=4))},Sr=(e,t,i)=>{let r,s,n=-1,a=t[1],o=0,A=7,l=4;for(0===a&&(A=138,l=3),r=0;r<=i;r++)if(s=a,a=t[2*(r+1)+1],!(++o<A&&s===a)){if(o<l)do{Cr(e,s,e.bl_tree)}while(0!=--o);else 0!==s?(s!==n&&(Cr(e,s,e.bl_tree),o--),Cr(e,16,e.bl_tree),wr(e,o-3,2)):o<=10?(Cr(e,17,e.bl_tree),wr(e,o-3,3)):(Cr(e,18,e.bl_tree),wr(e,o-11,7));o=0,n=s,0===a?(A=138,l=3):s===a?(A=6,l=3):(A=7,l=4)}};let Mr=!1;const Ur=(e,t,i,r)=>{wr(e,0+(r?1:0),3),Qr(e),_r(e,i),_r(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};var Gr=(e,t,i,r)=>{let s,n,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<$i;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),vr(e,e.l_desc),vr(e,e.d_desc),a=(e=>{let t;for(Dr(e,e.dyn_ltree,e.l_desc.max_code),Dr(e,e.dyn_dtree,e.d_desc.max_code),vr(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*ar[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=s&&(s=n)):s=n=i+5,i+4<=s&&-1!==t?Ur(e,t,i,r):4===e.strategy||n===s?(wr(e,2+(r?1:0),3),xr(e,or,Ar)):(wr(e,4+(r?1:0),3),((e,t,i,r)=>{let s;for(wr(e,t-257,5),wr(e,i-1,5),wr(e,r-4,4),s=0;s<r;s++)wr(e,e.bl_tree[2*ar[s]+1],3);Sr(e,e.dyn_ltree,t-1),Sr(e,e.dyn_dtree,i-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),xr(e,e.dyn_ltree,e.dyn_dtree)),yr(e),r&&Qr(e)},Tr={_tr_init:e=>{Mr||((()=>{let e,t,i,r,s;const n=new Array(16);for(i=0,r=0;r<28;r++)for(cr[r]=i,e=0;e<1<<rr[r];e++)hr[i++]=r;for(hr[i-1]=r,s=0,r=0;r<16;r++)for(gr[r]=s,e=0;e<1<<sr[r];e++)lr[s++]=r;for(s>>=7;r<tr;r++)for(gr[r]=s<<7,e=0;e<1<<sr[r]-7;e++)lr[256+s++]=r;for(t=0;t<=ir;t++)n[t]=0;for(e=0;e<=143;)or[2*e+1]=8,e++,n[8]++;for(;e<=255;)or[2*e+1]=9,e++,n[9]++;for(;e<=279;)or[2*e+1]=7,e++,n[7]++;for(;e<=287;)or[2*e+1]=8,e++,n[8]++;for(Er(or,287,n),e=0;e<tr;e++)Ar[2*e+1]=5,Ar[2*e]=Br(e,5);dr=new ur(or,rr,257,er,ir),fr=new ur(Ar,sr,0,tr,ir),pr=new ur(new Array(0),nr,0,19,7)})(),Mr=!0),e.l_desc=new Ir(e.dyn_ltree,dr),e.d_desc=new Ir(e.dyn_dtree,fr),e.bl_desc=new Ir(e.bl_tree,pr),e.bi_buf=0,e.bi_valid=0,yr(e)},_tr_stored_block:Ur,_tr_flush_block:Gr,_tr_tally:(e,t,i)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(hr[i]+$i+1)]++,e.dyn_dtree[2*mr(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{wr(e,2,3),Cr(e,256,or),(e=>{16===e.bi_valid?(_r(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Fr=(e,t,i,r)=>{let s=65535&e|0,n=e>>>16&65535|0,a=0;for(;0!==i;){a=i>2e3?2e3:i,i-=a;do{s=s+t[r++]|0,n=n+s|0}while(--a);s%=65521,n%=65521}return s|n<<16|0};const Rr=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var Lr=(e,t,i,r)=>{const s=Rr,n=r+i;e^=-1;for(let i=r;i<n;i++)e=e>>>8^s[255&(e^t[i])];return-1^e},Nr={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Or={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Pr,_tr_stored_block:zr,_tr_flush_block:qr,_tr_tally:Kr,_tr_align:Hr}=Tr,{Z_NO_FLUSH:Vr,Z_PARTIAL_FLUSH:Jr,Z_FULL_FLUSH:Yr,Z_FINISH:jr,Z_BLOCK:Zr,Z_OK:Wr,Z_STREAM_END:Xr,Z_STREAM_ERROR:$r,Z_DATA_ERROR:es,Z_BUF_ERROR:ts,Z_DEFAULT_COMPRESSION:is,Z_FILTERED:rs,Z_HUFFMAN_ONLY:ss,Z_RLE:ns,Z_FIXED:as,Z_DEFAULT_STRATEGY:os,Z_UNKNOWN:As,Z_DEFLATED:ls}=Or,hs=258,cs=262,gs=42,us=113,ds=666,fs=(e,t)=>(e.msg=Nr[t],t),ps=e=>2*e-(e>4?9:0),Is=e=>{let t=e.length;for(;--t>=0;)e[t]=0},ms=e=>{let t,i,r,s=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=s?i-s:0}while(--t);t=s,r=t;do{i=e.prev[--r],e.prev[r]=i>=s?i-s:0}while(--t)};let _s=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask;const ws=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Cs=(e,t)=>{qr(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,ws(e.strm)},Bs=(e,t)=>{e.pending_buf[e.pending++]=t},Es=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},ys=(e,t,i,r)=>{let s=e.avail_in;return s>r&&(s=r),0===s?0:(e.avail_in-=s,t.set(e.input.subarray(e.next_in,e.next_in+s),i),1===e.state.wrap?e.adler=Fr(e.adler,t,s,i):2===e.state.wrap&&(e.adler=Lr(e.adler,t,s,i)),e.next_in+=s,e.total_in+=s,s)},Qs=(e,t)=>{let i,r,s=e.max_chain_length,n=e.strstart,a=e.prev_length,o=e.nice_match;const A=e.strstart>e.w_size-cs?e.strstart-(e.w_size-cs):0,l=e.window,h=e.w_mask,c=e.prev,g=e.strstart+hs;let u=l[n+a-1],d=l[n+a];e.prev_length>=e.good_match&&(s>>=2),o>e.lookahead&&(o=e.lookahead);do{if(i=t,l[i+a]===d&&l[i+a-1]===u&&l[i]===l[n]&&l[++i]===l[n+1]){n+=2,i++;do{}while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&n<g);if(r=hs-(g-n),n=g-hs,r>a){if(e.match_start=t,a=r,r>=o)break;u=l[n+a-1],d=l[n+a]}}}while((t=c[t&h])>A&&0!=--s);return a<=e.lookahead?a:e.lookahead},bs=e=>{const t=e.w_size;let i,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-cs)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),ms(e),r+=t),0===e.strm.avail_in)break;if(i=ys(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=_s(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=_s(e,e.ins_h,e.window[s+3-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<cs&&0!==e.strm.avail_in)},ks=(e,t)=>{let i,r,s,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,o=e.strm.avail_in;do{if(i=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s)break;if(s=e.strm.avail_out-s,r=e.strstart-e.block_start,i>r+e.strm.avail_in&&(i=r+e.strm.avail_in),i>s&&(i=s),i<n&&(0===i&&t!==jr||t===Vr||i!==r+e.strm.avail_in))break;a=t===jr&&i===r+e.strm.avail_in?1:0,zr(e,0,0,a),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,ws(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(ys(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==Vr&&t!==jr&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(ys(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,n=s>e.w_size?e.w_size:s,r=e.strstart-e.block_start,(r>=n||(r||t===jr)&&t!==Vr&&0===e.strm.avail_in&&r<=s)&&(i=r>s?s:r,a=t===jr&&0===e.strm.avail_in&&i===r?1:0,zr(e,e.block_start,i,a),e.block_start+=i,ws(e.strm)),a?3:1)},xs=(e,t)=>{let i,r;for(;;){if(e.lookahead<cs){if(bs(e),e.lookahead<cs&&t===Vr)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=_s(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-cs&&(e.match_length=Qs(e,i)),e.match_length>=3)if(r=Kr(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=_s(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=_s(e,e.ins_h,e.window[e.strstart+1]);else r=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Cs(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===jr?(Cs(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Cs(e,!1),0===e.strm.avail_out)?1:2},vs=(e,t)=>{let i,r,s;for(;;){if(e.lookahead<cs){if(bs(e),e.lookahead<cs&&t===Vr)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=_s(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-cs&&(e.match_length=Qs(e,i),e.match_length<=5&&(e.strategy===rs||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,r=Kr(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=_s(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Cs(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Kr(e,0,e.window[e.strstart-1]),r&&Cs(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Kr(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===jr?(Cs(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Cs(e,!1),0===e.strm.avail_out)?1:2};function Ds(e,t,i,r,s){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=s}const Ss=[new Ds(0,0,0,0,ks),new Ds(4,4,8,4,xs),new Ds(4,5,16,8,xs),new Ds(4,6,32,32,xs),new Ds(4,4,16,16,vs),new Ds(8,16,32,32,vs),new Ds(8,16,128,128,vs),new Ds(8,32,128,256,vs),new Ds(32,128,258,1024,vs),new Ds(32,258,258,4096,vs)];function Ms(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ls,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Is(this.dyn_ltree),Is(this.dyn_dtree),Is(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Is(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Is(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Us=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==gs&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==us&&t.status!==ds?1:0},Gs=e=>{if(Us(e))return fs(e,$r);e.total_in=e.total_out=0,e.data_type=As;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?gs:us,e.adler=2===t.wrap?0:1,t.last_flush=-2,Pr(t),Wr},Ts=e=>{const t=Gs(e);var i;return t===Wr&&((i=e.state).window_size=2*i.w_size,Is(i.head),i.max_lazy_match=Ss[i.level].max_lazy,i.good_match=Ss[i.level].good_length,i.nice_match=Ss[i.level].nice_length,i.max_chain_length=Ss[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),t},Fs=(e,t,i,r,s,n)=>{if(!e)return $r;let a=1;if(t===is&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),s<1||s>9||i!==ls||r<8||r>15||t<0||t>9||n<0||n>as||8===r&&1!==a)return fs(e,$r);8===r&&(r=9);const o=new Ms;return e.state=o,o.strm=e,o.status=gs,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=s+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<s+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=n,o.method=i,Ts(e)};var Rs={deflateInit:(e,t)=>Fs(e,t,ls,15,8,os),deflateInit2:Fs,deflateReset:Ts,deflateResetKeep:Gs,deflateSetHeader:(e,t)=>Us(e)||2!==e.state.wrap?$r:(e.state.gzhead=t,Wr),deflate:(e,t)=>{if(Us(e)||t>Zr||t<0)return e?fs(e,$r):$r;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===ds&&t!==jr)return fs(e,0===e.avail_out?ts:$r);const r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(ws(e),0===e.avail_out)return i.last_flush=-1,Wr}else if(0===e.avail_in&&ps(t)<=ps(r)&&t!==jr)return fs(e,ts);if(i.status===ds&&0!==e.avail_in)return fs(e,ts);if(i.status===gs&&0===i.wrap&&(i.status=us),i.status===gs){let t=ls+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=ss||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,Es(i,t),0!==i.strstart&&(Es(i,e.adler>>>16),Es(i,65535&e.adler)),e.adler=1,i.status=us,ws(e),0!==i.pending)return i.last_flush=-1,Wr}if(57===i.status)if(e.adler=0,Bs(i,31),Bs(i,139),Bs(i,8),i.gzhead)Bs(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),Bs(i,255&i.gzhead.time),Bs(i,i.gzhead.time>>8&255),Bs(i,i.gzhead.time>>16&255),Bs(i,i.gzhead.time>>24&255),Bs(i,9===i.level?2:i.strategy>=ss||i.level<2?4:0),Bs(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(Bs(i,255&i.gzhead.extra.length),Bs(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=Lr(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(Bs(i,0),Bs(i,0),Bs(i,0),Bs(i,0),Bs(i,0),Bs(i,9===i.level?2:i.strategy>=ss||i.level<2?4:0),Bs(i,3),i.status=us,ws(e),0!==i.pending)return i.last_flush=-1,Wr;if(69===i.status){if(i.gzhead.extra){let t=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let s=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+s),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=s,ws(e),0!==i.pending)return i.last_flush=-1,Wr;t=0,r-=s}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>t&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-r,r)),ws(e),0!==i.pending)return i.last_flush=-1,Wr;r=0}t=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,Bs(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-r,r)),ws(e),0!==i.pending)return i.last_flush=-1,Wr;r=0}t=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,Bs(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=Lr(e.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(ws(e),0!==i.pending))return i.last_flush=-1,Wr;Bs(i,255&e.adler),Bs(i,e.adler>>8&255),e.adler=0}if(i.status=us,ws(e),0!==i.pending)return i.last_flush=-1,Wr}if(0!==e.avail_in||0!==i.lookahead||t!==Vr&&i.status!==ds){let r=0===i.level?ks(i,t):i.strategy===ss?((e,t)=>{let i;for(;;){if(0===e.lookahead&&(bs(e),0===e.lookahead)){if(t===Vr)return 1;break}if(e.match_length=0,i=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Cs(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===jr?(Cs(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Cs(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===ns?((e,t)=>{let i,r,s,n;const a=e.window;for(;;){if(e.lookahead<=hs){if(bs(e),e.lookahead<=hs&&t===Vr)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(s=e.strstart-1,r=a[s],r===a[++s]&&r===a[++s]&&r===a[++s])){n=e.strstart+hs;do{}while(r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&s<n);e.match_length=hs-(n-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=Kr(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=Kr(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Cs(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===jr?(Cs(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Cs(e,!1),0===e.strm.avail_out)?1:2})(i,t):Ss[i.level].func(i,t);if(3!==r&&4!==r||(i.status=ds),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),Wr;if(2===r&&(t===Jr?Hr(i):t!==Zr&&(zr(i,0,0,!1),t===Yr&&(Is(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),ws(e),0===e.avail_out))return i.last_flush=-1,Wr}return t!==jr?Wr:i.wrap<=0?Xr:(2===i.wrap?(Bs(i,255&e.adler),Bs(i,e.adler>>8&255),Bs(i,e.adler>>16&255),Bs(i,e.adler>>24&255),Bs(i,255&e.total_in),Bs(i,e.total_in>>8&255),Bs(i,e.total_in>>16&255),Bs(i,e.total_in>>24&255)):(Es(i,e.adler>>>16),Es(i,65535&e.adler)),ws(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?Wr:Xr)},deflateEnd:e=>{if(Us(e))return $r;const t=e.state.status;return e.state=null,t===us?fs(e,es):Wr},deflateSetDictionary:(e,t)=>{let i=t.length;if(Us(e))return $r;const r=e.state,s=r.wrap;if(2===s||1===s&&r.status!==gs||r.lookahead)return $r;if(1===s&&(e.adler=Fr(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===s&&(Is(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const n=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,bs(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=_s(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,bs(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=n,r.wrap=s,Wr},deflateInfo:"pako deflate (from Nodeca project)"};const Ls=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var Ns={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)Ls(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,r=0,s=e.length;t<s;t++){let s=e[t];i.set(s,r),r+=s.length}return i}};let Os=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Os=!1}const Ps=new Uint8Array(256);for(let e=0;e<256;e++)Ps[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Ps[254]=Ps[254]=1;var zs={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,s,n,a=e.length,o=0;for(s=0;s<a;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<a&&(r=e.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(o),n=0,s=0;n<o;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<a&&(r=e.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),i<128?t[n++]=i:i<2048?(t[n++]=192|i>>>6,t[n++]=128|63&i):i<65536?(t[n++]=224|i>>>12,t[n++]=128|i>>>6&63,t[n++]=128|63&i):(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63,t[n++]=128|i>>>6&63,t[n++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,s;const n=new Array(2*i);for(s=0,r=0;r<i;){let t=e[r++];if(t<128){n[s++]=t;continue}let a=Ps[t];if(a>4)n[s++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<i;)t=t<<6|63&e[r++],a--;a>1?n[s++]=65533:t<65536?n[s++]=t:(t-=65536,n[s++]=55296|t>>10&1023,n[s++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Os)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i})(n,s)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+Ps[e[i]]>t?i:t}};var qs=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ks=Object.prototype.toString,{Z_NO_FLUSH:Hs,Z_SYNC_FLUSH:Vs,Z_FULL_FLUSH:Js,Z_FINISH:Ys,Z_OK:js,Z_STREAM_END:Zs,Z_DEFAULT_COMPRESSION:Ws,Z_DEFAULT_STRATEGY:Xs,Z_DEFLATED:$s}=Or;function en(e){this.options=Ns.assign({level:Ws,method:$s,chunkSize:16384,windowBits:15,memLevel:8,strategy:Xs},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qs,this.strm.avail_out=0;let i=Rs.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==js)throw new Error(Nr[i]);if(t.header&&Rs.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?zs.string2buf(t.dictionary):"[object ArrayBuffer]"===Ks.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=Rs.deflateSetDictionary(this.strm,e),i!==js)throw new Error(Nr[i]);this._dict_set=!0}}en.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let s,n;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Ys:Hs,"string"==typeof e?i.input=zs.string2buf(e):"[object ArrayBuffer]"===Ks.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===Vs||n===Js)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(s=Rs.deflate(i,n),s===Zs)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),s=Rs.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===js;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},en.prototype.onData=function(e){this.chunks.push(e)},en.prototype.onEnd=function(e){e===js&&(this.result=Ns.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const tn=16209;var rn=function(e,t){let i,r,s,n,a,o,A,l,h,c,g,u,d,f,p,I,m,_,w,C,B,E,y,Q;const b=e.state;i=e.next_in,y=e.input,r=i+(e.avail_in-5),s=e.next_out,Q=e.output,n=s-(t-e.avail_out),a=s+(e.avail_out-257),o=b.dmax,A=b.wsize,l=b.whave,h=b.wnext,c=b.window,g=b.hold,u=b.bits,d=b.lencode,f=b.distcode,p=(1<<b.lenbits)-1,I=(1<<b.distbits)-1;e:do{u<15&&(g+=y[i++]<<u,u+=8,g+=y[i++]<<u,u+=8),m=d[g&p];t:for(;;){if(_=m>>>24,g>>>=_,u-=_,_=m>>>16&255,0===_)Q[s++]=65535&m;else{if(!(16&_)){if(0==(64&_)){m=d[(65535&m)+(g&(1<<_)-1)];continue t}if(32&_){b.mode=16191;break e}e.msg="invalid literal/length code",b.mode=tn;break e}w=65535&m,_&=15,_&&(u<_&&(g+=y[i++]<<u,u+=8),w+=g&(1<<_)-1,g>>>=_,u-=_),u<15&&(g+=y[i++]<<u,u+=8,g+=y[i++]<<u,u+=8),m=f[g&I];i:for(;;){if(_=m>>>24,g>>>=_,u-=_,_=m>>>16&255,!(16&_)){if(0==(64&_)){m=f[(65535&m)+(g&(1<<_)-1)];continue i}e.msg="invalid distance code",b.mode=tn;break e}if(C=65535&m,_&=15,u<_&&(g+=y[i++]<<u,u+=8,u<_&&(g+=y[i++]<<u,u+=8)),C+=g&(1<<_)-1,C>o){e.msg="invalid distance too far back",b.mode=tn;break e}if(g>>>=_,u-=_,_=s-n,C>_){if(_=C-_,_>l&&b.sane){e.msg="invalid distance too far back",b.mode=tn;break e}if(B=0,E=c,0===h){if(B+=A-_,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}}else if(h<_){if(B+=A+h-_,_-=h,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);if(B=0,h<w){_=h,w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}}}else if(B+=h-_,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}for(;w>2;)Q[s++]=E[B++],Q[s++]=E[B++],Q[s++]=E[B++],w-=3;w&&(Q[s++]=E[B++],w>1&&(Q[s++]=E[B++]))}else{B=s-C;do{Q[s++]=Q[B++],Q[s++]=Q[B++],Q[s++]=Q[B++],w-=3}while(w>2);w&&(Q[s++]=Q[B++],w>1&&(Q[s++]=Q[B++]))}break}}break}}while(i<r&&s<a);w=u>>3,i-=w,u-=w<<3,g&=(1<<u)-1,e.next_in=i,e.next_out=s,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=s<a?a-s+257:257-(s-a),b.hold=g,b.bits=u};const sn=15,nn=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),an=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),on=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),An=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var ln=(e,t,i,r,s,n,a,o)=>{const A=o.bits;let l,h,c,g,u,d,f=0,p=0,I=0,m=0,_=0,w=0,C=0,B=0,E=0,y=0,Q=null;const b=new Uint16Array(16),k=new Uint16Array(16);let x,v,D,S=null;for(f=0;f<=sn;f++)b[f]=0;for(p=0;p<r;p++)b[t[i+p]]++;for(_=A,m=sn;m>=1&&0===b[m];m--);if(_>m&&(_=m),0===m)return s[n++]=20971520,s[n++]=20971520,o.bits=1,0;for(I=1;I<m&&0===b[I];I++);for(_<I&&(_=I),B=1,f=1;f<=sn;f++)if(B<<=1,B-=b[f],B<0)return-1;if(B>0&&(0===e||1!==m))return-1;for(k[1]=0,f=1;f<sn;f++)k[f+1]=k[f]+b[f];for(p=0;p<r;p++)0!==t[i+p]&&(a[k[t[i+p]]++]=p);if(0===e?(Q=S=a,d=20):1===e?(Q=nn,S=an,d=257):(Q=on,S=An,d=0),y=0,p=0,f=I,u=n,w=_,C=0,c=-1,E=1<<_,g=E-1,1===e&&E>852||2===e&&E>592)return 1;for(;;){x=f-C,a[p]+1<d?(v=0,D=a[p]):a[p]>=d?(v=S[a[p]-d],D=Q[a[p]-d]):(v=96,D=0),l=1<<f-C,h=1<<w,I=h;do{h-=l,s[u+(y>>C)+h]=x<<24|v<<16|D|0}while(0!==h);for(l=1<<f-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,p++,0==--b[f]){if(f===m)break;f=t[i+a[p]]}if(f>_&&(y&g)!==c){for(0===C&&(C=_),u+=I,w=f-C,B=1<<w;w+C<m&&(B-=b[w+C],!(B<=0));)w++,B<<=1;if(E+=1<<w,1===e&&E>852||2===e&&E>592)return 1;c=y&g,s[c]=_<<24|w<<16|u-n|0}}return 0!==y&&(s[u+y]=f-C<<24|64<<16|0),o.bits=_,0};const{Z_FINISH:hn,Z_BLOCK:cn,Z_TREES:gn,Z_OK:un,Z_STREAM_END:dn,Z_NEED_DICT:fn,Z_STREAM_ERROR:pn,Z_DATA_ERROR:In,Z_MEM_ERROR:mn,Z_BUF_ERROR:_n,Z_DEFLATED:wn}=Or,Cn=16180,Bn=16190,En=16191,yn=16192,Qn=16194,bn=16199,kn=16200,xn=16206,vn=16209,Dn=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Sn(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Mn=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Cn||t.mode>16211?1:0},Un=e=>{if(Mn(e))return pn;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Cn,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,un},Gn=e=>{if(Mn(e))return pn;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Un(e)},Tn=(e,t)=>{let i;if(Mn(e))return pn;const r=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?pn:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,Gn(e))},Fn=(e,t)=>{if(!e)return pn;const i=new Sn;e.state=i,i.strm=e,i.window=null,i.mode=Cn;const r=Tn(e,t);return r!==un&&(e.state=null),r};let Rn,Ln,Nn=!0;const On=e=>{if(Nn){Rn=new Int32Array(512),Ln=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(ln(1,e.lens,0,288,Rn,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;ln(2,e.lens,0,32,Ln,0,e.work,{bits:5}),Nn=!1}e.lencode=Rn,e.lenbits=9,e.distcode=Ln,e.distbits=5},Pn=(e,t,i,r)=>{let s;const n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(t.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(t.subarray(i-r,i-r+s),n.wnext),(r-=s)?(n.window.set(t.subarray(i-r,i),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0};var zn={inflateReset:Gn,inflateReset2:Tn,inflateResetKeep:Un,inflateInit:e=>Fn(e,15),inflateInit2:Fn,inflate:(e,t)=>{let i,r,s,n,a,o,A,l,h,c,g,u,d,f,p,I,m,_,w,C,B,E,y=0;const Q=new Uint8Array(4);let b,k;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Mn(e)||!e.output||!e.input&&0!==e.avail_in)return pn;i=e.state,i.mode===En&&(i.mode=yn),a=e.next_out,s=e.output,A=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,h=i.bits,c=o,g=A,E=un;e:for(;;)switch(i.mode){case Cn:if(0===i.wrap){i.mode=yn;break}for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(2&i.wrap&&35615===l){0===i.wbits&&(i.wbits=15),i.check=0,Q[0]=255&l,Q[1]=l>>>8&255,i.check=Lr(i.check,Q,2,0),l=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=vn;break}if((15&l)!==wn){e.msg="unknown compression method",i.mode=vn;break}if(l>>>=4,h-=4,B=8+(15&l),0===i.wbits&&(i.wbits=B),B>15||B>i.wbits){e.msg="invalid window size",i.mode=vn;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=512&l?16189:En,l=0,h=0;break;case 16181:for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(i.flags=l,(255&i.flags)!==wn){e.msg="unknown compression method",i.mode=vn;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=vn;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=Lr(i.check,Q,2,0)),l=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.head&&(i.head.time=l),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,Q[2]=l>>>16&255,Q[3]=l>>>24&255,i.check=Lr(i.check,Q,4,0)),l=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=Lr(i.check,Q,2,0)),l=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=Lr(i.check,Q,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(u=i.length,u>o&&(u=o),u&&(i.head&&(B=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(n,n+u),B)),512&i.flags&&4&i.wrap&&(i.check=Lr(i.check,r,u,n)),o-=u,n+=u,i.length-=u),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===o)break e;u=0;do{B=r[n+u++],i.head&&B&&i.length<65536&&(i.head.name+=String.fromCharCode(B))}while(B&&u<o);if(512&i.flags&&4&i.wrap&&(i.check=Lr(i.check,r,u,n)),o-=u,n+=u,B)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===o)break e;u=0;do{B=r[n+u++],i.head&&B&&i.length<65536&&(i.head.comment+=String.fromCharCode(B))}while(B&&u<o);if(512&i.flags&&4&i.wrap&&(i.check=Lr(i.check,r,u,n)),o-=u,n+=u,B)break e}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(4&i.wrap&&l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=vn;break}l=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=En;break;case 16189:for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}e.adler=i.check=Dn(l),l=0,h=0,i.mode=Bn;case Bn:if(0===i.havedict)return e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,fn;e.adler=i.check=1,i.mode=En;case En:if(t===cn||t===gn)break e;case yn:if(i.last){l>>>=7&h,h-=7&h,i.mode=xn;break}for(;h<3;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}switch(i.last=1&l,l>>>=1,h-=1,3&l){case 0:i.mode=16193;break;case 1:if(On(i),i.mode=bn,t===gn){l>>>=2,h-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=vn}l>>>=2,h-=2;break;case 16193:for(l>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=vn;break}if(i.length=65535&l,l=0,h=0,i.mode=Qn,t===gn)break e;case Qn:i.mode=16195;case 16195:if(u=i.length,u){if(u>o&&(u=o),u>A&&(u=A),0===u)break e;s.set(r.subarray(n,n+u),a),o-=u,n+=u,A-=u,a+=u,i.length-=u;break}i.mode=En;break;case 16196:for(;h<14;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(i.nlen=257+(31&l),l>>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=vn;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.lens[x[i.have++]]=7&l,l>>>=3,h-=3}for(;i.have<19;)i.lens[x[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,b={bits:i.lenbits},E=ln(0,i.lens,0,19,i.lencode,0,i.work,b),i.lenbits=b.bits,E){e.msg="invalid code lengths set",i.mode=vn;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;y=i.lencode[l&(1<<i.lenbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(m<16)l>>>=p,h-=p,i.lens[i.have++]=m;else{if(16===m){for(k=p+2;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(l>>>=p,h-=p,0===i.have){e.msg="invalid bit length repeat",i.mode=vn;break}B=i.lens[i.have-1],u=3+(3&l),l>>>=2,h-=2}else if(17===m){for(k=p+3;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=p,h-=p,B=0,u=3+(7&l),l>>>=3,h-=3}else{for(k=p+7;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=p,h-=p,B=0,u=11+(127&l),l>>>=7,h-=7}if(i.have+u>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=vn;break}for(;u--;)i.lens[i.have++]=B}}if(i.mode===vn)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=vn;break}if(i.lenbits=9,b={bits:i.lenbits},E=ln(1,i.lens,0,i.nlen,i.lencode,0,i.work,b),i.lenbits=b.bits,E){e.msg="invalid literal/lengths set",i.mode=vn;break}if(i.distbits=6,i.distcode=i.distdyn,b={bits:i.distbits},E=ln(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,b),i.distbits=b.bits,E){e.msg="invalid distances set",i.mode=vn;break}if(i.mode=bn,t===gn)break e;case bn:i.mode=kn;case kn:if(o>=6&&A>=258){e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,rn(e,g),a=e.next_out,s=e.output,A=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,h=i.bits,i.mode===En&&(i.back=-1);break}for(i.back=0;y=i.lencode[l&(1<<i.lenbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(I&&0==(240&I)){for(_=p,w=I,C=m;y=i.lencode[C+((l&(1<<_+w)-1)>>_)],p=y>>>24,I=y>>>16&255,m=65535&y,!(_+p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=_,h-=_,i.back+=_}if(l>>>=p,h-=p,i.back+=p,i.length=m,0===I){i.mode=16205;break}if(32&I){i.back=-1,i.mode=En;break}if(64&I){e.msg="invalid literal/length code",i.mode=vn;break}i.extra=15&I,i.mode=16201;case 16201:if(i.extra){for(k=i.extra;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;y=i.distcode[l&(1<<i.distbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(0==(240&I)){for(_=p,w=I,C=m;y=i.distcode[C+((l&(1<<_+w)-1)>>_)],p=y>>>24,I=y>>>16&255,m=65535&y,!(_+p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=_,h-=_,i.back+=_}if(l>>>=p,h-=p,i.back+=p,64&I){e.msg="invalid distance code",i.mode=vn;break}i.offset=m,i.extra=15&I,i.mode=16203;case 16203:if(i.extra){for(k=i.extra;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=vn;break}i.mode=16204;case 16204:if(0===A)break e;if(u=g-A,i.offset>u){if(u=i.offset-u,u>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=vn;break}u>i.wnext?(u-=i.wnext,d=i.wsize-u):d=i.wnext-u,u>i.length&&(u=i.length),f=i.window}else f=s,d=a-i.offset,u=i.length;u>A&&(u=A),A-=u,i.length-=u;do{s[a++]=f[d++]}while(--u);0===i.length&&(i.mode=kn);break;case 16205:if(0===A)break e;s[a++]=i.length,A--,i.mode=kn;break;case xn:if(i.wrap){for(;h<32;){if(0===o)break e;o--,l|=r[n++]<<h,h+=8}if(g-=A,e.total_out+=g,i.total+=g,4&i.wrap&&g&&(e.adler=i.check=i.flags?Lr(i.check,s,g,a-g):Fr(i.check,s,g,a-g)),g=A,4&i.wrap&&(i.flags?l:Dn(l))!==i.check){e.msg="incorrect data check",i.mode=vn;break}l=0,h=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(4&i.wrap&&l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=vn;break}l=0,h=0}i.mode=16208;case 16208:E=dn;break e;case vn:E=In;break e;case 16210:return mn;default:return pn}return e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,(i.wsize||g!==e.avail_out&&i.mode<vn&&(i.mode<xn||t!==hn))&&Pn(e,e.output,e.next_out,g-e.avail_out),c-=e.avail_in,g-=e.avail_out,e.total_in+=c,e.total_out+=g,i.total+=g,4&i.wrap&&g&&(e.adler=i.check=i.flags?Lr(i.check,s,g,e.next_out-g):Fr(i.check,s,g,e.next_out-g)),e.data_type=i.bits+(i.last?64:0)+(i.mode===En?128:0)+(i.mode===bn||i.mode===Qn?256:0),(0===c&&0===g||t===hn)&&E===un&&(E=_n),E},inflateEnd:e=>{if(Mn(e))return pn;let t=e.state;return t.window&&(t.window=null),e.state=null,un},inflateGetHeader:(e,t)=>{if(Mn(e))return pn;const i=e.state;return 0==(2&i.wrap)?pn:(i.head=t,t.done=!1,un)},inflateSetDictionary:(e,t)=>{const i=t.length;let r,s,n;return Mn(e)?pn:(r=e.state,0!==r.wrap&&r.mode!==Bn?pn:r.mode===Bn&&(s=1,s=Fr(s,t,i,0),s!==r.check)?In:(n=Pn(e,t,i,i),n?(r.mode=16210,mn):(r.havedict=1,un)))},inflateInfo:"pako inflate (from Nodeca project)"};var qn=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const Kn=Object.prototype.toString,{Z_NO_FLUSH:Hn,Z_FINISH:Vn,Z_OK:Jn,Z_STREAM_END:Yn,Z_NEED_DICT:jn,Z_STREAM_ERROR:Zn,Z_DATA_ERROR:Wn,Z_MEM_ERROR:Xn}=Or;function $n(e){this.options=Ns.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new qs,this.strm.avail_out=0;let i=zn.inflateInit2(this.strm,t.windowBits);if(i!==Jn)throw new Error(Nr[i]);if(this.header=new qn,zn.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=zs.string2buf(t.dictionary):"[object ArrayBuffer]"===Kn.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=zn.inflateSetDictionary(this.strm,t.dictionary),i!==Jn)))throw new Error(Nr[i])}function ea(e,t){const i=new $n(t);if(i.push(e),i.err)throw i.msg||Nr[i.err];return i.result}$n.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let n,a,o;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Vn:Hn,"[object ArrayBuffer]"===Kn.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),n=zn.inflate(i,a),n===jn&&s&&(n=zn.inflateSetDictionary(i,s),n===Jn?n=zn.inflate(i,a):n===Wn&&(n=jn));i.avail_in>0&&n===Yn&&i.state.wrap>0&&0!==e[i.next_in];)zn.inflateReset(i),n=zn.inflate(i,a);switch(n){case Zn:case Wn:case jn:case Xn:return this.onEnd(n),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||n===Yn))if("string"===this.options.to){let e=zs.utf8border(i.output,i.next_out),t=i.next_out-e,s=zs.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(n!==Jn||0!==o){if(n===Yn)return n=zn.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},$n.prototype.onData=function(e){this.chunks.push(e)},$n.prototype.onEnd=function(e){e===Jn&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Ns.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ta={Inflate:$n,inflate:ea,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ea(e,t)},ungzip:ea,constants:Or};const{Inflate:ia,inflate:ra,inflateRaw:sa,ungzip:na}=ta;var aa=ra;function oa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Aa={exports:{}};!function(e){function t(e){var t,i,r,s,n,a=Math.floor,o=new Array(64),A=new Array(64),l=new Array(64),h=new Array(64),c=new Array(65535),g=new Array(65535),u=new Array(64),d=new Array(64),f=[],p=0,I=7,m=new Array(64),_=new Array(64),w=new Array(64),C=new Array(256),B=new Array(2048),E=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],y=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],Q=[0,1,2,3,4,5,6,7,8,9,10,11],b=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],k=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],x=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],v=[0,1,2,3,4,5,6,7,8,9,10,11],D=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],S=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function M(e,t){for(var i=0,r=0,s=new Array,n=1;n<=16;n++){for(var a=1;a<=e[n];a++)s[t[r]]=[],s[t[r]][0]=i,s[t[r]][1]=n,r++,i++;i*=2}return s}function U(e){for(var t=e[0],i=e[1]-1;i>=0;)t&1<<i&&(p|=1<<I),i--,--I<0&&(255==p?(G(255),G(0)):G(p),I=7,p=0)}function G(e){f.push(e)}function T(e){G(e>>8&255),G(255&e)}function F(e,t,i,r,s){for(var n,a=s[0],o=s[240],A=function(e,t){var i,r,s,n,a,o,A,l,h,c,g=0;for(h=0;h<8;++h){i=e[g],r=e[g+1],s=e[g+2],n=e[g+3],a=e[g+4],o=e[g+5],A=e[g+6];var d=i+(l=e[g+7]),f=i-l,p=r+A,I=r-A,m=s+o,_=s-o,w=n+a,C=n-a,B=d+w,E=d-w,y=p+m,Q=p-m;e[g]=B+y,e[g+4]=B-y;var b=.707106781*(Q+E);e[g+2]=E+b,e[g+6]=E-b;var k=.382683433*((B=C+_)-(Q=I+f)),x=.5411961*B+k,v=1.306562965*Q+k,D=.707106781*(y=_+I),S=f+D,M=f-D;e[g+5]=M+x,e[g+3]=M-x,e[g+1]=S+v,e[g+7]=S-v,g+=8}for(g=0,h=0;h<8;++h){i=e[g],r=e[g+8],s=e[g+16],n=e[g+24],a=e[g+32],o=e[g+40],A=e[g+48];var U=i+(l=e[g+56]),G=i-l,T=r+A,F=r-A,R=s+o,L=s-o,N=n+a,O=n-a,P=U+N,z=U-N,q=T+R,K=T-R;e[g]=P+q,e[g+32]=P-q;var H=.707106781*(K+z);e[g+16]=z+H,e[g+48]=z-H;var V=.382683433*((P=O+L)-(K=F+G)),J=.5411961*P+V,Y=1.306562965*K+V,j=.707106781*(q=L+F),Z=G+j,W=G-j;e[g+40]=W+J,e[g+24]=W-J,e[g+8]=Z+Y,e[g+56]=Z-Y,g++}for(h=0;h<64;++h)c=e[h]*t[h],u[h]=c>0?c+.5|0:c-.5|0;return u}(e,t),l=0;l<64;++l)d[E[l]]=A[l];var h=d[0]-i;i=d[0],0==h?U(r[0]):(U(r[g[n=32767+h]]),U(c[n]));for(var f=63;f>0&&0==d[f];f--);if(0==f)return U(a),i;for(var p,I=1;I<=f;){for(var m=I;0==d[I]&&I<=f;++I);var _=I-m;if(_>=16){p=_>>4;for(var w=1;w<=p;++w)U(o);_&=15}n=32767+d[I],U(s[(_<<4)+g[n]]),U(c[n]),I++}return 63!=f&&U(a),i}function R(e){if(e<=0&&(e=1),e>100&&(e=100),n!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],i=0;i<64;i++){var r=a((t[i]*e+50)/100);r<1?r=1:r>255&&(r=255),o[E[i]]=r}for(var s=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],n=0;n<64;n++){var c=a((s[n]*e+50)/100);c<1?c=1:c>255&&(c=255),A[E[n]]=c}for(var g=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],u=0,d=0;d<8;d++)for(var f=0;f<8;f++)l[u]=1/(o[E[u]]*g[d]*g[f]*8),h[u]=1/(A[E[u]]*g[d]*g[f]*8),u++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),n=e}}this.encode=function(e,n){var a;(new Date).getTime(),n&&R(n),f=new Array,p=0,I=7,T(65496),T(65504),T(16),G(74),G(70),G(73),G(70),G(0),G(1),G(1),G(0),T(1),T(1),G(0),G(0),void 0!==(a=e.comments)&&a.constructor===Array&&a.forEach((e=>{if("string"==typeof e){T(65534);var t,i=e.length;for(T(i+2),t=0;t<i;t++)G(e.charCodeAt(t))}})),function(e){if(e){T(65505),69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]?T(e.length+2):(T(e.length+5+2),G(69),G(120),G(105),G(102),G(0));for(var t=0;t<e.length;t++)G(e[t])}}(e.exifBuffer),function(){T(65499),T(132),G(0);for(var e=0;e<64;e++)G(o[e]);G(1);for(var t=0;t<64;t++)G(A[t])}(),function(e,t){T(65472),T(17),G(8),T(t),T(e),G(3),G(1),G(17),G(0),G(2),G(17),G(1),G(3),G(17),G(1)}(e.width,e.height),function(){T(65476),T(418),G(0);for(var e=0;e<16;e++)G(y[e+1]);for(var t=0;t<=11;t++)G(Q[t]);G(16);for(var i=0;i<16;i++)G(b[i+1]);for(var r=0;r<=161;r++)G(k[r]);G(1);for(var s=0;s<16;s++)G(x[s+1]);for(var n=0;n<=11;n++)G(v[n]);G(17);for(var a=0;a<16;a++)G(D[a+1]);for(var o=0;o<=161;o++)G(S[o])}(),T(65498),T(12),G(3),G(1),G(0),G(2),G(17),G(3),G(17),G(0),G(63),G(0);var c=0,g=0,u=0;p=0,I=7,this.encode.displayName="_encode_";for(var d,C,E,M,L,N,O,P,z,q=e.data,K=e.width,H=e.height,V=4*K,J=0;J<H;){for(d=0;d<V;){for(N=L=V*J+d,O=-1,P=0,z=0;z<64;z++)N=L+(P=z>>3)*V+(O=4*(7&z)),J+P>=H&&(N-=V*(J+1+P-H)),d+O>=V&&(N-=d+O-V+4),C=q[N++],E=q[N++],M=q[N++],m[z]=(B[C]+B[E+256>>0]+B[M+512>>0]>>16)-128,_[z]=(B[C+768>>0]+B[E+1024>>0]+B[M+1280>>0]>>16)-128,w[z]=(B[C+1280>>0]+B[E+1536>>0]+B[M+1792>>0]>>16)-128;c=F(m,l,c,t,r),g=F(_,h,g,i,s),u=F(w,h,u,i,s),d+=32}J+=8}if(I>=0){var Y=[];Y[1]=I+1,Y[0]=(1<<I+1)-1,U(Y)}return T(65497),Buffer.from(f)},(new Date).getTime(),e||(e=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)C[t]=e(t)}(),t=M(y,Q),i=M(x,v),r=M(b,k),s=M(D,S),function(){for(var e=1,t=2,i=1;i<=15;i++){for(var r=e;r<t;r++)g[32767+r]=i,c[32767+r]=[],c[32767+r][1]=i,c[32767+r][0]=r;for(var s=-(t-1);s<=-e;s++)g[32767+s]=i,c[32767+s]=[],c[32767+s][1]=i,c[32767+s][0]=t-1+s;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)B[e]=19595*e,B[e+256>>0]=38470*e,B[e+512>>0]=7471*e+32768,B[e+768>>0]=-11059*e,B[e+1024>>0]=-21709*e,B[e+1280>>0]=32768*e+8421375,B[e+1536>>0]=-27439*e,B[e+1792>>0]=-5329*e}(),R(e),(new Date).getTime()}Aa.exports=function(e,i){void 0===i&&(i=50);var r=new t(i),s=r.encode(e,i);return{data:s,width:e.width,height:e.height}}}();var la,ha,ca=Aa.exports,ga={exports:{}};la=ga,ha=function(){var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,i=799,r=3406,s=2276,n=1567,a=3784,o=5793,A=2896;function l(){}function h(e,t){for(var i,r,s=0,n=[],a=16;a>0&&!e[a-1];)a--;n.push({children:[],index:0});var o,A=n[0];for(i=0;i<a;i++){for(r=0;r<e[i];r++){for((A=n.pop()).children[A.index]=t[s];A.index>0;){if(0===n.length)throw new Error("Could not recreate Huffman Table");A=n.pop()}for(A.index++,n.push(A);n.length<=i;)n.push(o={children:[],index:0}),A.children[A.index]=o.children,A=o;s++}i+1<a&&(n.push(o={children:[],index:0}),A.children[A.index]=o.children,A=o)}return n[0].children}function c(t,i,r,s,n,a,o,A,l,h){r.precision,r.samplesPerLine,r.scanLines;var c=r.mcusPerLine,g=r.progressive;r.maxH,r.maxV;var u=i,d=0,f=0;function p(){if(f>0)return f--,d>>f&1;if(255==(d=t[i++])){var e=t[i++];if(e)throw new Error("unexpected marker: "+(d<<8|e).toString(16))}return f=7,d>>>7}function I(e){for(var t,i=e;null!==(t=p());){if("number"==typeof(i=i[t]))return i;if("object"!=typeof i)throw new Error("invalid huffman sequence")}return null}function m(e){for(var t=0;e>0;){var i=p();if(null===i)return;t=t<<1|i,e--}return t}function _(e){var t=m(e);return t>=1<<e-1?t:t+(-1<<e)+1}var w,C=0,B=0;function E(e,t,i,r,s){var n=i%c,a=(i/c|0)*e.v+r,o=n*e.h+s;void 0===e.blocks[a]&&h.tolerantDecoding||t(e,e.blocks[a][o])}function y(e,t,i){var r=i/e.blocksPerLine|0,s=i%e.blocksPerLine;void 0===e.blocks[r]&&h.tolerantDecoding||t(e,e.blocks[r][s])}var Q,b,k,x,v,D,S=s.length;D=g?0===a?0===A?function(e,t){var i=I(e.huffmanTableDC),r=0===i?0:_(i)<<l;t[0]=e.pred+=r}:function(e,t){t[0]|=p()<<l}:0===A?function(t,i){if(C>0)C--;else for(var r=a,s=o;r<=s;){var n=I(t.huffmanTableAC),A=15&n,h=n>>4;if(0!==A)i[e[r+=h]]=_(A)*(1<<l),r++;else{if(h<15){C=m(h)+(1<<h)-1;break}r+=16}}}:function(t,i){for(var r=a,s=o,n=0;r<=s;){var A=e[r],h=i[A]<0?-1:1;switch(B){case 0:var c=I(t.huffmanTableAC),g=15&c;if(n=c>>4,0===g)n<15?(C=m(n)+(1<<n),B=4):(n=16,B=1);else{if(1!==g)throw new Error("invalid ACn encoding");w=_(g),B=n?2:3}continue;case 1:case 2:i[A]?i[A]+=(p()<<l)*h:0==--n&&(B=2==B?3:0);break;case 3:i[A]?i[A]+=(p()<<l)*h:(i[A]=w<<l,B=0);break;case 4:i[A]&&(i[A]+=(p()<<l)*h)}r++}4===B&&0==--C&&(B=0)}:function(t,i){var r=I(t.huffmanTableDC),s=0===r?0:_(r);i[0]=t.pred+=s;for(var n=1;n<64;){var a=I(t.huffmanTableAC),o=15&a,A=a>>4;if(0!==o)i[e[n+=A]]=_(o),n++;else{if(A<15)break;n+=16}}};var M,U,G,T,F=0;for(U=1==S?s[0].blocksPerLine*s[0].blocksPerColumn:c*r.mcusPerColumn,n||(n=U);F<U;){for(b=0;b<S;b++)s[b].pred=0;if(C=0,1==S)for(Q=s[0],v=0;v<n;v++)y(Q,D,F),F++;else for(v=0;v<n;v++){for(b=0;b<S;b++)for(G=(Q=s[b]).h,T=Q.v,k=0;k<T;k++)for(x=0;x<G;x++)E(Q,D,F,k,x);if(++F===U)break}if(F===U)do{if(255===t[i]&&0!==t[i+1])break;i+=1}while(i<t.length-2);if(f=0,(M=t[i]<<8|t[i+1])<65280)throw new Error("marker was not found");if(!(M>=65488&&M<=65495))break;i+=2}return i-u}function g(e,l){var h,c,g=[],u=l.blocksPerLine,d=l.blocksPerColumn,f=u<<3,I=new Int32Array(64),m=new Uint8Array(64);function _(e,h,c){var g,u,d,f,p,I,m,_,w,C,B=l.quantizationTable,E=c;for(C=0;C<64;C++)E[C]=e[C]*B[C];for(C=0;C<8;++C){var y=8*C;0!=E[1+y]||0!=E[2+y]||0!=E[3+y]||0!=E[4+y]||0!=E[5+y]||0!=E[6+y]||0!=E[7+y]?(g=o*E[0+y]+128>>8,u=o*E[4+y]+128>>8,d=E[2+y],f=E[6+y],p=A*(E[1+y]-E[7+y])+128>>8,_=A*(E[1+y]+E[7+y])+128>>8,I=E[3+y]<<4,m=E[5+y]<<4,w=g-u+1>>1,g=g+u+1>>1,u=w,w=d*a+f*n+128>>8,d=d*n-f*a+128>>8,f=w,w=p-m+1>>1,p=p+m+1>>1,m=w,w=_+I+1>>1,I=_-I+1>>1,_=w,w=g-f+1>>1,g=g+f+1>>1,f=w,w=u-d+1>>1,u=u+d+1>>1,d=w,w=p*s+_*r+2048>>12,p=p*r-_*s+2048>>12,_=w,w=I*i+m*t+2048>>12,I=I*t-m*i+2048>>12,m=w,E[0+y]=g+_,E[7+y]=g-_,E[1+y]=u+m,E[6+y]=u-m,E[2+y]=d+I,E[5+y]=d-I,E[3+y]=f+p,E[4+y]=f-p):(w=o*E[0+y]+512>>10,E[0+y]=w,E[1+y]=w,E[2+y]=w,E[3+y]=w,E[4+y]=w,E[5+y]=w,E[6+y]=w,E[7+y]=w)}for(C=0;C<8;++C){var Q=C;0!=E[8+Q]||0!=E[16+Q]||0!=E[24+Q]||0!=E[32+Q]||0!=E[40+Q]||0!=E[48+Q]||0!=E[56+Q]?(g=o*E[0+Q]+2048>>12,u=o*E[32+Q]+2048>>12,d=E[16+Q],f=E[48+Q],p=A*(E[8+Q]-E[56+Q])+2048>>12,_=A*(E[8+Q]+E[56+Q])+2048>>12,I=E[24+Q],m=E[40+Q],w=g-u+1>>1,g=g+u+1>>1,u=w,w=d*a+f*n+2048>>12,d=d*n-f*a+2048>>12,f=w,w=p-m+1>>1,p=p+m+1>>1,m=w,w=_+I+1>>1,I=_-I+1>>1,_=w,w=g-f+1>>1,g=g+f+1>>1,f=w,w=u-d+1>>1,u=u+d+1>>1,d=w,w=p*s+_*r+2048>>12,p=p*r-_*s+2048>>12,_=w,w=I*i+m*t+2048>>12,I=I*t-m*i+2048>>12,m=w,E[0+Q]=g+_,E[56+Q]=g-_,E[8+Q]=u+m,E[48+Q]=u-m,E[16+Q]=d+I,E[40+Q]=d-I,E[24+Q]=f+p,E[32+Q]=f-p):(w=o*c[C+0]+8192>>14,E[0+Q]=w,E[8+Q]=w,E[16+Q]=w,E[24+Q]=w,E[32+Q]=w,E[40+Q]=w,E[48+Q]=w,E[56+Q]=w)}for(C=0;C<64;++C){var b=128+(E[C]+8>>4);h[C]=b<0?0:b>255?255:b}}p(f*d*8);for(var w=0;w<d;w++){var C=w<<3;for(h=0;h<8;h++)g.push(new Uint8Array(f));for(var B=0;B<u;B++){_(l.blocks[w][B],m,I);var E=0,y=B<<3;for(c=0;c<8;c++){var Q=g[C+c];for(h=0;h<8;h++)Q[y+h]=m[E++]}}}return g}function u(e){return e<0?0:e>255?255:e}l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var i=1e3*this.opts.maxResolutionInMP*1e3,r=0;function s(){var e=t[r]<<8|t[r+1];return r+=2,e}function n(e){var t,i,r=1,s=1;for(i in e.components)e.components.hasOwnProperty(i)&&(r<(t=e.components[i]).h&&(r=t.h),s<t.v&&(s=t.v));var n=Math.ceil(e.samplesPerLine/8/r),a=Math.ceil(e.scanLines/8/s);for(i in e.components)if(e.components.hasOwnProperty(i)){t=e.components[i];var o=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/r),A=Math.ceil(Math.ceil(e.scanLines/8)*t.v/s),l=n*t.h,h=a*t.v,c=[];p(h*l*256);for(var g=0;g<h;g++){for(var u=[],d=0;d<l;d++)u.push(new Int32Array(64));c.push(u)}t.blocksPerLine=o,t.blocksPerColumn=A,t.blocks=c}e.maxH=r,e.maxV=s,e.mcusPerLine=n,e.mcusPerColumn=a}t.length;var a,o,A,l,u=null,d=null,f=[],I=[],m=[],_=[],w=s(),C=-1;if(this.comments=[],65496!=w)throw new Error("SOI not found");for(w=s();65497!=w;){switch(w){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var B=(A=void 0,l=void 0,A=s(),l=t.subarray(r,r+A-2),r+=l.length,l);if(65534===w){var E=String.fromCharCode.apply(null,B);this.comments.push(E)}65504===w&&74===B[0]&&70===B[1]&&73===B[2]&&70===B[3]&&0===B[4]&&(u={version:{major:B[5],minor:B[6]},densityUnits:B[7],xDensity:B[8]<<8|B[9],yDensity:B[10]<<8|B[11],thumbWidth:B[12],thumbHeight:B[13],thumbData:B.subarray(14,14+3*B[12]*B[13])}),65505===w&&69===B[0]&&120===B[1]&&105===B[2]&&102===B[3]&&0===B[4]&&(this.exifBuffer=B.subarray(5,B.length)),65518===w&&65===B[0]&&100===B[1]&&111===B[2]&&98===B[3]&&101===B[4]&&0===B[5]&&(d={version:B[6],flags0:B[7]<<8|B[8],flags1:B[9]<<8|B[10],transformCode:B[11]});break;case 65499:for(var y=s()+r-2;r<y;){var Q=t[r++];p(256);var b=new Int32Array(64);if(Q>>4==0)for(Y=0;Y<64;Y++)b[e[Y]]=t[r++];else{if(Q>>4!=1)throw new Error("DQT: invalid table spec");for(Y=0;Y<64;Y++)b[e[Y]]=s()}f[15&Q]=b}break;case 65472:case 65473:case 65474:s(),(a={}).extended=65473===w,a.progressive=65474===w,a.precision=t[r++],a.scanLines=s(),a.samplesPerLine=s(),a.components={},a.componentsOrder=[];var k=a.scanLines*a.samplesPerLine;if(k>i){var x=Math.ceil((k-i)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${x}MP`)}var v,D=t[r++];for(V=0;V<D;V++){v=t[r];var S=t[r+1]>>4,M=15&t[r+1],U=t[r+2];if(S<=0||M<=0)throw new Error("Invalid sampling factor, expected values above 0");a.componentsOrder.push(v),a.components[v]={h:S,v:M,quantizationIdx:U},r+=3}n(a),I.push(a);break;case 65476:var G=s();for(V=2;V<G;){var T=t[r++],F=new Uint8Array(16),R=0;for(Y=0;Y<16;Y++,r++)R+=F[Y]=t[r];p(16+R);var L=new Uint8Array(R);for(Y=0;Y<R;Y++,r++)L[Y]=t[r];V+=17+R,(T>>4==0?_:m)[15&T]=h(F,L)}break;case 65501:s(),o=s();break;case 65500:s(),s();break;case 65498:s();var N=t[r++],O=[];for(V=0;V<N;V++){j=a.components[t[r++]];var P=t[r++];j.huffmanTableDC=_[P>>4],j.huffmanTableAC=m[15&P],O.push(j)}var z=t[r++],q=t[r++],K=t[r++],H=c(t,r,a,O,o,z,q,K>>4,15&K,this.opts);r+=H;break;case 65535:255!==t[r]&&r--;break;default:if(255==t[r-3]&&t[r-2]>=192&&t[r-2]<=254){r-=3;break}if(224===w||225==w){if(-1!==C)throw new Error(`first unknown JPEG marker at offset ${C.toString(16)}, second unknown JPEG marker ${w.toString(16)} at offset ${(r-1).toString(16)}`);C=r-1;const e=s();if(255===t[r+e-2]){r+=e-2;break}}throw new Error("unknown JPEG marker "+w.toString(16))}w=s()}if(1!=I.length)throw new Error("only single frame JPEGs supported");for(var V=0;V<I.length;V++){var J=I[V].components;for(var Y in J)J[Y].quantizationTable=f[J[Y].quantizationIdx],delete J[Y].quantizationIdx}for(this.width=a.samplesPerLine,this.height=a.scanLines,this.jfif=u,this.adobe=d,this.components=[],V=0;V<a.componentsOrder.length;V++){var j=a.components[a.componentsOrder[V]];this.components.push({lines:g(0,j),scaleX:j.h/a.maxH,scaleY:j.v/a.maxV})}},getData:function(e,t){var i,r,s,n,a,o,A,l,h,c,g,d,f,I,m,_,w,C,B,E,y,Q=this.width/e,b=this.height/t,k=0,x=e*t*this.components.length;p(x);var v=new Uint8Array(x);switch(this.components.length){case 1:for(i=this.components[0],c=0;c<t;c++)for(a=i.lines[0|c*i.scaleY*b],h=0;h<e;h++)g=a[0|h*i.scaleX*Q],v[k++]=g;break;case 2:for(i=this.components[0],r=this.components[1],c=0;c<t;c++)for(a=i.lines[0|c*i.scaleY*b],o=r.lines[0|c*r.scaleY*b],h=0;h<e;h++)g=a[0|h*i.scaleX*Q],v[k++]=g,g=o[0|h*r.scaleX*Q],v[k++]=g;break;case 3:for(y=!0,this.adobe&&this.adobe.transformCode?y=!0:void 0!==this.opts.colorTransform&&(y=!!this.opts.colorTransform),i=this.components[0],r=this.components[1],s=this.components[2],c=0;c<t;c++)for(a=i.lines[0|c*i.scaleY*b],o=r.lines[0|c*r.scaleY*b],A=s.lines[0|c*s.scaleY*b],h=0;h<e;h++)y?(g=a[0|h*i.scaleX*Q],d=o[0|h*r.scaleX*Q],C=u(g+1.402*((f=A[0|h*s.scaleX*Q])-128)),B=u(g-.3441363*(d-128)-.71413636*(f-128)),E=u(g+1.772*(d-128))):(C=a[0|h*i.scaleX*Q],B=o[0|h*r.scaleX*Q],E=A[0|h*s.scaleX*Q]),v[k++]=C,v[k++]=B,v[k++]=E;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(y=!1,this.adobe&&this.adobe.transformCode?y=!0:void 0!==this.opts.colorTransform&&(y=!!this.opts.colorTransform),i=this.components[0],r=this.components[1],s=this.components[2],n=this.components[3],c=0;c<t;c++)for(a=i.lines[0|c*i.scaleY*b],o=r.lines[0|c*r.scaleY*b],A=s.lines[0|c*s.scaleY*b],l=n.lines[0|c*n.scaleY*b],h=0;h<e;h++)y?(g=a[0|h*i.scaleX*Q],d=o[0|h*r.scaleX*Q],f=A[0|h*s.scaleX*Q],I=l[0|h*n.scaleX*Q],m=255-u(g+1.402*(f-128)),_=255-u(g-.3441363*(d-128)-.71413636*(f-128)),w=255-u(g+1.772*(d-128))):(m=a[0|h*i.scaleX*Q],_=o[0|h*r.scaleX*Q],w=A[0|h*s.scaleX*Q],I=l[0|h*n.scaleX*Q]),v[k++]=255-m,v[k++]=255-_,v[k++]=255-w,v[k++]=255-I;break;default:throw new Error("Unsupported color mode")}return v},copyToImageData:function(e,t){var i,r,s,n,a,o,A,l,h,c=e.width,g=e.height,d=e.data,f=this.getData(c,g),p=0,I=0;switch(this.components.length){case 1:for(r=0;r<g;r++)for(i=0;i<c;i++)s=f[p++],d[I++]=s,d[I++]=s,d[I++]=s,t&&(d[I++]=255);break;case 3:for(r=0;r<g;r++)for(i=0;i<c;i++)A=f[p++],l=f[p++],h=f[p++],d[I++]=A,d[I++]=l,d[I++]=h,t&&(d[I++]=255);break;case 4:for(r=0;r<g;r++)for(i=0;i<c;i++)a=f[p++],o=f[p++],s=f[p++],A=255-u(a*(1-(n=f[p++])/255)+n),l=255-u(o*(1-n/255)+n),h=255-u(s*(1-n/255)+n),d[I++]=A,d[I++]=l,d[I++]=h,t&&(d[I++]=255);break;default:throw new Error("Unsupported color mode")}}};var d=0,f=0;function p(e=0){var t=d+e;if(t>f){var i=Math.ceil((t-f)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${i}MB`)}d=t}return l.resetMaxMemoryUsage=function(e){d=0,f=e},l.getBytesAllocated=function(){return d},l.requestMemoryAllocation=p,l}(),la.exports=function(e,t={}){var i={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...t},r=new Uint8Array(e),s=new ha;s.opts=i,ha.resetMaxMemoryUsage(1024*i.maxMemoryUsageInMB*1024),s.parse(r);var n=i.formatAsRGBA?4:3,a=s.width*s.height*n;try{ha.requestMemoryAllocation(a);var o={width:s.width,height:s.height,exifBuffer:s.exifBuffer,data:i.useTArray?new Uint8Array(a):Buffer.alloc(a)};s.comments.length>0&&(o.comments=s.comments)}catch(e){if(e instanceof RangeError)throw new Error("Could not allocate enough memory for the image. Required: "+a);if(e instanceof ReferenceError&&"Buffer is not defined"===e.message)throw new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true");throw e}return s.copyToImageData(o,i.formatAsRGBA),o};var ua=oa({encode:ca,decode:ga.exports});const da=Math.PI,fa=da/4,pa=180/da;function Ia(e,t){let i=e.length-t,r=0;do{for(let i=t;i>0;i--)e[r+t]+=e[r],r++;i-=t}while(i>0)}function ma(e,t,i){let r=0,s=e.length;const n=s/i;for(;s>t;){for(let i=t;i>0;--i)e[r+t]+=e[r],++r;s-=t}const a=e.slice();for(let t=0;t<n;++t)for(let r=0;r<i;++r)e[i*t+r]=a[(i-r-1)*n+t]}let _a=class{async decode(e,t){const i=await this.decodeBlock(t),r=e.Predictor||1;if(1!==r){const t=!e.StripOffsets;return function(e,t,i,r,s,n){if(!t||1===t)return e;for(let e=0;e<s.length;++e){if(s[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(s[e]!==s[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const a=s[0]/8,o=2===n?1:s.length;for(let n=0;n<r&&!(n*o*i*a>=e.byteLength);++n){let r;if(2===t){switch(s[0]){case 8:r=new Uint8Array(e,n*o*i*a,o*i*a);break;case 16:r=new Uint16Array(e,n*o*i*a,o*i*a/2);break;case 32:r=new Uint32Array(e,n*o*i*a,o*i*a/4);break;default:throw new Error(`Predictor 2 not allowed with ${s[0]} bits per sample.`)}Ia(r,o)}else 3===t&&(r=new Uint8Array(e,n*o*i*a,o*i*a),ma(r,o,a))}return e}(i,r,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return i}};const wa=257;function Ca(e,t){for(let i=t.length-1;i>=0;i--)e.push(t[i]);return e}function Ba(e){const t=new Uint16Array(4093),i=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,i[e]=e;let r=258,s=9,n=0;function a(){r=258,s=9}function o(e){const t=function(e,t,i){const r=t%8,s=Math.floor(t/8),n=8-r,a=t+i-8*(s+1);let o=8*(s+2)-(t+i);const A=8*(s+2)-t;if(o=Math.max(0,o),s>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),wa;let l=e[s]&2**(8-r)-1;l<<=i-n;let h=l;if(s+1<e.length){let t=e[s+1]>>>o;t<<=Math.max(0,i-A),h+=t}if(a>8&&s+2<e.length){const r=8*(s+3)-(t+i);h+=e[s+2]>>>r}return h}(e,n,s);return n+=s,t}function A(e,s){return i[r]=s,t[r]=e,r++,r-1}function l(e){const r=[];for(let s=e;4096!==s;s=t[s])r.push(i[s]);return r}const h=[];a();const c=new Uint8Array(e);let g,u=o(c);for(;u!==wa;){if(256===u){for(a(),u=o(c);256===u;)u=o(c);if(u===wa)break;if(u>256)throw new Error(`corrupted code at scanline ${u}`);Ca(h,l(u)),g=u}else if(u<r){const e=l(u);Ca(h,e),A(g,e[e.length-1]),g=u}else{const e=l(g);if(!e)throw new Error(`Bogus entry. Not in dictionary,\n ${g} / ${r},\n position: ${n}`);Ca(h,e),h.push(e[e.length-1]),A(g,e[e.length-1]),g=u}r+1>=2**s&&(12===s?g=void 0:s++),u=o(c)}return new Uint8Array(h)}let Ea=class extends _a{decodeBlock(e){return Ba(e).buffer}};function ya(e){return(t,...i)=>ba(e,t,i)}function Qa(e,t){return ya(Da(e,t).get)}const{apply:ba,construct:ka,defineProperty:xa,get:va,getOwnPropertyDescriptor:Da,getPrototypeOf:Sa,has:Ma,ownKeys:Ua,set:Ga,setPrototypeOf:Ta}=Reflect,{iterator:Fa,species:Ra,toStringTag:La,for:Na}=Symbol,Oa=Object,{create:Pa,defineProperty:za,freeze:qa,is:Ka}=Oa,Ha=Array.prototype[Fa],Va=ya(Ha),Ja=ArrayBuffer;Qa(Ja.prototype,"byteLength");const Ya="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null;Ya&&Qa(Ya.prototype,"byteLength");const ja=Sa(Uint8Array);ja.from;const Za=ja.prototype;Za[Fa],ya(Za.keys),ya(Za.values),ya(Za.entries),ya(Za.set),ya(Za.reverse),ya(Za.fill),ya(Za.copyWithin),ya(Za.sort),ya(Za.slice),ya(Za.subarray),Qa(Za,"buffer"),Qa(Za,"byteOffset"),Qa(Za,"length"),Qa(Za,La);const Wa=Uint32Array,Xa=Float32Array,$a=Sa([][Fa]()),eo=ya($a.next),to=ya(function*(){}().next),io=Sa($a),ro=ya(DataView.prototype.getUint16),so=WeakMap,no=so.prototype,ao=ya(no.get),oo=ya(no.set),Ao=new so,lo=Pa(null,{next:{value:function(){const e=ao(Ao,this);return eo(e)}},[Fa]:{value:function(){return this}}});const ho=new so,co=Pa(io,{next:{value:function(){const e=ao(ho,this);return to(e)},writable:!0,configurable:!0}});for(const e of Ua($a))"next"!==e&&za(co,e,Da($a,e));const go=new Ja(4),uo=new Xa(go),fo=new Wa(go),po=new Wa(512),Io=new Wa(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(po[e]=0,po[256|e]=32768,Io[e]=24,Io[256|e]=24):t<-14?(po[e]=1024>>-t-14,po[256|e]=1024>>-t-14|32768,Io[e]=-t-1,Io[256|e]=-t-1):t<=15?(po[e]=t+15<<10,po[256|e]=t+15<<10|32768,Io[e]=13,Io[256|e]=13):t<128?(po[e]=31744,po[256|e]=64512,Io[e]=24,Io[256|e]=24):(po[e]=31744,po[256|e]=64512,Io[e]=13,Io[256|e]=13)}const mo=new Wa(2048),_o=new Wa(64),wo=new Wa(64);for(let e=1;e<1024;++e){let t=e<<13,i=0;for(;0==(8388608&t);)t<<=1,i-=8388608;t&=-8388609,i+=947912704,mo[e]=t|i}for(let e=1024;e<2048;++e)mo[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)_o[e]=e<<23;_o[31]=1199570944,_o[32]=2147483648;for(let e=33;e<63;++e)_o[e]=2147483648+(e-32<<23);_o[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(wo[e]=1024);function Co(e,t,...i){return function(e){const t=e>>10;return fo[0]=mo[wo[t]+(1023&e)]+_o[t],uo[0]}(ro(e,t,...function(e){if(e[Fa]===Ha&&$a.next===eo)return e;const t=Pa(lo);return oo(Ao,t,Va(e)),t}(i)))}var Bo={exports:{}};function Eo(e,t,i){const r=i&&i.debug||!1;r&&console.log("[xml-utils] getting "+t+" in "+e);const s="object"==typeof e?e.outer:e,n=s.slice(0,s.indexOf(">")+1),a=['"',"'"];for(let e=0;e<a.length;e++){const i=a[e],s=t+"\\="+i+"([^"+i+"]*)"+i;r&&console.log("[xml-utils] pattern:",s);const o=new RegExp(s).exec(n);if(r&&console.log("[xml-utils] match:",o),o)return o[1]}}Bo.exports=Eo,Bo.exports.default=Eo;var yo=oa(Bo.exports),Qo={exports:{}},bo={exports:{}},ko={exports:{}};function xo(e,t,i){const r=new RegExp(t).exec(e.slice(i));return r?i+r.index:-1}ko.exports=xo,ko.exports.default=xo;var vo=ko.exports,Do={exports:{}};function So(e,t,i){const r=new RegExp(t).exec(e.slice(i));return r?i+r.index+r[0].length-1:-1}Do.exports=So,Do.exports.default=So;var Mo=Do.exports,Uo={exports:{}};function Go(e,t){const i=new RegExp(t,"g"),r=e.match(i);return r?r.length:0}Uo.exports=Go,Uo.exports.default=Go;var To=Uo.exports;const Fo=vo,Ro=Mo,Lo=To;function No(e,t,i){const r=i&&i.debug||!1,s=!(i&&!1===typeof i.nested),n=i&&i.startIndex||0;r&&console.log("[xml-utils] starting findTagByName with",t," and ",i);const a=Fo(e,`<${t}[ \n>/]`,n);if(r&&console.log("[xml-utils] start:",a),-1===a)return;const o=e.slice(a+t.length);let A=Ro(o,"^[^<]*[ /]>",0);const l=-1!==A&&"/"===o[A-1];if(r&&console.log("[xml-utils] selfClosing:",l),!1===l)if(s){let e=0,i=1,r=0;for(;-1!==(A=Ro(o,"[ /]"+t+">",e));){const s=o.substring(e,A+1);if(i+=Lo(s,"<"+t+"[ \n\t>]"),r+=Lo(s,"</"+t+">"),r>=i)break;e=A}}else A=Ro(o,"[ /]"+t+">",0);const h=a+t.length+A+1;if(r&&console.log("[xml-utils] end:",h),-1===h)return;const c=e.slice(a,h);let g;return g=l?null:c.slice(c.indexOf(">")+1,c.lastIndexOf("<")),{inner:g,outer:c,start:a,end:h}}bo.exports=No,bo.exports.default=No;const Oo=bo.exports;function Po(e,t,i){const r=[],s=i&&i.debug||!1,n=!i||"boolean"!=typeof i.nested||i.nested;let a,o=i&&i.startIndex||0;for(;a=Oo(e,t,{debug:s,startIndex:o});)o=n?a.start+1+t.length:a.end,r.push(a);return s&&console.log("findTagsByName found",r.length,"tags"),r}Qo.exports=Po,Qo.exports.default=Po;var zo=oa(Qo.exports);const qo={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},Ko={};for(const e in qo)qo.hasOwnProperty(e)&&(Ko[qo[e]]=parseInt(e,10));const Ho=[Ko.BitsPerSample,Ko.ExtraSamples,Ko.SampleFormat,Ko.StripByteCounts,Ko.StripOffsets,Ko.StripRowCounts,Ko.TileByteCounts,Ko.TileOffsets,Ko.SubIFDs],Vo={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Jo={};for(const e in Vo)Vo.hasOwnProperty(e)&&(Jo[Vo[e]]=parseInt(e,10));const Yo=0,jo=1,Zo=2,Wo=3,Xo=5,$o=6,eA=8,tA=0,iA=1,rA=0,sA=1,nA=2,aA={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};const oA=new Map;function AA(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>oA.set(e,t)))}function lA(e,t,i,r=1){return new(Object.getPrototypeOf(e).constructor)(t*i*r)}function hA(e,t,i){return(1-i)*e+i*t}function cA(e,t,i,r,s,n="nearest"){switch(n.toLowerCase()){case"nearest":return function(e,t,i,r,s){const n=t/r,a=i/s;return e.map((e=>{const o=lA(e,r,s);for(let A=0;A<s;++A){const s=Math.min(Math.round(a*A),i-1);for(let i=0;i<r;++i){const a=Math.min(Math.round(n*i),t-1),l=e[s*t+a];o[A*r+i]=l}}return o}))}(e,t,i,r,s);case"bilinear":case"linear":return function(e,t,i,r,s){const n=t/r,a=i/s;return e.map((e=>{const o=lA(e,r,s);for(let A=0;A<s;++A){const s=a*A,l=Math.floor(s),h=Math.min(Math.ceil(s),i-1);for(let i=0;i<r;++i){const a=n*i,c=a%1,g=Math.floor(a),u=Math.min(Math.ceil(a),t-1),d=e[l*t+g],f=e[l*t+u],p=e[h*t+g],I=e[h*t+u],m=hA(hA(d,f,c),hA(p,I,c),s%1);o[A*r+i]=m}}return o}))}(e,t,i,r,s);default:throw new Error(`Unsupported resampling method: '${n}'`)}}function gA(e,t,i,r,s,n,a="nearest"){switch(a.toLowerCase()){case"nearest":return function(e,t,i,r,s,n){const a=t/r,o=i/s,A=lA(e,r,s,n);for(let l=0;l<s;++l){const s=Math.min(Math.round(o*l),i-1);for(let i=0;i<r;++i){const o=Math.min(Math.round(a*i),t-1);for(let a=0;a<n;++a){const h=e[s*t*n+o*n+a];A[l*r*n+i*n+a]=h}}}return A}(e,t,i,r,s,n);case"bilinear":case"linear":return function(e,t,i,r,s,n){const a=t/r,o=i/s,A=lA(e,r,s,n);for(let l=0;l<s;++l){const s=o*l,h=Math.floor(s),c=Math.min(Math.ceil(s),i-1);for(let i=0;i<r;++i){const o=a*i,g=o%1,u=Math.floor(o),d=Math.min(Math.ceil(o),t-1);for(let a=0;a<n;++a){const o=e[h*t*n+u*n+a],f=e[h*t*n+d*n+a],p=e[c*t*n+u*n+a],I=e[c*t*n+d*n+a],m=hA(hA(o,f,g),hA(p,I,g),s%1);A[l*r*n+i*n+a]=m}}}return A}(e,t,i,r,s,n);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function uA(e,t,i){let r=0;for(let s=t;s<i;++s)r+=e[s];return r}function dA(e,t,i){switch(e){case 1:if(t<=8)return new Uint8Array(i);if(t<=16)return new Uint16Array(i);if(t<=32)return new Uint32Array(i);break;case 2:if(8===t)return new Int8Array(i);if(16===t)return new Int16Array(i);if(32===t)return new Int32Array(i);break;case 3:switch(t){case 16:case 32:return new Float32Array(i);case 64:return new Float64Array(i)}}throw Error("Unsupported data format/bitsPerSample")}AA([void 0,1],(()=>Promise.resolve().then((function(){return al})).then((e=>e.default)))),AA(5,(()=>Promise.resolve().then((function(){return hl})).then((e=>e.default)))),AA(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),AA(7,(()=>Promise.resolve().then((function(){return yl})).then((e=>e.default)))),AA([8,32946],(()=>Promise.resolve().then((function(){return Ug})).then((e=>e.default)))),AA(32773,(()=>Promise.resolve().then((function(){return Gg})).then((e=>e.default)))),AA(34887,(()=>Promise.resolve().then((function(){return qg})).then((async e=>(await e.zstd.init(),e))).then((e=>e.default)))),AA(50001,(()=>Promise.resolve().then((function(){return Kg})).then((e=>e.default))));var fA=class{constructor(e,t,i,r,s,n){this.fileDirectory=e,this.geoKeys=t,this.dataView=i,this.littleEndian=r,this.tiles=s?{}:null,this.isTiled=!e.StripOffsets;const a=e.PlanarConfiguration;if(this.planarConfiguration=void 0===a?1:a,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=n}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t)e+=this.getSampleByteSize(t);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,i=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(i<=8)return DataView.prototype.getUint8;if(i<=16)return DataView.prototype.getUint16;if(i<=32)return DataView.prototype.getUint32;break;case 2:if(i<=8)return DataView.prototype.getInt8;if(i<=16)return DataView.prototype.getInt16;if(i<=32)return DataView.prototype.getInt32;break;case 3:switch(i){case 16:return function(e,t){return Co(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,t){return dA(this.getSampleFormat(e),this.getBitsPerSample(e),t)}async getTileOrStrip(e,t,i,r,s){const n=Math.ceil(this.getWidth()/this.getTileWidth()),a=Math.ceil(this.getHeight()/this.getTileHeight());let o;const{tiles:A}=this;let l,h;1===this.planarConfiguration?o=t*n+e:2===this.planarConfiguration&&(o=i*n*a+t*n+e),this.isTiled?(l=this.fileDirectory.TileOffsets[o],h=this.fileDirectory.TileByteCounts[o]):(l=this.fileDirectory.StripOffsets[o],h=this.fileDirectory.StripByteCounts[o]);const c=(await this.source.fetch([{offset:l,length:h}],s))[0];let g;return null!==A&&A[o]?g=A[o]:(g=(async()=>{let e=await r.decode(this.fileDirectory,c);const i=this.getSampleFormat(),s=this.getBitsPerSample();return function(e,t){return(1!==e&&2!==e||!(t<=32)||t%8!=0)&&(3!==e||16!==t&&32!==t&&64!==t)}(i,s)&&(e=function(e,t,i,r,s,n,a){const o=new DataView(e),A=2===i?1:r,l=dA(t,s,2===i?a*n:a*n*r),h=parseInt("1".repeat(s),2);if(1===t){let e;e=1===i?r*s:s;let t=n*e;0!=(7&t)&&(t=t+7&-8);for(let e=0;e<a;++e){const i=e*t;for(let t=0;t<n;++t){const r=i+t*A*s;for(let i=0;i<A;++i){const a=r+i*s,c=(e*n+t)*A+i,g=Math.floor(a/8),u=a%8;if(u+s<=8)l[c]=o.getUint8(g)>>8-s-u&h;else if(u+s<=16)l[c]=o.getUint16(g)>>16-s-u&h;else if(u+s<=24){const e=o.getUint16(g)<<8|o.getUint8(g+2);l[c]=e>>24-s-u&h}else l[c]=o.getUint32(g)>>32-s-u&h}}}}return l.buffer}(e,i,this.planarConfiguration,this.getSamplesPerPixel(),s,this.getTileWidth(),this.getBlockHeight(t))),e})(),null!==A&&(A[o]=g)),{x:e,y:t,sample:i,data:await g}}async _readRaster(e,t,i,r,s,n,a,o,A){const l=this.getTileWidth(),h=this.getTileHeight(),c=this.getWidth(),g=this.getHeight(),u=Math.max(Math.floor(e[0]/l),0),d=Math.min(Math.ceil(e[2]/l),Math.ceil(c/l)),f=Math.max(Math.floor(e[1]/h),0),p=Math.min(Math.ceil(e[3]/h),Math.ceil(g/h)),I=e[2]-e[0];let m=this.getBytesPerPixel();const _=[],w=[];for(let e=0;e<t.length;++e)1===this.planarConfiguration?_.push(uA(this.fileDirectory.BitsPerSample,0,t[e])/8):_.push(0),w.push(this.getReaderForSample(t[e]));const C=[],{littleEndian:B}=this;for(let n=f;n<p;++n)for(let a=u;a<d;++a){let o;1===this.planarConfiguration&&(o=this.getTileOrStrip(a,n,0,s,A));for(let u=0;u<t.length;++u){const d=u,f=t[u];2===this.planarConfiguration&&(m=this.getSampleByteSize(f),o=this.getTileOrStrip(a,n,f,s,A));const p=o.then((s=>{const n=s.data,a=new DataView(n),o=this.getBlockHeight(s.y),A=s.y*h,u=s.x*l,f=A+o,p=(s.x+1)*l,C=w[d],E=Math.min(o,o-(f-e[3]),g-A),y=Math.min(l,l-(p-e[2]),c-u);for(let s=Math.max(0,e[1]-A);s<E;++s)for(let n=Math.max(0,e[0]-u);n<y;++n){const o=(s*l+n)*m,h=C.call(a,o+_[d],B);let c;r?(c=(s+A-e[1])*I*t.length+(n+u-e[0])*t.length+d,i[c]=h):(c=(s+A-e[1])*I+n+u-e[0],i[d][c]=h)}}));C.push(p)}}if(await Promise.all(C),n&&e[2]-e[0]!==n||a&&e[3]-e[1]!==a){let s;return s=r?gA(i,e[2]-e[0],e[3]-e[1],n,a,t.length,o):cA(i,e[2]-e[0],e[3]-e[1],n,a,o),s.width=n,s.height=a,s}return i.width=n||e[2]-e[0],i.height=a||e[3]-e[1],i}async readRasters({window:e,samples:t=[],interleave:i,pool:r=null,width:s,height:n,resampleMethod:a,fillValue:o,signal:A}={}){const l=e||[0,0,this.getWidth(),this.getHeight()];if(l[0]>l[2]||l[1]>l[3])throw new Error("Invalid subsets");const h=(l[2]-l[0])*(l[3]-l[1]),c=this.getSamplesPerPixel();if(t&&t.length){for(let e=0;e<t.length;++e)if(t[e]>=c)return Promise.reject(new RangeError(`Invalid sample index '${t[e]}'.`))}else for(let e=0;e<c;++e)t.push(e);let g;if(i){g=dA(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),h*t.length),o&&g.fill(o)}else{g=[];for(let e=0;e<t.length;++e){const i=this.getArrayForSample(t[e],h);Array.isArray(o)&&e<o.length?i.fill(o[e]):o&&!Array.isArray(o)&&i.fill(o),g.push(i)}}const u=r||await async function(e){const t=oA.get(e.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${e.Compression}`);return new(await t())(e)}(this.fileDirectory);return await this._readRaster(l,t,g,i,u,s,n,a,A)}async readRGB({window:e,interleave:t=!0,pool:i=null,width:r,height:s,resampleMethod:n,enableAlpha:a=!1,signal:o}={}){const A=e||[0,0,this.getWidth(),this.getHeight()];if(A[0]>A[2]||A[1]>A[3])throw new Error("Invalid subsets");const l=this.fileDirectory.PhotometricInterpretation;if(l===Zo){let A=[0,1,2];if(this.fileDirectory.ExtraSamples!==tA&&a){A=[];for(let e=0;e<this.fileDirectory.BitsPerSample.length;e+=1)A.push(e)}return this.readRasters({window:e,interleave:t,samples:A,pool:i,width:r,height:s,resampleMethod:n,signal:o})}let h;switch(l){case Yo:case jo:case Wo:h=[0];break;case Xo:h=[0,1,2,3];break;case $o:case eA:h=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const c={window:A,interleave:!0,samples:h,pool:i,width:r,height:s,resampleMethod:n,signal:o},{fileDirectory:g}=this,u=await this.readRasters(c),d=2**this.fileDirectory.BitsPerSample[0];let f;switch(l){case Yo:f=function(e,t){const{width:i,height:r}=e,s=new Uint8Array(i*r*3);let n;for(let i=0,r=0;i<e.length;++i,r+=3)n=256-e[i]/t*256,s[r]=n,s[r+1]=n,s[r+2]=n;return s}(u,d);break;case jo:f=function(e,t){const{width:i,height:r}=e,s=new Uint8Array(i*r*3);let n;for(let i=0,r=0;i<e.length;++i,r+=3)n=e[i]/t*256,s[r]=n,s[r+1]=n,s[r+2]=n;return s}(u,d);break;case Wo:f=function(e,t){const{width:i,height:r}=e,s=new Uint8Array(i*r*3),n=t.length/3,a=t.length/3*2;for(let i=0,r=0;i<e.length;++i,r+=3){const o=e[i];s[r]=t[o]/65536*256,s[r+1]=t[o+n]/65536*256,s[r+2]=t[o+a]/65536*256}return s}(u,g.ColorMap);break;case Xo:f=function(e){const{width:t,height:i}=e,r=new Uint8Array(t*i*3);for(let t=0,i=0;t<e.length;t+=4,i+=3){const s=e[t],n=e[t+1],a=e[t+2],o=e[t+3];r[i]=(255-s)/256*255*((255-o)/256),r[i+1]=(255-n)/256*255*((255-o)/256),r[i+2]=(255-a)/256*255*((255-o)/256)}return r}(u);break;case $o:f=function(e){const{width:t,height:i}=e,r=new Uint8ClampedArray(t*i*3);for(let t=0,i=0;t<e.length;t+=3,i+=3){const s=e[t],n=e[t+1],a=e[t+2];r[i]=s+1.402*(a-128),r[i+1]=s-.34414*(n-128)-.71414*(a-128),r[i+2]=s+1.772*(n-128)}return r}(u);break;case eA:f=function(e){const{width:t,height:i}=e,r=new Uint8Array(t*i*3);for(let t=0,i=0;t<e.length;t+=3,i+=3){let s,n,a,o=(e[t+0]+16)/116,A=(e[t+1]<<24>>24)/500+o,l=o-(e[t+2]<<24>>24)/200;A=.95047*(A*A*A>.008856?A*A*A:(A-16/116)/7.787),o=1*(o*o*o>.008856?o*o*o:(o-16/116)/7.787),l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),s=3.2406*A+-1.5372*o+-.4986*l,n=-.9689*A+1.8758*o+.0415*l,a=.0557*A+-.204*o+1.057*l,s=s>.0031308?1.055*s**(1/2.4)-.055:12.92*s,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,r[i]=255*Math.max(0,Math.min(1,s)),r[i+1]=255*Math.max(0,Math.min(1,n)),r[i+2]=255*Math.max(0,Math.min(1,a))}return r}(u);break;default:throw new Error("Unsupported photometric interpretation.")}if(!t){const e=new Uint8Array(f.length/3),t=new Uint8Array(f.length/3),i=new Uint8Array(f.length/3);for(let r=0,s=0;r<f.length;r+=3,++s)e[s]=f[r],t[s]=f[r+1],i[s]=f[r+2];f=[e,t,i]}return f.width=u.width,f.height=u.height,f}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const i=this.fileDirectory.GDAL_METADATA;let r=zo(i,"Item");r=null===e?r.filter((e=>void 0===yo(e,"sample"))):r.filter((t=>Number(yo(t,"sample"))===e));for(let e=0;e<r.length;++e){const i=r[e];t[yo(i,"name")]=i.inner}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,i=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(i)return 0===i[1]&&0===i[4]?[i[0],-i[5],i[10]]:[Math.sqrt(i[0]*i[0]+i[4]*i[4]),-Math.sqrt(i[1]*i[1]+i[5]*i[5]),i[10]];if(e){const[t,i,r]=e.getResolution();return[t*e.getWidth()/this.getWidth(),i*e.getHeight()/this.getHeight(),r*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(e=!1){const t=this.getHeight(),i=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[e,r,s,n,a,o,A,l]=this.fileDirectory.ModelTransformation,h=[[0,0],[0,t],[i,0],[i,t]].map((([t,i])=>[n+e*t+r*i,l+a*t+o*i])),c=h.map((e=>e[0])),g=h.map((e=>e[1]));return[Math.min(...c),Math.min(...g),Math.max(...c),Math.max(...g)]}{const e=this.getOrigin(),r=this.getResolution(),s=e[0],n=e[1],a=s+r[0]*i,o=n+r[1]*t;return[Math.min(s,a),Math.min(n,o),Math.max(s,a),Math.max(n,o)]}}};class pA{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const i=this.getUint32(e,t),r=this.getUint32(e+4,t);let s;if(t){if(s=i+2**32*r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}if(s=2**32*i+r,!Number.isSafeInteger(s))throw new Error(`${s} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return s}getInt64(e,t){let i=0;const r=(128&this._dataView.getUint8(e+(t?7:0)))>0;let s=!0;for(let n=0;n<8;n++){let a=this._dataView.getUint8(e+(t?n:7-n));r&&(s?0!==a&&(a=255&~(a-1),s=!1):a=255&~a),i+=a*256**n}return r&&(i=-i),i}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat16(e,t){return Co(this._dataView,e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class IA{constructor(e,t,i,r){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=i,this._bigTiff=r}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),i=this.readUint32(e+4);let r;if(this._littleEndian){if(r=t+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*t+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}readInt64(e){let t=0;const i=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0;let r=!0;for(let s=0;s<8;s++){let n=this._dataView.getUint8(e+(this._littleEndian?s:7-s));i&&(r?0!==n&&(n=255&~(n-1),r=!1):n=255&~n),t+=n*256**s}return i&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class mA{async fetch(e,t=undefined){return Promise.all(e.map((e=>this.fetchSlice(e,t))))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class _A extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,_A),this.name="AbortError"}}class wA extends mA{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,t){if(t&&t.aborted)throw new _A("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function CA(e,t){let i=e.length-t,r=0;do{for(let i=t;i>0;i--)e[r+t]+=e[r],r++;i-=t}while(i>0)}function BA(e,t,i){let r=0,s=e.length;const n=s/i;for(;s>t;){for(let i=t;i>0;--i)e[r+t]+=e[r],++r;s-=t}const a=e.slice();for(let t=0;t<n;++t)for(let r=0;r<i;++r)e[i*t+r]=a[(i-r-1)*n+t]}class EA{async decode(e,t){const i=await this.decodeBlock(t),r=e.Predictor||1;if(1!==r){const t=!e.StripOffsets;return function(e,t,i,r,s,n){if(!t||1===t)return e;for(let e=0;e<s.length;++e){if(s[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(s[e]!==s[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const a=s[0]/8,o=2===n?1:s.length;for(let n=0;n<r&&!(n*o*i*a>=e.byteLength);++n){let r;if(2===t){switch(s[0]){case 8:r=new Uint8Array(e,n*o*i*a,o*i*a);break;case 16:r=new Uint16Array(e,n*o*i*a,o*i*a/2);break;case 32:r=new Uint32Array(e,n*o*i*a,o*i*a/4);break;default:throw new Error(`Predictor 2 not allowed with ${s[0]} bits per sample.`)}CA(r,o)}else 3===t&&(r=new Uint8Array(e,n*o*i*a,o*i*a),BA(r,o,a))}return e}(i,r,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return i}}function yA(e){switch(e){case Jo.BYTE:case Jo.ASCII:case Jo.SBYTE:case Jo.UNDEFINED:return 1;case Jo.SHORT:case Jo.SSHORT:return 2;case Jo.LONG:case Jo.SLONG:case Jo.FLOAT:case Jo.IFD:return 4;case Jo.RATIONAL:case Jo.SRATIONAL:case Jo.DOUBLE:case Jo.LONG8:case Jo.SLONG8:case Jo.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${e}`)}}function QA(e,t,i,r){let s=null,n=null;const a=yA(t);switch(t){case Jo.BYTE:case Jo.ASCII:case Jo.UNDEFINED:s=new Uint8Array(i),n=e.readUint8;break;case Jo.SBYTE:s=new Int8Array(i),n=e.readInt8;break;case Jo.SHORT:s=new Uint16Array(i),n=e.readUint16;break;case Jo.SSHORT:s=new Int16Array(i),n=e.readInt16;break;case Jo.LONG:case Jo.IFD:s=new Uint32Array(i),n=e.readUint32;break;case Jo.SLONG:s=new Int32Array(i),n=e.readInt32;break;case Jo.LONG8:case Jo.IFD8:s=new Array(i),n=e.readUint64;break;case Jo.SLONG8:s=new Array(i),n=e.readInt64;break;case Jo.RATIONAL:s=new Uint32Array(2*i),n=e.readUint32;break;case Jo.SRATIONAL:s=new Int32Array(2*i),n=e.readInt32;break;case Jo.FLOAT:s=new Float32Array(i),n=e.readFloat32;break;case Jo.DOUBLE:s=new Float64Array(i),n=e.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t!==Jo.RATIONAL&&t!==Jo.SRATIONAL)for(let t=0;t<i;++t)s[t]=n.call(e,r+t*a);else for(let t=0;t<i;t+=2)s[t]=n.call(e,r+t*a),s[t+1]=n.call(e,r+(t*a+4));return t===Jo.ASCII?new TextDecoder("utf-8").decode(s):s}class bA{constructor(e,t,i){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=i}}class kA extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class xA{async readRasters(e={}){const{window:t,width:i,height:r}=e;let{resX:s,resY:n,bbox:a}=e;const o=await this.getImage();let A=o;const l=await this.getImageCount(),h=o.getBoundingBox();if(t&&a)throw new Error('Both "bbox" and "window" passed.');if(i||r){if(t){const[e,i]=o.getOrigin(),[r,s]=o.getResolution();a=[e+t[0]*r,i+t[1]*s,e+t[2]*r,i+t[3]*s]}const e=a||h;if(i){if(s)throw new Error("Both width and resX passed");s=(e[2]-e[0])/i}if(r){if(n)throw new Error("Both width and resY passed");n=(e[3]-e[1])/r}}if(s||n){const e=[];for(let t=0;t<l;++t){const i=await this.getImage(t),{SubfileType:r,NewSubfileType:s}=i.fileDirectory;(0===t||2===r||1&s)&&e.push(i)}e.sort(((e,t)=>e.getWidth()-t.getWidth()));for(let t=0;t<e.length;++t){const i=e[t],r=(h[2]-h[0])/i.getWidth(),a=(h[3]-h[1])/i.getHeight();if(A=i,s&&s>r||n&&n>a)break}}let c=t;if(a){const[e,t]=o.getOrigin(),[i,r]=A.getResolution(o);c=[Math.round((a[0]-e)/i),Math.round((a[1]-t)/r),Math.round((a[2]-e)/i),Math.round((a[3]-t)/r)],c=[Math.min(c[0],c[2]),Math.min(c[1],c[3]),Math.max(c[0],c[2]),Math.max(c[1],c[3])]}return A.readRasters({...e,window:c})}}class vA extends xA{constructor(e,t,i,r,s={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=i,this.firstIFDOffset=r,this.cache=s.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const i=this.bigTiff?4048:1024;return new IA((await this.source.fetch([{offset:e,length:void 0!==t?t:i}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,i=this.bigTiff?8:2;let r=await this.getSlice(e);const s=this.bigTiff?r.readUint64(e):r.readUint16(e),n=s*t+(this.bigTiff?16:6);r.covers(e,n)||(r=await this.getSlice(e,n));const a={};let o=e+(this.bigTiff?8:2);for(let e=0;e<s;o+=t,++e){const e=r.readUint16(o),t=r.readUint16(o+2),i=this.bigTiff?r.readUint64(o+4):r.readUint32(o+4);let s,n;const A=yA(t),l=o+(this.bigTiff?12:8);if(A*i<=(this.bigTiff?8:4))s=QA(r,t,i,l);else{const e=r.readOffset(l),n=yA(t)*i;if(r.covers(e,n))s=QA(r,t,i,e);else{s=QA(await this.getSlice(e,n),t,i,e)}}n=1===i&&-1===Ho.indexOf(e)&&t!==Jo.RATIONAL&&t!==Jo.SRATIONAL?s[0]:s,a[qo[e]]=n}const A=function(e){const t=e.GeoKeyDirectory;if(!t)return null;const i={};for(let r=4;r<=4*t[3];r+=4){const s=aA[t[r]],n=t[r+1]?qo[t[r+1]]:null,a=t[r+2],o=t[r+3];let A=null;if(n){if(A=e[n],null==A)throw new Error(`Could not get value of geoKey '${s}'.`);"string"==typeof A?A=A.substring(o,o+a-1):A.subarray&&(A=A.subarray(o,o+a),1===a&&(A=A[0]))}else A=o;i[s]=A}return i}(a),l=r.readOffset(e+i+t*s);return new bA(a,A,l)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(0===e)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){if(t instanceof kA)throw new kA(e);throw t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(0===t.nextIFDByteOffset)throw new kA(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new fA(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(e){if(!(e instanceof kA))throw e;t=!1}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",i=t.length+100;let r=await this.getSlice(e,i);if(t===QA(r,Jo.ASCII,t.length,e)){const t=QA(r,Jo.ASCII,i,e).split("\n")[0],s=Number(t.split("=")[1].split(" ")[0])+t.length;s>i&&(r=await this.getSlice(e,s));const n=QA(r,Jo.ASCII,s,e);this.ghostValues={},n.split("\n").filter((e=>e.length>0)).map((e=>e.split("="))).forEach((([e,t])=>{this.ghostValues[e]=t}))}return this.ghostValues}static async fromSource(e,t,i){const r=(await e.fetch([{offset:0,length:1024}],i))[0],s=new pA(r),n=s.getUint16(0,0);let a;if(18761===n)a=!0;else{if(19789!==n)throw new TypeError("Invalid byte order value.");a=!1}const o=s.getUint16(2,a);let A;if(42===o)A=!1;else{if(43!==o)throw new TypeError("Invalid magic number.");A=!0;if(8!==s.getUint16(4,a))throw new Error("Unsupported offset byte-size.")}const l=A?s.getUint64(8,a):s.getUint32(4,a);return new vA(e,a,A,l,t)}close(){return"function"==typeof this.source.close&&this.source.close()}}async function DA(e,t){return vA.fromSource(function(e){return new wA(e)}(e),t)}class SA{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let i=e+2,r=0,s=0,n=0,a=0,o=0,A=0;for(1&i?n=a=o=t:r=s=A=t;(i>>=1)>1;){const e=r+n>>1,t=s+a>>1;1&i?(n=r,a=s,r=o,s=A):(r=n,s=a,n=o,a=A),o=e,A=t}const l=4*e;this.coords[l+0]=r,this.coords[l+1]=s,this.coords[l+2]=n,this.coords[l+3]=a}}createTile(e){return new MA(e,this)}}class MA{constructor(e,t){const i=t.gridSize;if(e.length!==i*i)throw new Error(`Expected terrain data of length ${i*i} (${i} x ${i}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:i,gridSize:r}=this.martini,{terrain:s,errors:n}=this;for(let a=e-1;a>=0;a--){const e=4*a,o=i[e+0],A=i[e+1],l=i[e+2],h=i[e+3],c=o+l>>1,g=A+h>>1,u=c+g-A,d=g+o-c,f=(s[A*r+o]+s[h*r+l])/2,p=g*r+c,I=Math.abs(f-s[p]);if(n[p]=Math.max(n[p],I),a<t){const e=(A+d>>1)*r+(o+u>>1),t=(h+d>>1)*r+(l+u>>1);n[p]=Math.max(n[p],n[e],n[t])}}}getMesh(e=0){const{gridSize:t,indices:i}=this.martini,{errors:r}=this;let s=0,n=0;const a=t-1;function o(a,A,l,h,c,g){const u=a+l>>1,d=A+h>>1;Math.abs(a-c)+Math.abs(A-g)>1&&r[d*t+u]>e?(o(c,g,a,A,u,d),o(l,h,c,g,u,d)):(i[A*t+a]=i[A*t+a]||++s,i[h*t+l]=i[h*t+l]||++s,i[g*t+c]=i[g*t+c]||++s,n++)}i.fill(0),o(0,0,a,a,a,0),o(a,a,0,0,0,a);const A=new Uint16Array(2*s),l=new Uint32Array(3*n);let h=0;function c(s,n,a,o,g,u){const d=s+a>>1,f=n+o>>1;if(Math.abs(s-g)+Math.abs(n-u)>1&&r[f*t+d]>e)c(g,u,s,n,d,f),c(a,o,g,u,d,f);else{const e=i[n*t+s]-1,r=i[o*t+a]-1,c=i[u*t+g]-1;A[2*e]=s,A[2*e+1]=n,A[2*r]=a,A[2*r+1]=o,A[2*c]=g,A[2*c+1]=u,l[h++]=e,l[h++]=r,l[h++]=c}}return c(0,0,a,a,a,0),c(a,a,0,0,0,a),{vertices:A,triangles:l}}}function UA(e){let t=1/0,i=1/0,r=1/0,s=-1/0,n=-1/0,a=-1/0;const o=e.POSITION?e.POSITION.value:[],A=o&&o.length;for(let e=0;e<A;e+=3){const A=o[e],l=o[e+1],h=o[e+2];t=A<t?A:t,i=l<i?l:i,r=h<r?h:r,s=A>s?A:s,n=l>n?l:n,a=h>a?h:a}return[[t,i,r],[s,n,a]]}function GA(){for(var e=arguments.length,t=new Array(e),i=0;i<e;i++)t[i]=arguments[i];const r=t,s=r&&r.length>1&&r[0].constructor||null;if(!s)throw new Error('"concatenateTypedArrays" - incorrect quantity of arguments or arguments have incompatible data types');const n=new s(r.reduce(((e,t)=>e+t.length),0));let a=0;for(const e of r)n.set(e,a),a+=e.length;return n}function TA(e,t,i,r){const s=r?function(e,t){e.westIndices.sort(((e,i)=>t[3*e+1]-t[3*i+1])),e.eastIndices.sort(((e,i)=>t[3*i+1]-t[3*e+1])),e.southIndices.sort(((e,i)=>t[3*i]-t[3*e])),e.northIndices.sort(((e,i)=>t[3*e]-t[3*i]));const i=[];for(const t in e){const r=e[t];for(let e=0;e<r.length-1;e++)i.push([r[e],r[e+1]])}return i}(r,e.POSITION.value):function(e){var t,i;const r=[];for(let t=0;t<e.length;t+=3)r.push([e[t],e[t+1]]),r.push([e[t+1],e[t+2]]),r.push([e[t+2],e[t]]);r.sort(((e,t)=>Math.min(...e)-Math.min(...t)||Math.max(...e)-Math.max(...t)));const s=[];let n=0;for(;n<r.length;)r[n][0]===(null===(t=r[n+1])||void 0===t?void 0:t[1])&&r[n][1]===(null===(i=r[n+1])||void 0===i?void 0:i[0])?n+=2:(s.push(r[n]),n++);return s}(t),n=new e.POSITION.value.constructor(6*s.length),a=new e.TEXCOORD_0.value.constructor(4*s.length),o=new t.constructor(6*s.length);for(let t=0;t<s.length;t++){FA({edge:s[t],edgeIndex:t,attributes:e,skirtHeight:i,newPosition:n,newTexcoord0:a,newTriangles:o})}e.POSITION.value=GA(e.POSITION.value,n),e.TEXCOORD_0.value=GA(e.TEXCOORD_0.value,a);return{attributes:e,triangles:t instanceof Array?t.concat(o):GA(t,o)}}function FA({edge:e,edgeIndex:t,attributes:i,skirtHeight:r,newPosition:s,newTexcoord0:n,newTriangles:a}){const o=i.POSITION.value.length,A=2*t,l=2*t+1;s.set(i.POSITION.value.subarray(3*e[0],3*e[0]+3),3*A),s[3*A+2]=s[3*A+2]-r,s.set(i.POSITION.value.subarray(3*e[1],3*e[1]+3),3*l),s[3*l+2]=s[3*l+2]-r,n.set(i.TEXCOORD_0.value.subarray(2*e[0],2*e[0]+2),2*A),n.set(i.TEXCOORD_0.value.subarray(2*e[1],2*e[1]+2),2*l);const h=2*t*3;a[h]=e[0],a[h+1]=o/3+l,a[h+2]=e[1],a[h+3]=o/3+l,a[h+4]=e[0],a[h+5]=o/3+A}const RA={type:"image",format:"uint8",useHeatMap:!0,useColorsBasedOnValues:!1,useAutoRange:!1,useDataForOpacity:!1,useSingleColor:!1,useColorClasses:!1,blurredTexture:!0,clipLow:null,clipHigh:null,multiplier:1,color:[255,0,255,255],colorScale:I.brewer.YlOrRd,colorScaleValueRange:[0,255],colorsBasedOnValues:null,colorClasses:null,alpha:100,useChannel:null,noDataValue:void 0,numOfChannels:void 0,nullColor:[0,0,0,0],unidentifiedColor:[0,0,0,0],clippedColor:[0,0,0,0],terrainColor:[133,133,133,255],terrainSkirtHeight:100,terrainMinValue:0};class LA{constructor(){this.scale=(e,t,i,r,s)=>(e-t)*(s-r)/(i-t)+r}setUrl(e){return T(this,void 0,void 0,(function*(){const t=yield fetch(e),i=yield t.arrayBuffer(),r=yield DA(i),s=yield r.getImage(0);this.data=s}))}getMap(e,t){return T(this,void 0,void 0,(function*(){const i=Object.assign(Object.assign({},RA),t);switch(console.log("xxx_mergedOptions",i),i.type){case"image":return this.getBitmap(e,i);case"terrain":return this.getHeightmap(e,i);default:return null}}))}getHeightmap(e,t){return T(this,void 0,void 0,(function*(){let i,r,s=[];"string"==typeof e?(yield this.setUrl(e),s=yield this.data.readRasters(),i=this.data.getWidth(),r=this.data.getHeight()):(s=e.rasters,i=e.width,r=e.height);let n=s[0];null!=t.useChannel&&s[t.useChannel]&&(n=s[t.useChannel]);const a=new Float32Array((i+1)*(r+1)),o=n.length/(i*r),A=i*r;console.log("xxx_size",A);let l=null===t.useChannel?0:t.useChannel;for(let e=0,s=0;s<r;s++)for(let r=0;r<i;r++,e++){const i=t.noDataValue&&n[l]===t.noDataValue?t.terrainMinValue:n[l]*t.multiplier;a[e+s]=i,l+=o}console.log("xxx_terrain",a),a[0];for(let e=(i+1)*i,t=0;t<i;t++,e++)a[e]=a[e-i-1];for(let e=r,t=0;t<r+1;t++,e+=r+1)a[e]=a[e-1];const{terrainSkirtHeight:h}=t;let c;console.log("xxx_bounds_0",e.bounds),c=NA(h,i,a);const{vertices:g}=c;let{triangles:u}=c,d=function(e,t,i,r,s){const n=i+1,a=e.length/2,o=new Float32Array(3*a),A=new Float32Array(2*a);console.log("xxx_bounds",s);const[l,h,c,g]=s||[0,0,i,r],u=(c-l)/i,d=(g-h)/r;for(let s=0;s<a;s++){const a=e[2*s],h=e[2*s+1],c=h*n+a;o[3*s+0]=a*u+l,o[3*s+1]=-h*d+g,o[3*s+2]=t[c],A[2*s+0]=a/i,A[2*s+1]=h/r}return{POSITION:{value:o,size:3},TEXCOORD_0:{value:A,size:2}}}(g,a,i,r,e.bounds);const f=UA(d);if(console.log("xxx_skirtHeight",h),h){const{attributes:e,triangles:t}=TA(d,u,h);d=e,u=t}return{loaderData:{header:{}},header:{vertexCount:u.length,boundingBox:f},mode:4,indices:{value:Uint32Array.from(u),size:1},attributes:d}}))}getBitmap(e,t){return T(this,void 0,void 0,(function*(){const i=Object.assign({},t);let r,s,n,a=[];"string"==typeof e?(yield this.setUrl(e),a=yield this.data.readRasters(),r=a.length,s=this.data.getWidth(),n=this.data.getHeight()):(a=e.rasters,r=a.length,s=e.width,n=e.height);const o=document.createElement("canvas");o.width=s,o.height=n;const A=o.getContext("2d"),l=A.createImageData(s,n);let h,c,g,u;const d=s*n*4;if(t.noDataValue||console.log("Missing noData value. Raster might be displayed incorrectly."),i.unidentifiedColor=this.getColorFromChromaType(i.unidentifiedColor),i.nullColor=this.getColorFromChromaType(i.nullColor),i.clippedColor=this.getColorFromChromaType(i.clippedColor),i.color=this.getColorFromChromaType(i.color),null==i.useChannel){if(1===r){if(a[0].length/(s*n)==1){const e=a[0];i.useAutoRange&&(i.colorScaleValueRange=this.getMinMax(e,i));this.getColorValue(e,i,d).forEach(((e,t)=>{l.data[t]=e}))}if(a[0].length/(s*n)==3){let e=0;for(let t=0;t<d;t+=4){const r=[a[0][e],a[0][e+1],a[0][e+2]],s=this.hasPixelsNoData(r,i.noDataValue)?i.nullColor:[...r,Math.floor(2.55*i.alpha)];[l.data[t],l.data[t+1],l.data[t+2],l.data[t+3]]=s,e+=3}}a[0].length/(s*n)==4&&a[0].forEach(((e,t)=>{l.data[t]=e}))}if(3===r){let e=0;for(let t=0;t<d;t+=4)h=a[0][e],c=a[1][e],g=a[2][e],u=Math.floor(2.55*i.alpha),l.data[t]=h,l.data[t+1]=c,l.data[t+2]=g,l.data[t+3]=u,e+=1}if(4===r){let e=0;for(let t=0;t<d;t+=4)h=a[0][e],c=a[1][e],g=a[2][e],u=Math.floor(2.55*i.alpha),l.data[t]=h,l.data[t+1]=c,l.data[t+2]=g,l.data[t+3]=u,e+=1}}else if(i.useChannel<=i.numOfChannels){let e=a[0];a[i.useChannel]&&(e=a[i.useChannel]),i.useAutoRange&&(i.colorScaleValueRange=this.getMinMax(e,i));const t=e.length/(s*n);this.getColorValue(e,i,d,t).forEach(((e,t)=>{l.data[t]=e}))}else{console.log("Defined channel does not exist, displaying only grey values");this.getDefaultColor(d,i.nullColor).forEach(((e,t)=>{l.data[t]=e}))}A.putImageData(l,0,0);return o.toDataURL("image/png")}))}getMinMax(e,t){let i=t.maxValue?t.maxValue:Number.MIN_VALUE,r=t.minValue?t.minValue:Number.MAX_VALUE;for(let s=0;s<e.length;s+=1)void 0!==t.noDataValue&&e[s]===t.noDataValue||(e[s]>i&&(i=e[s]),e[s]<r&&(r=e[s]));return[r,i]}getColorValue(e,t,i,r=1){const s=I.scale(t.colorScale).domain(t.colorScaleValueRange);let n=null===t.useChannel?0:t.useChannel;const a=new Array(i),o=t.colorsBasedOnValues?t.colorsBasedOnValues.map((([e])=>e)):void 0,A=t.colorsBasedOnValues?t.colorsBasedOnValues.map((([,e])=>[...I(e).rgb(),Math.floor(2.55*t.alpha)])):void 0,l=t.useColorClasses?t.colorClasses.map((([e])=>[...I(e).rgb(),Math.floor(2.55*t.alpha)])):void 0,h=t.useColorClasses?t.colorClasses.map((([,e])=>e)):void 0,c=t.useColorClasses?t.colorClasses.map((([,,e],i)=>void 0!==e?e:i===t.colorClasses.length-1?[!0,!0]:[!0,!1])):void 0;for(let g=0;g<i;g+=4){let i=t.nullColor;if(void 0===t.noDataValue||e[n]!==t.noDataValue)if(null!=t.clipLow&&e[n]<=t.clipLow||null!=t.clipHigh&&e[n]>=t.clipHigh)i=t.clippedColor;else{if(t.useHeatMap&&(i=[...s(e[n]).rgb(),Math.floor(2.55*t.alpha)]),t.useColorsBasedOnValues){const r=o.indexOf(e[n]);i=r>-1?A[r]:t.unidentifiedColor}if(t.useColorClasses){const r=this.findClassIndex(e[n],h,c);i=r>-1?l[r]:t.unidentifiedColor}t.useSingleColor&&(i=t.color),t.useDataForOpacity&&(i[3]=this.scale(e[n],t.colorScaleValueRange[0],t.colorScaleValueRange.slice(-1)[0],0,255))}else Number.isNaN(e[n])&&(i=[0,0,0,0]);[a[g],a[g+1],a[g+2],a[g+3]]=i,n+=r}return a}findClassIndex(e,t,i){for(let r=0;r<t.length;r+=1){const[s,n]=t[r],[a,o]=i[r];if((a?e>=s:e>s)&&(o?e<=n:e<n))return r}return-1}getDefaultColor(e,t){const i=new Array(e);for(let r=0;r<e;r+=4)[i[r],i[r+1],i[r+2],i[r+3]]=t;return i}getColorFromChromaType(e){return Array.isArray(e)&&4===e.length?e:[...I(e).rgb(),255]}hasPixelsNoData(e,t){return void 0!==t&&e.every((e=>e===t))}}function NA(e,t,i){const r=new SA(t+1).createTile(i),{vertices:s,triangles:n}=r.getMesh(e);return{vertices:s,triangles:n}}const OA=40075e3,PA=20037500;class zA{constructor(e){this.zoomRange=[0,0],this.lowestOriginTileOffset=[0,0],this.lowestOriginTileSize=0,this.loaded=!1,this.geo=new LA,this.lzw=new Ea,this.options=e}initializeCog(e){return T(this,void 0,void 0,(function*(){Wi.fetch=(e,t)=>T(this,void 0,void 0,(function*(){return yield fetch(e,t)}));const t=new Wi(e);return this.cog=yield Vi.create(t),this.cog.images.forEach((e=>{e.loadGeoTiffTags()})),this.tileSize=this.getTileSize(this.cog),this.lowestOriginTileOffset=this.getImageTileIndex(this.cog.images[this.cog.images.length-1]),this.zoomRange=this.getZoomRange(this.cog),this.cog}))}getTileSize(e){return e.images[e.images.length-1].tileSize.width}getZoomRange(e){const t=e.images[e.images.length-1],i=this.getZoomLevelFromResolution(e.images[e.images.length-1].tileSize.width,t.resolution[0]);return[i,i+(e.images.length-1)]}getBoundsAsLatLon(e){const{bbox:t}=e.images[e.images.length-1],i=Math.min(t[0],t[2]),r=Math.max(t[0],t[2]),s=Math.min(t[1],t[3]),n=Math.max(t[1],t[3]),a=this.getLatLon([i,s]),o=this.getLatLon([r,n]);return[a[0],a[1],o[0],o[1]]}getOriginAsLatLon(e){const{origin:t}=e.images[e.images.length-1];return this.getLatLon(t)}getImageTileIndex(e){const t=PA+e.origin[0],i=-(PA+(e.origin[1]-OA)),r=e.tileSize.width*this.getResolutionFromZoomLevel(e.tileSize.width,this.getZoomLevelFromResolution(e.tileSize.width,e.resolution[0]));return[Math.round(t/r),Math.round(i/r),this.getZoomLevelFromResolution(e.tileSize.width,e.resolution[0])]}getResolutionFromZoomLevel(e,t){return OA/e/Math.pow(2,t)}getZoomLevelFromResolution(e,t){return Math.round(Math.log2(OA/(t*e)))}getLatLon(e){const t=function(e){const[t,i]=e,r=t/512*(2*da)-da,s=2*(Math.atan(Math.exp(i/512*(2*da)-da))-fa);return[r*pa,s*pa]}([12776044915782906e-21*(PA+e[0]),12776044915782906e-21*-(PA+(e[1]-OA))]);return[t[0],-t[1]]}getTile(e,t,i,r){return T(this,void 0,void 0,(function*(){const s=this.getResolutionFromZoomLevel(this.tileSize,i),n=this.cog.getImageByResolution(s);let a=[0,0];if(i===this.zoomRange[0])a=this.lowestOriginTileOffset;else{const e=Math.pow(2,i-this.zoomRange[0]);a[0]=Math.floor(this.lowestOriginTileOffset[0]*e),a[1]=Math.floor(this.lowestOriginTileOffset[1]*e)}const o=n.tileCount.x,A=n.tileCount.y,l=a[0],h=a[1];let c,g;this.options.numOfChannels=Number(n.tags.get(277).value),this.options.noDataValue=this.getNoDataValue(n.tags),this.options.format||(this.options.format=this.getFormat(n.tags.get(339).value,n.tags.get(258).value));let u=n.tags.get(258).value;if(Array.isArray(u))if("terrain"===this.options.type){let e=0;u.forEach((t=>{e+=t})),u=e}else[u]=u;if(e-l>=0&&t-h>=0&&e-l<o&&t-h<A){const i=yield n.getTile(e-l,t-h);switch(n.compression){case"image/jpeg":g=ua.decode(i.bytes,{useTArray:!0});break;case"application/deflate":g=yield aa(i.bytes);break;case"application/lzw":g=this.lzw.decodeBlock(i.bytes.buffer);break;default:console.warn(`Unexpected compression method: ${n.compression}`)}let s;switch(this.options.format){case"uint8":s=new Uint8Array(g.buffer);break;case"uint16":s=new Uint16Array(g.buffer);break;case"uint32":s=new Uint32Array(g.buffer);break;case"int8":s=new Int8Array(g.buffer);break;case"int16":s=new Int16Array(g.buffer);break;case"int32":s=new Int32Array(g.buffer);break;case"float32":s=new Float32Array(g.buffer);break;case"float64":s=new Float64Array(g.buffer);break;default:s=null}return c=yield this.geo.getMap({rasters:[s],width:this.tileSize,height:this.tileSize,bounds:r},this.options),c}return null}))}getFormat(e,t){let i,r=e,s=t;switch(Array.isArray(e)&&([r]=e),Array.isArray(t)&&([s]=t),r){case 1:switch(s){case 8:i="uint8";break;case 16:i="uint16";break;case 32:i="uint32";break;default:i=null}break;case 2:switch(s){case 8:i="int8";break;case 16:i="int16";break;case 32:i="int32";break;default:i=null}break;case 3:switch(s){case 32:i="float32";break;case 64:i="float64";break;default:i=null}break;default:throw new Error("Unknown data format.")}return i}getNoDataValue(e){if(e.has(42113)){const t=e.get(42113).value;if("string"==typeof t||t instanceof String){const e=t.replace(/[\0\s]/g,"");return Number(e)}return Number.isNaN(Number(t))?void 0:Number(t)}}testCog(){return T(this,void 0,void 0,(function*(){this.options={type:"image",multiplier:1,useChannel:1,alpha:180,clipLow:1,clipHigh:Number.MAX_VALUE};const e=yield this.initializeCog("https://gisat-gis.eu-central-1.linodeobjects.com/eman/versions/v2/Quadrants/Q3_Bolivia_ASTER_2002_RGB_COG_LZW.tif"),t=e.images[Math.floor(e.images.length/2)];console.log(t);const i=this.getImageTileIndex(t);console.log(i);const r=Math.floor(t.tileCount.x/2),s=Math.floor(t.tileCount.y/2);console.log(e.getTile(r,s,Math.floor(e.images.length/2)));const n=r+i[0],a=s+i[1],o=i[2],A=yield this.getTile(n,a,o);!1===A?console.log("couldn't retrieve tile"):console.log(A)}))}}class qA extends o{constructor(e,t,i){super({}),this.id="",this.id=e,this.cogTiles=new zA(i),this.blurredTexture=i.blurredTexture,this.url=t}initializeState(){this.state={initialized:!1},this.init(this.url)}init(e){return T(this,void 0,void 0,(function*(){const t=yield this.cogTiles.initializeCog(e);this.setState({initialized:!0}),this.tileSize=this.cogTiles.getTileSize(t);const i=this.cogTiles.getZoomRange(t);[this.minZoom,this.maxZoom]=i}))}renderLayers(){if(this.cogTiles.cog){const e=new d({id:`${this.id}-${String(performance.now())}`,getTileData:e=>this.cogTiles.getTile(e.index.x,e.index.y,e.index.z),minZoom:this.minZoom,maxZoom:this.maxZoom,tileSize:this.tileSize,maxRequests:6,extent:this.cogTiles.cog?this.cogTiles.getBoundsAsLatLon(this.cogTiles.cog):null,renderSubLayers:e=>{var t,i,r,s,n,a,o;const{bbox:{west:A,south:l,east:h,north:c}}=e.tile;return new f(e,Object.assign({data:null,image:e.data,bounds:[A,l,h,c],opacity:1,textureParameters:{[p.TEXTURE_MIN_FILTER]:this.blurredTexture?p.LINEAR:p.NEAREST},extensions:(null===(i=null===(t=this.cogTiles)||void 0===t?void 0:t.options)||void 0===i?void 0:i.clampToTerrain)?[new Ai]:[]},(null===(n=null===(s=null===(r=this.cogTiles)||void 0===r?void 0:r.options)||void 0===s?void 0:s.clampToTerrain)||void 0===n?void 0:n.terrainDrawMode)?{terrainDrawMode:null===(o=null===(a=this.cogTiles)||void 0===a?void 0:a.options)||void 0===o?void 0:o.clampToTerrain.terrainDrawMode}:{}))}});return e}return null}}qA.layerName="CogBitmapLayer",qA.displayName="CogBitmapLayer";const KA=Math.PI/180,HA=new Float32Array(16),VA=new Float32Array(12);function JA(e,t,i){const r=t[0]*KA,s=t[1]*KA,n=t[2]*KA,a=Math.sin(n),o=Math.sin(r),A=Math.sin(s),l=Math.cos(n),h=Math.cos(r),c=Math.cos(s),g=i[0],u=i[1],d=i[2];e[0]=g*c*h,e[1]=g*A*h,e[2]=g*-o,e[3]=u*(-A*l+c*o*a),e[4]=u*(c*l+A*o*a),e[5]=u*h*a,e[6]=d*(A*a+c*o*l),e[7]=d*(-c*a+A*o*l),e[8]=d*h*l}function YA(e){return e[0]=e[0],e[1]=e[1],e[2]=e[2],e[3]=e[4],e[4]=e[5],e[5]=e[6],e[6]=e[8],e[7]=e[9],e[8]=e[10],e[9]=e[12],e[10]=e[13],e[11]=e[14],e.subarray(0,12)}const jA={size:12,accessor:["getOrientation","getScale","getTranslation","getTransformMatrix"],shaderAttributes:{instanceModelMatrixCol0:{size:3,elementOffset:0},instanceModelMatrixCol1:{size:3,elementOffset:3},instanceModelMatrixCol2:{size:3,elementOffset:6},instanceTranslation:{size:3,elementOffset:9}},update(e,{startRow:t,endRow:i}){const{data:r,getOrientation:s,getScale:n,getTranslation:a,getTransformMatrix:o}=this.props,l=Array.isArray(o),h=l&&16===o.length,c=Array.isArray(n),g=Array.isArray(s),u=Array.isArray(a),d=h||!l&&Boolean(o(r[0]));e.constant=d?h:g&&c&&u;const f=e.value;if(e.constant){let t;if(d)HA.set(o),t=YA(HA);else{t=VA;JA(t,s,n),t.set(a,9)}e.value=new Float32Array(t)}else{let l=t*e.size;const{iterable:p,objectInfo:I}=A(r,t,i);for(const e of p){let t;if(I.index++,d)HA.set(h?o:o(e,I)),t=YA(HA);else{t=VA;JA(t,g?s:s(e,I),c?n:n(e,I)),t.set(u?a:a(e,I),9)}f[l++]=t[0],f[l++]=t[1],f[l++]=t[2],f[l++]=t[3],f[l++]=t[4],f[l++]=t[5],f[l++]=t[6],f[l++]=t[7],f[l++]=t[8],f[l++]=t[9],f[l++]=t[10],f[l++]=t[11]}}}};function ZA(e,t){return t===l.CARTESIAN||t===l.METER_OFFSETS||t===l.DEFAULT&&!e.isGeospatial}function WA(e){const t=e.positions||e.POSITION;n.assert(t,'no "postions" or "POSITION" attribute in mesh');const i=t.value.length/t.size;let r=e.COLOR_0||e.colors;r||(r={size:3,value:new Float32Array(3*i).fill(1)});let s=e.NORMAL||e.normals;s||(s={size:3,value:new Float32Array(3*i).fill(0)});let a=e.TEXCOORD_0||e.texCoords;return a||(a={size:2,value:new Float32Array(2*i).fill(0)}),{positions:t,colors:r,normals:s,texCoords:a}}function XA(e){return e instanceof Vt?(e.attributes=WA(e.attributes),e):e.attributes?new Vt({...e,topology:"triangle-list",attributes:WA(e.attributes)}):new Vt({topology:"triangle-list",attributes:WA(e)})}const $A={mesh:{type:"object",value:null,async:!0},texture:{type:"image",value:null,async:!0},sizeScale:{type:"number",value:1,min:0},_instanced:!0,wireframe:!1,material:!0,getPosition:{type:"accessor",value:e=>e.position},getColor:{type:"accessor",value:[0,0,0,255]},getOrientation:{type:"accessor",value:[0,0,0]},getScale:{type:"accessor",value:[1,1,1]},getTranslation:{type:"accessor",value:[0,0,0]},getTransformMatrix:{type:"accessor",value:[]},textureParameters:{type:"object",ignore:!0,value:null}};class el extends h{static{this.defaultProps=$A}static{this.layerName="SimpleMeshLayer"}getShaders(){return super.getShaders({vs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-vs\nuniform float sizeScale;\nuniform bool composeModelMatrix;\nin vec3 positions;\nin vec3 normals;\nin vec3 colors;\nin vec2 texCoords;\nin vec3 instancePositions;\nin vec3 instancePositions64Low;\nin vec4 instanceColors;\nin vec3 instancePickingColors;\nin vec3 instanceModelMatrixCol0;\nin vec3 instanceModelMatrixCol1;\nin vec3 instanceModelMatrixCol2;\nin vec3 instanceTranslation;\nout vec2 vTexCoord;\nout vec3 cameraPosition;\nout vec3 normals_commonspace;\nout vec4 position_commonspace;\nout vec4 vColor;\nvoid main(void) {\ngeometry.worldPosition = instancePositions;\ngeometry.uv = texCoords;\ngeometry.pickingColor = instancePickingColors;\nvTexCoord = texCoords;\ncameraPosition = project_uCameraPosition;\nvColor = vec4(colors * instanceColors.rgb, instanceColors.a);\nmat3 instanceModelMatrix = mat3(instanceModelMatrixCol0, instanceModelMatrixCol1, instanceModelMatrixCol2);\nvec3 pos = (instanceModelMatrix * positions) * sizeScale + instanceTranslation;\nif (composeModelMatrix) {\nDECKGL_FILTER_SIZE(pos, geometry);\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\ngeometry.worldPosition += pos;\ngl_Position = project_position_to_clipspace(pos + instancePositions, instancePositions64Low, vec3(0.0), position_commonspace);\ngeometry.position = position_commonspace;\n}\nelse {\npos = project_size(pos);\nDECKGL_FILTER_SIZE(pos, geometry);\ngl_Position = project_position_to_clipspace(instancePositions, instancePositions64Low, pos, position_commonspace);\ngeometry.position = position_commonspace;\nnormals_commonspace = project_normal(instanceModelMatrix * normals);\n}\ngeometry.normal = normals_commonspace;\nDECKGL_FILTER_GL_POSITION(gl_Position, geometry);\nDECKGL_FILTER_COLOR(vColor, geometry);\n}\n",fs:"#version 300 es\n#define SHADER_NAME simple-mesh-layer-fs\nprecision highp float;\nuniform bool hasTexture;\nuniform sampler2D sampler;\nuniform bool flatShading;\nuniform float opacity;\nin vec2 vTexCoord;\nin vec3 cameraPosition;\nin vec3 normals_commonspace;\nin vec4 position_commonspace;\nin vec4 vColor;\nout vec4 fragColor;\nvoid main(void) {\ngeometry.uv = vTexCoord;\nvec3 normal;\nif (flatShading) {\nnormal = normalize(cross(dFdx(position_commonspace.xyz), dFdy(position_commonspace.xyz)));\n} else {\nnormal = normals_commonspace;\n}\nvec4 color = hasTexture ? texture(sampler, vTexCoord) : vColor;\nDECKGL_FILTER_COLOR(color, geometry);\nvec3 lightColor = lighting_getLightColor(color.rgb, cameraPosition, position_commonspace.xyz, normal);\nfragColor = vec4(lightColor, color.a * opacity);\n}\n",modules:[c,g,u]})}getBounds(){if(this.props._instanced)return super.getBounds();let e=this.state.positionBounds;if(e)return e;const{mesh:t}=this.props;if(!t)return null;if(e=t.header?.boundingBox,!e){const{attributes:i}=XA(t);i.POSITION=i.POSITION||i.positions,e=UA(i)}return this.state.positionBounds=e,e}initializeState(){this.getAttributeManager().addInstanced({instancePositions:{transition:!0,type:"float64",fp64:this.use64bitPositions(),size:3,accessor:"getPosition"},instanceColors:{type:"unorm8",transition:!0,size:this.props.colorFormat.length,accessor:"getColor",defaultValue:[0,0,0,255]},instanceModelMatrix:jA}),this.setState({emptyTexture:this.context.device.createTexture({data:new Uint8Array(4),width:1,height:1})})}updateState(e){super.updateState(e);const{props:t,oldProps:i,changeFlags:r}=e;if(t.mesh!==i.mesh||r.extensionsChanged){if(this.state.positionBounds=null,this.state.model?.destroy(),t.mesh){this.state.model=this.getModel(t.mesh);const e=t.mesh.attributes||t.mesh;this.setState({hasNormals:Boolean(e.NORMAL||e.normals)})}this.getAttributeManager().invalidateAll()}t.texture!==i.texture&&t.texture instanceof S&&this.setTexture(t.texture),this.state.model&&this.state.model.setTopology(this.props.wireframe?"line-strip":"triangle-list")}finalizeState(e){super.finalizeState(e),this.state.emptyTexture.delete()}draw({uniforms:e}){const{model:t}=this.state;if(!t)return;const{viewport:i,renderPass:r}=this.context,{sizeScale:s,coordinateSystem:n,_instanced:a}=this.props;t.setUniforms(e),t.setUniforms({sizeScale:s,composeModelMatrix:!a||ZA(i,n),flatShading:!this.state.hasNormals}),t.draw(r)}get isLoaded(){return Boolean(this.state?.model&&super.isLoaded)}getModel(e){const t=new qt(this.context.device,{...this.getShaders(),id:this.props.id,bufferLayout:this.getAttributeManager().getBufferLayouts(),geometry:XA(e),isInstanced:!0}),{texture:i}=this.props,{emptyTexture:r}=this.state;return t.setBindings({sampler:i||r}),t.setUniforms({hasTexture:Boolean(i)}),t}setTexture(e){const{emptyTexture:t,model:i}=this.state;i&&(i.setBindings({sampler:e||t}),i.setUniforms({hasTexture:Boolean(e)}))}}const tl={type:"object",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e)),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;const i=e.length;if(i!==t.length)return!1;for(let r=0;r<i;r++)if(e[r]!==t[r])return!1;return!0}},il=[1],rl=Object.assign(Object.assign({},d.defaultProps),{elevationData:tl,texture:Object.assign(Object.assign({},tl),{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0});class sl extends o{constructor(e,t){super(e),console.log("xxx_terrainOptions",t),this.terrainCogTiles=new zA(t)}initializeState(e){const t=Object.create(null,{initializeState:{get:()=>super.initializeState}});return T(this,void 0,void 0,(function*(){t.initializeState.call(this,e),this.setState({initialized:!1}),yield this.init(this.terrainUrl)}))}init(e){return T(this,void 0,void 0,(function*(){console.log("xxx_LAYER INITIALIZE STATE");const e=yield this.terrainCogTiles.initializeCog(this.props.elevationData);console.log("xxx_LAYER INITIALIZE STATE",e);const t=this.terrainCogTiles.getZoomRange(e);console.log("xxx_LAYER INITIALIZE STATE",t),[this.minZoom,this.maxZoom]=t,this.setState({initialized:!0})}))}updateState({props:e,oldProps:t}){const i=e.elevationData!==t.elevationData;if(i){const{elevationData:t}=e,i=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"))||this.props.isTiled;this.setState({isTiled:i})}const r=i||e.meshMaxError!==t.meshMaxError||e.elevationDecoder!==t.elevationDecoder||e.bounds!==t.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&n.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:i,meshMaxError:r,signal:s}){if(!e)return null;let n=this.getLoadOptions();n=Object.assign(Object.assign({},n),{_workerType:"test",terrain:Object.assign(Object.assign({skirtHeight:this.state.isTiled?2*r:0},null==n?void 0:n.terrain),{bounds:t,meshMaxError:r,elevationDecoder:i})});const{fetch:a}=this.props;return console.log("xxx_loaddata"),a(e,{propName:"elevationData",layer:this,loadOptions:n,signal:s})}getTiledTerrainData(e){return T(this,void 0,void 0,(function*(){this.props;const{viewport:t}=this.context;let i=[0,0],r=[0,0];if(t.isGeospatial){const s=e.bbox;console.log("xxx_coords",s.west,s.south,s.east,s.north),i=t.projectFlat([s.west,s.south]),r=t.projectFlat([s.east,s.north])}else{const t=e.bbox;i=[t.left,t.bottom],r=[t.right,t.top]}const s=[i[0],i[1],r[0],r[1]],n=yield this.terrainCogTiles.getTile(e.index.x,e.index.y,e.index.z,s);return console.log("xxx_TILE",n,s),Promise.all([n])}))}renderSubLayers(e){const t=this.getSubLayerClass("mesh",el),{color:i,wireframe:r,material:s}=this.props,{data:n}=e;if(!n)return null;const[a]=n;return new t(Object.assign(Object.assign({},e),{tileSize:256}),{data:il,mesh:a,_instanced:!1,coordinateSystem:l.CARTESIAN,getPosition:e=>[0,0,0],getColor:i,wireframe:r,material:s})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,i=e.map((e=>e.content)).filter((e=>e&&e[0])).map((e=>{var t,i;const r=null===(i=null===(t=e[0])||void 0===t?void 0:t.header)||void 0===i?void 0:i.boundingBox;return null==r?void 0:r.map((e=>e[2]))}));if(0===i.length)return;const r=Math.min(...i.map((e=>e[0]))),s=Math.max(...i.map((e=>e[1])));console.log("xxx_ranges",i),(!t||r<t[0]||s>t[1])&&this.setState({zRange:[Number.isFinite(r)?r:0,Number.isFinite(s)?s:0]})}renderLayers(){const{color:e,material:t,elevationData:i,texture:r,wireframe:s,meshMaxError:n,elevationDecoder:a,tileSize:o,maxZoom:A,minZoom:l,extent:h,maxRequests:c,onTileLoad:g,onTileUnload:u,onTileError:f,maxCacheSize:p,maxCacheByteSize:I,refinementStrategy:m}=this.props;if(console.log("xxx_renderLayers",this.state.initialized),this.state.isTiled&&this.state.initialized)return new d(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:(_=i,Array.isArray(_)?_.join(";"):_||""),meshMaxError:n,elevationDecoder:a}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:o,maxZoom:A,minZoom:l,extent:h,maxRequests:c,onTileLoad:g,onTileUnload:u,onTileError:f,maxCacheSize:p,maxCacheByteSize:I,refinementStrategy:m});var _}}sl.defaultProps=rl,sl.layerName="TerrainLayer";var nl={CogBitmapLayer:qA,CogTerrainLayer:sl,cogtiles:zA,GeoImage:LA};var al=Object.freeze({__proto__:null,default:class extends EA{decodeBlock(e){return e}}});const ol=257;function Al(e,t){for(let i=t.length-1;i>=0;i--)e.push(t[i]);return e}function ll(e){const t=new Uint16Array(4093),i=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,i[e]=e;let r=258,s=9,n=0;function a(){r=258,s=9}function o(e){const t=function(e,t,i){const r=t%8,s=Math.floor(t/8),n=8-r,a=t+i-8*(s+1);let o=8*(s+2)-(t+i);const A=8*(s+2)-t;if(o=Math.max(0,o),s>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),ol;let l=e[s]&2**(8-r)-1;l<<=i-n;let h=l;if(s+1<e.length){let t=e[s+1]>>>o;t<<=Math.max(0,i-A),h+=t}if(a>8&&s+2<e.length){const r=8*(s+3)-(t+i);h+=e[s+2]>>>r}return h}(e,n,s);return n+=s,t}function A(e,s){return i[r]=s,t[r]=e,r++,r-1}function l(e){const r=[];for(let s=e;4096!==s;s=t[s])r.push(i[s]);return r}const h=[];a();const c=new Uint8Array(e);let g,u=o(c);for(;u!==ol;){if(256===u){for(a(),u=o(c);256===u;)u=o(c);if(u===ol)break;if(u>256)throw new Error(`corrupted code at scanline ${u}`);Al(h,l(u)),g=u}else if(u<r){const e=l(u);Al(h,e),A(g,e[e.length-1]),g=u}else{const e=l(g);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${g} / ${r}, position: ${n}`);Al(h,e),h.push(e[e.length-1]),A(g,e[e.length-1]),g=u}r+1>=2**s&&(12===s?g=void 0:s++),u=o(c)}return new Uint8Array(h)}var hl=Object.freeze({__proto__:null,default:class extends EA{decodeBlock(e){return ll(e).buffer}}});const cl=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),gl=4017,ul=799,dl=3406,fl=2276,pl=1567,Il=3784,ml=5793,_l=2896;function wl(e,t){let i=0;const r=[];let s=16;for(;s>0&&!e[s-1];)--s;r.push({children:[],index:0});let n,a=r[0];for(let o=0;o<s;o++){for(let s=0;s<e[o];s++){for(a=r.pop(),a.children[a.index]=t[i];a.index>0;)a=r.pop();for(a.index++,r.push(a);r.length<=o;)r.push(n={children:[],index:0}),a.children[a.index]=n.children,a=n;i++}o+1<s&&(r.push(n={children:[],index:0}),a.children[a.index]=n.children,a=n)}return r[0].children}function Cl(e,t,i,r,s,n,a,o,A){const{mcusPerLine:l,progressive:h}=i,c=t;let g=t,u=0,d=0;function f(){if(d>0)return d--,u>>d&1;if(u=e[g++],255===u){const t=e[g++];if(t)throw new Error(`unexpected marker: ${(u<<8|t).toString(16)}`)}return d=7,u>>>7}function p(e){let t,i=e;for(;null!==(t=f());){if(i=i[t],"number"==typeof i)return i;if("object"!=typeof i)throw new Error("invalid huffman sequence")}return null}function I(e){let t=e,i=0;for(;t>0;){const e=f();if(null===e)return;i=i<<1|e,--t}return i}function m(e){const t=I(e);return t>=1<<e-1?t:t+(-1<<e)+1}let _=0;let w,C=0;function B(e,t,i,r,s){const n=i%l,a=(i/l|0)*e.v+r,o=n*e.h+s;t(e,e.blocks[a][o])}function E(e,t,i){const r=i/e.blocksPerLine|0,s=i%e.blocksPerLine;t(e,e.blocks[r][s])}const y=r.length;let Q,b,k,x,v,D;D=h?0===n?0===o?function(e,t){const i=p(e.huffmanTableDC),r=0===i?0:m(i)<<A;e.pred+=r,t[0]=e.pred}:function(e,t){t[0]|=f()<<A}:0===o?function(e,t){if(_>0)return void _--;let i=n;const r=a;for(;i<=r;){const r=p(e.huffmanTableAC),s=15&r,n=r>>4;if(0===s){if(n<15){_=I(n)+(1<<n)-1;break}i+=16}else i+=n,t[cl[i]]=m(s)*(1<<A),i++}}:function(e,t){let i=n;const r=a;let s=0;for(;i<=r;){const r=cl[i],n=t[r]<0?-1:1;switch(C){case 0:{const t=p(e.huffmanTableAC),i=15&t;if(s=t>>4,0===i)s<15?(_=I(s)+(1<<s),C=4):(s=16,C=1);else{if(1!==i)throw new Error("invalid ACn encoding");w=m(i),C=s?2:3}continue}case 1:case 2:t[r]?t[r]+=(f()<<A)*n:(s--,0===s&&(C=2===C?3:0));break;case 3:t[r]?t[r]+=(f()<<A)*n:(t[r]=w<<A,C=0);break;case 4:t[r]&&(t[r]+=(f()<<A)*n)}i++}4===C&&(_--,0===_&&(C=0))}:function(e,t){const i=p(e.huffmanTableDC),r=0===i?0:m(i);e.pred+=r,t[0]=e.pred;let s=1;for(;s<64;){const i=p(e.huffmanTableAC),r=15&i,n=i>>4;if(0===r){if(n<15)break;s+=16}else s+=n,t[cl[s]]=m(r),s++}};let S,M,U=0;M=1===y?r[0].blocksPerLine*r[0].blocksPerColumn:l*i.mcusPerColumn;const G=s||M;for(;U<M;){for(b=0;b<y;b++)r[b].pred=0;if(_=0,1===y)for(Q=r[0],v=0;v<G;v++)E(Q,D,U),U++;else for(v=0;v<G;v++){for(b=0;b<y;b++){Q=r[b];const{h:e,v:t}=Q;for(k=0;k<t;k++)for(x=0;x<e;x++)B(Q,D,U,k,x)}if(U++,U===M)break}if(d=0,S=e[g]<<8|e[g+1],S<65280)throw new Error("marker was not found");if(!(S>=65488&&S<=65495))break;g+=2}return g-c}function Bl(e,t){const i=[],{blocksPerLine:r,blocksPerColumn:s}=t,n=r<<3,a=new Int32Array(64),o=new Uint8Array(64);function A(e,i,r){const s=t.quantizationTable;let n,a,o,A,l,h,c,g,u;const d=r;let f;for(f=0;f<64;f++)d[f]=e[f]*s[f];for(f=0;f<8;++f){const e=8*f;0!==d[1+e]||0!==d[2+e]||0!==d[3+e]||0!==d[4+e]||0!==d[5+e]||0!==d[6+e]||0!==d[7+e]?(n=ml*d[0+e]+128>>8,a=ml*d[4+e]+128>>8,o=d[2+e],A=d[6+e],l=_l*(d[1+e]-d[7+e])+128>>8,g=_l*(d[1+e]+d[7+e])+128>>8,h=d[3+e]<<4,c=d[5+e]<<4,u=n-a+1>>1,n=n+a+1>>1,a=u,u=o*Il+A*pl+128>>8,o=o*pl-A*Il+128>>8,A=u,u=l-c+1>>1,l=l+c+1>>1,c=u,u=g+h+1>>1,h=g-h+1>>1,g=u,u=n-A+1>>1,n=n+A+1>>1,A=u,u=a-o+1>>1,a=a+o+1>>1,o=u,u=l*fl+g*dl+2048>>12,l=l*dl-g*fl+2048>>12,g=u,u=h*ul+c*gl+2048>>12,h=h*gl-c*ul+2048>>12,c=u,d[0+e]=n+g,d[7+e]=n-g,d[1+e]=a+c,d[6+e]=a-c,d[2+e]=o+h,d[5+e]=o-h,d[3+e]=A+l,d[4+e]=A-l):(u=ml*d[0+e]+512>>10,d[0+e]=u,d[1+e]=u,d[2+e]=u,d[3+e]=u,d[4+e]=u,d[5+e]=u,d[6+e]=u,d[7+e]=u)}for(f=0;f<8;++f){const e=f;0!==d[8+e]||0!==d[16+e]||0!==d[24+e]||0!==d[32+e]||0!==d[40+e]||0!==d[48+e]||0!==d[56+e]?(n=ml*d[0+e]+2048>>12,a=ml*d[32+e]+2048>>12,o=d[16+e],A=d[48+e],l=_l*(d[8+e]-d[56+e])+2048>>12,g=_l*(d[8+e]+d[56+e])+2048>>12,h=d[24+e],c=d[40+e],u=n-a+1>>1,n=n+a+1>>1,a=u,u=o*Il+A*pl+2048>>12,o=o*pl-A*Il+2048>>12,A=u,u=l-c+1>>1,l=l+c+1>>1,c=u,u=g+h+1>>1,h=g-h+1>>1,g=u,u=n-A+1>>1,n=n+A+1>>1,A=u,u=a-o+1>>1,a=a+o+1>>1,o=u,u=l*fl+g*dl+2048>>12,l=l*dl-g*fl+2048>>12,g=u,u=h*ul+c*gl+2048>>12,h=h*gl-c*ul+2048>>12,c=u,d[0+e]=n+g,d[56+e]=n-g,d[8+e]=a+c,d[48+e]=a-c,d[16+e]=o+h,d[40+e]=o-h,d[24+e]=A+l,d[32+e]=A-l):(u=ml*r[f+0]+8192>>14,d[0+e]=u,d[8+e]=u,d[16+e]=u,d[24+e]=u,d[32+e]=u,d[40+e]=u,d[48+e]=u,d[56+e]=u)}for(f=0;f<64;++f){const e=128+(d[f]+8>>4);i[f]=e<0?0:e>255?255:e}}for(let e=0;e<s;e++){const s=e<<3;for(let e=0;e<8;e++)i.push(new Uint8Array(n));for(let n=0;n<r;n++){A(t.blocks[e][n],o,a);let r=0;const l=n<<3;for(let e=0;e<8;e++){const t=i[s+e];for(let e=0;e<8;e++)t[l+e]=o[r++]}}}return i}class El{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function i(){const i=e[t]<<8|e[t+1];return t+=2,i}function r(){const r=i(),s=e.subarray(t,t+r-2);return t+=s.length,s}function s(e){let t,i,r=0,s=0;for(i in e.components)e.components.hasOwnProperty(i)&&(t=e.components[i],r<t.h&&(r=t.h),s<t.v&&(s=t.v));const n=Math.ceil(e.samplesPerLine/8/r),a=Math.ceil(e.scanLines/8/s);for(i in e.components)if(e.components.hasOwnProperty(i)){t=e.components[i];const o=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/r),A=Math.ceil(Math.ceil(e.scanLines/8)*t.v/s),l=n*t.h,h=a*t.v,c=[];for(let e=0;e<h;e++){const e=[];for(let t=0;t<l;t++)e.push(new Int32Array(64));c.push(e)}t.blocksPerLine=o,t.blocksPerColumn=A,t.blocks=c}e.maxH=r,e.maxV=s,e.mcusPerLine=n,e.mcusPerColumn=a}let n=i();if(65496!==n)throw new Error("SOI not found");for(n=i();65497!==n;){switch(n){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=r();65504===n&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===n&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const r=i()+t-2;for(;t<r;){const r=e[t++],s=new Int32Array(64);if(r>>4==0)for(let i=0;i<64;i++){s[cl[i]]=e[t++]}else{if(r>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){s[cl[e]]=i()}}this.quantizationTables[15&r]=s}break}case 65472:case 65473:case 65474:{i();const r={extended:65473===n,progressive:65474===n,precision:e[t++],scanLines:i(),samplesPerLine:i(),components:{},componentsOrder:[]},a=e[t++];let o;for(let i=0;i<a;i++){o=e[t];const i=e[t+1]>>4,s=15&e[t+1],n=e[t+2];r.componentsOrder.push(o),r.components[o]={h:i,v:s,quantizationIdx:n},t+=3}s(r),this.frames.push(r);break}case 65476:{const r=i();for(let i=2;i<r;){const r=e[t++],s=new Uint8Array(16);let n=0;for(let i=0;i<16;i++,t++)s[i]=e[t],n+=s[i];const a=new Uint8Array(n);for(let i=0;i<n;i++,t++)a[i]=e[t];i+=17+n,r>>4==0?this.huffmanTablesDC[15&r]=wl(s,a):this.huffmanTablesAC[15&r]=wl(s,a)}break}case 65501:i(),this.resetInterval=i();break;case 65498:{i();const r=e[t++],s=[],n=this.frames[0];for(let i=0;i<r;i++){const i=n.components[e[t++]],r=e[t++];i.huffmanTableDC=this.huffmanTablesDC[r>>4],i.huffmanTableAC=this.huffmanTablesAC[15&r],s.push(i)}const a=e[t++],o=e[t++],A=e[t++],l=Cl(e,t,n,s,this.resetInterval,a,o,A>>4,15&A);t+=l;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(`unknown JPEG marker ${n.toString(16)}`)}n=i()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:i,componentsOrder:r}=t,s=[],n=t.samplesPerLine,a=t.scanLines;for(let e=0;e<r.length;e++){const n=i[r[e]];s.push({lines:Bl(0,n),scaleX:n.h/t.maxH,scaleY:n.v/t.maxV})}const o=new Uint8Array(n*a*s.length);let A=0;for(let e=0;e<a;++e)for(let t=0;t<n;++t)for(let i=0;i<s.length;++i){const r=s[i];o[A]=r.lines[0|e*r.scaleY][0|t*r.scaleX],++A}return o}}var yl=Object.freeze({__proto__:null,default:class extends EA{constructor(e){super(),this.reader=new El,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}});
|
|
3
|
-
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function Ql(e){let t=e.length;for(;--t>=0;)e[t]=0}const bl=256,kl=286,xl=30,vl=15,Dl=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),Sl=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Ml=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),Ul=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),Gl=new Array(576);Ql(Gl);const Tl=new Array(60);Ql(Tl);const Fl=new Array(512);Ql(Fl);const Rl=new Array(256);Ql(Rl);const Ll=new Array(29);Ql(Ll);const Nl=new Array(xl);function Ol(e,t,i,r,s){this.static_tree=e,this.extra_bits=t,this.extra_base=i,this.elems=r,this.max_length=s,this.has_stree=e&&e.length}let Pl,zl,ql;function Kl(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}Ql(Nl);const Hl=e=>e<256?Fl[e]:Fl[256+(e>>>7)],Vl=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Jl=(e,t,i)=>{e.bi_valid>16-i?(e.bi_buf|=t<<e.bi_valid&65535,Vl(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=i-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=i)},Yl=(e,t,i)=>{Jl(e,i[2*t],i[2*t+1])},jl=(e,t)=>{let i=0;do{i|=1&e,e>>>=1,i<<=1}while(--t>0);return i>>>1},Zl=(e,t,i)=>{const r=new Array(16);let s,n,a=0;for(s=1;s<=vl;s++)a=a+i[s-1]<<1,r[s]=a;for(n=0;n<=t;n++){let t=e[2*n+1];0!==t&&(e[2*n]=jl(r[t]++,t))}},Wl=e=>{let t;for(t=0;t<kl;t++)e.dyn_ltree[2*t]=0;for(t=0;t<xl;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Xl=e=>{e.bi_valid>8?Vl(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},$l=(e,t,i,r)=>{const s=2*t,n=2*i;return e[s]<e[n]||e[s]===e[n]&&r[t]<=r[i]},eh=(e,t,i)=>{const r=e.heap[i];let s=i<<1;for(;s<=e.heap_len&&(s<e.heap_len&&$l(t,e.heap[s+1],e.heap[s],e.depth)&&s++,!$l(t,r,e.heap[s],e.depth));)e.heap[i]=e.heap[s],i=s,s<<=1;e.heap[i]=r},th=(e,t,i)=>{let r,s,n,a,o=0;if(0!==e.sym_next)do{r=255&e.pending_buf[e.sym_buf+o++],r+=(255&e.pending_buf[e.sym_buf+o++])<<8,s=e.pending_buf[e.sym_buf+o++],0===r?Yl(e,s,t):(n=Rl[s],Yl(e,n+bl+1,t),a=Dl[n],0!==a&&(s-=Ll[n],Jl(e,s,a)),r--,n=Hl(r),Yl(e,n,i),a=Sl[n],0!==a&&(r-=Nl[n],Jl(e,r,a)))}while(o<e.sym_next);Yl(e,256,t)},ih=(e,t)=>{const i=t.dyn_tree,r=t.stat_desc.static_tree,s=t.stat_desc.has_stree,n=t.stat_desc.elems;let a,o,A,l=-1;for(e.heap_len=0,e.heap_max=573,a=0;a<n;a++)0!==i[2*a]?(e.heap[++e.heap_len]=l=a,e.depth[a]=0):i[2*a+1]=0;for(;e.heap_len<2;)A=e.heap[++e.heap_len]=l<2?++l:0,i[2*A]=1,e.depth[A]=0,e.opt_len--,s&&(e.static_len-=r[2*A+1]);for(t.max_code=l,a=e.heap_len>>1;a>=1;a--)eh(e,i,a);A=n;do{a=e.heap[1],e.heap[1]=e.heap[e.heap_len--],eh(e,i,1),o=e.heap[1],e.heap[--e.heap_max]=a,e.heap[--e.heap_max]=o,i[2*A]=i[2*a]+i[2*o],e.depth[A]=(e.depth[a]>=e.depth[o]?e.depth[a]:e.depth[o])+1,i[2*a+1]=i[2*o+1]=A,e.heap[1]=A++,eh(e,i,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const i=t.dyn_tree,r=t.max_code,s=t.stat_desc.static_tree,n=t.stat_desc.has_stree,a=t.stat_desc.extra_bits,o=t.stat_desc.extra_base,A=t.stat_desc.max_length;let l,h,c,g,u,d,f=0;for(g=0;g<=vl;g++)e.bl_count[g]=0;for(i[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)h=e.heap[l],g=i[2*i[2*h+1]+1]+1,g>A&&(g=A,f++),i[2*h+1]=g,h>r||(e.bl_count[g]++,u=0,h>=o&&(u=a[h-o]),d=i[2*h],e.opt_len+=d*(g+u),n&&(e.static_len+=d*(s[2*h+1]+u)));if(0!==f){do{for(g=A-1;0===e.bl_count[g];)g--;e.bl_count[g]--,e.bl_count[g+1]+=2,e.bl_count[A]--,f-=2}while(f>0);for(g=A;0!==g;g--)for(h=e.bl_count[g];0!==h;)c=e.heap[--l],c>r||(i[2*c+1]!==g&&(e.opt_len+=(g-i[2*c+1])*i[2*c],i[2*c+1]=g),h--)}})(e,t),Zl(i,l,e.bl_count)},rh=(e,t,i)=>{let r,s,n=-1,a=t[1],o=0,A=7,l=4;for(0===a&&(A=138,l=3),t[2*(i+1)+1]=65535,r=0;r<=i;r++)s=a,a=t[2*(r+1)+1],++o<A&&s===a||(o<l?e.bl_tree[2*s]+=o:0!==s?(s!==n&&e.bl_tree[2*s]++,e.bl_tree[32]++):o<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=0,n=s,0===a?(A=138,l=3):s===a?(A=6,l=3):(A=7,l=4))},sh=(e,t,i)=>{let r,s,n=-1,a=t[1],o=0,A=7,l=4;for(0===a&&(A=138,l=3),r=0;r<=i;r++)if(s=a,a=t[2*(r+1)+1],!(++o<A&&s===a)){if(o<l)do{Yl(e,s,e.bl_tree)}while(0!=--o);else 0!==s?(s!==n&&(Yl(e,s,e.bl_tree),o--),Yl(e,16,e.bl_tree),Jl(e,o-3,2)):o<=10?(Yl(e,17,e.bl_tree),Jl(e,o-3,3)):(Yl(e,18,e.bl_tree),Jl(e,o-11,7));o=0,n=s,0===a?(A=138,l=3):s===a?(A=6,l=3):(A=7,l=4)}};let nh=!1;const ah=(e,t,i,r)=>{Jl(e,0+(r?1:0),3),Xl(e),Vl(e,i),Vl(e,~i),i&&e.pending_buf.set(e.window.subarray(t,t+i),e.pending),e.pending+=i};var oh=(e,t,i,r)=>{let s,n,a=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,i=4093624447;for(t=0;t<=31;t++,i>>>=1)if(1&i&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<bl;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),ih(e,e.l_desc),ih(e,e.d_desc),a=(e=>{let t;for(rh(e,e.dyn_ltree,e.l_desc.max_code),rh(e,e.dyn_dtree,e.d_desc.max_code),ih(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Ul[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),s=e.opt_len+3+7>>>3,n=e.static_len+3+7>>>3,n<=s&&(s=n)):s=n=i+5,i+4<=s&&-1!==t?ah(e,t,i,r):4===e.strategy||n===s?(Jl(e,2+(r?1:0),3),th(e,Gl,Tl)):(Jl(e,4+(r?1:0),3),((e,t,i,r)=>{let s;for(Jl(e,t-257,5),Jl(e,i-1,5),Jl(e,r-4,4),s=0;s<r;s++)Jl(e,e.bl_tree[2*Ul[s]+1],3);sh(e,e.dyn_ltree,t-1),sh(e,e.dyn_dtree,i-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),th(e,e.dyn_ltree,e.dyn_dtree)),Wl(e),r&&Xl(e)},Ah={_tr_init:e=>{nh||((()=>{let e,t,i,r,s;const n=new Array(16);for(i=0,r=0;r<28;r++)for(Ll[r]=i,e=0;e<1<<Dl[r];e++)Rl[i++]=r;for(Rl[i-1]=r,s=0,r=0;r<16;r++)for(Nl[r]=s,e=0;e<1<<Sl[r];e++)Fl[s++]=r;for(s>>=7;r<xl;r++)for(Nl[r]=s<<7,e=0;e<1<<Sl[r]-7;e++)Fl[256+s++]=r;for(t=0;t<=vl;t++)n[t]=0;for(e=0;e<=143;)Gl[2*e+1]=8,e++,n[8]++;for(;e<=255;)Gl[2*e+1]=9,e++,n[9]++;for(;e<=279;)Gl[2*e+1]=7,e++,n[7]++;for(;e<=287;)Gl[2*e+1]=8,e++,n[8]++;for(Zl(Gl,287,n),e=0;e<xl;e++)Tl[2*e+1]=5,Tl[2*e]=jl(e,5);Pl=new Ol(Gl,Dl,257,kl,vl),zl=new Ol(Tl,Sl,0,xl,vl),ql=new Ol(new Array(0),Ml,0,19,7)})(),nh=!0),e.l_desc=new Kl(e.dyn_ltree,Pl),e.d_desc=new Kl(e.dyn_dtree,zl),e.bl_desc=new Kl(e.bl_tree,ql),e.bi_buf=0,e.bi_valid=0,Wl(e)},_tr_stored_block:ah,_tr_flush_block:oh,_tr_tally:(e,t,i)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=i,0===t?e.dyn_ltree[2*i]++:(e.matches++,t--,e.dyn_ltree[2*(Rl[i]+bl+1)]++,e.dyn_dtree[2*Hl(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Jl(e,2,3),Yl(e,256,Gl),(e=>{16===e.bi_valid?(Vl(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var lh=(e,t,i,r)=>{let s=65535&e|0,n=e>>>16&65535|0,a=0;for(;0!==i;){a=i>2e3?2e3:i,i-=a;do{s=s+t[r++]|0,n=n+s|0}while(--a);s%=65521,n%=65521}return s|n<<16|0};const hh=new Uint32Array((()=>{let e,t=[];for(var i=0;i<256;i++){e=i;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[i]=e}return t})());var ch=(e,t,i,r)=>{const s=hh,n=r+i;e^=-1;for(let i=r;i<n;i++)e=e>>>8^s[255&(e^t[i])];return-1^e},gh={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},uh={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:dh,_tr_stored_block:fh,_tr_flush_block:ph,_tr_tally:Ih,_tr_align:mh}=Ah,{Z_NO_FLUSH:_h,Z_PARTIAL_FLUSH:wh,Z_FULL_FLUSH:Ch,Z_FINISH:Bh,Z_BLOCK:Eh,Z_OK:yh,Z_STREAM_END:Qh,Z_STREAM_ERROR:bh,Z_DATA_ERROR:kh,Z_BUF_ERROR:xh,Z_DEFAULT_COMPRESSION:vh,Z_FILTERED:Dh,Z_HUFFMAN_ONLY:Sh,Z_RLE:Mh,Z_FIXED:Uh,Z_DEFAULT_STRATEGY:Gh,Z_UNKNOWN:Th,Z_DEFLATED:Fh}=uh,Rh=258,Lh=262,Nh=42,Oh=113,Ph=666,zh=(e,t)=>(e.msg=gh[t],t),qh=e=>2*e-(e>4?9:0),Kh=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Hh=e=>{let t,i,r,s=e.w_size;t=e.hash_size,r=t;do{i=e.head[--r],e.head[r]=i>=s?i-s:0}while(--t);t=s,r=t;do{i=e.prev[--r],e.prev[r]=i>=s?i-s:0}while(--t)};let Vh=(e,t,i)=>(t<<e.hash_shift^i)&e.hash_mask;const Jh=e=>{const t=e.state;let i=t.pending;i>e.avail_out&&(i=e.avail_out),0!==i&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+i),e.next_out),e.next_out+=i,t.pending_out+=i,e.total_out+=i,e.avail_out-=i,t.pending-=i,0===t.pending&&(t.pending_out=0))},Yh=(e,t)=>{ph(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Jh(e.strm)},jh=(e,t)=>{e.pending_buf[e.pending++]=t},Zh=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Wh=(e,t,i,r)=>{let s=e.avail_in;return s>r&&(s=r),0===s?0:(e.avail_in-=s,t.set(e.input.subarray(e.next_in,e.next_in+s),i),1===e.state.wrap?e.adler=lh(e.adler,t,s,i):2===e.state.wrap&&(e.adler=ch(e.adler,t,s,i)),e.next_in+=s,e.total_in+=s,s)},Xh=(e,t)=>{let i,r,s=e.max_chain_length,n=e.strstart,a=e.prev_length,o=e.nice_match;const A=e.strstart>e.w_size-Lh?e.strstart-(e.w_size-Lh):0,l=e.window,h=e.w_mask,c=e.prev,g=e.strstart+Rh;let u=l[n+a-1],d=l[n+a];e.prev_length>=e.good_match&&(s>>=2),o>e.lookahead&&(o=e.lookahead);do{if(i=t,l[i+a]===d&&l[i+a-1]===u&&l[i]===l[n]&&l[++i]===l[n+1]){n+=2,i++;do{}while(l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&l[++n]===l[++i]&&n<g);if(r=Rh-(g-n),n=g-Rh,r>a){if(e.match_start=t,a=r,r>=o)break;u=l[n+a-1],d=l[n+a]}}}while((t=c[t&h])>A&&0!=--s);return a<=e.lookahead?a:e.lookahead},$h=e=>{const t=e.w_size;let i,r,s;do{if(r=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Lh)&&(e.window.set(e.window.subarray(t,t+t-r),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Hh(e),r+=t),0===e.strm.avail_in)break;if(i=Wh(e.strm,e.window,e.strstart+e.lookahead,r),e.lookahead+=i,e.lookahead+e.insert>=3)for(s=e.strstart-e.insert,e.ins_h=e.window[s],e.ins_h=Vh(e,e.ins_h,e.window[s+1]);e.insert&&(e.ins_h=Vh(e,e.ins_h,e.window[s+3-1]),e.prev[s&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=s,s++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Lh&&0!==e.strm.avail_in)},ec=(e,t)=>{let i,r,s,n=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,a=0,o=e.strm.avail_in;do{if(i=65535,s=e.bi_valid+42>>3,e.strm.avail_out<s)break;if(s=e.strm.avail_out-s,r=e.strstart-e.block_start,i>r+e.strm.avail_in&&(i=r+e.strm.avail_in),i>s&&(i=s),i<n&&(0===i&&t!==Bh||t===_h||i!==r+e.strm.avail_in))break;a=t===Bh&&i===r+e.strm.avail_in?1:0,fh(e,0,0,a),e.pending_buf[e.pending-4]=i,e.pending_buf[e.pending-3]=i>>8,e.pending_buf[e.pending-2]=~i,e.pending_buf[e.pending-1]=~i>>8,Jh(e.strm),r&&(r>i&&(r=i),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+r),e.strm.next_out),e.strm.next_out+=r,e.strm.avail_out-=r,e.strm.total_out+=r,e.block_start+=r,i-=r),i&&(Wh(e.strm,e.strm.output,e.strm.next_out,i),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i)}while(0===a);return o-=e.strm.avail_in,o&&(o>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=o&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-o,e.strm.next_in),e.strstart),e.strstart+=o,e.insert+=o>e.w_size-e.insert?e.w_size-e.insert:o),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),a?4:t!==_h&&t!==Bh&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(s=e.window_size-e.strstart,e.strm.avail_in>s&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,s+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),s>e.strm.avail_in&&(s=e.strm.avail_in),s&&(Wh(e.strm,e.window,e.strstart,s),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.high_water<e.strstart&&(e.high_water=e.strstart),s=e.bi_valid+42>>3,s=e.pending_buf_size-s>65535?65535:e.pending_buf_size-s,n=s>e.w_size?e.w_size:s,r=e.strstart-e.block_start,(r>=n||(r||t===Bh)&&t!==_h&&0===e.strm.avail_in&&r<=s)&&(i=r>s?s:r,a=t===Bh&&0===e.strm.avail_in&&i===r?1:0,fh(e,e.block_start,i,a),e.block_start+=i,Jh(e.strm)),a?3:1)},tc=(e,t)=>{let i,r;for(;;){if(e.lookahead<Lh){if($h(e),e.lookahead<Lh&&t===_h)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Vh(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==i&&e.strstart-i<=e.w_size-Lh&&(e.match_length=Xh(e,i)),e.match_length>=3)if(r=Ih(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Vh(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Vh(e,e.ins_h,e.window[e.strstart+1]);else r=Ih(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Yh(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===Bh?(Yh(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yh(e,!1),0===e.strm.avail_out)?1:2},ic=(e,t)=>{let i,r,s;for(;;){if(e.lookahead<Lh){if($h(e),e.lookahead<Lh&&t===_h)return 1;if(0===e.lookahead)break}if(i=0,e.lookahead>=3&&(e.ins_h=Vh(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==i&&e.prev_length<e.max_lazy_match&&e.strstart-i<=e.w_size-Lh&&(e.match_length=Xh(e,i),e.match_length<=5&&(e.strategy===Dh||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){s=e.strstart+e.lookahead-3,r=Ih(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=s&&(e.ins_h=Vh(e,e.ins_h,e.window[e.strstart+3-1]),i=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Yh(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(r=Ih(e,0,e.window[e.strstart-1]),r&&Yh(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=Ih(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===Bh?(Yh(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yh(e,!1),0===e.strm.avail_out)?1:2};function rc(e,t,i,r,s){this.good_length=e,this.max_lazy=t,this.nice_length=i,this.max_chain=r,this.func=s}const sc=[new rc(0,0,0,0,ec),new rc(4,4,8,4,tc),new rc(4,5,16,8,tc),new rc(4,6,32,32,tc),new rc(4,4,16,16,ic),new rc(8,16,32,32,ic),new rc(8,16,128,128,ic),new rc(8,32,128,256,ic),new rc(32,128,258,1024,ic),new rc(32,258,258,4096,ic)];function nc(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=Fh,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Kh(this.dyn_ltree),Kh(this.dyn_dtree),Kh(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Kh(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Kh(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const ac=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==Nh&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==Oh&&t.status!==Ph?1:0},oc=e=>{if(ac(e))return zh(e,bh);e.total_in=e.total_out=0,e.data_type=Th;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?Nh:Oh,e.adler=2===t.wrap?0:1,t.last_flush=-2,dh(t),yh},Ac=e=>{const t=oc(e);var i;return t===yh&&((i=e.state).window_size=2*i.w_size,Kh(i.head),i.max_lazy_match=sc[i.level].max_lazy,i.good_match=sc[i.level].good_length,i.nice_match=sc[i.level].nice_length,i.max_chain_length=sc[i.level].max_chain,i.strstart=0,i.block_start=0,i.lookahead=0,i.insert=0,i.match_length=i.prev_length=2,i.match_available=0,i.ins_h=0),t},lc=(e,t,i,r,s,n)=>{if(!e)return bh;let a=1;if(t===vh&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),s<1||s>9||i!==Fh||r<8||r>15||t<0||t>9||n<0||n>Uh||8===r&&1!==a)return zh(e,bh);8===r&&(r=9);const o=new nc;return e.state=o,o.strm=e,o.status=Nh,o.wrap=a,o.gzhead=null,o.w_bits=r,o.w_size=1<<o.w_bits,o.w_mask=o.w_size-1,o.hash_bits=s+7,o.hash_size=1<<o.hash_bits,o.hash_mask=o.hash_size-1,o.hash_shift=~~((o.hash_bits+3-1)/3),o.window=new Uint8Array(2*o.w_size),o.head=new Uint16Array(o.hash_size),o.prev=new Uint16Array(o.w_size),o.lit_bufsize=1<<s+6,o.pending_buf_size=4*o.lit_bufsize,o.pending_buf=new Uint8Array(o.pending_buf_size),o.sym_buf=o.lit_bufsize,o.sym_end=3*(o.lit_bufsize-1),o.level=t,o.strategy=n,o.method=i,Ac(e)};var hc={deflateInit:(e,t)=>lc(e,t,Fh,15,8,Gh),deflateInit2:lc,deflateReset:Ac,deflateResetKeep:oc,deflateSetHeader:(e,t)=>ac(e)||2!==e.state.wrap?bh:(e.state.gzhead=t,yh),deflate:(e,t)=>{if(ac(e)||t>Eh||t<0)return e?zh(e,bh):bh;const i=e.state;if(!e.output||0!==e.avail_in&&!e.input||i.status===Ph&&t!==Bh)return zh(e,0===e.avail_out?xh:bh);const r=i.last_flush;if(i.last_flush=t,0!==i.pending){if(Jh(e),0===e.avail_out)return i.last_flush=-1,yh}else if(0===e.avail_in&&qh(t)<=qh(r)&&t!==Bh)return zh(e,xh);if(i.status===Ph&&0!==e.avail_in)return zh(e,xh);if(i.status===Nh&&0===i.wrap&&(i.status=Oh),i.status===Nh){let t=Fh+(i.w_bits-8<<4)<<8,r=-1;if(r=i.strategy>=Sh||i.level<2?0:i.level<6?1:6===i.level?2:3,t|=r<<6,0!==i.strstart&&(t|=32),t+=31-t%31,Zh(i,t),0!==i.strstart&&(Zh(i,e.adler>>>16),Zh(i,65535&e.adler)),e.adler=1,i.status=Oh,Jh(e),0!==i.pending)return i.last_flush=-1,yh}if(57===i.status)if(e.adler=0,jh(i,31),jh(i,139),jh(i,8),i.gzhead)jh(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),jh(i,255&i.gzhead.time),jh(i,i.gzhead.time>>8&255),jh(i,i.gzhead.time>>16&255),jh(i,i.gzhead.time>>24&255),jh(i,9===i.level?2:i.strategy>=Sh||i.level<2?4:0),jh(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(jh(i,255&i.gzhead.extra.length),jh(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=ch(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69;else if(jh(i,0),jh(i,0),jh(i,0),jh(i,0),jh(i,0),jh(i,9===i.level?2:i.strategy>=Sh||i.level<2?4:0),jh(i,3),i.status=Oh,Jh(e),0!==i.pending)return i.last_flush=-1,yh;if(69===i.status){if(i.gzhead.extra){let t=i.pending,r=(65535&i.gzhead.extra.length)-i.gzindex;for(;i.pending+r>i.pending_buf_size;){let s=i.pending_buf_size-i.pending;if(i.pending_buf.set(i.gzhead.extra.subarray(i.gzindex,i.gzindex+s),i.pending),i.pending=i.pending_buf_size,i.gzhead.hcrc&&i.pending>t&&(e.adler=ch(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex+=s,Jh(e),0!==i.pending)return i.last_flush=-1,yh;t=0,r-=s}let s=new Uint8Array(i.gzhead.extra);i.pending_buf.set(s.subarray(i.gzindex,i.gzindex+r),i.pending),i.pending+=r,i.gzhead.hcrc&&i.pending>t&&(e.adler=ch(e.adler,i.pending_buf,i.pending-t,t)),i.gzindex=0}i.status=73}if(73===i.status){if(i.gzhead.name){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=ch(e.adler,i.pending_buf,i.pending-r,r)),Jh(e),0!==i.pending)return i.last_flush=-1,yh;r=0}t=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,jh(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=ch(e.adler,i.pending_buf,i.pending-r,r)),i.gzindex=0}i.status=91}if(91===i.status){if(i.gzhead.comment){let t,r=i.pending;do{if(i.pending===i.pending_buf_size){if(i.gzhead.hcrc&&i.pending>r&&(e.adler=ch(e.adler,i.pending_buf,i.pending-r,r)),Jh(e),0!==i.pending)return i.last_flush=-1,yh;r=0}t=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,jh(i,t)}while(0!==t);i.gzhead.hcrc&&i.pending>r&&(e.adler=ch(e.adler,i.pending_buf,i.pending-r,r))}i.status=103}if(103===i.status){if(i.gzhead.hcrc){if(i.pending+2>i.pending_buf_size&&(Jh(e),0!==i.pending))return i.last_flush=-1,yh;jh(i,255&e.adler),jh(i,e.adler>>8&255),e.adler=0}if(i.status=Oh,Jh(e),0!==i.pending)return i.last_flush=-1,yh}if(0!==e.avail_in||0!==i.lookahead||t!==_h&&i.status!==Ph){let r=0===i.level?ec(i,t):i.strategy===Sh?((e,t)=>{let i;for(;;){if(0===e.lookahead&&($h(e),0===e.lookahead)){if(t===_h)return 1;break}if(e.match_length=0,i=Ih(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,i&&(Yh(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Bh?(Yh(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yh(e,!1),0===e.strm.avail_out)?1:2})(i,t):i.strategy===Mh?((e,t)=>{let i,r,s,n;const a=e.window;for(;;){if(e.lookahead<=Rh){if($h(e),e.lookahead<=Rh&&t===_h)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(s=e.strstart-1,r=a[s],r===a[++s]&&r===a[++s]&&r===a[++s])){n=e.strstart+Rh;do{}while(r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&r===a[++s]&&s<n);e.match_length=Rh-(n-s),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(i=Ih(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(i=Ih(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),i&&(Yh(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===Bh?(Yh(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Yh(e,!1),0===e.strm.avail_out)?1:2})(i,t):sc[i.level].func(i,t);if(3!==r&&4!==r||(i.status=Ph),1===r||3===r)return 0===e.avail_out&&(i.last_flush=-1),yh;if(2===r&&(t===wh?mh(i):t!==Eh&&(fh(i,0,0,!1),t===Ch&&(Kh(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),Jh(e),0===e.avail_out))return i.last_flush=-1,yh}return t!==Bh?yh:i.wrap<=0?Qh:(2===i.wrap?(jh(i,255&e.adler),jh(i,e.adler>>8&255),jh(i,e.adler>>16&255),jh(i,e.adler>>24&255),jh(i,255&e.total_in),jh(i,e.total_in>>8&255),jh(i,e.total_in>>16&255),jh(i,e.total_in>>24&255)):(Zh(i,e.adler>>>16),Zh(i,65535&e.adler)),Jh(e),i.wrap>0&&(i.wrap=-i.wrap),0!==i.pending?yh:Qh)},deflateEnd:e=>{if(ac(e))return bh;const t=e.state.status;return e.state=null,t===Oh?zh(e,kh):yh},deflateSetDictionary:(e,t)=>{let i=t.length;if(ac(e))return bh;const r=e.state,s=r.wrap;if(2===s||1===s&&r.status!==Nh||r.lookahead)return bh;if(1===s&&(e.adler=lh(e.adler,t,i,0)),r.wrap=0,i>=r.w_size){0===s&&(Kh(r.head),r.strstart=0,r.block_start=0,r.insert=0);let e=new Uint8Array(r.w_size);e.set(t.subarray(i-r.w_size,i),0),t=e,i=r.w_size}const n=e.avail_in,a=e.next_in,o=e.input;for(e.avail_in=i,e.next_in=0,e.input=t,$h(r);r.lookahead>=3;){let e=r.strstart,t=r.lookahead-2;do{r.ins_h=Vh(r,r.ins_h,r.window[e+3-1]),r.prev[e&r.w_mask]=r.head[r.ins_h],r.head[r.ins_h]=e,e++}while(--t);r.strstart=e,r.lookahead=2,$h(r)}return r.strstart+=r.lookahead,r.block_start=r.strstart,r.insert=r.lookahead,r.lookahead=0,r.match_length=r.prev_length=2,r.match_available=0,e.next_in=a,e.input=o,e.avail_in=n,r.wrap=s,yh},deflateInfo:"pako deflate (from Nodeca project)"};const cc=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var gc={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const i=t.shift();if(i){if("object"!=typeof i)throw new TypeError(i+"must be non-object");for(const t in i)cc(i,t)&&(e[t]=i[t])}}return e},flattenChunks:e=>{let t=0;for(let i=0,r=e.length;i<r;i++)t+=e[i].length;const i=new Uint8Array(t);for(let t=0,r=0,s=e.length;t<s;t++){let s=e[t];i.set(s,r),r+=s.length}return i}};let uc=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){uc=!1}const dc=new Uint8Array(256);for(let e=0;e<256;e++)dc[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;dc[254]=dc[254]=1;var fc={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,i,r,s,n,a=e.length,o=0;for(s=0;s<a;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<a&&(r=e.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),o+=i<128?1:i<2048?2:i<65536?3:4;for(t=new Uint8Array(o),n=0,s=0;n<o;s++)i=e.charCodeAt(s),55296==(64512&i)&&s+1<a&&(r=e.charCodeAt(s+1),56320==(64512&r)&&(i=65536+(i-55296<<10)+(r-56320),s++)),i<128?t[n++]=i:i<2048?(t[n++]=192|i>>>6,t[n++]=128|63&i):i<65536?(t[n++]=224|i>>>12,t[n++]=128|i>>>6&63,t[n++]=128|63&i):(t[n++]=240|i>>>18,t[n++]=128|i>>>12&63,t[n++]=128|i>>>6&63,t[n++]=128|63&i);return t},buf2string:(e,t)=>{const i=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let r,s;const n=new Array(2*i);for(s=0,r=0;r<i;){let t=e[r++];if(t<128){n[s++]=t;continue}let a=dc[t];if(a>4)n[s++]=65533,r+=a-1;else{for(t&=2===a?31:3===a?15:7;a>1&&r<i;)t=t<<6|63&e[r++],a--;a>1?n[s++]=65533:t<65536?n[s++]=t:(t-=65536,n[s++]=55296|t>>10&1023,n[s++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&uc)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let i="";for(let r=0;r<t;r++)i+=String.fromCharCode(e[r]);return i})(n,s)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let i=t-1;for(;i>=0&&128==(192&e[i]);)i--;return i<0||0===i?t:i+dc[e[i]]>t?i:t}};var pc=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Ic=Object.prototype.toString,{Z_NO_FLUSH:mc,Z_SYNC_FLUSH:_c,Z_FULL_FLUSH:wc,Z_FINISH:Cc,Z_OK:Bc,Z_STREAM_END:Ec,Z_DEFAULT_COMPRESSION:yc,Z_DEFAULT_STRATEGY:Qc,Z_DEFLATED:bc}=uh;function kc(e){this.options=gc.assign({level:yc,method:bc,chunkSize:16384,windowBits:15,memLevel:8,strategy:Qc},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pc,this.strm.avail_out=0;let i=hc.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(i!==Bc)throw new Error(gh[i]);if(t.header&&hc.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?fc.string2buf(t.dictionary):"[object ArrayBuffer]"===Ic.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,i=hc.deflateSetDictionary(this.strm,e),i!==Bc)throw new Error(gh[i]);this._dict_set=!0}}kc.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize;let s,n;if(this.ended)return!1;for(n=t===~~t?t:!0===t?Cc:mc,"string"==typeof e?i.input=fc.string2buf(e):"[object ArrayBuffer]"===Ic.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;)if(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),(n===_c||n===wc)&&i.avail_out<=6)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else{if(s=hc.deflate(i,n),s===Ec)return i.next_out>0&&this.onData(i.output.subarray(0,i.next_out)),s=hc.deflateEnd(this.strm),this.onEnd(s),this.ended=!0,s===Bc;if(0!==i.avail_out){if(n>0&&i.next_out>0)this.onData(i.output.subarray(0,i.next_out)),i.avail_out=0;else if(0===i.avail_in)break}else this.onData(i.output)}return!0},kc.prototype.onData=function(e){this.chunks.push(e)},kc.prototype.onEnd=function(e){e===Bc&&(this.result=gc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const xc=16209;var vc=function(e,t){let i,r,s,n,a,o,A,l,h,c,g,u,d,f,p,I,m,_,w,C,B,E,y,Q;const b=e.state;i=e.next_in,y=e.input,r=i+(e.avail_in-5),s=e.next_out,Q=e.output,n=s-(t-e.avail_out),a=s+(e.avail_out-257),o=b.dmax,A=b.wsize,l=b.whave,h=b.wnext,c=b.window,g=b.hold,u=b.bits,d=b.lencode,f=b.distcode,p=(1<<b.lenbits)-1,I=(1<<b.distbits)-1;e:do{u<15&&(g+=y[i++]<<u,u+=8,g+=y[i++]<<u,u+=8),m=d[g&p];t:for(;;){if(_=m>>>24,g>>>=_,u-=_,_=m>>>16&255,0===_)Q[s++]=65535&m;else{if(!(16&_)){if(0==(64&_)){m=d[(65535&m)+(g&(1<<_)-1)];continue t}if(32&_){b.mode=16191;break e}e.msg="invalid literal/length code",b.mode=xc;break e}w=65535&m,_&=15,_&&(u<_&&(g+=y[i++]<<u,u+=8),w+=g&(1<<_)-1,g>>>=_,u-=_),u<15&&(g+=y[i++]<<u,u+=8,g+=y[i++]<<u,u+=8),m=f[g&I];i:for(;;){if(_=m>>>24,g>>>=_,u-=_,_=m>>>16&255,!(16&_)){if(0==(64&_)){m=f[(65535&m)+(g&(1<<_)-1)];continue i}e.msg="invalid distance code",b.mode=xc;break e}if(C=65535&m,_&=15,u<_&&(g+=y[i++]<<u,u+=8,u<_&&(g+=y[i++]<<u,u+=8)),C+=g&(1<<_)-1,C>o){e.msg="invalid distance too far back",b.mode=xc;break e}if(g>>>=_,u-=_,_=s-n,C>_){if(_=C-_,_>l&&b.sane){e.msg="invalid distance too far back",b.mode=xc;break e}if(B=0,E=c,0===h){if(B+=A-_,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}}else if(h<_){if(B+=A+h-_,_-=h,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);if(B=0,h<w){_=h,w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}}}else if(B+=h-_,_<w){w-=_;do{Q[s++]=c[B++]}while(--_);B=s-C,E=Q}for(;w>2;)Q[s++]=E[B++],Q[s++]=E[B++],Q[s++]=E[B++],w-=3;w&&(Q[s++]=E[B++],w>1&&(Q[s++]=E[B++]))}else{B=s-C;do{Q[s++]=Q[B++],Q[s++]=Q[B++],Q[s++]=Q[B++],w-=3}while(w>2);w&&(Q[s++]=Q[B++],w>1&&(Q[s++]=Q[B++]))}break}}break}}while(i<r&&s<a);w=u>>3,i-=w,u-=w<<3,g&=(1<<u)-1,e.next_in=i,e.next_out=s,e.avail_in=i<r?r-i+5:5-(i-r),e.avail_out=s<a?a-s+257:257-(s-a),b.hold=g,b.bits=u};const Dc=15,Sc=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),Mc=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),Uc=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),Gc=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var Tc=(e,t,i,r,s,n,a,o)=>{const A=o.bits;let l,h,c,g,u,d,f=0,p=0,I=0,m=0,_=0,w=0,C=0,B=0,E=0,y=0,Q=null;const b=new Uint16Array(16),k=new Uint16Array(16);let x,v,D,S=null;for(f=0;f<=Dc;f++)b[f]=0;for(p=0;p<r;p++)b[t[i+p]]++;for(_=A,m=Dc;m>=1&&0===b[m];m--);if(_>m&&(_=m),0===m)return s[n++]=20971520,s[n++]=20971520,o.bits=1,0;for(I=1;I<m&&0===b[I];I++);for(_<I&&(_=I),B=1,f=1;f<=Dc;f++)if(B<<=1,B-=b[f],B<0)return-1;if(B>0&&(0===e||1!==m))return-1;for(k[1]=0,f=1;f<Dc;f++)k[f+1]=k[f]+b[f];for(p=0;p<r;p++)0!==t[i+p]&&(a[k[t[i+p]]++]=p);if(0===e?(Q=S=a,d=20):1===e?(Q=Sc,S=Mc,d=257):(Q=Uc,S=Gc,d=0),y=0,p=0,f=I,u=n,w=_,C=0,c=-1,E=1<<_,g=E-1,1===e&&E>852||2===e&&E>592)return 1;for(;;){x=f-C,a[p]+1<d?(v=0,D=a[p]):a[p]>=d?(v=S[a[p]-d],D=Q[a[p]-d]):(v=96,D=0),l=1<<f-C,h=1<<w,I=h;do{h-=l,s[u+(y>>C)+h]=x<<24|v<<16|D|0}while(0!==h);for(l=1<<f-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,p++,0==--b[f]){if(f===m)break;f=t[i+a[p]]}if(f>_&&(y&g)!==c){for(0===C&&(C=_),u+=I,w=f-C,B=1<<w;w+C<m&&(B-=b[w+C],!(B<=0));)w++,B<<=1;if(E+=1<<w,1===e&&E>852||2===e&&E>592)return 1;c=y&g,s[c]=_<<24|w<<16|u-n|0}}return 0!==y&&(s[u+y]=f-C<<24|64<<16|0),o.bits=_,0};const{Z_FINISH:Fc,Z_BLOCK:Rc,Z_TREES:Lc,Z_OK:Nc,Z_STREAM_END:Oc,Z_NEED_DICT:Pc,Z_STREAM_ERROR:zc,Z_DATA_ERROR:qc,Z_MEM_ERROR:Kc,Z_BUF_ERROR:Hc,Z_DEFLATED:Vc}=uh,Jc=16180,Yc=16190,jc=16191,Zc=16192,Wc=16194,Xc=16199,$c=16200,eg=16206,tg=16209,ig=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function rg(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const sg=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Jc||t.mode>16211?1:0},ng=e=>{if(sg(e))return zc;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Jc,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,Nc},ag=e=>{if(sg(e))return zc;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,ng(e)},og=(e,t)=>{let i;if(sg(e))return zc;const r=e.state;return t<0?(i=0,t=-t):(i=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?zc:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=i,r.wbits=t,ag(e))},Ag=(e,t)=>{if(!e)return zc;const i=new rg;e.state=i,i.strm=e,i.window=null,i.mode=Jc;const r=og(e,t);return r!==Nc&&(e.state=null),r};let lg,hg,cg=!0;const gg=e=>{if(cg){lg=new Int32Array(512),hg=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(Tc(1,e.lens,0,288,lg,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;Tc(2,e.lens,0,32,hg,0,e.work,{bits:5}),cg=!1}e.lencode=lg,e.lenbits=9,e.distcode=hg,e.distbits=5},ug=(e,t,i,r)=>{let s;const n=e.state;return null===n.window&&(n.wsize=1<<n.wbits,n.wnext=0,n.whave=0,n.window=new Uint8Array(n.wsize)),r>=n.wsize?(n.window.set(t.subarray(i-n.wsize,i),0),n.wnext=0,n.whave=n.wsize):(s=n.wsize-n.wnext,s>r&&(s=r),n.window.set(t.subarray(i-r,i-r+s),n.wnext),(r-=s)?(n.window.set(t.subarray(i-r,i),0),n.wnext=r,n.whave=n.wsize):(n.wnext+=s,n.wnext===n.wsize&&(n.wnext=0),n.whave<n.wsize&&(n.whave+=s))),0};var dg={inflateReset:ag,inflateReset2:og,inflateResetKeep:ng,inflateInit:e=>Ag(e,15),inflateInit2:Ag,inflate:(e,t)=>{let i,r,s,n,a,o,A,l,h,c,g,u,d,f,p,I,m,_,w,C,B,E,y=0;const Q=new Uint8Array(4);let b,k;const x=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(sg(e)||!e.output||!e.input&&0!==e.avail_in)return zc;i=e.state,i.mode===jc&&(i.mode=Zc),a=e.next_out,s=e.output,A=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,h=i.bits,c=o,g=A,E=Nc;e:for(;;)switch(i.mode){case Jc:if(0===i.wrap){i.mode=Zc;break}for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(2&i.wrap&&35615===l){0===i.wbits&&(i.wbits=15),i.check=0,Q[0]=255&l,Q[1]=l>>>8&255,i.check=ch(i.check,Q,2,0),l=0,h=0,i.mode=16181;break}if(i.head&&(i.head.done=!1),!(1&i.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",i.mode=tg;break}if((15&l)!==Vc){e.msg="unknown compression method",i.mode=tg;break}if(l>>>=4,h-=4,B=8+(15&l),0===i.wbits&&(i.wbits=B),B>15||B>i.wbits){e.msg="invalid window size",i.mode=tg;break}i.dmax=1<<i.wbits,i.flags=0,e.adler=i.check=1,i.mode=512&l?16189:jc,l=0,h=0;break;case 16181:for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(i.flags=l,(255&i.flags)!==Vc){e.msg="unknown compression method",i.mode=tg;break}if(57344&i.flags){e.msg="unknown header flags set",i.mode=tg;break}i.head&&(i.head.text=l>>8&1),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=ch(i.check,Q,2,0)),l=0,h=0,i.mode=16182;case 16182:for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.head&&(i.head.time=l),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,Q[2]=l>>>16&255,Q[3]=l>>>24&255,i.check=ch(i.check,Q,4,0)),l=0,h=0,i.mode=16183;case 16183:for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.head&&(i.head.xflags=255&l,i.head.os=l>>8),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=ch(i.check,Q,2,0)),l=0,h=0,i.mode=16184;case 16184:if(1024&i.flags){for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.length=l,i.head&&(i.head.extra_len=l),512&i.flags&&4&i.wrap&&(Q[0]=255&l,Q[1]=l>>>8&255,i.check=ch(i.check,Q,2,0)),l=0,h=0}else i.head&&(i.head.extra=null);i.mode=16185;case 16185:if(1024&i.flags&&(u=i.length,u>o&&(u=o),u&&(i.head&&(B=i.head.extra_len-i.length,i.head.extra||(i.head.extra=new Uint8Array(i.head.extra_len)),i.head.extra.set(r.subarray(n,n+u),B)),512&i.flags&&4&i.wrap&&(i.check=ch(i.check,r,u,n)),o-=u,n+=u,i.length-=u),i.length))break e;i.length=0,i.mode=16186;case 16186:if(2048&i.flags){if(0===o)break e;u=0;do{B=r[n+u++],i.head&&B&&i.length<65536&&(i.head.name+=String.fromCharCode(B))}while(B&&u<o);if(512&i.flags&&4&i.wrap&&(i.check=ch(i.check,r,u,n)),o-=u,n+=u,B)break e}else i.head&&(i.head.name=null);i.length=0,i.mode=16187;case 16187:if(4096&i.flags){if(0===o)break e;u=0;do{B=r[n+u++],i.head&&B&&i.length<65536&&(i.head.comment+=String.fromCharCode(B))}while(B&&u<o);if(512&i.flags&&4&i.wrap&&(i.check=ch(i.check,r,u,n)),o-=u,n+=u,B)break e}else i.head&&(i.head.comment=null);i.mode=16188;case 16188:if(512&i.flags){for(;h<16;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(4&i.wrap&&l!==(65535&i.check)){e.msg="header crc mismatch",i.mode=tg;break}l=0,h=0}i.head&&(i.head.hcrc=i.flags>>9&1,i.head.done=!0),e.adler=i.check=0,i.mode=jc;break;case 16189:for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}e.adler=i.check=ig(l),l=0,h=0,i.mode=Yc;case Yc:if(0===i.havedict)return e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,Pc;e.adler=i.check=1,i.mode=jc;case jc:if(t===Rc||t===Lc)break e;case Zc:if(i.last){l>>>=7&h,h-=7&h,i.mode=eg;break}for(;h<3;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}switch(i.last=1&l,l>>>=1,h-=1,3&l){case 0:i.mode=16193;break;case 1:if(gg(i),i.mode=Xc,t===Lc){l>>>=2,h-=2;break e}break;case 2:i.mode=16196;break;case 3:e.msg="invalid block type",i.mode=tg}l>>>=2,h-=2;break;case 16193:for(l>>>=7&h,h-=7&h;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",i.mode=tg;break}if(i.length=65535&l,l=0,h=0,i.mode=Wc,t===Lc)break e;case Wc:i.mode=16195;case 16195:if(u=i.length,u){if(u>o&&(u=o),u>A&&(u=A),0===u)break e;s.set(r.subarray(n,n+u),a),o-=u,n+=u,A-=u,a+=u,i.length-=u;break}i.mode=jc;break;case 16196:for(;h<14;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(i.nlen=257+(31&l),l>>>=5,h-=5,i.ndist=1+(31&l),l>>>=5,h-=5,i.ncode=4+(15&l),l>>>=4,h-=4,i.nlen>286||i.ndist>30){e.msg="too many length or distance symbols",i.mode=tg;break}i.have=0,i.mode=16197;case 16197:for(;i.have<i.ncode;){for(;h<3;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.lens[x[i.have++]]=7&l,l>>>=3,h-=3}for(;i.have<19;)i.lens[x[i.have++]]=0;if(i.lencode=i.lendyn,i.lenbits=7,b={bits:i.lenbits},E=Tc(0,i.lens,0,19,i.lencode,0,i.work,b),i.lenbits=b.bits,E){e.msg="invalid code lengths set",i.mode=tg;break}i.have=0,i.mode=16198;case 16198:for(;i.have<i.nlen+i.ndist;){for(;y=i.lencode[l&(1<<i.lenbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(m<16)l>>>=p,h-=p,i.lens[i.have++]=m;else{if(16===m){for(k=p+2;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(l>>>=p,h-=p,0===i.have){e.msg="invalid bit length repeat",i.mode=tg;break}B=i.lens[i.have-1],u=3+(3&l),l>>>=2,h-=2}else if(17===m){for(k=p+3;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=p,h-=p,B=0,u=3+(7&l),l>>>=3,h-=3}else{for(k=p+7;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=p,h-=p,B=0,u=11+(127&l),l>>>=7,h-=7}if(i.have+u>i.nlen+i.ndist){e.msg="invalid bit length repeat",i.mode=tg;break}for(;u--;)i.lens[i.have++]=B}}if(i.mode===tg)break;if(0===i.lens[256]){e.msg="invalid code -- missing end-of-block",i.mode=tg;break}if(i.lenbits=9,b={bits:i.lenbits},E=Tc(1,i.lens,0,i.nlen,i.lencode,0,i.work,b),i.lenbits=b.bits,E){e.msg="invalid literal/lengths set",i.mode=tg;break}if(i.distbits=6,i.distcode=i.distdyn,b={bits:i.distbits},E=Tc(2,i.lens,i.nlen,i.ndist,i.distcode,0,i.work,b),i.distbits=b.bits,E){e.msg="invalid distances set",i.mode=tg;break}if(i.mode=Xc,t===Lc)break e;case Xc:i.mode=$c;case $c:if(o>=6&&A>=258){e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,vc(e,g),a=e.next_out,s=e.output,A=e.avail_out,n=e.next_in,r=e.input,o=e.avail_in,l=i.hold,h=i.bits,i.mode===jc&&(i.back=-1);break}for(i.back=0;y=i.lencode[l&(1<<i.lenbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(I&&0==(240&I)){for(_=p,w=I,C=m;y=i.lencode[C+((l&(1<<_+w)-1)>>_)],p=y>>>24,I=y>>>16&255,m=65535&y,!(_+p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=_,h-=_,i.back+=_}if(l>>>=p,h-=p,i.back+=p,i.length=m,0===I){i.mode=16205;break}if(32&I){i.back=-1,i.mode=jc;break}if(64&I){e.msg="invalid literal/length code",i.mode=tg;break}i.extra=15&I,i.mode=16201;case 16201:if(i.extra){for(k=i.extra;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.length+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}i.was=i.length,i.mode=16202;case 16202:for(;y=i.distcode[l&(1<<i.distbits)-1],p=y>>>24,I=y>>>16&255,m=65535&y,!(p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(0==(240&I)){for(_=p,w=I,C=m;y=i.distcode[C+((l&(1<<_+w)-1)>>_)],p=y>>>24,I=y>>>16&255,m=65535&y,!(_+p<=h);){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}l>>>=_,h-=_,i.back+=_}if(l>>>=p,h-=p,i.back+=p,64&I){e.msg="invalid distance code",i.mode=tg;break}i.offset=m,i.extra=15&I,i.mode=16203;case 16203:if(i.extra){for(k=i.extra;h<k;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}i.offset+=l&(1<<i.extra)-1,l>>>=i.extra,h-=i.extra,i.back+=i.extra}if(i.offset>i.dmax){e.msg="invalid distance too far back",i.mode=tg;break}i.mode=16204;case 16204:if(0===A)break e;if(u=g-A,i.offset>u){if(u=i.offset-u,u>i.whave&&i.sane){e.msg="invalid distance too far back",i.mode=tg;break}u>i.wnext?(u-=i.wnext,d=i.wsize-u):d=i.wnext-u,u>i.length&&(u=i.length),f=i.window}else f=s,d=a-i.offset,u=i.length;u>A&&(u=A),A-=u,i.length-=u;do{s[a++]=f[d++]}while(--u);0===i.length&&(i.mode=$c);break;case 16205:if(0===A)break e;s[a++]=i.length,A--,i.mode=$c;break;case eg:if(i.wrap){for(;h<32;){if(0===o)break e;o--,l|=r[n++]<<h,h+=8}if(g-=A,e.total_out+=g,i.total+=g,4&i.wrap&&g&&(e.adler=i.check=i.flags?ch(i.check,s,g,a-g):lh(i.check,s,g,a-g)),g=A,4&i.wrap&&(i.flags?l:ig(l))!==i.check){e.msg="incorrect data check",i.mode=tg;break}l=0,h=0}i.mode=16207;case 16207:if(i.wrap&&i.flags){for(;h<32;){if(0===o)break e;o--,l+=r[n++]<<h,h+=8}if(4&i.wrap&&l!==(4294967295&i.total)){e.msg="incorrect length check",i.mode=tg;break}l=0,h=0}i.mode=16208;case 16208:E=Oc;break e;case tg:E=qc;break e;case 16210:return Kc;default:return zc}return e.next_out=a,e.avail_out=A,e.next_in=n,e.avail_in=o,i.hold=l,i.bits=h,(i.wsize||g!==e.avail_out&&i.mode<tg&&(i.mode<eg||t!==Fc))&&ug(e,e.output,e.next_out,g-e.avail_out),c-=e.avail_in,g-=e.avail_out,e.total_in+=c,e.total_out+=g,i.total+=g,4&i.wrap&&g&&(e.adler=i.check=i.flags?ch(i.check,s,g,e.next_out-g):lh(i.check,s,g,e.next_out-g)),e.data_type=i.bits+(i.last?64:0)+(i.mode===jc?128:0)+(i.mode===Xc||i.mode===Wc?256:0),(0===c&&0===g||t===Fc)&&E===Nc&&(E=Hc),E},inflateEnd:e=>{if(sg(e))return zc;let t=e.state;return t.window&&(t.window=null),e.state=null,Nc},inflateGetHeader:(e,t)=>{if(sg(e))return zc;const i=e.state;return 0==(2&i.wrap)?zc:(i.head=t,t.done=!1,Nc)},inflateSetDictionary:(e,t)=>{const i=t.length;let r,s,n;return sg(e)?zc:(r=e.state,0!==r.wrap&&r.mode!==Yc?zc:r.mode===Yc&&(s=1,s=lh(s,t,i,0),s!==r.check)?qc:(n=ug(e,t,i,i),n?(r.mode=16210,Kc):(r.havedict=1,Nc)))},inflateInfo:"pako inflate (from Nodeca project)"};var fg=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const pg=Object.prototype.toString,{Z_NO_FLUSH:Ig,Z_FINISH:mg,Z_OK:_g,Z_STREAM_END:wg,Z_NEED_DICT:Cg,Z_STREAM_ERROR:Bg,Z_DATA_ERROR:Eg,Z_MEM_ERROR:yg}=uh;function Qg(e){this.options=gc.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new pc,this.strm.avail_out=0;let i=dg.inflateInit2(this.strm,t.windowBits);if(i!==_g)throw new Error(gh[i]);if(this.header=new fg,dg.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=fc.string2buf(t.dictionary):"[object ArrayBuffer]"===pg.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(i=dg.inflateSetDictionary(this.strm,t.dictionary),i!==_g)))throw new Error(gh[i])}function bg(e,t){const i=new Qg(t);if(i.push(e),i.err)throw i.msg||gh[i.err];return i.result}Qg.prototype.push=function(e,t){const i=this.strm,r=this.options.chunkSize,s=this.options.dictionary;let n,a,o;if(this.ended)return!1;for(a=t===~~t?t:!0===t?mg:Ig,"[object ArrayBuffer]"===pg.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;;){for(0===i.avail_out&&(i.output=new Uint8Array(r),i.next_out=0,i.avail_out=r),n=dg.inflate(i,a),n===Cg&&s&&(n=dg.inflateSetDictionary(i,s),n===_g?n=dg.inflate(i,a):n===Eg&&(n=Cg));i.avail_in>0&&n===wg&&i.state.wrap>0&&0!==e[i.next_in];)dg.inflateReset(i),n=dg.inflate(i,a);switch(n){case Bg:case Eg:case Cg:case yg:return this.onEnd(n),this.ended=!0,!1}if(o=i.avail_out,i.next_out&&(0===i.avail_out||n===wg))if("string"===this.options.to){let e=fc.utf8border(i.output,i.next_out),t=i.next_out-e,s=fc.buf2string(i.output,e);i.next_out=t,i.avail_out=r-t,t&&i.output.set(i.output.subarray(e,e+t),0),this.onData(s)}else this.onData(i.output.length===i.next_out?i.output:i.output.subarray(0,i.next_out));if(n!==_g||0!==o){if(n===wg)return n=dg.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,!0;if(0===i.avail_in)break}}return!0},Qg.prototype.onData=function(e){this.chunks.push(e)},Qg.prototype.onEnd=function(e){e===_g&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=gc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var kg={Inflate:Qg,inflate:bg,inflateRaw:function(e,t){return(t=t||{}).raw=!0,bg(e,t)},ungzip:bg,constants:uh};const{Inflate:xg,inflate:vg,inflateRaw:Dg,ungzip:Sg}=kg;var Mg=vg;var Ug=Object.freeze({__proto__:null,default:class extends EA{decodeBlock(e){return Mg(new Uint8Array(e)).buffer}}});var Gg=Object.freeze({__proto__:null,default:class extends EA{decodeBlock(e){const t=new DataView(e),i=[];for(let r=0;r<e.byteLength;++r){let e=t.getInt8(r);if(e<0){const s=t.getUint8(r+1);e=-e;for(let t=0;t<=e;++t)i.push(s);r+=1}else{for(let s=0;s<=e;++s)i.push(t.getUint8(r+s+1));r+=e+1}}return new Uint8Array(i).buffer}}}),Tg={exports:{}};!function(e){
|
|
1
|
+
import{CompositeLayer as e,log as t,COORDINATE_SYSTEM as A}from"@deck.gl/core";import{TileLayer as i}from"@deck.gl/geo-layers";import{BitmapLayer as r}from"@deck.gl/layers";import{_TerrainExtension as a}from"@deck.gl/extensions";import{GL as n}from"@luma.gl/constants";import s from"chroma-js";import{getMeshBoundingBox as o}from"@loaders.gl/schema";import{concatenateTypedArrays as l}from"@loaders.gl/loader-utils";import{SimpleMeshLayer as g}from"@deck.gl/mesh-layers";function h(e,t,A,i){return new(A||(A=Promise))((function(r,a){function n(e){try{o(i.next(e))}catch(e){a(e)}}function s(e){try{o(i.throw(e))}catch(e){a(e)}}function o(e){var t;e.done?r(e.value):(t=e.value,t instanceof A?t:new A((function(e){e(t)}))).then(n,s)}o((i=i.apply(e,t||[])).next())}))}var c,f,d,I,u,B,C,E,w,Q,m,p,y,_;!function(e){e[e.Big=19789]="Big",e[e.Little=18761]="Little"}(c||(c={})),function(e){e[e.ReducedImage=1]="ReducedImage",e[e.Page=2]="Page",e[e.Mask=4]="Mask"}(f||(f={})),function(e){e[e.TopLeft=1]="TopLeft",e[e.TopRight=2]="TopRight",e[e.BottomRight=3]="BottomRight",e[e.BottomLeft=4]="BottomLeft",e[e.LeftTop=5]="LeftTop",e[e.RightTOP=6]="RightTOP",e[e.RightBottom=7]="RightBottom",e[e.LeftBottom=8]="LeftBottom"}(d||(d={})),function(e){e[e.PixelIsArea=1]="PixelIsArea",e[e.PixelIsPoint=2]="PixelIsPoint"}(I||(I={})),function(e){e[e.Unknown=0]="Unknown",e[e.Projected=1]="Projected",e[e.Geographic=2]="Geographic",e[e.Geocentric=3]="Geocentric",e[e.UserDefined=32767]="UserDefined"}(u||(u={})),function(e){e[e.Image=1]="Image",e[e.ReducedImage=2]="ReducedImage",e[e.Page=3]="Page"}(B||(B={})),function(e){e[e.None=1]="None",e[e.Lzw=5]="Lzw",e[e.Jpeg6=6]="Jpeg6",e[e.Jpeg=7]="Jpeg",e[e.DeflateOther=8]="DeflateOther",e[e.Deflate=32946]="Deflate",e[e.Jp2000=3417]="Jp2000",e[e.Lerc=34887]="Lerc",e[e.Lzma=34925]="Lzma",e[e.Zstd=5e4]="Zstd",e[e.Webp=50001]="Webp",e[e.JpegXl=50002]="JpegXl"}(C||(C={})),function(e){e[e.Contig=1]="Contig",e[e.Separate=2]="Separate"}(E||(E={})),function(e){e[e.Uint=1]="Uint",e[e.Int=2]="Int",e[e.Float=3]="Float",e[e.Void=4]="Void",e[e.ComplexInt=5]="ComplexInt",e[e.ComplexFloat=6]="ComplexFloat"}(w||(w={})),function(e){e[e.MinIsWhite=0]="MinIsWhite",e[e.MinIsBlack=1]="MinIsBlack",e[e.Rgb=2]="Rgb",e[e.Palette=3]="Palette",e[e.Mask=4]="Mask",e[e.Separated=5]="Separated",e[e.Ycbcr=6]="Ycbcr",e[e.Cielab=8]="Cielab",e[e.Icclab=9]="Icclab",e[e.Itulab=10]="Itulab",e[e.Cfa=32803]="Cfa",e[e.Logl=32844]="Logl",e[e.Logluv=32845]="Logluv"}(Q||(Q={})),function(e){e[e.SubFileType=254]="SubFileType",e[e.OldSubFileType=255]="OldSubFileType",e[e.ImageWidth=256]="ImageWidth",e[e.ImageHeight=257]="ImageHeight",e[e.BitsPerSample=258]="BitsPerSample",e[e.SampleFormat=339]="SampleFormat",e[e.Compression=259]="Compression",e[e.Photometric=262]="Photometric",e[e.TileWidth=322]="TileWidth",e[e.TileHeight=323]="TileHeight",e[e.TileOffsets=324]="TileOffsets",e[e.TileByteCounts=325]="TileByteCounts",e[e.JpegTables=347]="JpegTables",e[e.StripOffsets=273]="StripOffsets",e[e.StripByteCounts=279]="StripByteCounts",e[e.GdalMetadata=42112]="GdalMetadata",e[e.GdalNoData=42113]="GdalNoData",e[e.ModelPixelScale=33550]="ModelPixelScale",e[e.ModelTiePoint=33922]="ModelTiePoint",e[e.ModelTransformation=34744]="ModelTransformation",e[e.GeoKeyDirectory=34735]="GeoKeyDirectory",e[e.GeoDoubleParams=34736]="GeoDoubleParams",e[e.GeoAsciiParams=34737]="GeoAsciiParams",e[e.LercParameters=50674]="LercParameters",e[e.PlanarConfiguration=284]="PlanarConfiguration",e[e.CellLength=265]="CellLength",e[e.CellWidth=264]="CellWidth",e[e.ColorMap=320]="ColorMap",e[e.Copyright=33432]="Copyright",e[e.DateTime=306]="DateTime",e[e.ExtraSamples=338]="ExtraSamples",e[e.FillOrder=266]="FillOrder",e[e.FreeByteCounts=289]="FreeByteCounts",e[e.FreeOffsets=288]="FreeOffsets",e[e.GrayResponseCurve=291]="GrayResponseCurve",e[e.GrayResponseUnit=290]="GrayResponseUnit",e[e.HostComputer=316]="HostComputer",e[e.ImageDescription=270]="ImageDescription",e[e.Make=271]="Make",e[e.MaxSampleValue=281]="MaxSampleValue",e[e.MinSampleValue=280]="MinSampleValue",e[e.Model=272]="Model",e[e.Orientation=274]="Orientation",e[e.ResolutionUnit=296]="ResolutionUnit",e[e.RowsPerStrip=278]="RowsPerStrip",e[e.SamplesPerPixel=277]="SamplesPerPixel",e[e.Software=305]="Software",e[e.Threshholding=263]="Threshholding",e[e.XResolution=282]="XResolution",e[e.YResolution=283]="YResolution",e[e.BadFaxLines=326]="BadFaxLines",e[e.CleanFaxData=327]="CleanFaxData",e[e.ClipPath=343]="ClipPath",e[e.ConsecutiveBadFaxLines=328]="ConsecutiveBadFaxLines",e[e.Decode=433]="Decode",e[e.DefaultImageColor=434]="DefaultImageColor",e[e.DocumentName=269]="DocumentName",e[e.DotRange=336]="DotRange",e[e.HalftoneHints=321]="HalftoneHints",e[e.Indexed=346]="Indexed",e[e.PageName=285]="PageName",e[e.PageNumber=297]="PageNumber",e[e.Predictor=317]="Predictor",e[e.PrimaryChromaticities=319]="PrimaryChromaticities",e[e.ReferenceBlackWhite=532]="ReferenceBlackWhite",e[e.SMinSampleValue=340]="SMinSampleValue",e[e.SMaxSampleValue=341]="SMaxSampleValue",e[e.StripRowCounts=559]="StripRowCounts",e[e.SubIFDs=330]="SubIFDs",e[e.T4Options=292]="T4Options",e[e.T6Options=293]="T6Options",e[e.TransferFunction=301]="TransferFunction",e[e.WhitePoint=318]="WhitePoint",e[e.XClipPathUnits=344]="XClipPathUnits",e[e.XPosition=286]="XPosition",e[e.YCbCrCoefficients=529]="YCbCrCoefficients",e[e.YCbCrPositioning=531]="YCbCrPositioning",e[e.YCbCrSubSampling=530]="YCbCrSubSampling",e[e.YClipPathUnits=345]="YClipPathUnits",e[e.YPosition=287]="YPosition",e[e.ApertureValue=37378]="ApertureValue",e[e.ColorSpace=40961]="ColorSpace",e[e.DateTimeDigitized=36868]="DateTimeDigitized",e[e.DateTimeOriginal=36867]="DateTimeOriginal",e[e.ExifIFD=34665]="ExifIFD",e[e.ExifVersion=36864]="ExifVersion",e[e.ExposureTime=33434]="ExposureTime",e[e.FileSource=41728]="FileSource",e[e.Flash=37385]="Flash",e[e.FlashpixVersion=40960]="FlashpixVersion",e[e.FNumber=33437]="FNumber",e[e.ImageUniqueID=42016]="ImageUniqueID",e[e.LightSource=37384]="LightSource",e[e.MakerNote=37500]="MakerNote",e[e.ShutterSpeedValue=37377]="ShutterSpeedValue",e[e.UserComment=37510]="UserComment",e[e.IPTC=33723]="IPTC",e[e.ICCProfile=34675]="ICCProfile",e[e.XMP=700]="XMP"}(m||(m={})),function(e){e[e.GTModelTypeGeoKey=1024]="GTModelTypeGeoKey",e[e.GTRasterTypeGeoKey=1025]="GTRasterTypeGeoKey",e[e.GTCitationGeoKey=1026]="GTCitationGeoKey",e[e.GeodeticCRSGeoKey=2048]="GeodeticCRSGeoKey",e[e.GeodeticCitationGeoKey=2049]="GeodeticCitationGeoKey",e[e.GeodeticDatumGeoKey=2050]="GeodeticDatumGeoKey",e[e.PrimeMeridianGeoKey=2051]="PrimeMeridianGeoKey",e[e.GeogLinearUnitsGeoKey=2052]="GeogLinearUnitsGeoKey",e[e.GeogLinearUnitSizeGeoKey=2053]="GeogLinearUnitSizeGeoKey",e[e.GeogAngularUnitsGeoKey=2054]="GeogAngularUnitsGeoKey",e[e.GeogAngularUnitSizeGeoKey=2055]="GeogAngularUnitSizeGeoKey",e[e.EllipsoidGeoKey=2056]="EllipsoidGeoKey",e[e.EllipsoidSemiMajorAxisGeoKey=2057]="EllipsoidSemiMajorAxisGeoKey",e[e.EllipsoidSemiMinorAxisGeoKey=2058]="EllipsoidSemiMinorAxisGeoKey",e[e.EllipsoidInvFlatteningGeoKey=2059]="EllipsoidInvFlatteningGeoKey",e[e.PrimeMeridianLongitudeGeoKey=2061]="PrimeMeridianLongitudeGeoKey",e[e.GeogTOWGS84GeoKey=2062]="GeogTOWGS84GeoKey",e[e.GeogAzimuthUnitsGeoKey=2060]="GeogAzimuthUnitsGeoKey",e[e.ProjectedCRSGeoKey=3072]="ProjectedCRSGeoKey",e[e.ProjectedCitationGeoKey=3073]="ProjectedCitationGeoKey",e[e.ProjectionGeoKey=3074]="ProjectionGeoKey",e[e.ProjMethodGeoKey=3075]="ProjMethodGeoKey",e[e.ProjLinearUnitsGeoKey=3076]="ProjLinearUnitsGeoKey",e[e.ProjLinearUnitSizeGeoKey=3077]="ProjLinearUnitSizeGeoKey",e[e.ProjStdParallel1GeoKey=3078]="ProjStdParallel1GeoKey",e[e.ProjStdParallel2GeoKey=3079]="ProjStdParallel2GeoKey",e[e.ProjNatOriginLongGeoKey=3080]="ProjNatOriginLongGeoKey",e[e.ProjNatOriginLatGeoKey=3081]="ProjNatOriginLatGeoKey",e[e.ProjFalseEastingGeoKey=3082]="ProjFalseEastingGeoKey",e[e.ProjFalseNorthingGeoKey=3083]="ProjFalseNorthingGeoKey",e[e.ProjFalseOriginLongGeoKey=3084]="ProjFalseOriginLongGeoKey",e[e.ProjFalseOriginLatGeoKey=3085]="ProjFalseOriginLatGeoKey",e[e.ProjFalseOriginEastingGeoKey=3086]="ProjFalseOriginEastingGeoKey",e[e.ProjFalseOriginNorthingGeoKey=3087]="ProjFalseOriginNorthingGeoKey",e[e.ProjCenterLongGeoKey=3088]="ProjCenterLongGeoKey",e[e.ProjCenterLatGeoKey=3089]="ProjCenterLatGeoKey",e[e.ProjCenterEastingGeoKey=3090]="ProjCenterEastingGeoKey",e[e.ProjCenterNorthingGeoKey=3091]="ProjCenterNorthingGeoKey",e[e.ProjScaleAtNatOriginGeoKey=3092]="ProjScaleAtNatOriginGeoKey",e[e.ProjScaleAtCenterGeoKey=3093]="ProjScaleAtCenterGeoKey",e[e.ProjAzimuthAngleGeoKey=3094]="ProjAzimuthAngleGeoKey",e[e.ProjStraightVertPoleLongGeoKey=3095]="ProjStraightVertPoleLongGeoKey",e[e.ProjRectifiedGridAngleGeoKey=3096]="ProjRectifiedGridAngleGeoKey",e[e.VerticalGeoKey=4096]="VerticalGeoKey",e[e.VerticalCitationGeoKey=4097]="VerticalCitationGeoKey",e[e.VerticalDatumGeoKey=4098]="VerticalDatumGeoKey",e[e.VerticalUnitsGeoKey=4099]="VerticalUnitsGeoKey"}(p||(p={})),function(e){e[e.Radian=9101]="Radian",e[e.Degree=9102]="Degree",e[e.ArcMinute=9103]="ArcMinute",e[e.ArcDegree=9104]="ArcDegree",e[e.Grad=9105]="Grad",e[e.Gon=9106]="Gon",e[e.Dms=9107]="Dms"}(y||(y={})),function(e){e[e.Metre=9001]="Metre",e[e.Foot=9002]="Foot",e[e.FootUsSurvey=9003]="FootUsSurvey",e[e.FootModifiedAmerican=9004]="FootModifiedAmerican",e[e.FootClarke=9005]="FootClarke",e[e.FootIndian=9006]="FootIndian",e[e.Link=9007]="Link",e[e.LinkBenoit=9008]="LinkBenoit",e[e.LinkSears=9009]="LinkSears",e[e.ChainBenoit=9010]="ChainBenoit",e[e.ChainSears=9011]="ChainSears",e[e.YardSears=9012]="YardSears",e[e.YardIndian=9013]="YardIndian",e[e.Fathom=9014]="Fathom",e[e.MileInternationalNautical=9015]="MileInternationalNautical"}(_||(_={}));const b={[m.TileByteCounts]:!0,[m.TileOffsets]:!0,[m.StripOffsets]:!0,[m.StripByteCounts]:!0,[m.BitsPerSample]:!0,[m.SampleFormat]:!0,[m.GeoKeyDirectory]:!0,[m.GeoDoubleParams]:!0};var D;!function(e){e.None="application/octet-stream",e.Jpeg="image/jpeg",e.Jp2000="image/jp2",e.JpegXl="image/jpegxl",e.Webp="image/webp",e.Zstd="application/zstd",e.Lzw="application/lzw",e.Deflate="application/deflate",e.Lerc="application/lerc",e.Lzma="application/x-lzma"}(D||(D={}));const k={[C.None]:D.None,[C.Lzw]:D.Lzw,[C.Jpeg6]:D.Jpeg,[C.Jpeg]:D.Jpeg,[C.DeflateOther]:D.Deflate,[C.Deflate]:D.Deflate,[C.Lerc]:D.Lerc,[C.Lzma]:D.Lzma,[C.Jp2000]:D.Jp2000,[C.Zstd]:D.Zstd,[C.Webp]:D.Webp,[C.JpegXl]:D.JpegXl};var v,x,S,G;function U(e){switch(e){case v.Uint8:case v.Ascii:case v.Int8:case v.Undefined:return 1;case v.Uint16:case v.Int16:return 2;case v.Uint32:case v.Int32:case v.Float32:return 4;case v.Rational:case v.SignedRational:case v.Float64:case v.Uint64:case v.Int64:case v.Ifd8:return 8;default:throw new Error(`Invalid fieldType ${e}`)}}!function(e){e[e.Uint8=1]="Uint8",e[e.Ascii=2]="Ascii",e[e.Uint16=3]="Uint16",e[e.Uint32=4]="Uint32",e[e.Rational=5]="Rational",e[e.Int8=6]="Int8",e[e.Undefined=7]="Undefined",e[e.Int16=8]="Int16",e[e.Int32=9]="Int32",e[e.SignedRational=10]="SignedRational",e[e.Float32=11]="Float32",e[e.Float64=12]="Float64",e[e.Uint64=16]="Uint64",e[e.Int64=17]="Int64",e[e.Ifd8=18]="Ifd8"}(v||(v={})),function(e){e[e.BigTiff=43]="BigTiff",e[e.Tiff=42]="Tiff"}(x||(x={})),function(e){e[e.Double=8]="Double",e[e.Float32=4]="Float32"}(S||(S={})),function(e){e[e.UInt64=8]="UInt64",e[e.UInt32=4]="UInt32",e[e.UInt16=2]="UInt16",e[e.UInt8=1]="UInt8"}(G||(G={}));const F=2**32;function R(e,t,A){const i=e.getUint32(t,A),r=e.getUint32(t+4,A),a=A?i+F*r:F*i+r;if(!Number.isSafeInteger(a))throw new Error(a+" exceeds MAX_SAFE_INTEGER. Precision may is lost");return a}function L(e,t,A,i){switch(A){case G.UInt8:return e.getUint8(t);case G.UInt16:return e.getUint16(t,i);case G.UInt32:return e.getUint32(t,i);case G.UInt64:return R(e,t,i)}}function M(e,t,A){return!(t<e.sourceOffset)&&!(e.sourceOffset+e.byteLength<t+A)}function T(e,t,A,i){switch(e){case v.Ascii:return String.fromCharCode(t.getUint8(A));case v.Undefined:case v.Uint8:return t.getUint8(A);case v.Int8:return t.getInt8(A);case v.Uint16:return t.getUint16(A,i);case v.Int16:return t.getInt16(A,i);case v.Uint32:return t.getUint32(A,i);case v.Int32:return t.getInt32(A,i);case v.Rational:return[t.getUint32(A,i),t.getUint32(A+4,i)];case v.SignedRational:return[t.getInt32(A,i),t.getInt32(A+4,i)];case v.Float64:return t.getFloat64(A,i);case v.Float32:return t.getFloat32(A,i);case v.Uint64:return R(t,A,i);default:throw new Error(`Unknown read type "${e}" "${v[e]}"`)}}function N(e,t,A,i,r,a){const n=U(r),s=a*n;if(1===a){const a=T(r,A,i,e.isLittleEndian);return t&&b[t]?[a]:a}if(r===v.Ascii)return String.fromCharCode.apply(null,new Uint8Array(A.buffer,i,s-1));const o=[];for(let t=0;t<s;t+=n)o.push(T(r,A,i+t,e.isLittleEndian));return o}function O(e,t,A){const i=t.getUint16(A+0,e.isLittleEndian),r=t.getUint16(A+2,e.isLittleEndian),a=L(t,A+4,e.ifdConfig.pointer,e.isLittleEndian),n=U(r)*a;if(n<=e.ifdConfig.pointer){const n=N(e,i,t,A+4+e.ifdConfig.pointer,r,a);return{type:"inline",id:i,name:m[i],count:a,value:n,dataType:r,tagOffset:A}}const s=L(t,A+4+e.ifdConfig.pointer,e.ifdConfig.pointer,e.isLittleEndian);switch(i){case m.TileOffsets:case m.TileByteCounts:case m.StripByteCounts:case m.StripOffsets:const e={type:"offset",id:i,name:m[i],count:a,dataType:r,dataOffset:s,isLoaded:!1,value:[],tagOffset:A};return i===m.TileOffsets&&M(t,s,n)&&function(e,t){const A=U(e.dataType),i=t.byteOffset+e.dataOffset-t.sourceOffset;e.view=new DataView(t.buffer.slice(i,i+A*e.count)),e.view.sourceOffset=e.dataOffset}(e,t),e}if(M(t,s,n)){const n=N(e,i,t,s-t.sourceOffset,r,a);return{type:"inline",id:i,name:m[i],count:a,value:n,dataType:r,tagOffset:A}}return{type:"lazy",id:i,name:m[i],count:a,dataOffset:s,dataType:r,tagOffset:A}}new Set([m.Compression,m.ImageHeight,m.ImageWidth,m.ModelPixelScale,m.ModelTiePoint,m.ModelTransformation,m.TileHeight,m.TileWidth,m.GeoKeyDirectory,m.GeoAsciiParams,m.GeoDoubleParams,m.TileOffsets]);class P{constructor(e,t,A){Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tiff",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"isGeoTagsLoaded",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"tagsGeo",{enumerable:!0,configurable:!0,writable:!0,value:new Map}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.tiff=e,this.id=t,this.tags=A}async init(e=!0){const t=[this.fetch(m.Compression),this.fetch(m.ImageHeight),this.fetch(m.ImageWidth),this.fetch(m.ModelPixelScale),this.fetch(m.ModelTiePoint),this.fetch(m.ModelTransformation),this.fetch(m.TileHeight),this.fetch(m.TileWidth)];e&&(t.push(this.fetch(m.GeoKeyDirectory)),t.push(this.fetch(m.GeoAsciiParams)),t.push(this.fetch(m.GeoDoubleParams))),await Promise.all(t),e&&await this.loadGeoTiffTags()}value(e){const t=this.tags.get(e);return null==t||"offset"===t.type&&!1===t.isLoaded?null:t.value}has(e){return this.tags.has(e)}async fetch(e){const t=this.tags.get(e);if(null==t)return null;if("inline"===t.type)return t.value;if("lazy"===t.type)return async function(e,t){if(null!=e.value)return e.value;const A=U(e.dataType)*e.count,i=await t.source.fetch(e.dataOffset,A),r=new DataView(i);return e.value=N(t,e.id,r,0,e.dataType,e.count),e.value}(t,this.tiff);if(t.isLoaded)return t.value;if("offset"===t.type)return async function(e,t){const A=U(t.dataType);if(null==t.view){const i=await e.source.fetch(t.dataOffset,A*t.count);t.view=new DataView(i),t.view.sourceOffset=t.dataOffset}return t.value=N(e,t.id,t.view,0,t.dataType,t.count),t.isLoaded=!0,t.value}(this.tiff,t);throw new Error("Cannot fetch:"+e)}valueGeo(e){if(!1===this.isGeoTagsLoaded)throw new Error("loadGeoTiffTags() has not been called");return this.tagsGeo.get(e)}get noData(){const e=this.tags.get(m.GdalNoData);if(null==e)return null;if(e.value)return Number(e.value);throw new Error("GdalNoData tag is not loaded")}async loadGeoTiffTags(){if(this.isGeoTagsLoaded)return;const e=this.tags.get(m.GeoKeyDirectory);if(null==e)return void(this.isGeoTagsLoaded=!0);if("lazy"===e.type&&null==e.value&&await Promise.all([this.fetch(m.GeoKeyDirectory),this.fetch(m.GeoAsciiParams),this.fetch(m.GeoDoubleParams)]),this.isGeoTagsLoaded=!0,null==e.value)return;const t=e.value;if("number"==typeof t)throw new Error("Invalid geo tags found");for(let e=4;e<=4*t[3];e+=4){const A=t[e],i=t[e+1],r=t[e+3];if(0===i){this.tagsGeo.set(A,r);continue}const a=this.tags.get(i);if(null==a||null==a.value)continue;const n=t[e+2];if("string"==typeof a.value)this.tagsGeo.set(A,a.value.slice(r,r+n-1).trim());else{if(!Array.isArray(a.value))throw new Error("Failed to extract GeoTiffTags");1===n?this.tagsGeo.set(A,a.value[r]):this.tagsGeo.set(A,a.value.slice(r,r+n))}}}get origin(){const e=this.value(m.ModelTiePoint);if(null!=e&&6===e.length)return[e[3],e[4],e[5]];const t=this.value(m.ModelTransformation);if(null!=t)return[t[3],t[7],t[11]];if(this.value(m.SubFileType)===f.ReducedImage&&0!==this.id)return this.tiff.images[0].origin;throw new Error("Image does not have a geo transformation.")}get isGeoLocated(){return!(null==this.value(m.ModelPixelScale)&&null==this.value(m.ModelTransformation))||!(!this.isSubImage||0===this.id)&&this.tiff.images[0].isGeoLocated}get resolution(){const e=this.value(m.ModelPixelScale);if(null!=e)return[e[0],-e[1],e[2]];const t=this.value(m.ModelTransformation);if(null!=t)return[t[0],t[5],t[10]];if(this.isSubImage&&0!==this.id){const e=this.tiff.images[0],[t,A,i]=e.resolution,r=e.size,a=this.size;return[t*r.width/a.width,A*r.height/a.height,i]}throw new Error("Image does not have a geo transformation.")}get isSubImage(){return this.value(m.SubFileType)===f.ReducedImage}get bbox(){const e=this.size,t=this.origin,A=this.resolution;if(null==t||null==e||null==A)throw new Error("Unable to calculate bounding box");const i=t[0],r=t[1],a=i+A[0]*e.width,n=r+A[1]*e.height;return[Math.min(i,a),Math.min(r,n),Math.max(i,a),Math.max(r,n)]}get compression(){const e=this.value(m.Compression);return null==e?null:k[e]}get epsg(){const e=this.valueGeo(p.ProjectionGeoKey);if(null!=e&&32767!==e)return e;let t=null;switch(this.valueGeo(p.GTModelTypeGeoKey)){case u.Unknown:return null;case u.Projected:t=this.valueGeo(p.ProjectedCRSGeoKey);break;case u.Geographic:case u.Geocentric:t=this.valueGeo(p.GeodeticCRSGeoKey);break;case u.UserDefined:return null}return 32767===t?null:t}get size(){const e=this.value(m.ImageWidth),t=this.value(m.ImageHeight);if(null==e||null==t)throw new Error("Tiff has no height or width");return{width:e,height:t}}isTiled(){return null!==this.value(m.TileWidth)}get tileSize(){const e=this.value(m.TileWidth),t=this.value(m.TileHeight);if(null==e||null==t)throw new Error("Tiff is not tiled");return{width:e,height:t}}get tileCount(){const e=this.size,t=this.tileSize;return{x:Math.ceil(e.width/t.width),y:Math.ceil(e.height/t.height)}}get tileOffset(){const e=this.tags.get(m.TileOffsets);if(null==e)throw new Error("No tile offsets found");return e}get stripCount(){return this.tags.get(m.StripByteCounts)?.count??0}getTileBounds(e,t){const{size:A,tileSize:i}=this,r=t*i.height,a=e*i.width;return{x:a,y:r,width:a+i.width>=A.width?A.width-a:i.width,height:r+i.height>=A.height?A.height-r:i.height}}async getStrip(e){if(this.isTiled())throw new Error("Cannot read stripes, tiff is tiled: "+e);const t=this.tags.get(m.StripByteCounts),A=this.tags.get(m.StripOffsets);if(e>=t.count)throw new Error("Cannot read strip, index out of bounds");const[i,r]=await Promise.all([z(this.tiff,A,e),z(this.tiff,t,e)]);return this.getBytes(i,r)}getJpegHeader(e){const t=this.value(m.JpegTables);if(null==t)throw new Error("Unable to find Jpeg header");const A=t.slice(0,t.length-2),i=new Uint8Array(e.byteLength+A.length-2);return i.set(A,0),i.set(new Uint8Array(e).slice(2),A.length),i}async getBytes(e,t){if(0===t)return null;const A=await this.tiff.source.fetch(e,t);if(A.byteLength<t)throw new Error(`Failed to fetch bytes from offset:${e} wanted:${t} got:${A.byteLength}`);let i=this.value(m.Compression);null==i&&(i=C.None);const r=(null==(a=i)?null:k[a])??D.None;var a;return i===C.Jpeg?{mimeType:r,bytes:this.getJpegHeader(A),compression:i}:{mimeType:r,bytes:A,compression:i}}async getTile(e,t){const A=this.size,i=this.tileSize;if(null==i)throw new Error("Tiff is not tiled");const r=Math.ceil(A.height/i.height),a=Math.ceil(A.width/i.width);if(e>=a||t>=r)throw new Error(`Tile index is outside of range x:${e} >= ${a} or y:${t} >= ${r}`);const n=t*a+e,s=a*r;if(n>=s)throw new Error(`Tile index is outside of tile range: ${n} >= ${s}`);const{offset:o,imageSize:l}=await this.getTileSize(n);return this.getBytes(o,l)}async hasTile(e,t){const A=this.tileSize,i=this.size;if(null==A)throw new Error("Tiff is not tiled");const r=Math.ceil(i.height/A.height),a=Math.ceil(i.width/A.width);if(e>=a||t>=r)return!1;const n=t*a+e;return(await this.getTileSize(n)).offset>0}async getTileSize(e){const t=this.tiff.options?.tileLeaderByteSize;if(t){const A=await z(this.tiff,this.tileOffset,e);if(0===A)return{offset:0,imageSize:0};const i=await this.tiff.source.fetch(A-t,t);return{offset:A,imageSize:L(new DataView(i),0,t,this.tiff.isLittleEndian)}}const A=this.tags.get(m.TileByteCounts);if(null==A)throw new Error("No tile byte counts found");const[i,r]=await Promise.all([z(this.tiff,this.tileOffset,e),z(this.tiff,A,e)]);return{offset:i,imageSize:r}}}function z(e,t,A){if(A<0)throw new Error(`Tiff: ${e.source.url.href} out of bounds ${m[t.id]} index:${A} total:${t.count}`);return A>=t.count?0:"inline"===t.type?t.value[A]:async function(e,t,A){if(A>t.count||A<0)throw new Error("TagOffset: out of bounds :"+A);if(null!=t.value[A])return t.value[A];const i=U(t.dataType);if(null==t.view){const r=await e.source.fetch(t.dataOffset+A*i,i),a=N(e,void 0,new DataView(r),0,t.dataType,1);return t.value[A]=a,a}const r=N(e,void 0,t.view,A*i,t.dataType,1);return t.value[A]=r,r}(e,t,A)}var K,J,q;!function(e){e.GdalStructuralMetadataSize="GDAL_STRUCTURAL_METADATA_SIZE",e.Layout="LAYOUT",e.BlockOrder="BLOCK_ORDER",e.BlockLeader="BLOCK_LEADER",e.BlockTrailer="BLOCK_TRAILER",e.KnownIncompatibleEdition="KNOWN_INCOMPATIBLE_EDITION",e.MaskInterleavedWithImagery="MASK_INTERLEAVED_WITH_IMAGERY"}(K||(K={})),function(e){e.RowMajor="ROW_MAJOR"}(J||(J={})),function(e){e.uint32="SIZE_AS_UINT4"}(q||(q={}));class H{constructor(){Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}get isCogOptimized(){return!this.isBroken&&"IFDS_BEFORE_DATA"===this.options.get(K.Layout)}get isBroken(){return"YES"===this.options.get(K.KnownIncompatibleEdition)}process(e,t,A){let i="",r="",a=!1;for(let n=0;n<A;n++){const A=e.getUint8(t+n);if(0===A)break;const s=String.fromCharCode(A);"\n"===s?(this.options.set(i.trim(),r.trim()),i="",r="",a=!1):"="===s?a=!0:a?r+=s:i+=s}}get tileLeaderByteSize(){return this.options.get(K.BlockLeader)===q.uint32?G.UInt32:null}get isMaskInterleaved(){return"YES"===this.options.get(K.MaskInterleavedWithImagery)}}const Y={version:x.Tiff,pointer:G.UInt32,offset:G.UInt16,ifd:G.UInt16+G.UInt16+2*G.UInt32},V={version:x.BigTiff,pointer:G.UInt64,offset:G.UInt64,ifd:G.UInt16+G.UInt16+2*G.UInt64};x.BigTiff,x.Tiff;class Z{constructor(e){Object.defineProperty(this,"defaultReadSize",{enumerable:!0,configurable:!0,writable:!0,value:Z.DefaultReadSize}),Object.defineProperty(this,"source",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"version",{enumerable:!0,configurable:!0,writable:!0,value:x.Tiff}),Object.defineProperty(this,"images",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"options",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"ifdConfig",{enumerable:!0,configurable:!0,writable:!0,value:Y}),Object.defineProperty(this,"isLittleEndian",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"isInitialized",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"_initPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.source=e}static create(e){return new Z(e).init()}init(){return this._initPromise||(this._initPromise=this.readHeader()),this._initPromise}getImageByResolution(e){const t=this.images[0],A=t.size,[i]=t.resolution,r=i*A.width;for(let t=this.images.length-1;t>0;t--){const A=this.images[t];if(r/A.size.width-e<=.01)return A}return t}async readHeader(){if(this.isInitialized)return this;const e=new DataView(await this.source.fetch(0,j(this.source,0,this.defaultReadSize)));e.sourceOffset=0;let t=0;const A=e.getUint16(t,this.isLittleEndian);if(t+=2,this.isLittleEndian=A===c.Little,!this.isLittleEndian)throw new Error("Only little endian is supported");let i;if(this.version=e.getUint16(t,this.isLittleEndian),t+=2,this.version===x.BigTiff){this.ifdConfig=V;const A=e.getUint16(t,this.isLittleEndian);if(t+=2,8!==A)throw new Error("Only 8byte pointers are supported");const r=e.getUint16(t,this.isLittleEndian);if(t+=2,0!==r)throw new Error("Invalid big tiff header");i=L(e,t,this.ifdConfig.pointer,this.isLittleEndian),t+=this.ifdConfig.pointer}else{if(this.version!==x.Tiff)throw new Error(`Only tiff supported version:${this.version}`);i=L(e,t,this.ifdConfig.pointer,this.isLittleEndian),t+=this.ifdConfig.pointer}const r=i-t;for(r>0&&r<16384&&(this.options=new H,this.options.process(e,t,r));0!==i;){let t=e;if(!M(t,i,1024)){const e=await this.source.fetch(i,j(this.source,i,this.defaultReadSize));t=new DataView(e),t.sourceOffset=i}i=await this.readIfd(i,t)}return await Promise.all(this.images.map((e=>e.init()))),this.isInitialized=!0,this}async readIfd(e,t){const A=e-t.sourceOffset,i=L(t,A,this.ifdConfig.offset,this.isLittleEndian),r=new Map;if(!M(t,e,i*this.ifdConfig.ifd))throw new Error("IFD out of range @ "+function(e,t=4,A=!0){const i=e.toString(16).padStart(t,"0");return A?"0x"+i:i}(e)+" IFD"+this.images.length);const a=this.ifdConfig.ifd,n=A+this.ifdConfig.offset;for(let e=0;e<i;e++){const A=O(this,t,n+e*a);r.set(A.id,A)}return this.images.push(new P(this,this.images.length,r)),L(t,n+i*a,this.ifdConfig.pointer,this.isLittleEndian)}}function j(e,t,A){if(null==e.metadata?.size)return A;const i=e.metadata.size;return t+A>i?i-t:A}Object.defineProperty(Z,"DefaultReadSize",{enumerable:!0,configurable:!0,writable:!0,value:16384});class X extends Error{code;url;source;constructor(e,t,A,i){super(e,{cause:i}),this.code=t,this.url=A.url,this.source=A,Object.defineProperty(this,"_sourceError",{enumerable:!1,value:"SourceError"})}static is(e){return e instanceof X||"object"==typeof e&&(null!=e&&("_sourceError"in e&&"SourceError"===e._sourceError))}}const W={toRange(e,t){if(null==t)return`bytes=${e}`;if(e<0)throw new Error("Cannot read from remote source with negative offset and length");return`bytes=${e}-${e+t-1}`},parseSize(e){const[t,A]=e.split(" ");if("bytes"!==t)throw new Error("Failed to parse content-range: "+e);if(null==A)throw new Error("Failed to parse content-range: "+e);const[,i]=A.split("/"),r=Number(i);if(isNaN(r))throw new Error("Failed to parse content-range: "+e);return r}};function $(e){const t={size:-1},A=e.headers.get("content-range");return null!=A&&(t.size=W.parseSize(A)),t.eTag=e.headers.get("etag")??void 0,t.contentType=e.headers.get("content-type")??void 0,t.contentDisposition=e.headers.get("content-disposition")??void 0,t}class ee{constructor(e,t){this.type="http",this.url="string"==typeof e?ee.tryUrl(e):e,this.headers=t}static tryUrl(e){try{return new URL(e)}catch(t){return"undefined"!=typeof document?new URL(e,document.baseURI):new URL(e,import.meta.url)}}head(){return this._head||(this._head=ee.fetch(this.url,{method:"HEAD",headers:this.headers}).then((e=>{if(!e.ok)throw delete this._head,new Error(`Failed to HEAD ${this.url}`,{cause:{statusCode:e.status,msg:e.statusText}});return this.metadata=$(e),this.metadata}))),this._head}async fetch(e,t){try{const A={range:W.toRange(e,t),...this.headers},i=await ee.fetch(this.url,{headers:A});if(!i.ok)throw new X(`Failed to fetch ${this.url} ${A.range}`,i.status,this,new Error(i.statusText));const r=$(i);if(null==this.metadata)this.metadata=r;else if(this.metadata.eTag&&this.metadata.eTag!==r.eTag)throw new X(`ETag conflict ${this.url} ${A.range} expected: ${this.metadata.eTag} got: ${r.eTag}`,409,this);return i.arrayBuffer()}catch(e){if(X.is(e)&&e.source===this)throw e;throw new X(`Failed to fetch: ${this.url}`,500,this,e)}}}ee.fetch=(e,t)=>fetch(e,t)
|
|
2
|
+
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */;function te(e){let t=e.length;for(;--t>=0;)e[t]=0}const Ae=256,ie=286,re=30,ae=15,ne=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),se=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),oe=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),le=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),ge=new Array(576);te(ge);const he=new Array(60);te(he);const ce=new Array(512);te(ce);const fe=new Array(256);te(fe);const de=new Array(29);te(de);const Ie=new Array(re);function ue(e,t,A,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=A,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}let Be,Ce,Ee;function we(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}te(Ie);const Qe=e=>e<256?ce[e]:ce[256+(e>>>7)],me=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},pe=(e,t,A)=>{e.bi_valid>16-A?(e.bi_buf|=t<<e.bi_valid&65535,me(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=A-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=A)},ye=(e,t,A)=>{pe(e,A[2*t],A[2*t+1])},_e=(e,t)=>{let A=0;do{A|=1&e,e>>>=1,A<<=1}while(--t>0);return A>>>1},be=(e,t,A)=>{const i=new Array(16);let r,a,n=0;for(r=1;r<=ae;r++)n=n+A[r-1]<<1,i[r]=n;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=_e(i[t]++,t))}},De=e=>{let t;for(t=0;t<ie;t++)e.dyn_ltree[2*t]=0;for(t=0;t<re;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},ke=e=>{e.bi_valid>8?me(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},ve=(e,t,A,i)=>{const r=2*t,a=2*A;return e[r]<e[a]||e[r]===e[a]&&i[t]<=i[A]},xe=(e,t,A)=>{const i=e.heap[A];let r=A<<1;for(;r<=e.heap_len&&(r<e.heap_len&&ve(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!ve(t,i,e.heap[r],e.depth));)e.heap[A]=e.heap[r],A=r,r<<=1;e.heap[A]=i},Se=(e,t,A)=>{let i,r,a,n,s=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+s++],i+=(255&e.pending_buf[e.sym_buf+s++])<<8,r=e.pending_buf[e.sym_buf+s++],0===i?ye(e,r,t):(a=fe[r],ye(e,a+Ae+1,t),n=ne[a],0!==n&&(r-=de[a],pe(e,r,n)),i--,a=Qe(i),ye(e,a,A),n=se[a],0!==n&&(i-=Ie[a],pe(e,i,n)))}while(s<e.sym_next);ye(e,256,t)},Ge=(e,t)=>{const A=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,a=t.stat_desc.elems;let n,s,o,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<a;n++)0!==A[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):A[2*n+1]=0;for(;e.heap_len<2;)o=e.heap[++e.heap_len]=l<2?++l:0,A[2*o]=1,e.depth[o]=0,e.opt_len--,r&&(e.static_len-=i[2*o+1]);for(t.max_code=l,n=e.heap_len>>1;n>=1;n--)xe(e,A,n);o=a;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],xe(e,A,1),s=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=s,A[2*o]=A[2*n]+A[2*s],e.depth[o]=(e.depth[n]>=e.depth[s]?e.depth[n]:e.depth[s])+1,A[2*n+1]=A[2*s+1]=o,e.heap[1]=o++,xe(e,A,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const A=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,n=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,o=t.stat_desc.max_length;let l,g,h,c,f,d,I=0;for(c=0;c<=ae;c++)e.bl_count[c]=0;for(A[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)g=e.heap[l],c=A[2*A[2*g+1]+1]+1,c>o&&(c=o,I++),A[2*g+1]=c,g>i||(e.bl_count[c]++,f=0,g>=s&&(f=n[g-s]),d=A[2*g],e.opt_len+=d*(c+f),a&&(e.static_len+=d*(r[2*g+1]+f)));if(0!==I){do{for(c=o-1;0===e.bl_count[c];)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[o]--,I-=2}while(I>0);for(c=o;0!==c;c--)for(g=e.bl_count[c];0!==g;)h=e.heap[--l],h>i||(A[2*h+1]!==c&&(e.opt_len+=(c-A[2*h+1])*A[2*h],A[2*h+1]=c),g--)}})(e,t),be(A,l,e.bl_count)},Ue=(e,t,A)=>{let i,r,a=-1,n=t[1],s=0,o=7,l=4;for(0===n&&(o=138,l=3),t[2*(A+1)+1]=65535,i=0;i<=A;i++)r=n,n=t[2*(i+1)+1],++s<o&&r===n||(s<l?e.bl_tree[2*r]+=s:0!==r?(r!==a&&e.bl_tree[2*r]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=r,0===n?(o=138,l=3):r===n?(o=6,l=3):(o=7,l=4))},Fe=(e,t,A)=>{let i,r,a=-1,n=t[1],s=0,o=7,l=4;for(0===n&&(o=138,l=3),i=0;i<=A;i++)if(r=n,n=t[2*(i+1)+1],!(++s<o&&r===n)){if(s<l)do{ye(e,r,e.bl_tree)}while(0!=--s);else 0!==r?(r!==a&&(ye(e,r,e.bl_tree),s--),ye(e,16,e.bl_tree),pe(e,s-3,2)):s<=10?(ye(e,17,e.bl_tree),pe(e,s-3,3)):(ye(e,18,e.bl_tree),pe(e,s-11,7));s=0,a=r,0===n?(o=138,l=3):r===n?(o=6,l=3):(o=7,l=4)}};let Re=!1;const Le=(e,t,A,i)=>{pe(e,0+(i?1:0),3),ke(e),me(e,A),me(e,~A),A&&e.pending_buf.set(e.window.subarray(t,t+A),e.pending),e.pending+=A};var Me=(e,t,A,i)=>{let r,a,n=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,A=4093624447;for(t=0;t<=31;t++,A>>>=1)if(1&A&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<Ae;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),Ge(e,e.l_desc),Ge(e,e.d_desc),n=(e=>{let t;for(Ue(e,e.dyn_ltree,e.l_desc.max_code),Ue(e,e.dyn_dtree,e.d_desc.max_code),Ge(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*le[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=A+5,A+4<=r&&-1!==t?Le(e,t,A,i):4===e.strategy||a===r?(pe(e,2+(i?1:0),3),Se(e,ge,he)):(pe(e,4+(i?1:0),3),((e,t,A,i)=>{let r;for(pe(e,t-257,5),pe(e,A-1,5),pe(e,i-4,4),r=0;r<i;r++)pe(e,e.bl_tree[2*le[r]+1],3);Fe(e,e.dyn_ltree,t-1),Fe(e,e.dyn_dtree,A-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,n+1),Se(e,e.dyn_ltree,e.dyn_dtree)),De(e),i&&ke(e)},Te={_tr_init:e=>{Re||((()=>{let e,t,A,i,r;const a=new Array(16);for(A=0,i=0;i<28;i++)for(de[i]=A,e=0;e<1<<ne[i];e++)fe[A++]=i;for(fe[A-1]=i,r=0,i=0;i<16;i++)for(Ie[i]=r,e=0;e<1<<se[i];e++)ce[r++]=i;for(r>>=7;i<re;i++)for(Ie[i]=r<<7,e=0;e<1<<se[i]-7;e++)ce[256+r++]=i;for(t=0;t<=ae;t++)a[t]=0;for(e=0;e<=143;)ge[2*e+1]=8,e++,a[8]++;for(;e<=255;)ge[2*e+1]=9,e++,a[9]++;for(;e<=279;)ge[2*e+1]=7,e++,a[7]++;for(;e<=287;)ge[2*e+1]=8,e++,a[8]++;for(be(ge,287,a),e=0;e<re;e++)he[2*e+1]=5,he[2*e]=_e(e,5);Be=new ue(ge,ne,257,ie,ae),Ce=new ue(he,se,0,re,ae),Ee=new ue(new Array(0),oe,0,19,7)})(),Re=!0),e.l_desc=new we(e.dyn_ltree,Be),e.d_desc=new we(e.dyn_dtree,Ce),e.bl_desc=new we(e.bl_tree,Ee),e.bi_buf=0,e.bi_valid=0,De(e)},_tr_stored_block:Le,_tr_flush_block:Me,_tr_tally:(e,t,A)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=A,0===t?e.dyn_ltree[2*A]++:(e.matches++,t--,e.dyn_ltree[2*(fe[A]+Ae+1)]++,e.dyn_dtree[2*Qe(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{pe(e,2,3),ye(e,256,ge),(e=>{16===e.bi_valid?(me(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Ne=(e,t,A,i)=>{let r=65535&e|0,a=e>>>16&65535|0,n=0;for(;0!==A;){n=A>2e3?2e3:A,A-=n;do{r=r+t[i++]|0,a=a+r|0}while(--n);r%=65521,a%=65521}return r|a<<16|0};const Oe=new Uint32Array((()=>{let e,t=[];for(var A=0;A<256;A++){e=A;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[A]=e}return t})());var Pe=(e,t,A,i)=>{const r=Oe,a=i+A;e^=-1;for(let A=i;A<a;A++)e=e>>>8^r[255&(e^t[A])];return-1^e},ze={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},Ke={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:Je,_tr_stored_block:qe,_tr_flush_block:He,_tr_tally:Ye,_tr_align:Ve}=Te,{Z_NO_FLUSH:Ze,Z_PARTIAL_FLUSH:je,Z_FULL_FLUSH:Xe,Z_FINISH:We,Z_BLOCK:$e,Z_OK:et,Z_STREAM_END:tt,Z_STREAM_ERROR:At,Z_DATA_ERROR:it,Z_BUF_ERROR:rt,Z_DEFAULT_COMPRESSION:at,Z_FILTERED:nt,Z_HUFFMAN_ONLY:st,Z_RLE:ot,Z_FIXED:lt,Z_DEFAULT_STRATEGY:gt,Z_UNKNOWN:ht,Z_DEFLATED:ct}=Ke,ft=258,dt=262,It=42,ut=113,Bt=666,Ct=(e,t)=>(e.msg=ze[t],t),Et=e=>2*e-(e>4?9:0),wt=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Qt=e=>{let t,A,i,r=e.w_size;t=e.hash_size,i=t;do{A=e.head[--i],e.head[i]=A>=r?A-r:0}while(--t);t=r,i=t;do{A=e.prev[--i],e.prev[i]=A>=r?A-r:0}while(--t)};let mt=(e,t,A)=>(t<<e.hash_shift^A)&e.hash_mask;const pt=e=>{const t=e.state;let A=t.pending;A>e.avail_out&&(A=e.avail_out),0!==A&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+A),e.next_out),e.next_out+=A,t.pending_out+=A,e.total_out+=A,e.avail_out-=A,t.pending-=A,0===t.pending&&(t.pending_out=0))},yt=(e,t)=>{He(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,pt(e.strm)},_t=(e,t)=>{e.pending_buf[e.pending++]=t},bt=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Dt=(e,t,A,i)=>{let r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),A),1===e.state.wrap?e.adler=Ne(e.adler,t,r,A):2===e.state.wrap&&(e.adler=Pe(e.adler,t,r,A)),e.next_in+=r,e.total_in+=r,r)},kt=(e,t)=>{let A,i,r=e.max_chain_length,a=e.strstart,n=e.prev_length,s=e.nice_match;const o=e.strstart>e.w_size-dt?e.strstart-(e.w_size-dt):0,l=e.window,g=e.w_mask,h=e.prev,c=e.strstart+ft;let f=l[a+n-1],d=l[a+n];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(A=t,l[A+n]===d&&l[A+n-1]===f&&l[A]===l[a]&&l[++A]===l[a+1]){a+=2,A++;do{}while(l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&a<c);if(i=ft-(c-a),a=c-ft,i>n){if(e.match_start=t,n=i,i>=s)break;f=l[a+n-1],d=l[a+n]}}}while((t=h[t&g])>o&&0!=--r);return n<=e.lookahead?n:e.lookahead},vt=e=>{const t=e.w_size;let A,i,r;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-dt)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Qt(e),i+=t),0===e.strm.avail_in)break;if(A=Dt(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=A,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=mt(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=mt(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<dt&&0!==e.strm.avail_in)},xt=(e,t)=>{let A,i,r,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n=0,s=e.strm.avail_in;do{if(A=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,i=e.strstart-e.block_start,A>i+e.strm.avail_in&&(A=i+e.strm.avail_in),A>r&&(A=r),A<a&&(0===A&&t!==We||t===Ze||A!==i+e.strm.avail_in))break;n=t===We&&A===i+e.strm.avail_in?1:0,qe(e,0,0,n),e.pending_buf[e.pending-4]=A,e.pending_buf[e.pending-3]=A>>8,e.pending_buf[e.pending-2]=~A,e.pending_buf[e.pending-1]=~A>>8,pt(e.strm),i&&(i>A&&(i=A),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,A-=i),A&&(Dt(e.strm,e.strm.output,e.strm.next_out,A),e.strm.next_out+=A,e.strm.avail_out-=A,e.strm.total_out+=A)}while(0===n);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),n?4:t!==Ze&&t!==We&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Dt(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,a=r>e.w_size?e.w_size:r,i=e.strstart-e.block_start,(i>=a||(i||t===We)&&t!==Ze&&0===e.strm.avail_in&&i<=r)&&(A=i>r?r:i,n=t===We&&0===e.strm.avail_in&&A===i?1:0,qe(e,e.block_start,A,n),e.block_start+=A,pt(e.strm)),n?3:1)},St=(e,t)=>{let A,i;for(;;){if(e.lookahead<dt){if(vt(e),e.lookahead<dt&&t===Ze)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=mt(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==A&&e.strstart-A<=e.w_size-dt&&(e.match_length=kt(e,A)),e.match_length>=3)if(i=Ye(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=mt(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=mt(e,e.ins_h,e.window[e.strstart+1]);else i=Ye(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===We?(yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yt(e,!1),0===e.strm.avail_out)?1:2},Gt=(e,t)=>{let A,i,r;for(;;){if(e.lookahead<dt){if(vt(e),e.lookahead<dt&&t===Ze)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=mt(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==A&&e.prev_length<e.max_lazy_match&&e.strstart-A<=e.w_size-dt&&(e.match_length=kt(e,A),e.match_length<=5&&(e.strategy===nt||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=Ye(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=mt(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(yt(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=Ye(e,0,e.window[e.strstart-1]),i&&yt(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=Ye(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===We?(yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yt(e,!1),0===e.strm.avail_out)?1:2};function Ut(e,t,A,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=A,this.max_chain=i,this.func=r}const Ft=[new Ut(0,0,0,0,xt),new Ut(4,4,8,4,St),new Ut(4,5,16,8,St),new Ut(4,6,32,32,St),new Ut(4,4,16,16,Gt),new Ut(8,16,32,32,Gt),new Ut(8,16,128,128,Gt),new Ut(8,32,128,256,Gt),new Ut(32,128,258,1024,Gt),new Ut(32,258,258,4096,Gt)];function Rt(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=ct,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),wt(this.dyn_ltree),wt(this.dyn_dtree),wt(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),wt(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),wt(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Lt=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==It&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==ut&&t.status!==Bt?1:0},Mt=e=>{if(Lt(e))return Ct(e,At);e.total_in=e.total_out=0,e.data_type=ht;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?It:ut,e.adler=2===t.wrap?0:1,t.last_flush=-2,Je(t),et},Tt=e=>{const t=Mt(e);var A;return t===et&&((A=e.state).window_size=2*A.w_size,wt(A.head),A.max_lazy_match=Ft[A.level].max_lazy,A.good_match=Ft[A.level].good_length,A.nice_match=Ft[A.level].nice_length,A.max_chain_length=Ft[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=2,A.match_available=0,A.ins_h=0),t},Nt=(e,t,A,i,r,a)=>{if(!e)return At;let n=1;if(t===at&&(t=6),i<0?(n=0,i=-i):i>15&&(n=2,i-=16),r<1||r>9||A!==ct||i<8||i>15||t<0||t>9||a<0||a>lt||8===i&&1!==n)return Ct(e,At);8===i&&(i=9);const s=new Rt;return e.state=s,s.strm=e,s.status=It,s.wrap=n,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=a,s.method=A,Tt(e)};var Ot={deflateInit:(e,t)=>Nt(e,t,ct,15,8,gt),deflateInit2:Nt,deflateReset:Tt,deflateResetKeep:Mt,deflateSetHeader:(e,t)=>Lt(e)||2!==e.state.wrap?At:(e.state.gzhead=t,et),deflate:(e,t)=>{if(Lt(e)||t>$e||t<0)return e?Ct(e,At):At;const A=e.state;if(!e.output||0!==e.avail_in&&!e.input||A.status===Bt&&t!==We)return Ct(e,0===e.avail_out?rt:At);const i=A.last_flush;if(A.last_flush=t,0!==A.pending){if(pt(e),0===e.avail_out)return A.last_flush=-1,et}else if(0===e.avail_in&&Et(t)<=Et(i)&&t!==We)return Ct(e,rt);if(A.status===Bt&&0!==e.avail_in)return Ct(e,rt);if(A.status===It&&0===A.wrap&&(A.status=ut),A.status===It){let t=ct+(A.w_bits-8<<4)<<8,i=-1;if(i=A.strategy>=st||A.level<2?0:A.level<6?1:6===A.level?2:3,t|=i<<6,0!==A.strstart&&(t|=32),t+=31-t%31,bt(A,t),0!==A.strstart&&(bt(A,e.adler>>>16),bt(A,65535&e.adler)),e.adler=1,A.status=ut,pt(e),0!==A.pending)return A.last_flush=-1,et}if(57===A.status)if(e.adler=0,_t(A,31),_t(A,139),_t(A,8),A.gzhead)_t(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),_t(A,255&A.gzhead.time),_t(A,A.gzhead.time>>8&255),_t(A,A.gzhead.time>>16&255),_t(A,A.gzhead.time>>24&255),_t(A,9===A.level?2:A.strategy>=st||A.level<2?4:0),_t(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(_t(A,255&A.gzhead.extra.length),_t(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(e.adler=Pe(e.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69;else if(_t(A,0),_t(A,0),_t(A,0),_t(A,0),_t(A,0),_t(A,9===A.level?2:A.strategy>=st||A.level<2?4:0),_t(A,3),A.status=ut,pt(e),0!==A.pending)return A.last_flush=-1,et;if(69===A.status){if(A.gzhead.extra){let t=A.pending,i=(65535&A.gzhead.extra.length)-A.gzindex;for(;A.pending+i>A.pending_buf_size;){let r=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+r),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>t&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex+=r,pt(e),0!==A.pending)return A.last_flush=-1,et;t=0,i-=r}let r=new Uint8Array(A.gzhead.extra);A.pending_buf.set(r.subarray(A.gzindex,A.gzindex+i),A.pending),A.pending+=i,A.gzhead.hcrc&&A.pending>t&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex=0}A.status=73}if(73===A.status){if(A.gzhead.name){let t,i=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-i,i)),pt(e),0!==A.pending)return A.last_flush=-1,et;i=0}t=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,_t(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>i&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-i,i)),A.gzindex=0}A.status=91}if(91===A.status){if(A.gzhead.comment){let t,i=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-i,i)),pt(e),0!==A.pending)return A.last_flush=-1,et;i=0}t=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,_t(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>i&&(e.adler=Pe(e.adler,A.pending_buf,A.pending-i,i))}A.status=103}if(103===A.status){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(pt(e),0!==A.pending))return A.last_flush=-1,et;_t(A,255&e.adler),_t(A,e.adler>>8&255),e.adler=0}if(A.status=ut,pt(e),0!==A.pending)return A.last_flush=-1,et}if(0!==e.avail_in||0!==A.lookahead||t!==Ze&&A.status!==Bt){let i=0===A.level?xt(A,t):A.strategy===st?((e,t)=>{let A;for(;;){if(0===e.lookahead&&(vt(e),0===e.lookahead)){if(t===Ze)return 1;break}if(e.match_length=0,A=Ye(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,A&&(yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===We?(yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yt(e,!1),0===e.strm.avail_out)?1:2})(A,t):A.strategy===ot?((e,t)=>{let A,i,r,a;const n=e.window;for(;;){if(e.lookahead<=ft){if(vt(e),e.lookahead<=ft&&t===Ze)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=e.strstart-1,i=n[r],i===n[++r]&&i===n[++r]&&i===n[++r])){a=e.strstart+ft;do{}while(i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&r<a);e.match_length=ft-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(A=Ye(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(A=Ye(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),A&&(yt(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===We?(yt(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(yt(e,!1),0===e.strm.avail_out)?1:2})(A,t):Ft[A.level].func(A,t);if(3!==i&&4!==i||(A.status=Bt),1===i||3===i)return 0===e.avail_out&&(A.last_flush=-1),et;if(2===i&&(t===je?Ve(A):t!==$e&&(qe(A,0,0,!1),t===Xe&&(wt(A.head),0===A.lookahead&&(A.strstart=0,A.block_start=0,A.insert=0))),pt(e),0===e.avail_out))return A.last_flush=-1,et}return t!==We?et:A.wrap<=0?tt:(2===A.wrap?(_t(A,255&e.adler),_t(A,e.adler>>8&255),_t(A,e.adler>>16&255),_t(A,e.adler>>24&255),_t(A,255&e.total_in),_t(A,e.total_in>>8&255),_t(A,e.total_in>>16&255),_t(A,e.total_in>>24&255)):(bt(A,e.adler>>>16),bt(A,65535&e.adler)),pt(e),A.wrap>0&&(A.wrap=-A.wrap),0!==A.pending?et:tt)},deflateEnd:e=>{if(Lt(e))return At;const t=e.state.status;return e.state=null,t===ut?Ct(e,it):et},deflateSetDictionary:(e,t)=>{let A=t.length;if(Lt(e))return At;const i=e.state,r=i.wrap;if(2===r||1===r&&i.status!==It||i.lookahead)return At;if(1===r&&(e.adler=Ne(e.adler,t,A,0)),i.wrap=0,A>=i.w_size){0===r&&(wt(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(A-i.w_size,A),0),t=e,A=i.w_size}const a=e.avail_in,n=e.next_in,s=e.input;for(e.avail_in=A,e.next_in=0,e.input=t,vt(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=mt(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,vt(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=n,e.input=s,e.avail_in=a,i.wrap=r,et},deflateInfo:"pako deflate (from Nodeca project)"};const Pt=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var zt={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const A=t.shift();if(A){if("object"!=typeof A)throw new TypeError(A+"must be non-object");for(const t in A)Pt(A,t)&&(e[t]=A[t])}}return e},flattenChunks:e=>{let t=0;for(let A=0,i=e.length;A<i;A++)t+=e[A].length;const A=new Uint8Array(t);for(let t=0,i=0,r=e.length;t<r;t++){let r=e[t];A.set(r,i),i+=r.length}return A}};let Kt=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Kt=!1}const Jt=new Uint8Array(256);for(let e=0;e<256;e++)Jt[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;Jt[254]=Jt[254]=1;var qt={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,A,i,r,a,n=e.length,s=0;for(r=0;r<n;r++)A=e.charCodeAt(r),55296==(64512&A)&&r+1<n&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(A=65536+(A-55296<<10)+(i-56320),r++)),s+=A<128?1:A<2048?2:A<65536?3:4;for(t=new Uint8Array(s),a=0,r=0;a<s;r++)A=e.charCodeAt(r),55296==(64512&A)&&r+1<n&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(A=65536+(A-55296<<10)+(i-56320),r++)),A<128?t[a++]=A:A<2048?(t[a++]=192|A>>>6,t[a++]=128|63&A):A<65536?(t[a++]=224|A>>>12,t[a++]=128|A>>>6&63,t[a++]=128|63&A):(t[a++]=240|A>>>18,t[a++]=128|A>>>12&63,t[a++]=128|A>>>6&63,t[a++]=128|63&A);return t},buf2string:(e,t)=>{const A=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const a=new Array(2*A);for(r=0,i=0;i<A;){let t=e[i++];if(t<128){a[r++]=t;continue}let n=Jt[t];if(n>4)a[r++]=65533,i+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&i<A;)t=t<<6|63&e[i++],n--;n>1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Kt)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let A="";for(let i=0;i<t;i++)A+=String.fromCharCode(e[i]);return A})(a,r)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let A=t-1;for(;A>=0&&128==(192&e[A]);)A--;return A<0||0===A?t:A+Jt[e[A]]>t?A:t}};var Ht=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const Yt=Object.prototype.toString,{Z_NO_FLUSH:Vt,Z_SYNC_FLUSH:Zt,Z_FULL_FLUSH:jt,Z_FINISH:Xt,Z_OK:Wt,Z_STREAM_END:$t,Z_DEFAULT_COMPRESSION:eA,Z_DEFAULT_STRATEGY:tA,Z_DEFLATED:AA}=Ke;function iA(e){this.options=zt.assign({level:eA,method:AA,chunkSize:16384,windowBits:15,memLevel:8,strategy:tA},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ht,this.strm.avail_out=0;let A=Ot.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(A!==Wt)throw new Error(ze[A]);if(t.header&&Ot.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?qt.string2buf(t.dictionary):"[object ArrayBuffer]"===Yt.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,A=Ot.deflateSetDictionary(this.strm,e),A!==Wt)throw new Error(ze[A]);this._dict_set=!0}}iA.prototype.push=function(e,t){const A=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?Xt:Vt,"string"==typeof e?A.input=qt.string2buf(e):"[object ArrayBuffer]"===Yt.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;)if(0===A.avail_out&&(A.output=new Uint8Array(i),A.next_out=0,A.avail_out=i),(a===Zt||a===jt)&&A.avail_out<=6)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else{if(r=Ot.deflate(A,a),r===$t)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),r=Ot.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===Wt;if(0!==A.avail_out){if(a>0&&A.next_out>0)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else if(0===A.avail_in)break}else this.onData(A.output)}return!0},iA.prototype.onData=function(e){this.chunks.push(e)},iA.prototype.onEnd=function(e){e===Wt&&(this.result=zt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const rA=16209;var aA=function(e,t){let A,i,r,a,n,s,o,l,g,h,c,f,d,I,u,B,C,E,w,Q,m,p,y,_;const b=e.state;A=e.next_in,y=e.input,i=A+(e.avail_in-5),r=e.next_out,_=e.output,a=r-(t-e.avail_out),n=r+(e.avail_out-257),s=b.dmax,o=b.wsize,l=b.whave,g=b.wnext,h=b.window,c=b.hold,f=b.bits,d=b.lencode,I=b.distcode,u=(1<<b.lenbits)-1,B=(1<<b.distbits)-1;e:do{f<15&&(c+=y[A++]<<f,f+=8,c+=y[A++]<<f,f+=8),C=d[c&u];t:for(;;){if(E=C>>>24,c>>>=E,f-=E,E=C>>>16&255,0===E)_[r++]=65535&C;else{if(!(16&E)){if(0==(64&E)){C=d[(65535&C)+(c&(1<<E)-1)];continue t}if(32&E){b.mode=16191;break e}e.msg="invalid literal/length code",b.mode=rA;break e}w=65535&C,E&=15,E&&(f<E&&(c+=y[A++]<<f,f+=8),w+=c&(1<<E)-1,c>>>=E,f-=E),f<15&&(c+=y[A++]<<f,f+=8,c+=y[A++]<<f,f+=8),C=I[c&B];A:for(;;){if(E=C>>>24,c>>>=E,f-=E,E=C>>>16&255,!(16&E)){if(0==(64&E)){C=I[(65535&C)+(c&(1<<E)-1)];continue A}e.msg="invalid distance code",b.mode=rA;break e}if(Q=65535&C,E&=15,f<E&&(c+=y[A++]<<f,f+=8,f<E&&(c+=y[A++]<<f,f+=8)),Q+=c&(1<<E)-1,Q>s){e.msg="invalid distance too far back",b.mode=rA;break e}if(c>>>=E,f-=E,E=r-a,Q>E){if(E=Q-E,E>l&&b.sane){e.msg="invalid distance too far back",b.mode=rA;break e}if(m=0,p=h,0===g){if(m+=o-E,E<w){w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}}else if(g<E){if(m+=o+g-E,E-=g,E<w){w-=E;do{_[r++]=h[m++]}while(--E);if(m=0,g<w){E=g,w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}}}else if(m+=g-E,E<w){w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}for(;w>2;)_[r++]=p[m++],_[r++]=p[m++],_[r++]=p[m++],w-=3;w&&(_[r++]=p[m++],w>1&&(_[r++]=p[m++]))}else{m=r-Q;do{_[r++]=_[m++],_[r++]=_[m++],_[r++]=_[m++],w-=3}while(w>2);w&&(_[r++]=_[m++],w>1&&(_[r++]=_[m++]))}break}}break}}while(A<i&&r<n);w=f>>3,A-=w,f-=w<<3,c&=(1<<f)-1,e.next_in=A,e.next_out=r,e.avail_in=A<i?i-A+5:5-(A-i),e.avail_out=r<n?n-r+257:257-(r-n),b.hold=c,b.bits=f};const nA=15,sA=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),oA=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),lA=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),gA=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var hA=(e,t,A,i,r,a,n,s)=>{const o=s.bits;let l,g,h,c,f,d,I=0,u=0,B=0,C=0,E=0,w=0,Q=0,m=0,p=0,y=0,_=null;const b=new Uint16Array(16),D=new Uint16Array(16);let k,v,x,S=null;for(I=0;I<=nA;I++)b[I]=0;for(u=0;u<i;u++)b[t[A+u]]++;for(E=o,C=nA;C>=1&&0===b[C];C--);if(E>C&&(E=C),0===C)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(B=1;B<C&&0===b[B];B++);for(E<B&&(E=B),m=1,I=1;I<=nA;I++)if(m<<=1,m-=b[I],m<0)return-1;if(m>0&&(0===e||1!==C))return-1;for(D[1]=0,I=1;I<nA;I++)D[I+1]=D[I]+b[I];for(u=0;u<i;u++)0!==t[A+u]&&(n[D[t[A+u]]++]=u);if(0===e?(_=S=n,d=20):1===e?(_=sA,S=oA,d=257):(_=lA,S=gA,d=0),y=0,u=0,I=B,f=a,w=E,Q=0,h=-1,p=1<<E,c=p-1,1===e&&p>852||2===e&&p>592)return 1;for(;;){k=I-Q,n[u]+1<d?(v=0,x=n[u]):n[u]>=d?(v=S[n[u]-d],x=_[n[u]-d]):(v=96,x=0),l=1<<I-Q,g=1<<w,B=g;do{g-=l,r[f+(y>>Q)+g]=k<<24|v<<16|x|0}while(0!==g);for(l=1<<I-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,u++,0==--b[I]){if(I===C)break;I=t[A+n[u]]}if(I>E&&(y&c)!==h){for(0===Q&&(Q=E),f+=B,w=I-Q,m=1<<w;w+Q<C&&(m-=b[w+Q],!(m<=0));)w++,m<<=1;if(p+=1<<w,1===e&&p>852||2===e&&p>592)return 1;h=y&c,r[h]=E<<24|w<<16|f-a|0}}return 0!==y&&(r[f+y]=I-Q<<24|64<<16|0),s.bits=E,0};const{Z_FINISH:cA,Z_BLOCK:fA,Z_TREES:dA,Z_OK:IA,Z_STREAM_END:uA,Z_NEED_DICT:BA,Z_STREAM_ERROR:CA,Z_DATA_ERROR:EA,Z_MEM_ERROR:wA,Z_BUF_ERROR:QA,Z_DEFLATED:mA}=Ke,pA=16180,yA=16190,_A=16191,bA=16192,DA=16194,kA=16199,vA=16200,xA=16206,SA=16209,GA=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function UA(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const FA=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<pA||t.mode>16211?1:0},RA=e=>{if(FA(e))return CA;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=pA,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,IA},LA=e=>{if(FA(e))return CA;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,RA(e)},MA=(e,t)=>{let A;if(FA(e))return CA;const i=e.state;return t<0?(A=0,t=-t):(A=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?CA:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=A,i.wbits=t,LA(e))},TA=(e,t)=>{if(!e)return CA;const A=new UA;e.state=A,A.strm=e,A.window=null,A.mode=pA;const i=MA(e,t);return i!==IA&&(e.state=null),i};let NA,OA,PA=!0;const zA=e=>{if(PA){NA=new Int32Array(512),OA=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(hA(1,e.lens,0,288,NA,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;hA(2,e.lens,0,32,OA,0,e.work,{bits:5}),PA=!1}e.lencode=NA,e.lenbits=9,e.distcode=OA,e.distbits=5},KA=(e,t,A,i)=>{let r;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(A-a.wsize,A),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(t.subarray(A-i,A-i+r),a.wnext),(i-=r)?(a.window.set(t.subarray(A-i,A),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};var JA={inflateReset:LA,inflateReset2:MA,inflateResetKeep:RA,inflateInit:e=>TA(e,15),inflateInit2:TA,inflate:(e,t)=>{let A,i,r,a,n,s,o,l,g,h,c,f,d,I,u,B,C,E,w,Q,m,p,y=0;const _=new Uint8Array(4);let b,D;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(FA(e)||!e.output||!e.input&&0!==e.avail_in)return CA;A=e.state,A.mode===_A&&(A.mode=bA),n=e.next_out,r=e.output,o=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=A.hold,g=A.bits,h=s,c=o,p=IA;e:for(;;)switch(A.mode){case pA:if(0===A.wrap){A.mode=bA;break}for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(2&A.wrap&&35615===l){0===A.wbits&&(A.wbits=15),A.check=0,_[0]=255&l,_[1]=l>>>8&255,A.check=Pe(A.check,_,2,0),l=0,g=0,A.mode=16181;break}if(A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",A.mode=SA;break}if((15&l)!==mA){e.msg="unknown compression method",A.mode=SA;break}if(l>>>=4,g-=4,m=8+(15&l),0===A.wbits&&(A.wbits=m),m>15||m>A.wbits){e.msg="invalid window size",A.mode=SA;break}A.dmax=1<<A.wbits,A.flags=0,e.adler=A.check=1,A.mode=512&l?16189:_A,l=0,g=0;break;case 16181:for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(A.flags=l,(255&A.flags)!==mA){e.msg="unknown compression method",A.mode=SA;break}if(57344&A.flags){e.msg="unknown header flags set",A.mode=SA;break}A.head&&(A.head.text=l>>8&1),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=Pe(A.check,_,2,0)),l=0,g=0,A.mode=16182;case 16182:for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.head&&(A.head.time=l),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,A.check=Pe(A.check,_,4,0)),l=0,g=0,A.mode=16183;case 16183:for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.head&&(A.head.xflags=255&l,A.head.os=l>>8),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=Pe(A.check,_,2,0)),l=0,g=0,A.mode=16184;case 16184:if(1024&A.flags){for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.length=l,A.head&&(A.head.extra_len=l),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=Pe(A.check,_,2,0)),l=0,g=0}else A.head&&(A.head.extra=null);A.mode=16185;case 16185:if(1024&A.flags&&(f=A.length,f>s&&(f=s),f&&(A.head&&(m=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(i.subarray(a,a+f),m)),512&A.flags&&4&A.wrap&&(A.check=Pe(A.check,i,f,a)),s-=f,a+=f,A.length-=f),A.length))break e;A.length=0,A.mode=16186;case 16186:if(2048&A.flags){if(0===s)break e;f=0;do{m=i[a+f++],A.head&&m&&A.length<65536&&(A.head.name+=String.fromCharCode(m))}while(m&&f<s);if(512&A.flags&&4&A.wrap&&(A.check=Pe(A.check,i,f,a)),s-=f,a+=f,m)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=16187;case 16187:if(4096&A.flags){if(0===s)break e;f=0;do{m=i[a+f++],A.head&&m&&A.length<65536&&(A.head.comment+=String.fromCharCode(m))}while(m&&f<s);if(512&A.flags&&4&A.wrap&&(A.check=Pe(A.check,i,f,a)),s-=f,a+=f,m)break e}else A.head&&(A.head.comment=null);A.mode=16188;case 16188:if(512&A.flags){for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(4&A.wrap&&l!==(65535&A.check)){e.msg="header crc mismatch",A.mode=SA;break}l=0,g=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),e.adler=A.check=0,A.mode=_A;break;case 16189:for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}e.adler=A.check=GA(l),l=0,g=0,A.mode=yA;case yA:if(0===A.havedict)return e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,BA;e.adler=A.check=1,A.mode=_A;case _A:if(t===fA||t===dA)break e;case bA:if(A.last){l>>>=7&g,g-=7&g,A.mode=xA;break}for(;g<3;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}switch(A.last=1&l,l>>>=1,g-=1,3&l){case 0:A.mode=16193;break;case 1:if(zA(A),A.mode=kA,t===dA){l>>>=2,g-=2;break e}break;case 2:A.mode=16196;break;case 3:e.msg="invalid block type",A.mode=SA}l>>>=2,g-=2;break;case 16193:for(l>>>=7&g,g-=7&g;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",A.mode=SA;break}if(A.length=65535&l,l=0,g=0,A.mode=DA,t===dA)break e;case DA:A.mode=16195;case 16195:if(f=A.length,f){if(f>s&&(f=s),f>o&&(f=o),0===f)break e;r.set(i.subarray(a,a+f),n),s-=f,a+=f,o-=f,n+=f,A.length-=f;break}A.mode=_A;break;case 16196:for(;g<14;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(A.nlen=257+(31&l),l>>>=5,g-=5,A.ndist=1+(31&l),l>>>=5,g-=5,A.ncode=4+(15&l),l>>>=4,g-=4,A.nlen>286||A.ndist>30){e.msg="too many length or distance symbols",A.mode=SA;break}A.have=0,A.mode=16197;case 16197:for(;A.have<A.ncode;){for(;g<3;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.lens[k[A.have++]]=7&l,l>>>=3,g-=3}for(;A.have<19;)A.lens[k[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,b={bits:A.lenbits},p=hA(0,A.lens,0,19,A.lencode,0,A.work,b),A.lenbits=b.bits,p){e.msg="invalid code lengths set",A.mode=SA;break}A.have=0,A.mode=16198;case 16198:for(;A.have<A.nlen+A.ndist;){for(;y=A.lencode[l&(1<<A.lenbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(C<16)l>>>=u,g-=u,A.lens[A.have++]=C;else{if(16===C){for(D=u+2;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(l>>>=u,g-=u,0===A.have){e.msg="invalid bit length repeat",A.mode=SA;break}m=A.lens[A.have-1],f=3+(3&l),l>>>=2,g-=2}else if(17===C){for(D=u+3;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=u,g-=u,m=0,f=3+(7&l),l>>>=3,g-=3}else{for(D=u+7;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=u,g-=u,m=0,f=11+(127&l),l>>>=7,g-=7}if(A.have+f>A.nlen+A.ndist){e.msg="invalid bit length repeat",A.mode=SA;break}for(;f--;)A.lens[A.have++]=m}}if(A.mode===SA)break;if(0===A.lens[256]){e.msg="invalid code -- missing end-of-block",A.mode=SA;break}if(A.lenbits=9,b={bits:A.lenbits},p=hA(1,A.lens,0,A.nlen,A.lencode,0,A.work,b),A.lenbits=b.bits,p){e.msg="invalid literal/lengths set",A.mode=SA;break}if(A.distbits=6,A.distcode=A.distdyn,b={bits:A.distbits},p=hA(2,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,b),A.distbits=b.bits,p){e.msg="invalid distances set",A.mode=SA;break}if(A.mode=kA,t===dA)break e;case kA:A.mode=vA;case vA:if(s>=6&&o>=258){e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,aA(e,c),n=e.next_out,r=e.output,o=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=A.hold,g=A.bits,A.mode===_A&&(A.back=-1);break}for(A.back=0;y=A.lencode[l&(1<<A.lenbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(B&&0==(240&B)){for(E=u,w=B,Q=C;y=A.lencode[Q+((l&(1<<E+w)-1)>>E)],u=y>>>24,B=y>>>16&255,C=65535&y,!(E+u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=E,g-=E,A.back+=E}if(l>>>=u,g-=u,A.back+=u,A.length=C,0===B){A.mode=16205;break}if(32&B){A.back=-1,A.mode=_A;break}if(64&B){e.msg="invalid literal/length code",A.mode=SA;break}A.extra=15&B,A.mode=16201;case 16201:if(A.extra){for(D=A.extra;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.length+=l&(1<<A.extra)-1,l>>>=A.extra,g-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=16202;case 16202:for(;y=A.distcode[l&(1<<A.distbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(0==(240&B)){for(E=u,w=B,Q=C;y=A.distcode[Q+((l&(1<<E+w)-1)>>E)],u=y>>>24,B=y>>>16&255,C=65535&y,!(E+u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=E,g-=E,A.back+=E}if(l>>>=u,g-=u,A.back+=u,64&B){e.msg="invalid distance code",A.mode=SA;break}A.offset=C,A.extra=15&B,A.mode=16203;case 16203:if(A.extra){for(D=A.extra;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.offset+=l&(1<<A.extra)-1,l>>>=A.extra,g-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){e.msg="invalid distance too far back",A.mode=SA;break}A.mode=16204;case 16204:if(0===o)break e;if(f=c-o,A.offset>f){if(f=A.offset-f,f>A.whave&&A.sane){e.msg="invalid distance too far back",A.mode=SA;break}f>A.wnext?(f-=A.wnext,d=A.wsize-f):d=A.wnext-f,f>A.length&&(f=A.length),I=A.window}else I=r,d=n-A.offset,f=A.length;f>o&&(f=o),o-=f,A.length-=f;do{r[n++]=I[d++]}while(--f);0===A.length&&(A.mode=vA);break;case 16205:if(0===o)break e;r[n++]=A.length,o--,A.mode=vA;break;case xA:if(A.wrap){for(;g<32;){if(0===s)break e;s--,l|=i[a++]<<g,g+=8}if(c-=o,e.total_out+=c,A.total+=c,4&A.wrap&&c&&(e.adler=A.check=A.flags?Pe(A.check,r,c,n-c):Ne(A.check,r,c,n-c)),c=o,4&A.wrap&&(A.flags?l:GA(l))!==A.check){e.msg="incorrect data check",A.mode=SA;break}l=0,g=0}A.mode=16207;case 16207:if(A.wrap&&A.flags){for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(4&A.wrap&&l!==(4294967295&A.total)){e.msg="incorrect length check",A.mode=SA;break}l=0,g=0}A.mode=16208;case 16208:p=uA;break e;case SA:p=EA;break e;case 16210:return wA;default:return CA}return e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,(A.wsize||c!==e.avail_out&&A.mode<SA&&(A.mode<xA||t!==cA))&&KA(e,e.output,e.next_out,c-e.avail_out),h-=e.avail_in,c-=e.avail_out,e.total_in+=h,e.total_out+=c,A.total+=c,4&A.wrap&&c&&(e.adler=A.check=A.flags?Pe(A.check,r,c,e.next_out-c):Ne(A.check,r,c,e.next_out-c)),e.data_type=A.bits+(A.last?64:0)+(A.mode===_A?128:0)+(A.mode===kA||A.mode===DA?256:0),(0===h&&0===c||t===cA)&&p===IA&&(p=QA),p},inflateEnd:e=>{if(FA(e))return CA;let t=e.state;return t.window&&(t.window=null),e.state=null,IA},inflateGetHeader:(e,t)=>{if(FA(e))return CA;const A=e.state;return 0==(2&A.wrap)?CA:(A.head=t,t.done=!1,IA)},inflateSetDictionary:(e,t)=>{const A=t.length;let i,r,a;return FA(e)?CA:(i=e.state,0!==i.wrap&&i.mode!==yA?CA:i.mode===yA&&(r=1,r=Ne(r,t,A,0),r!==i.check)?EA:(a=KA(e,t,A,A),a?(i.mode=16210,wA):(i.havedict=1,IA)))},inflateInfo:"pako inflate (from Nodeca project)"};var qA=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const HA=Object.prototype.toString,{Z_NO_FLUSH:YA,Z_FINISH:VA,Z_OK:ZA,Z_STREAM_END:jA,Z_NEED_DICT:XA,Z_STREAM_ERROR:WA,Z_DATA_ERROR:$A,Z_MEM_ERROR:ei}=Ke;function ti(e){this.options=zt.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new Ht,this.strm.avail_out=0;let A=JA.inflateInit2(this.strm,t.windowBits);if(A!==ZA)throw new Error(ze[A]);if(this.header=new qA,JA.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=qt.string2buf(t.dictionary):"[object ArrayBuffer]"===HA.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(A=JA.inflateSetDictionary(this.strm,t.dictionary),A!==ZA)))throw new Error(ze[A])}function Ai(e,t){const A=new ti(t);if(A.push(e),A.err)throw A.msg||ze[A.err];return A.result}ti.prototype.push=function(e,t){const A=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,n,s;if(this.ended)return!1;for(n=t===~~t?t:!0===t?VA:YA,"[object ArrayBuffer]"===HA.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;){for(0===A.avail_out&&(A.output=new Uint8Array(i),A.next_out=0,A.avail_out=i),a=JA.inflate(A,n),a===XA&&r&&(a=JA.inflateSetDictionary(A,r),a===ZA?a=JA.inflate(A,n):a===$A&&(a=XA));A.avail_in>0&&a===jA&&A.state.wrap>0&&0!==e[A.next_in];)JA.inflateReset(A),a=JA.inflate(A,n);switch(a){case WA:case $A:case XA:case ei:return this.onEnd(a),this.ended=!0,!1}if(s=A.avail_out,A.next_out&&(0===A.avail_out||a===jA))if("string"===this.options.to){let e=qt.utf8border(A.output,A.next_out),t=A.next_out-e,r=qt.buf2string(A.output,e);A.next_out=t,A.avail_out=i-t,t&&A.output.set(A.output.subarray(e,e+t),0),this.onData(r)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(a!==ZA||0!==s){if(a===jA)return a=JA.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===A.avail_in)break}}return!0},ti.prototype.onData=function(e){this.chunks.push(e)},ti.prototype.onEnd=function(e){e===ZA&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=zt.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var ii={Inflate:ti,inflate:Ai,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Ai(e,t)},ungzip:Ai,constants:Ke};const{Inflate:ri,inflate:ai,inflateRaw:ni,ungzip:si}=ii;var oi=ai;function li(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var gi={exports:{}};!function(e){function t(e){var t,A,i,r,a,n=Math.floor,s=new Array(64),o=new Array(64),l=new Array(64),g=new Array(64),h=new Array(65535),c=new Array(65535),f=new Array(64),d=new Array(64),I=[],u=0,B=7,C=new Array(64),E=new Array(64),w=new Array(64),Q=new Array(256),m=new Array(2048),p=[0,1,5,6,14,15,27,28,2,4,7,13,16,26,29,42,3,8,12,17,25,30,41,43,9,11,18,24,31,40,44,53,10,19,23,32,39,45,52,54,20,22,33,38,46,51,55,60,21,34,37,47,50,56,59,61,35,36,48,49,57,58,62,63],y=[0,0,1,5,1,1,1,1,1,1,0,0,0,0,0,0,0],_=[0,1,2,3,4,5,6,7,8,9,10,11],b=[0,0,2,1,3,3,2,4,3,5,5,4,4,0,0,1,125],D=[1,2,3,0,4,17,5,18,33,49,65,6,19,81,97,7,34,113,20,50,129,145,161,8,35,66,177,193,21,82,209,240,36,51,98,114,130,9,10,22,23,24,25,26,37,38,39,40,41,42,52,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,225,226,227,228,229,230,231,232,233,234,241,242,243,244,245,246,247,248,249,250],k=[0,0,3,1,1,1,1,1,1,1,1,1,0,0,0,0,0],v=[0,1,2,3,4,5,6,7,8,9,10,11],x=[0,0,2,1,2,4,4,3,4,7,5,4,4,0,1,2,119],S=[0,1,2,3,17,4,5,33,49,6,18,65,81,7,97,113,19,34,50,129,8,20,66,145,161,177,193,9,35,51,82,240,21,98,114,209,10,22,36,52,225,37,241,23,24,25,26,38,39,40,41,42,53,54,55,56,57,58,67,68,69,70,71,72,73,74,83,84,85,86,87,88,89,90,99,100,101,102,103,104,105,106,115,116,117,118,119,120,121,122,130,131,132,133,134,135,136,137,138,146,147,148,149,150,151,152,153,154,162,163,164,165,166,167,168,169,170,178,179,180,181,182,183,184,185,186,194,195,196,197,198,199,200,201,202,210,211,212,213,214,215,216,217,218,226,227,228,229,230,231,232,233,234,242,243,244,245,246,247,248,249,250];function G(e,t){for(var A=0,i=0,r=new Array,a=1;a<=16;a++){for(var n=1;n<=e[a];n++)r[t[i]]=[],r[t[i]][0]=A,r[t[i]][1]=a,i++,A++;A*=2}return r}function U(e){for(var t=e[0],A=e[1]-1;A>=0;)t&1<<A&&(u|=1<<B),A--,--B<0&&(255==u?(F(255),F(0)):F(u),B=7,u=0)}function F(e){I.push(e)}function R(e){F(e>>8&255),F(255&e)}function L(e,t,A,i,r){for(var a,n=r[0],s=r[240],o=function(e,t){var A,i,r,a,n,s,o,l,g,h,c=0;for(g=0;g<8;++g){A=e[c],i=e[c+1],r=e[c+2],a=e[c+3],n=e[c+4],s=e[c+5],o=e[c+6];var d=A+(l=e[c+7]),I=A-l,u=i+o,B=i-o,C=r+s,E=r-s,w=a+n,Q=a-n,m=d+w,p=d-w,y=u+C,_=u-C;e[c]=m+y,e[c+4]=m-y;var b=.707106781*(_+p);e[c+2]=p+b,e[c+6]=p-b;var D=.382683433*((m=Q+E)-(_=B+I)),k=.5411961*m+D,v=1.306562965*_+D,x=.707106781*(y=E+B),S=I+x,G=I-x;e[c+5]=G+k,e[c+3]=G-k,e[c+1]=S+v,e[c+7]=S-v,c+=8}for(c=0,g=0;g<8;++g){A=e[c],i=e[c+8],r=e[c+16],a=e[c+24],n=e[c+32],s=e[c+40],o=e[c+48];var U=A+(l=e[c+56]),F=A-l,R=i+o,L=i-o,M=r+s,T=r-s,N=a+n,O=a-n,P=U+N,z=U-N,K=R+M,J=R-M;e[c]=P+K,e[c+32]=P-K;var q=.707106781*(J+z);e[c+16]=z+q,e[c+48]=z-q;var H=.382683433*((P=O+T)-(J=L+F)),Y=.5411961*P+H,V=1.306562965*J+H,Z=.707106781*(K=T+L),j=F+Z,X=F-Z;e[c+40]=X+Y,e[c+24]=X-Y,e[c+8]=j+V,e[c+56]=j-V,c++}for(g=0;g<64;++g)h=e[g]*t[g],f[g]=h>0?h+.5|0:h-.5|0;return f}(e,t),l=0;l<64;++l)d[p[l]]=o[l];var g=d[0]-A;A=d[0],0==g?U(i[0]):(U(i[c[a=32767+g]]),U(h[a]));for(var I=63;I>0&&0==d[I];I--);if(0==I)return U(n),A;for(var u,B=1;B<=I;){for(var C=B;0==d[B]&&B<=I;++B);var E=B-C;if(E>=16){u=E>>4;for(var w=1;w<=u;++w)U(s);E&=15}a=32767+d[B],U(r[(E<<4)+c[a]]),U(h[a]),B++}return 63!=I&&U(n),A}function M(e){if(e<=0&&(e=1),e>100&&(e=100),a!=e){(function(e){for(var t=[16,11,10,16,24,40,51,61,12,12,14,19,26,58,60,55,14,13,16,24,40,57,69,56,14,17,22,29,51,87,80,62,18,22,37,56,68,109,103,77,24,35,55,64,81,104,113,92,49,64,78,87,103,121,120,101,72,92,95,98,112,100,103,99],A=0;A<64;A++){var i=n((t[A]*e+50)/100);i<1?i=1:i>255&&(i=255),s[p[A]]=i}for(var r=[17,18,24,47,99,99,99,99,18,21,26,66,99,99,99,99,24,26,56,99,99,99,99,99,47,66,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99,99],a=0;a<64;a++){var h=n((r[a]*e+50)/100);h<1?h=1:h>255&&(h=255),o[p[a]]=h}for(var c=[1,1.387039845,1.306562965,1.175875602,1,.785694958,.5411961,.275899379],f=0,d=0;d<8;d++)for(var I=0;I<8;I++)l[f]=1/(s[p[f]]*c[d]*c[I]*8),g[f]=1/(o[p[f]]*c[d]*c[I]*8),f++})(e<50?Math.floor(5e3/e):Math.floor(200-2*e)),a=e}}this.encode=function(e,a){var n;(new Date).getTime(),a&&M(a),I=new Array,u=0,B=7,R(65496),R(65504),R(16),F(74),F(70),F(73),F(70),F(0),F(1),F(1),F(0),R(1),R(1),F(0),F(0),void 0!==(n=e.comments)&&n.constructor===Array&&n.forEach((e=>{if("string"==typeof e){R(65534);var t,A=e.length;for(R(A+2),t=0;t<A;t++)F(e.charCodeAt(t))}})),function(e){if(e){R(65505),69===e[0]&&120===e[1]&&105===e[2]&&102===e[3]?R(e.length+2):(R(e.length+5+2),F(69),F(120),F(105),F(102),F(0));for(var t=0;t<e.length;t++)F(e[t])}}(e.exifBuffer),function(){R(65499),R(132),F(0);for(var e=0;e<64;e++)F(s[e]);F(1);for(var t=0;t<64;t++)F(o[t])}(),function(e,t){R(65472),R(17),F(8),R(t),R(e),F(3),F(1),F(17),F(0),F(2),F(17),F(1),F(3),F(17),F(1)}(e.width,e.height),function(){R(65476),R(418),F(0);for(var e=0;e<16;e++)F(y[e+1]);for(var t=0;t<=11;t++)F(_[t]);F(16);for(var A=0;A<16;A++)F(b[A+1]);for(var i=0;i<=161;i++)F(D[i]);F(1);for(var r=0;r<16;r++)F(k[r+1]);for(var a=0;a<=11;a++)F(v[a]);F(17);for(var n=0;n<16;n++)F(x[n+1]);for(var s=0;s<=161;s++)F(S[s])}(),R(65498),R(12),F(3),F(1),F(0),F(2),F(17),F(3),F(17),F(0),F(63),F(0);var h=0,c=0,f=0;u=0,B=7,this.encode.displayName="_encode_";for(var d,Q,p,G,T,N,O,P,z,K=e.data,J=e.width,q=e.height,H=4*J,Y=0;Y<q;){for(d=0;d<H;){for(N=T=H*Y+d,O=-1,P=0,z=0;z<64;z++)N=T+(P=z>>3)*H+(O=4*(7&z)),Y+P>=q&&(N-=H*(Y+1+P-q)),d+O>=H&&(N-=d+O-H+4),Q=K[N++],p=K[N++],G=K[N++],C[z]=(m[Q]+m[p+256>>0]+m[G+512>>0]>>16)-128,E[z]=(m[Q+768>>0]+m[p+1024>>0]+m[G+1280>>0]>>16)-128,w[z]=(m[Q+1280>>0]+m[p+1536>>0]+m[G+1792>>0]>>16)-128;h=L(C,l,h,t,i),c=L(E,g,c,A,r),f=L(w,g,f,A,r),d+=32}Y+=8}if(B>=0){var V=[];V[1]=B+1,V[0]=(1<<B+1)-1,U(V)}return R(65497),Buffer.from(I)},(new Date).getTime(),e||(e=50),function(){for(var e=String.fromCharCode,t=0;t<256;t++)Q[t]=e(t)}(),t=G(y,_),A=G(k,v),i=G(b,D),r=G(x,S),function(){for(var e=1,t=2,A=1;A<=15;A++){for(var i=e;i<t;i++)c[32767+i]=A,h[32767+i]=[],h[32767+i][1]=A,h[32767+i][0]=i;for(var r=-(t-1);r<=-e;r++)c[32767+r]=A,h[32767+r]=[],h[32767+r][1]=A,h[32767+r][0]=t-1+r;e<<=1,t<<=1}}(),function(){for(var e=0;e<256;e++)m[e]=19595*e,m[e+256>>0]=38470*e,m[e+512>>0]=7471*e+32768,m[e+768>>0]=-11059*e,m[e+1024>>0]=-21709*e,m[e+1280>>0]=32768*e+8421375,m[e+1536>>0]=-27439*e,m[e+1792>>0]=-5329*e}(),M(e),(new Date).getTime()}gi.exports=function(e,A){void 0===A&&(A=50);var i=new t(A),r=i.encode(e,A);return{data:r,width:e.width,height:e.height}}}();var hi,ci,fi=gi.exports,di={exports:{}};hi=di,ci=function(){var e=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),t=4017,A=799,i=3406,r=2276,a=1567,n=3784,s=5793,o=2896;function l(){}function g(e,t){for(var A,i,r=0,a=[],n=16;n>0&&!e[n-1];)n--;a.push({children:[],index:0});var s,o=a[0];for(A=0;A<n;A++){for(i=0;i<e[A];i++){for((o=a.pop()).children[o.index]=t[r];o.index>0;){if(0===a.length)throw new Error("Could not recreate Huffman Table");o=a.pop()}for(o.index++,a.push(o);a.length<=A;)a.push(s={children:[],index:0}),o.children[o.index]=s.children,o=s;r++}A+1<n&&(a.push(s={children:[],index:0}),o.children[o.index]=s.children,o=s)}return a[0].children}function h(t,A,i,r,a,n,s,o,l,g){i.precision,i.samplesPerLine,i.scanLines;var h=i.mcusPerLine,c=i.progressive;i.maxH,i.maxV;var f=A,d=0,I=0;function u(){if(I>0)return I--,d>>I&1;if(255==(d=t[A++])){var e=t[A++];if(e)throw new Error("unexpected marker: "+(d<<8|e).toString(16))}return I=7,d>>>7}function B(e){for(var t,A=e;null!==(t=u());){if("number"==typeof(A=A[t]))return A;if("object"!=typeof A)throw new Error("invalid huffman sequence")}return null}function C(e){for(var t=0;e>0;){var A=u();if(null===A)return;t=t<<1|A,e--}return t}function E(e){var t=C(e);return t>=1<<e-1?t:t+(-1<<e)+1}var w,Q=0,m=0;function p(e,t,A,i,r){var a=A%h,n=(A/h|0)*e.v+i,s=a*e.h+r;void 0===e.blocks[n]&&g.tolerantDecoding||t(e,e.blocks[n][s])}function y(e,t,A){var i=A/e.blocksPerLine|0,r=A%e.blocksPerLine;void 0===e.blocks[i]&&g.tolerantDecoding||t(e,e.blocks[i][r])}var _,b,D,k,v,x,S=r.length;x=c?0===n?0===o?function(e,t){var A=B(e.huffmanTableDC),i=0===A?0:E(A)<<l;t[0]=e.pred+=i}:function(e,t){t[0]|=u()<<l}:0===o?function(t,A){if(Q>0)Q--;else for(var i=n,r=s;i<=r;){var a=B(t.huffmanTableAC),o=15&a,g=a>>4;if(0!==o)A[e[i+=g]]=E(o)*(1<<l),i++;else{if(g<15){Q=C(g)+(1<<g)-1;break}i+=16}}}:function(t,A){for(var i=n,r=s,a=0;i<=r;){var o=e[i],g=A[o]<0?-1:1;switch(m){case 0:var h=B(t.huffmanTableAC),c=15&h;if(a=h>>4,0===c)a<15?(Q=C(a)+(1<<a),m=4):(a=16,m=1);else{if(1!==c)throw new Error("invalid ACn encoding");w=E(c),m=a?2:3}continue;case 1:case 2:A[o]?A[o]+=(u()<<l)*g:0==--a&&(m=2==m?3:0);break;case 3:A[o]?A[o]+=(u()<<l)*g:(A[o]=w<<l,m=0);break;case 4:A[o]&&(A[o]+=(u()<<l)*g)}i++}4===m&&0==--Q&&(m=0)}:function(t,A){var i=B(t.huffmanTableDC),r=0===i?0:E(i);A[0]=t.pred+=r;for(var a=1;a<64;){var n=B(t.huffmanTableAC),s=15&n,o=n>>4;if(0!==s)A[e[a+=o]]=E(s),a++;else{if(o<15)break;a+=16}}};var G,U,F,R,L=0;for(U=1==S?r[0].blocksPerLine*r[0].blocksPerColumn:h*i.mcusPerColumn,a||(a=U);L<U;){for(b=0;b<S;b++)r[b].pred=0;if(Q=0,1==S)for(_=r[0],v=0;v<a;v++)y(_,x,L),L++;else for(v=0;v<a;v++){for(b=0;b<S;b++)for(F=(_=r[b]).h,R=_.v,D=0;D<R;D++)for(k=0;k<F;k++)p(_,x,L,D,k);if(++L===U)break}if(L===U)do{if(255===t[A]&&0!==t[A+1])break;A+=1}while(A<t.length-2);if(I=0,(G=t[A]<<8|t[A+1])<65280)throw new Error("marker was not found");if(!(G>=65488&&G<=65495))break;A+=2}return A-f}function c(e,l){var g,h,c=[],f=l.blocksPerLine,d=l.blocksPerColumn,I=f<<3,B=new Int32Array(64),C=new Uint8Array(64);function E(e,g,h){var c,f,d,I,u,B,C,E,w,Q,m=l.quantizationTable,p=h;for(Q=0;Q<64;Q++)p[Q]=e[Q]*m[Q];for(Q=0;Q<8;++Q){var y=8*Q;0!=p[1+y]||0!=p[2+y]||0!=p[3+y]||0!=p[4+y]||0!=p[5+y]||0!=p[6+y]||0!=p[7+y]?(c=s*p[0+y]+128>>8,f=s*p[4+y]+128>>8,d=p[2+y],I=p[6+y],u=o*(p[1+y]-p[7+y])+128>>8,E=o*(p[1+y]+p[7+y])+128>>8,B=p[3+y]<<4,C=p[5+y]<<4,w=c-f+1>>1,c=c+f+1>>1,f=w,w=d*n+I*a+128>>8,d=d*a-I*n+128>>8,I=w,w=u-C+1>>1,u=u+C+1>>1,C=w,w=E+B+1>>1,B=E-B+1>>1,E=w,w=c-I+1>>1,c=c+I+1>>1,I=w,w=f-d+1>>1,f=f+d+1>>1,d=w,w=u*r+E*i+2048>>12,u=u*i-E*r+2048>>12,E=w,w=B*A+C*t+2048>>12,B=B*t-C*A+2048>>12,C=w,p[0+y]=c+E,p[7+y]=c-E,p[1+y]=f+C,p[6+y]=f-C,p[2+y]=d+B,p[5+y]=d-B,p[3+y]=I+u,p[4+y]=I-u):(w=s*p[0+y]+512>>10,p[0+y]=w,p[1+y]=w,p[2+y]=w,p[3+y]=w,p[4+y]=w,p[5+y]=w,p[6+y]=w,p[7+y]=w)}for(Q=0;Q<8;++Q){var _=Q;0!=p[8+_]||0!=p[16+_]||0!=p[24+_]||0!=p[32+_]||0!=p[40+_]||0!=p[48+_]||0!=p[56+_]?(c=s*p[0+_]+2048>>12,f=s*p[32+_]+2048>>12,d=p[16+_],I=p[48+_],u=o*(p[8+_]-p[56+_])+2048>>12,E=o*(p[8+_]+p[56+_])+2048>>12,B=p[24+_],C=p[40+_],w=c-f+1>>1,c=c+f+1>>1,f=w,w=d*n+I*a+2048>>12,d=d*a-I*n+2048>>12,I=w,w=u-C+1>>1,u=u+C+1>>1,C=w,w=E+B+1>>1,B=E-B+1>>1,E=w,w=c-I+1>>1,c=c+I+1>>1,I=w,w=f-d+1>>1,f=f+d+1>>1,d=w,w=u*r+E*i+2048>>12,u=u*i-E*r+2048>>12,E=w,w=B*A+C*t+2048>>12,B=B*t-C*A+2048>>12,C=w,p[0+_]=c+E,p[56+_]=c-E,p[8+_]=f+C,p[48+_]=f-C,p[16+_]=d+B,p[40+_]=d-B,p[24+_]=I+u,p[32+_]=I-u):(w=s*h[Q+0]+8192>>14,p[0+_]=w,p[8+_]=w,p[16+_]=w,p[24+_]=w,p[32+_]=w,p[40+_]=w,p[48+_]=w,p[56+_]=w)}for(Q=0;Q<64;++Q){var b=128+(p[Q]+8>>4);g[Q]=b<0?0:b>255?255:b}}u(I*d*8);for(var w=0;w<d;w++){var Q=w<<3;for(g=0;g<8;g++)c.push(new Uint8Array(I));for(var m=0;m<f;m++){E(l.blocks[w][m],C,B);var p=0,y=m<<3;for(h=0;h<8;h++){var _=c[Q+h];for(g=0;g<8;g++)_[y+g]=C[p++]}}}return c}function f(e){return e<0?0:e>255?255:e}l.prototype={load:function(e){var t=new XMLHttpRequest;t.open("GET",e,!0),t.responseType="arraybuffer",t.onload=function(){var e=new Uint8Array(t.response||t.mozResponseArrayBuffer);this.parse(e),this.onload&&this.onload()}.bind(this),t.send(null)},parse:function(t){var A=1e3*this.opts.maxResolutionInMP*1e3,i=0;function r(){var e=t[i]<<8|t[i+1];return i+=2,e}function a(e){var t,A,i=1,r=1;for(A in e.components)e.components.hasOwnProperty(A)&&(i<(t=e.components[A]).h&&(i=t.h),r<t.v&&(r=t.v));var a=Math.ceil(e.samplesPerLine/8/i),n=Math.ceil(e.scanLines/8/r);for(A in e.components)if(e.components.hasOwnProperty(A)){t=e.components[A];var s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/i),o=Math.ceil(Math.ceil(e.scanLines/8)*t.v/r),l=a*t.h,g=n*t.v,h=[];u(g*l*256);for(var c=0;c<g;c++){for(var f=[],d=0;d<l;d++)f.push(new Int32Array(64));h.push(f)}t.blocksPerLine=s,t.blocksPerColumn=o,t.blocks=h}e.maxH=i,e.maxV=r,e.mcusPerLine=a,e.mcusPerColumn=n}t.length;var n,s,o,l,f=null,d=null,I=[],B=[],C=[],E=[],w=r(),Q=-1;if(this.comments=[],65496!=w)throw new Error("SOI not found");for(w=r();65497!=w;){switch(w){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:var m=(o=void 0,l=void 0,o=r(),l=t.subarray(i,i+o-2),i+=l.length,l);if(65534===w){var p=String.fromCharCode.apply(null,m);this.comments.push(p)}65504===w&&74===m[0]&&70===m[1]&&73===m[2]&&70===m[3]&&0===m[4]&&(f={version:{major:m[5],minor:m[6]},densityUnits:m[7],xDensity:m[8]<<8|m[9],yDensity:m[10]<<8|m[11],thumbWidth:m[12],thumbHeight:m[13],thumbData:m.subarray(14,14+3*m[12]*m[13])}),65505===w&&69===m[0]&&120===m[1]&&105===m[2]&&102===m[3]&&0===m[4]&&(this.exifBuffer=m.subarray(5,m.length)),65518===w&&65===m[0]&&100===m[1]&&111===m[2]&&98===m[3]&&101===m[4]&&0===m[5]&&(d={version:m[6],flags0:m[7]<<8|m[8],flags1:m[9]<<8|m[10],transformCode:m[11]});break;case 65499:for(var y=r()+i-2;i<y;){var _=t[i++];u(256);var b=new Int32Array(64);if(_>>4==0)for(V=0;V<64;V++)b[e[V]]=t[i++];else{if(_>>4!=1)throw new Error("DQT: invalid table spec");for(V=0;V<64;V++)b[e[V]]=r()}I[15&_]=b}break;case 65472:case 65473:case 65474:r(),(n={}).extended=65473===w,n.progressive=65474===w,n.precision=t[i++],n.scanLines=r(),n.samplesPerLine=r(),n.components={},n.componentsOrder=[];var D=n.scanLines*n.samplesPerLine;if(D>A){var k=Math.ceil((D-A)/1e6);throw new Error(`maxResolutionInMP limit exceeded by ${k}MP`)}var v,x=t[i++];for(H=0;H<x;H++){v=t[i];var S=t[i+1]>>4,G=15&t[i+1],U=t[i+2];if(S<=0||G<=0)throw new Error("Invalid sampling factor, expected values above 0");n.componentsOrder.push(v),n.components[v]={h:S,v:G,quantizationIdx:U},i+=3}a(n),B.push(n);break;case 65476:var F=r();for(H=2;H<F;){var R=t[i++],L=new Uint8Array(16),M=0;for(V=0;V<16;V++,i++)M+=L[V]=t[i];u(16+M);var T=new Uint8Array(M);for(V=0;V<M;V++,i++)T[V]=t[i];H+=17+M,(R>>4==0?E:C)[15&R]=g(L,T)}break;case 65501:r(),s=r();break;case 65500:r(),r();break;case 65498:r();var N=t[i++],O=[];for(H=0;H<N;H++){Z=n.components[t[i++]];var P=t[i++];Z.huffmanTableDC=E[P>>4],Z.huffmanTableAC=C[15&P],O.push(Z)}var z=t[i++],K=t[i++],J=t[i++],q=h(t,i,n,O,s,z,K,J>>4,15&J,this.opts);i+=q;break;case 65535:255!==t[i]&&i--;break;default:if(255==t[i-3]&&t[i-2]>=192&&t[i-2]<=254){i-=3;break}if(224===w||225==w){if(-1!==Q)throw new Error(`first unknown JPEG marker at offset ${Q.toString(16)}, second unknown JPEG marker ${w.toString(16)} at offset ${(i-1).toString(16)}`);Q=i-1;const e=r();if(255===t[i+e-2]){i+=e-2;break}}throw new Error("unknown JPEG marker "+w.toString(16))}w=r()}if(1!=B.length)throw new Error("only single frame JPEGs supported");for(var H=0;H<B.length;H++){var Y=B[H].components;for(var V in Y)Y[V].quantizationTable=I[Y[V].quantizationIdx],delete Y[V].quantizationIdx}for(this.width=n.samplesPerLine,this.height=n.scanLines,this.jfif=f,this.adobe=d,this.components=[],H=0;H<n.componentsOrder.length;H++){var Z=n.components[n.componentsOrder[H]];this.components.push({lines:c(0,Z),scaleX:Z.h/n.maxH,scaleY:Z.v/n.maxV})}},getData:function(e,t){var A,i,r,a,n,s,o,l,g,h,c,d,I,B,C,E,w,Q,m,p,y,_=this.width/e,b=this.height/t,D=0,k=e*t*this.components.length;u(k);var v=new Uint8Array(k);switch(this.components.length){case 1:for(A=this.components[0],h=0;h<t;h++)for(n=A.lines[0|h*A.scaleY*b],g=0;g<e;g++)c=n[0|g*A.scaleX*_],v[D++]=c;break;case 2:for(A=this.components[0],i=this.components[1],h=0;h<t;h++)for(n=A.lines[0|h*A.scaleY*b],s=i.lines[0|h*i.scaleY*b],g=0;g<e;g++)c=n[0|g*A.scaleX*_],v[D++]=c,c=s[0|g*i.scaleX*_],v[D++]=c;break;case 3:for(y=!0,this.adobe&&this.adobe.transformCode?y=!0:void 0!==this.opts.colorTransform&&(y=!!this.opts.colorTransform),A=this.components[0],i=this.components[1],r=this.components[2],h=0;h<t;h++)for(n=A.lines[0|h*A.scaleY*b],s=i.lines[0|h*i.scaleY*b],o=r.lines[0|h*r.scaleY*b],g=0;g<e;g++)y?(c=n[0|g*A.scaleX*_],d=s[0|g*i.scaleX*_],Q=f(c+1.402*((I=o[0|g*r.scaleX*_])-128)),m=f(c-.3441363*(d-128)-.71413636*(I-128)),p=f(c+1.772*(d-128))):(Q=n[0|g*A.scaleX*_],m=s[0|g*i.scaleX*_],p=o[0|g*r.scaleX*_]),v[D++]=Q,v[D++]=m,v[D++]=p;break;case 4:if(!this.adobe)throw new Error("Unsupported color mode (4 components)");for(y=!1,this.adobe&&this.adobe.transformCode?y=!0:void 0!==this.opts.colorTransform&&(y=!!this.opts.colorTransform),A=this.components[0],i=this.components[1],r=this.components[2],a=this.components[3],h=0;h<t;h++)for(n=A.lines[0|h*A.scaleY*b],s=i.lines[0|h*i.scaleY*b],o=r.lines[0|h*r.scaleY*b],l=a.lines[0|h*a.scaleY*b],g=0;g<e;g++)y?(c=n[0|g*A.scaleX*_],d=s[0|g*i.scaleX*_],I=o[0|g*r.scaleX*_],B=l[0|g*a.scaleX*_],C=255-f(c+1.402*(I-128)),E=255-f(c-.3441363*(d-128)-.71413636*(I-128)),w=255-f(c+1.772*(d-128))):(C=n[0|g*A.scaleX*_],E=s[0|g*i.scaleX*_],w=o[0|g*r.scaleX*_],B=l[0|g*a.scaleX*_]),v[D++]=255-C,v[D++]=255-E,v[D++]=255-w,v[D++]=255-B;break;default:throw new Error("Unsupported color mode")}return v},copyToImageData:function(e,t){var A,i,r,a,n,s,o,l,g,h=e.width,c=e.height,d=e.data,I=this.getData(h,c),u=0,B=0;switch(this.components.length){case 1:for(i=0;i<c;i++)for(A=0;A<h;A++)r=I[u++],d[B++]=r,d[B++]=r,d[B++]=r,t&&(d[B++]=255);break;case 3:for(i=0;i<c;i++)for(A=0;A<h;A++)o=I[u++],l=I[u++],g=I[u++],d[B++]=o,d[B++]=l,d[B++]=g,t&&(d[B++]=255);break;case 4:for(i=0;i<c;i++)for(A=0;A<h;A++)n=I[u++],s=I[u++],r=I[u++],o=255-f(n*(1-(a=I[u++])/255)+a),l=255-f(s*(1-a/255)+a),g=255-f(r*(1-a/255)+a),d[B++]=o,d[B++]=l,d[B++]=g,t&&(d[B++]=255);break;default:throw new Error("Unsupported color mode")}}};var d=0,I=0;function u(e=0){var t=d+e;if(t>I){var A=Math.ceil((t-I)/1024/1024);throw new Error(`maxMemoryUsageInMB limit exceeded by at least ${A}MB`)}d=t}return l.resetMaxMemoryUsage=function(e){d=0,I=e},l.getBytesAllocated=function(){return d},l.requestMemoryAllocation=u,l}(),hi.exports=function(e,t={}){var A={colorTransform:void 0,useTArray:!1,formatAsRGBA:!0,tolerantDecoding:!0,maxResolutionInMP:100,maxMemoryUsageInMB:512,...t},i=new Uint8Array(e),r=new ci;r.opts=A,ci.resetMaxMemoryUsage(1024*A.maxMemoryUsageInMB*1024),r.parse(i);var a=A.formatAsRGBA?4:3,n=r.width*r.height*a;try{ci.requestMemoryAllocation(n);var s={width:r.width,height:r.height,exifBuffer:r.exifBuffer,data:A.useTArray?new Uint8Array(n):Buffer.alloc(n)};r.comments.length>0&&(s.comments=r.comments)}catch(e){if(e instanceof RangeError)throw new Error("Could not allocate enough memory for the image. Required: "+n);if(e instanceof ReferenceError&&"Buffer is not defined"===e.message)throw new Error("Buffer is not globally defined in this environment. Consider setting useTArray to true");throw e}return r.copyToImageData(s,A.formatAsRGBA),s};var Ii=li({encode:fi,decode:di.exports});const ui=Math.PI,Bi=ui/4,Ci=180/ui;function Ei(e,t){let A=e.length-t,i=0;do{for(let A=t;A>0;A--)e[i+t]+=e[i],i++;A-=t}while(A>0)}function wi(e,t,A){let i=0,r=e.length;const a=r/A;for(;r>t;){for(let A=t;A>0;--A)e[i+t]+=e[i],++i;r-=t}const n=e.slice();for(let t=0;t<a;++t)for(let i=0;i<A;++i)e[A*t+i]=n[(A-i-1)*a+t]}let Qi=class{async decode(e,t){const A=await this.decodeBlock(t),i=e.Predictor||1;if(1!==i){const t=!e.StripOffsets;return function(e,t,A,i,r,a){if(!t||1===t)return e;for(let e=0;e<r.length;++e){if(r[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[e]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const n=r[0]/8,s=2===a?1:r.length;for(let a=0;a<i&&!(a*s*A*n>=e.byteLength);++a){let i;if(2===t){switch(r[0]){case 8:i=new Uint8Array(e,a*s*A*n,s*A*n);break;case 16:i=new Uint16Array(e,a*s*A*n,s*A*n/2);break;case 32:i=new Uint32Array(e,a*s*A*n,s*A*n/4);break;default:throw new Error(`Predictor 2 not allowed with ${r[0]} bits per sample.`)}Ei(i,s)}else 3===t&&(i=new Uint8Array(e,a*s*A*n,s*A*n),wi(i,s,n))}return e}(A,i,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return A}};const mi=257;function pi(e,t){for(let A=t.length-1;A>=0;A--)e.push(t[A]);return e}function yi(e){const t=new Uint16Array(4093),A=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,A[e]=e;let i=258,r=9,a=0;function n(){i=258,r=9}function s(e){const t=function(e,t,A){const i=t%8,r=Math.floor(t/8),a=8-i,n=t+A-8*(r+1);let s=8*(r+2)-(t+A);const o=8*(r+2)-t;if(s=Math.max(0,s),r>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),mi;let l=e[r]&2**(8-i)-1;l<<=A-a;let g=l;if(r+1<e.length){let t=e[r+1]>>>s;t<<=Math.max(0,A-o),g+=t}if(n>8&&r+2<e.length){const i=8*(r+3)-(t+A);g+=e[r+2]>>>i}return g}(e,a,r);return a+=r,t}function o(e,r){return A[i]=r,t[i]=e,i++,i-1}function l(e){const i=[];for(let r=e;4096!==r;r=t[r])i.push(A[r]);return i}const g=[];n();const h=new Uint8Array(e);let c,f=s(h);for(;f!==mi;){if(256===f){for(n(),f=s(h);256===f;)f=s(h);if(f===mi)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);pi(g,l(f)),c=f}else if(f<i){const e=l(f);pi(g,e),o(c,e[e.length-1]),c=f}else{const e=l(c);if(!e)throw new Error(`Bogus entry. Not in dictionary,\n ${c} / ${i},\n position: ${a}`);pi(g,e),g.push(e[e.length-1]),o(c,e[e.length-1]),c=f}i+1>=2**r&&(12===r?c=void 0:r++),f=s(h)}return new Uint8Array(g)}let _i=class extends Qi{decodeBlock(e){return yi(e).buffer}};function bi(e){return(t,...A)=>ki(e,t,A)}function Di(e,t){return bi(Gi(e,t).get)}const{apply:ki,construct:vi,defineProperty:xi,get:Si,getOwnPropertyDescriptor:Gi,getPrototypeOf:Ui,has:Fi,ownKeys:Ri,set:Li,setPrototypeOf:Mi}=Reflect,{iterator:Ti,species:Ni,toStringTag:Oi,for:Pi}=Symbol,zi=Object,{create:Ki,defineProperty:Ji,freeze:qi,is:Hi}=zi,Yi=Array.prototype[Ti],Vi=bi(Yi),Zi=ArrayBuffer;Di(Zi.prototype,"byteLength");const ji="undefined"!=typeof SharedArrayBuffer?SharedArrayBuffer:null;ji&&Di(ji.prototype,"byteLength");const Xi=Ui(Uint8Array);Xi.from;const Wi=Xi.prototype;Wi[Ti],bi(Wi.keys),bi(Wi.values),bi(Wi.entries),bi(Wi.set),bi(Wi.reverse),bi(Wi.fill),bi(Wi.copyWithin),bi(Wi.sort),bi(Wi.slice),bi(Wi.subarray),Di(Wi,"buffer"),Di(Wi,"byteOffset"),Di(Wi,"length"),Di(Wi,Oi);const $i=Uint32Array,er=Float32Array,tr=Ui([][Ti]()),Ar=bi(tr.next),ir=bi(function*(){}().next),rr=Ui(tr),ar=bi(DataView.prototype.getUint16),nr=WeakMap,sr=nr.prototype,or=bi(sr.get),lr=bi(sr.set),gr=new nr,hr=Ki(null,{next:{value:function(){const e=or(gr,this);return Ar(e)}},[Ti]:{value:function(){return this}}});const cr=new nr,fr=Ki(rr,{next:{value:function(){const e=or(cr,this);return ir(e)},writable:!0,configurable:!0}});for(const e of Ri(tr))"next"!==e&&Ji(fr,e,Gi(tr,e));const dr=new Zi(4),Ir=new er(dr),ur=new $i(dr),Br=new $i(512),Cr=new $i(512);for(let e=0;e<256;++e){const t=e-127;t<-27?(Br[e]=0,Br[256|e]=32768,Cr[e]=24,Cr[256|e]=24):t<-14?(Br[e]=1024>>-t-14,Br[256|e]=1024>>-t-14|32768,Cr[e]=-t-1,Cr[256|e]=-t-1):t<=15?(Br[e]=t+15<<10,Br[256|e]=t+15<<10|32768,Cr[e]=13,Cr[256|e]=13):t<128?(Br[e]=31744,Br[256|e]=64512,Cr[e]=24,Cr[256|e]=24):(Br[e]=31744,Br[256|e]=64512,Cr[e]=13,Cr[256|e]=13)}const Er=new $i(2048),wr=new $i(64),Qr=new $i(64);for(let e=1;e<1024;++e){let t=e<<13,A=0;for(;0==(8388608&t);)t<<=1,A-=8388608;t&=-8388609,A+=947912704,Er[e]=t|A}for(let e=1024;e<2048;++e)Er[e]=939524096+(e-1024<<13);for(let e=1;e<31;++e)wr[e]=e<<23;wr[31]=1199570944,wr[32]=2147483648;for(let e=33;e<63;++e)wr[e]=2147483648+(e-32<<23);wr[63]=3347054592;for(let e=1;e<64;++e)32!==e&&(Qr[e]=1024);function mr(e,t,...A){return function(e){const t=e>>10;return ur[0]=Er[Qr[t]+(1023&e)]+wr[t],Ir[0]}(ar(e,t,...function(e){if(e[Ti]===Yi&&tr.next===Ar)return e;const t=Ki(hr);return lr(gr,t,Vi(e)),t}(A)))}var pr={exports:{}};function yr(e,t,A){const i=A&&A.debug||!1;i&&console.log("[xml-utils] getting "+t+" in "+e);const r="object"==typeof e?e.outer:e,a=r.slice(0,r.indexOf(">")+1),n=['"',"'"];for(let e=0;e<n.length;e++){const A=n[e],r=t+"\\="+A+"([^"+A+"]*)"+A;i&&console.log("[xml-utils] pattern:",r);const s=new RegExp(r).exec(a);if(i&&console.log("[xml-utils] match:",s),s)return s[1]}}pr.exports=yr,pr.exports.default=yr;var _r=li(pr.exports),br={exports:{}},Dr={exports:{}},kr={exports:{}};function vr(e,t,A){const i=new RegExp(t).exec(e.slice(A));return i?A+i.index:-1}kr.exports=vr,kr.exports.default=vr;var xr=kr.exports,Sr={exports:{}};function Gr(e,t,A){const i=new RegExp(t).exec(e.slice(A));return i?A+i.index+i[0].length-1:-1}Sr.exports=Gr,Sr.exports.default=Gr;var Ur=Sr.exports,Fr={exports:{}};function Rr(e,t){const A=new RegExp(t,"g"),i=e.match(A);return i?i.length:0}Fr.exports=Rr,Fr.exports.default=Rr;var Lr=Fr.exports;const Mr=xr,Tr=Ur,Nr=Lr;function Or(e,t,A){const i=A&&A.debug||!1,r=!(A&&!1===typeof A.nested),a=A&&A.startIndex||0;i&&console.log("[xml-utils] starting findTagByName with",t," and ",A);const n=Mr(e,`<${t}[ \n>/]`,a);if(i&&console.log("[xml-utils] start:",n),-1===n)return;const s=e.slice(n+t.length);let o=Tr(s,"^[^<]*[ /]>",0);const l=-1!==o&&"/"===s[o-1];if(i&&console.log("[xml-utils] selfClosing:",l),!1===l)if(r){let e=0,A=1,i=0;for(;-1!==(o=Tr(s,"[ /]"+t+">",e));){const r=s.substring(e,o+1);if(A+=Nr(r,"<"+t+"[ \n\t>]"),i+=Nr(r,"</"+t+">"),i>=A)break;e=o}}else o=Tr(s,"[ /]"+t+">",0);const g=n+t.length+o+1;if(i&&console.log("[xml-utils] end:",g),-1===g)return;const h=e.slice(n,g);let c;return c=l?null:h.slice(h.indexOf(">")+1,h.lastIndexOf("<")),{inner:c,outer:h,start:n,end:g}}Dr.exports=Or,Dr.exports.default=Or;const Pr=Dr.exports;function zr(e,t,A){const i=[],r=A&&A.debug||!1,a=!A||"boolean"!=typeof A.nested||A.nested;let n,s=A&&A.startIndex||0;for(;n=Pr(e,t,{debug:r,startIndex:s});)s=a?n.start+1+t.length:n.end,i.push(n);return r&&console.log("findTagsByName found",i.length,"tags"),i}br.exports=zr,br.exports.default=zr;var Kr=li(br.exports);const Jr={315:"Artist",258:"BitsPerSample",265:"CellLength",264:"CellWidth",320:"ColorMap",259:"Compression",33432:"Copyright",306:"DateTime",338:"ExtraSamples",266:"FillOrder",289:"FreeByteCounts",288:"FreeOffsets",291:"GrayResponseCurve",290:"GrayResponseUnit",316:"HostComputer",270:"ImageDescription",257:"ImageLength",256:"ImageWidth",271:"Make",281:"MaxSampleValue",280:"MinSampleValue",272:"Model",254:"NewSubfileType",274:"Orientation",262:"PhotometricInterpretation",284:"PlanarConfiguration",296:"ResolutionUnit",278:"RowsPerStrip",277:"SamplesPerPixel",305:"Software",279:"StripByteCounts",273:"StripOffsets",255:"SubfileType",263:"Threshholding",282:"XResolution",283:"YResolution",326:"BadFaxLines",327:"CleanFaxData",343:"ClipPath",328:"ConsecutiveBadFaxLines",433:"Decode",434:"DefaultImageColor",269:"DocumentName",336:"DotRange",321:"HalftoneHints",346:"Indexed",347:"JPEGTables",285:"PageName",297:"PageNumber",317:"Predictor",319:"PrimaryChromaticities",532:"ReferenceBlackWhite",339:"SampleFormat",340:"SMinSampleValue",341:"SMaxSampleValue",559:"StripRowCounts",330:"SubIFDs",292:"T4Options",293:"T6Options",325:"TileByteCounts",323:"TileLength",324:"TileOffsets",322:"TileWidth",301:"TransferFunction",318:"WhitePoint",344:"XClipPathUnits",286:"XPosition",529:"YCbCrCoefficients",531:"YCbCrPositioning",530:"YCbCrSubSampling",345:"YClipPathUnits",287:"YPosition",37378:"ApertureValue",40961:"ColorSpace",36868:"DateTimeDigitized",36867:"DateTimeOriginal",34665:"Exif IFD",36864:"ExifVersion",33434:"ExposureTime",41728:"FileSource",37385:"Flash",40960:"FlashpixVersion",33437:"FNumber",42016:"ImageUniqueID",37384:"LightSource",37500:"MakerNote",37377:"ShutterSpeedValue",37510:"UserComment",33723:"IPTC",34675:"ICC Profile",700:"XMP",42112:"GDAL_METADATA",42113:"GDAL_NODATA",34377:"Photoshop",33550:"ModelPixelScale",33922:"ModelTiepoint",34264:"ModelTransformation",34735:"GeoKeyDirectory",34736:"GeoDoubleParams",34737:"GeoAsciiParams",50674:"LercParameters"},qr={};for(const e in Jr)Jr.hasOwnProperty(e)&&(qr[Jr[e]]=parseInt(e,10));const Hr=[qr.BitsPerSample,qr.ExtraSamples,qr.SampleFormat,qr.StripByteCounts,qr.StripOffsets,qr.StripRowCounts,qr.TileByteCounts,qr.TileOffsets,qr.SubIFDs],Yr={1:"BYTE",2:"ASCII",3:"SHORT",4:"LONG",5:"RATIONAL",6:"SBYTE",7:"UNDEFINED",8:"SSHORT",9:"SLONG",10:"SRATIONAL",11:"FLOAT",12:"DOUBLE",13:"IFD",16:"LONG8",17:"SLONG8",18:"IFD8"},Vr={};for(const e in Yr)Yr.hasOwnProperty(e)&&(Vr[Yr[e]]=parseInt(e,10));const Zr=0,jr=1,Xr=2,Wr=3,$r=5,ea=6,ta=8,Aa=0,ia=1,ra=0,aa=1,na=2,sa={1024:"GTModelTypeGeoKey",1025:"GTRasterTypeGeoKey",1026:"GTCitationGeoKey",2048:"GeographicTypeGeoKey",2049:"GeogCitationGeoKey",2050:"GeogGeodeticDatumGeoKey",2051:"GeogPrimeMeridianGeoKey",2052:"GeogLinearUnitsGeoKey",2053:"GeogLinearUnitSizeGeoKey",2054:"GeogAngularUnitsGeoKey",2055:"GeogAngularUnitSizeGeoKey",2056:"GeogEllipsoidGeoKey",2057:"GeogSemiMajorAxisGeoKey",2058:"GeogSemiMinorAxisGeoKey",2059:"GeogInvFlatteningGeoKey",2060:"GeogAzimuthUnitsGeoKey",2061:"GeogPrimeMeridianLongGeoKey",2062:"GeogTOWGS84GeoKey",3072:"ProjectedCSTypeGeoKey",3073:"PCSCitationGeoKey",3074:"ProjectionGeoKey",3075:"ProjCoordTransGeoKey",3076:"ProjLinearUnitsGeoKey",3077:"ProjLinearUnitSizeGeoKey",3078:"ProjStdParallel1GeoKey",3079:"ProjStdParallel2GeoKey",3080:"ProjNatOriginLongGeoKey",3081:"ProjNatOriginLatGeoKey",3082:"ProjFalseEastingGeoKey",3083:"ProjFalseNorthingGeoKey",3084:"ProjFalseOriginLongGeoKey",3085:"ProjFalseOriginLatGeoKey",3086:"ProjFalseOriginEastingGeoKey",3087:"ProjFalseOriginNorthingGeoKey",3088:"ProjCenterLongGeoKey",3089:"ProjCenterLatGeoKey",3090:"ProjCenterEastingGeoKey",3091:"ProjCenterNorthingGeoKey",3092:"ProjScaleAtNatOriginGeoKey",3093:"ProjScaleAtCenterGeoKey",3094:"ProjAzimuthAngleGeoKey",3095:"ProjStraightVertPoleLongGeoKey",3096:"ProjRectifiedGridAngleGeoKey",4096:"VerticalCSTypeGeoKey",4097:"VerticalCitationGeoKey",4098:"VerticalDatumGeoKey",4099:"VerticalUnitsGeoKey"};const oa=new Map;function la(e,t){Array.isArray(e)||(e=[e]),e.forEach((e=>oa.set(e,t)))}function ga(e,t,A,i=1){return new(Object.getPrototypeOf(e).constructor)(t*A*i)}function ha(e,t,A){return(1-A)*e+A*t}function ca(e,t,A,i,r,a="nearest"){switch(a.toLowerCase()){case"nearest":return function(e,t,A,i,r){const a=t/i,n=A/r;return e.map((e=>{const s=ga(e,i,r);for(let o=0;o<r;++o){const r=Math.min(Math.round(n*o),A-1);for(let A=0;A<i;++A){const n=Math.min(Math.round(a*A),t-1),l=e[r*t+n];s[o*i+A]=l}}return s}))}(e,t,A,i,r);case"bilinear":case"linear":return function(e,t,A,i,r){const a=t/i,n=A/r;return e.map((e=>{const s=ga(e,i,r);for(let o=0;o<r;++o){const r=n*o,l=Math.floor(r),g=Math.min(Math.ceil(r),A-1);for(let A=0;A<i;++A){const n=a*A,h=n%1,c=Math.floor(n),f=Math.min(Math.ceil(n),t-1),d=e[l*t+c],I=e[l*t+f],u=e[g*t+c],B=e[g*t+f],C=ha(ha(d,I,h),ha(u,B,h),r%1);s[o*i+A]=C}}return s}))}(e,t,A,i,r);default:throw new Error(`Unsupported resampling method: '${a}'`)}}function fa(e,t,A,i,r,a,n="nearest"){switch(n.toLowerCase()){case"nearest":return function(e,t,A,i,r,a){const n=t/i,s=A/r,o=ga(e,i,r,a);for(let l=0;l<r;++l){const r=Math.min(Math.round(s*l),A-1);for(let A=0;A<i;++A){const s=Math.min(Math.round(n*A),t-1);for(let n=0;n<a;++n){const g=e[r*t*a+s*a+n];o[l*i*a+A*a+n]=g}}}return o}(e,t,A,i,r,a);case"bilinear":case"linear":return function(e,t,A,i,r,a){const n=t/i,s=A/r,o=ga(e,i,r,a);for(let l=0;l<r;++l){const r=s*l,g=Math.floor(r),h=Math.min(Math.ceil(r),A-1);for(let A=0;A<i;++A){const s=n*A,c=s%1,f=Math.floor(s),d=Math.min(Math.ceil(s),t-1);for(let n=0;n<a;++n){const s=e[g*t*a+f*a+n],I=e[g*t*a+d*a+n],u=e[h*t*a+f*a+n],B=e[h*t*a+d*a+n],C=ha(ha(s,I,c),ha(u,B,c),r%1);o[l*i*a+A*a+n]=C}}}return o}(e,t,A,i,r,a);default:throw new Error(`Unsupported resampling method: '${n}'`)}}function da(e,t,A){let i=0;for(let r=t;r<A;++r)i+=e[r];return i}function Ia(e,t,A){switch(e){case 1:if(t<=8)return new Uint8Array(A);if(t<=16)return new Uint16Array(A);if(t<=32)return new Uint32Array(A);break;case 2:if(8===t)return new Int8Array(A);if(16===t)return new Int16Array(A);if(32===t)return new Int32Array(A);break;case 3:switch(t){case 16:case 32:return new Float32Array(A);case 64:return new Float64Array(A)}}throw Error("Unsupported data format/bitsPerSample")}la([void 0,1],(()=>Promise.resolve().then((function(){return Va})).then((e=>e.default)))),la(5,(()=>Promise.resolve().then((function(){return Wa})).then((e=>e.default)))),la(6,(()=>{throw new Error("old style JPEG compression is not supported.")})),la(7,(()=>Promise.resolve().then((function(){return fn})).then((e=>e.default)))),la([8,32946],(()=>Promise.resolve().then((function(){return pl})).then((e=>e.default)))),la(32773,(()=>Promise.resolve().then((function(){return yl})).then((e=>e.default)))),la(34887,(()=>Promise.resolve().then((function(){return Ul})).then((async e=>(await e.zstd.init(),e))).then((e=>e.default)))),la(50001,(()=>Promise.resolve().then((function(){return Fl})).then((e=>e.default))));var ua=class{constructor(e,t,A,i,r,a){this.fileDirectory=e,this.geoKeys=t,this.dataView=A,this.littleEndian=i,this.tiles=r?{}:null,this.isTiled=!e.StripOffsets;const n=e.PlanarConfiguration;if(this.planarConfiguration=void 0===n?1:n,1!==this.planarConfiguration&&2!==this.planarConfiguration)throw new Error("Invalid planar configuration.");this.source=a}getFileDirectory(){return this.fileDirectory}getGeoKeys(){return this.geoKeys}getWidth(){return this.fileDirectory.ImageWidth}getHeight(){return this.fileDirectory.ImageLength}getSamplesPerPixel(){return void 0!==this.fileDirectory.SamplesPerPixel?this.fileDirectory.SamplesPerPixel:1}getTileWidth(){return this.isTiled?this.fileDirectory.TileWidth:this.getWidth()}getTileHeight(){return this.isTiled?this.fileDirectory.TileLength:void 0!==this.fileDirectory.RowsPerStrip?Math.min(this.fileDirectory.RowsPerStrip,this.getHeight()):this.getHeight()}getBlockWidth(){return this.getTileWidth()}getBlockHeight(e){return this.isTiled||(e+1)*this.getTileHeight()<=this.getHeight()?this.getTileHeight():this.getHeight()-e*this.getTileHeight()}getBytesPerPixel(){let e=0;for(let t=0;t<this.fileDirectory.BitsPerSample.length;++t)e+=this.getSampleByteSize(t);return e}getSampleByteSize(e){if(e>=this.fileDirectory.BitsPerSample.length)throw new RangeError(`Sample index ${e} is out of range.`);return Math.ceil(this.fileDirectory.BitsPerSample[e]/8)}getReaderForSample(e){const t=this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1,A=this.fileDirectory.BitsPerSample[e];switch(t){case 1:if(A<=8)return DataView.prototype.getUint8;if(A<=16)return DataView.prototype.getUint16;if(A<=32)return DataView.prototype.getUint32;break;case 2:if(A<=8)return DataView.prototype.getInt8;if(A<=16)return DataView.prototype.getInt16;if(A<=32)return DataView.prototype.getInt32;break;case 3:switch(A){case 16:return function(e,t){return mr(this,e,t)};case 32:return DataView.prototype.getFloat32;case 64:return DataView.prototype.getFloat64}}throw Error("Unsupported data format/bitsPerSample")}getSampleFormat(e=0){return this.fileDirectory.SampleFormat?this.fileDirectory.SampleFormat[e]:1}getBitsPerSample(e=0){return this.fileDirectory.BitsPerSample[e]}getArrayForSample(e,t){return Ia(this.getSampleFormat(e),this.getBitsPerSample(e),t)}async getTileOrStrip(e,t,A,i,r){const a=Math.ceil(this.getWidth()/this.getTileWidth()),n=Math.ceil(this.getHeight()/this.getTileHeight());let s;const{tiles:o}=this;let l,g;1===this.planarConfiguration?s=t*a+e:2===this.planarConfiguration&&(s=A*a*n+t*a+e),this.isTiled?(l=this.fileDirectory.TileOffsets[s],g=this.fileDirectory.TileByteCounts[s]):(l=this.fileDirectory.StripOffsets[s],g=this.fileDirectory.StripByteCounts[s]);const h=(await this.source.fetch([{offset:l,length:g}],r))[0];let c;return null!==o&&o[s]?c=o[s]:(c=(async()=>{let e=await i.decode(this.fileDirectory,h);const A=this.getSampleFormat(),r=this.getBitsPerSample();return function(e,t){return(1!==e&&2!==e||!(t<=32)||t%8!=0)&&(3!==e||16!==t&&32!==t&&64!==t)}(A,r)&&(e=function(e,t,A,i,r,a,n){const s=new DataView(e),o=2===A?1:i,l=Ia(t,r,2===A?n*a:n*a*i),g=parseInt("1".repeat(r),2);if(1===t){let e;e=1===A?i*r:r;let t=a*e;0!=(7&t)&&(t=t+7&-8);for(let e=0;e<n;++e){const A=e*t;for(let t=0;t<a;++t){const i=A+t*o*r;for(let A=0;A<o;++A){const n=i+A*r,h=(e*a+t)*o+A,c=Math.floor(n/8),f=n%8;if(f+r<=8)l[h]=s.getUint8(c)>>8-r-f&g;else if(f+r<=16)l[h]=s.getUint16(c)>>16-r-f&g;else if(f+r<=24){const e=s.getUint16(c)<<8|s.getUint8(c+2);l[h]=e>>24-r-f&g}else l[h]=s.getUint32(c)>>32-r-f&g}}}}return l.buffer}(e,A,this.planarConfiguration,this.getSamplesPerPixel(),r,this.getTileWidth(),this.getBlockHeight(t))),e})(),null!==o&&(o[s]=c)),{x:e,y:t,sample:A,data:await c}}async _readRaster(e,t,A,i,r,a,n,s,o){const l=this.getTileWidth(),g=this.getTileHeight(),h=this.getWidth(),c=this.getHeight(),f=Math.max(Math.floor(e[0]/l),0),d=Math.min(Math.ceil(e[2]/l),Math.ceil(h/l)),I=Math.max(Math.floor(e[1]/g),0),u=Math.min(Math.ceil(e[3]/g),Math.ceil(c/g)),B=e[2]-e[0];let C=this.getBytesPerPixel();const E=[],w=[];for(let e=0;e<t.length;++e)1===this.planarConfiguration?E.push(da(this.fileDirectory.BitsPerSample,0,t[e])/8):E.push(0),w.push(this.getReaderForSample(t[e]));const Q=[],{littleEndian:m}=this;for(let a=I;a<u;++a)for(let n=f;n<d;++n){let s;1===this.planarConfiguration&&(s=this.getTileOrStrip(n,a,0,r,o));for(let f=0;f<t.length;++f){const d=f,I=t[f];2===this.planarConfiguration&&(C=this.getSampleByteSize(I),s=this.getTileOrStrip(n,a,I,r,o));const u=s.then((r=>{const a=r.data,n=new DataView(a),s=this.getBlockHeight(r.y),o=r.y*g,f=r.x*l,I=o+s,u=(r.x+1)*l,Q=w[d],p=Math.min(s,s-(I-e[3]),c-o),y=Math.min(l,l-(u-e[2]),h-f);for(let r=Math.max(0,e[1]-o);r<p;++r)for(let a=Math.max(0,e[0]-f);a<y;++a){const s=(r*l+a)*C,g=Q.call(n,s+E[d],m);let h;i?(h=(r+o-e[1])*B*t.length+(a+f-e[0])*t.length+d,A[h]=g):(h=(r+o-e[1])*B+a+f-e[0],A[d][h]=g)}}));Q.push(u)}}if(await Promise.all(Q),a&&e[2]-e[0]!==a||n&&e[3]-e[1]!==n){let r;return r=i?fa(A,e[2]-e[0],e[3]-e[1],a,n,t.length,s):ca(A,e[2]-e[0],e[3]-e[1],a,n,s),r.width=a,r.height=n,r}return A.width=a||e[2]-e[0],A.height=n||e[3]-e[1],A}async readRasters({window:e,samples:t=[],interleave:A,pool:i=null,width:r,height:a,resampleMethod:n,fillValue:s,signal:o}={}){const l=e||[0,0,this.getWidth(),this.getHeight()];if(l[0]>l[2]||l[1]>l[3])throw new Error("Invalid subsets");const g=(l[2]-l[0])*(l[3]-l[1]),h=this.getSamplesPerPixel();if(t&&t.length){for(let e=0;e<t.length;++e)if(t[e]>=h)return Promise.reject(new RangeError(`Invalid sample index '${t[e]}'.`))}else for(let e=0;e<h;++e)t.push(e);let c;if(A){c=Ia(this.fileDirectory.SampleFormat?Math.max.apply(null,this.fileDirectory.SampleFormat):1,Math.max.apply(null,this.fileDirectory.BitsPerSample),g*t.length),s&&c.fill(s)}else{c=[];for(let e=0;e<t.length;++e){const A=this.getArrayForSample(t[e],g);Array.isArray(s)&&e<s.length?A.fill(s[e]):s&&!Array.isArray(s)&&A.fill(s),c.push(A)}}const f=i||await async function(e){const t=oa.get(e.Compression);if(!t)throw new Error(`Unknown compression method identifier: ${e.Compression}`);return new(await t())(e)}(this.fileDirectory);return await this._readRaster(l,t,c,A,f,r,a,n,o)}async readRGB({window:e,interleave:t=!0,pool:A=null,width:i,height:r,resampleMethod:a,enableAlpha:n=!1,signal:s}={}){const o=e||[0,0,this.getWidth(),this.getHeight()];if(o[0]>o[2]||o[1]>o[3])throw new Error("Invalid subsets");const l=this.fileDirectory.PhotometricInterpretation;if(l===Xr){let o=[0,1,2];if(this.fileDirectory.ExtraSamples!==Aa&&n){o=[];for(let e=0;e<this.fileDirectory.BitsPerSample.length;e+=1)o.push(e)}return this.readRasters({window:e,interleave:t,samples:o,pool:A,width:i,height:r,resampleMethod:a,signal:s})}let g;switch(l){case Zr:case jr:case Wr:g=[0];break;case $r:g=[0,1,2,3];break;case ea:case ta:g=[0,1,2];break;default:throw new Error("Invalid or unsupported photometric interpretation.")}const h={window:o,interleave:!0,samples:g,pool:A,width:i,height:r,resampleMethod:a,signal:s},{fileDirectory:c}=this,f=await this.readRasters(h),d=2**this.fileDirectory.BitsPerSample[0];let I;switch(l){case Zr:I=function(e,t){const{width:A,height:i}=e,r=new Uint8Array(A*i*3);let a;for(let A=0,i=0;A<e.length;++A,i+=3)a=256-e[A]/t*256,r[i]=a,r[i+1]=a,r[i+2]=a;return r}(f,d);break;case jr:I=function(e,t){const{width:A,height:i}=e,r=new Uint8Array(A*i*3);let a;for(let A=0,i=0;A<e.length;++A,i+=3)a=e[A]/t*256,r[i]=a,r[i+1]=a,r[i+2]=a;return r}(f,d);break;case Wr:I=function(e,t){const{width:A,height:i}=e,r=new Uint8Array(A*i*3),a=t.length/3,n=t.length/3*2;for(let A=0,i=0;A<e.length;++A,i+=3){const s=e[A];r[i]=t[s]/65536*256,r[i+1]=t[s+a]/65536*256,r[i+2]=t[s+n]/65536*256}return r}(f,c.ColorMap);break;case $r:I=function(e){const{width:t,height:A}=e,i=new Uint8Array(t*A*3);for(let t=0,A=0;t<e.length;t+=4,A+=3){const r=e[t],a=e[t+1],n=e[t+2],s=e[t+3];i[A]=(255-r)/256*255*((255-s)/256),i[A+1]=(255-a)/256*255*((255-s)/256),i[A+2]=(255-n)/256*255*((255-s)/256)}return i}(f);break;case ea:I=function(e){const{width:t,height:A}=e,i=new Uint8ClampedArray(t*A*3);for(let t=0,A=0;t<e.length;t+=3,A+=3){const r=e[t],a=e[t+1],n=e[t+2];i[A]=r+1.402*(n-128),i[A+1]=r-.34414*(a-128)-.71414*(n-128),i[A+2]=r+1.772*(a-128)}return i}(f);break;case ta:I=function(e){const{width:t,height:A}=e,i=new Uint8Array(t*A*3);for(let t=0,A=0;t<e.length;t+=3,A+=3){let r,a,n,s=(e[t+0]+16)/116,o=(e[t+1]<<24>>24)/500+s,l=s-(e[t+2]<<24>>24)/200;o=.95047*(o*o*o>.008856?o*o*o:(o-16/116)/7.787),s=1*(s*s*s>.008856?s*s*s:(s-16/116)/7.787),l=1.08883*(l*l*l>.008856?l*l*l:(l-16/116)/7.787),r=3.2406*o+-1.5372*s+-.4986*l,a=-.9689*o+1.8758*s+.0415*l,n=.0557*o+-.204*s+1.057*l,r=r>.0031308?1.055*r**(1/2.4)-.055:12.92*r,a=a>.0031308?1.055*a**(1/2.4)-.055:12.92*a,n=n>.0031308?1.055*n**(1/2.4)-.055:12.92*n,i[A]=255*Math.max(0,Math.min(1,r)),i[A+1]=255*Math.max(0,Math.min(1,a)),i[A+2]=255*Math.max(0,Math.min(1,n))}return i}(f);break;default:throw new Error("Unsupported photometric interpretation.")}if(!t){const e=new Uint8Array(I.length/3),t=new Uint8Array(I.length/3),A=new Uint8Array(I.length/3);for(let i=0,r=0;i<I.length;i+=3,++r)e[r]=I[i],t[r]=I[i+1],A[r]=I[i+2];I=[e,t,A]}return I.width=f.width,I.height=f.height,I}getTiePoints(){if(!this.fileDirectory.ModelTiepoint)return[];const e=[];for(let t=0;t<this.fileDirectory.ModelTiepoint.length;t+=6)e.push({i:this.fileDirectory.ModelTiepoint[t],j:this.fileDirectory.ModelTiepoint[t+1],k:this.fileDirectory.ModelTiepoint[t+2],x:this.fileDirectory.ModelTiepoint[t+3],y:this.fileDirectory.ModelTiepoint[t+4],z:this.fileDirectory.ModelTiepoint[t+5]});return e}getGDALMetadata(e=null){const t={};if(!this.fileDirectory.GDAL_METADATA)return null;const A=this.fileDirectory.GDAL_METADATA;let i=Kr(A,"Item");i=null===e?i.filter((e=>void 0===_r(e,"sample"))):i.filter((t=>Number(_r(t,"sample"))===e));for(let e=0;e<i.length;++e){const A=i[e];t[_r(A,"name")]=A.inner}return t}getGDALNoData(){if(!this.fileDirectory.GDAL_NODATA)return null;const e=this.fileDirectory.GDAL_NODATA;return Number(e.substring(0,e.length-1))}getOrigin(){const e=this.fileDirectory.ModelTiepoint,t=this.fileDirectory.ModelTransformation;if(e&&6===e.length)return[e[3],e[4],e[5]];if(t)return[t[3],t[7],t[11]];throw new Error("The image does not have an affine transformation.")}getResolution(e=null){const t=this.fileDirectory.ModelPixelScale,A=this.fileDirectory.ModelTransformation;if(t)return[t[0],-t[1],t[2]];if(A)return 0===A[1]&&0===A[4]?[A[0],-A[5],A[10]]:[Math.sqrt(A[0]*A[0]+A[4]*A[4]),-Math.sqrt(A[1]*A[1]+A[5]*A[5]),A[10]];if(e){const[t,A,i]=e.getResolution();return[t*e.getWidth()/this.getWidth(),A*e.getHeight()/this.getHeight(),i*e.getWidth()/this.getWidth()]}throw new Error("The image does not have an affine transformation.")}pixelIsArea(){return 1===this.geoKeys.GTRasterTypeGeoKey}getBoundingBox(e=!1){const t=this.getHeight(),A=this.getWidth();if(this.fileDirectory.ModelTransformation&&!e){const[e,i,r,a,n,s,o,l]=this.fileDirectory.ModelTransformation,g=[[0,0],[0,t],[A,0],[A,t]].map((([t,A])=>[a+e*t+i*A,l+n*t+s*A])),h=g.map((e=>e[0])),c=g.map((e=>e[1]));return[Math.min(...h),Math.min(...c),Math.max(...h),Math.max(...c)]}{const e=this.getOrigin(),i=this.getResolution(),r=e[0],a=e[1],n=r+i[0]*A,s=a+i[1]*t;return[Math.min(r,n),Math.min(a,s),Math.max(r,n),Math.max(a,s)]}}};class Ba{constructor(e){this._dataView=new DataView(e)}get buffer(){return this._dataView.buffer}getUint64(e,t){const A=this.getUint32(e,t),i=this.getUint32(e+4,t);let r;if(t){if(r=A+2**32*i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}if(r=2**32*A+i,!Number.isSafeInteger(r))throw new Error(`${r} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return r}getInt64(e,t){let A=0;const i=(128&this._dataView.getUint8(e+(t?7:0)))>0;let r=!0;for(let a=0;a<8;a++){let n=this._dataView.getUint8(e+(t?a:7-a));i&&(r?0!==n&&(n=255&~(n-1),r=!1):n=255&~n),A+=n*256**a}return i&&(A=-A),A}getUint8(e,t){return this._dataView.getUint8(e,t)}getInt8(e,t){return this._dataView.getInt8(e,t)}getUint16(e,t){return this._dataView.getUint16(e,t)}getInt16(e,t){return this._dataView.getInt16(e,t)}getUint32(e,t){return this._dataView.getUint32(e,t)}getInt32(e,t){return this._dataView.getInt32(e,t)}getFloat16(e,t){return mr(this._dataView,e,t)}getFloat32(e,t){return this._dataView.getFloat32(e,t)}getFloat64(e,t){return this._dataView.getFloat64(e,t)}}class Ca{constructor(e,t,A,i){this._dataView=new DataView(e),this._sliceOffset=t,this._littleEndian=A,this._bigTiff=i}get sliceOffset(){return this._sliceOffset}get sliceTop(){return this._sliceOffset+this.buffer.byteLength}get littleEndian(){return this._littleEndian}get bigTiff(){return this._bigTiff}get buffer(){return this._dataView.buffer}covers(e,t){return this.sliceOffset<=e&&this.sliceTop>=e+t}readUint8(e){return this._dataView.getUint8(e-this._sliceOffset,this._littleEndian)}readInt8(e){return this._dataView.getInt8(e-this._sliceOffset,this._littleEndian)}readUint16(e){return this._dataView.getUint16(e-this._sliceOffset,this._littleEndian)}readInt16(e){return this._dataView.getInt16(e-this._sliceOffset,this._littleEndian)}readUint32(e){return this._dataView.getUint32(e-this._sliceOffset,this._littleEndian)}readInt32(e){return this._dataView.getInt32(e-this._sliceOffset,this._littleEndian)}readFloat32(e){return this._dataView.getFloat32(e-this._sliceOffset,this._littleEndian)}readFloat64(e){return this._dataView.getFloat64(e-this._sliceOffset,this._littleEndian)}readUint64(e){const t=this.readUint32(e),A=this.readUint32(e+4);let i;if(this._littleEndian){if(i=t+2**32*A,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}if(i=2**32*t+A,!Number.isSafeInteger(i))throw new Error(`${i} exceeds MAX_SAFE_INTEGER. Precision may be lost. Please report if you get this message to https://github.com/geotiffjs/geotiff.js/issues`);return i}readInt64(e){let t=0;const A=(128&this._dataView.getUint8(e+(this._littleEndian?7:0)))>0;let i=!0;for(let r=0;r<8;r++){let a=this._dataView.getUint8(e+(this._littleEndian?r:7-r));A&&(i?0!==a&&(a=255&~(a-1),i=!1):a=255&~a),t+=a*256**r}return A&&(t=-t),t}readOffset(e){return this._bigTiff?this.readUint64(e):this.readUint32(e)}}class Ea{async fetch(e,t=undefined){return Promise.all(e.map((e=>this.fetchSlice(e,t))))}async fetchSlice(e){throw new Error(`fetching of slice ${e} not possible, not implemented`)}get fileSize(){return null}async close(){}}class wa extends Error{constructor(e){super(e),Error.captureStackTrace&&Error.captureStackTrace(this,wa),this.name="AbortError"}}class Qa extends Ea{constructor(e){super(),this.arrayBuffer=e}fetchSlice(e,t){if(t&&t.aborted)throw new wa("Request aborted");return this.arrayBuffer.slice(e.offset,e.offset+e.length)}}function ma(e,t){let A=e.length-t,i=0;do{for(let A=t;A>0;A--)e[i+t]+=e[i],i++;A-=t}while(A>0)}function pa(e,t,A){let i=0,r=e.length;const a=r/A;for(;r>t;){for(let A=t;A>0;--A)e[i+t]+=e[i],++i;r-=t}const n=e.slice();for(let t=0;t<a;++t)for(let i=0;i<A;++i)e[A*t+i]=n[(A-i-1)*a+t]}class ya{async decode(e,t){const A=await this.decodeBlock(t),i=e.Predictor||1;if(1!==i){const t=!e.StripOffsets;return function(e,t,A,i,r,a){if(!t||1===t)return e;for(let e=0;e<r.length;++e){if(r[e]%8!=0)throw new Error("When decoding with predictor, only multiple of 8 bits are supported.");if(r[e]!==r[0])throw new Error("When decoding with predictor, all samples must have the same size.")}const n=r[0]/8,s=2===a?1:r.length;for(let a=0;a<i&&!(a*s*A*n>=e.byteLength);++a){let i;if(2===t){switch(r[0]){case 8:i=new Uint8Array(e,a*s*A*n,s*A*n);break;case 16:i=new Uint16Array(e,a*s*A*n,s*A*n/2);break;case 32:i=new Uint32Array(e,a*s*A*n,s*A*n/4);break;default:throw new Error(`Predictor 2 not allowed with ${r[0]} bits per sample.`)}ma(i,s)}else 3===t&&(i=new Uint8Array(e,a*s*A*n,s*A*n),pa(i,s,n))}return e}(A,i,t?e.TileWidth:e.ImageWidth,t?e.TileLength:e.RowsPerStrip||e.ImageLength,e.BitsPerSample,e.PlanarConfiguration)}return A}}function _a(e){switch(e){case Vr.BYTE:case Vr.ASCII:case Vr.SBYTE:case Vr.UNDEFINED:return 1;case Vr.SHORT:case Vr.SSHORT:return 2;case Vr.LONG:case Vr.SLONG:case Vr.FLOAT:case Vr.IFD:return 4;case Vr.RATIONAL:case Vr.SRATIONAL:case Vr.DOUBLE:case Vr.LONG8:case Vr.SLONG8:case Vr.IFD8:return 8;default:throw new RangeError(`Invalid field type: ${e}`)}}function ba(e,t,A,i){let r=null,a=null;const n=_a(t);switch(t){case Vr.BYTE:case Vr.ASCII:case Vr.UNDEFINED:r=new Uint8Array(A),a=e.readUint8;break;case Vr.SBYTE:r=new Int8Array(A),a=e.readInt8;break;case Vr.SHORT:r=new Uint16Array(A),a=e.readUint16;break;case Vr.SSHORT:r=new Int16Array(A),a=e.readInt16;break;case Vr.LONG:case Vr.IFD:r=new Uint32Array(A),a=e.readUint32;break;case Vr.SLONG:r=new Int32Array(A),a=e.readInt32;break;case Vr.LONG8:case Vr.IFD8:r=new Array(A),a=e.readUint64;break;case Vr.SLONG8:r=new Array(A),a=e.readInt64;break;case Vr.RATIONAL:r=new Uint32Array(2*A),a=e.readUint32;break;case Vr.SRATIONAL:r=new Int32Array(2*A),a=e.readInt32;break;case Vr.FLOAT:r=new Float32Array(A),a=e.readFloat32;break;case Vr.DOUBLE:r=new Float64Array(A),a=e.readFloat64;break;default:throw new RangeError(`Invalid field type: ${t}`)}if(t!==Vr.RATIONAL&&t!==Vr.SRATIONAL)for(let t=0;t<A;++t)r[t]=a.call(e,i+t*n);else for(let t=0;t<A;t+=2)r[t]=a.call(e,i+t*n),r[t+1]=a.call(e,i+(t*n+4));return t===Vr.ASCII?new TextDecoder("utf-8").decode(r):r}class Da{constructor(e,t,A){this.fileDirectory=e,this.geoKeyDirectory=t,this.nextIFDByteOffset=A}}class ka extends Error{constructor(e){super(`No image at index ${e}`),this.index=e}}class va{async readRasters(e={}){const{window:t,width:A,height:i}=e;let{resX:r,resY:a,bbox:n}=e;const s=await this.getImage();let o=s;const l=await this.getImageCount(),g=s.getBoundingBox();if(t&&n)throw new Error('Both "bbox" and "window" passed.');if(A||i){if(t){const[e,A]=s.getOrigin(),[i,r]=s.getResolution();n=[e+t[0]*i,A+t[1]*r,e+t[2]*i,A+t[3]*r]}const e=n||g;if(A){if(r)throw new Error("Both width and resX passed");r=(e[2]-e[0])/A}if(i){if(a)throw new Error("Both width and resY passed");a=(e[3]-e[1])/i}}if(r||a){const e=[];for(let t=0;t<l;++t){const A=await this.getImage(t),{SubfileType:i,NewSubfileType:r}=A.fileDirectory;(0===t||2===i||1&r)&&e.push(A)}e.sort(((e,t)=>e.getWidth()-t.getWidth()));for(let t=0;t<e.length;++t){const A=e[t],i=(g[2]-g[0])/A.getWidth(),n=(g[3]-g[1])/A.getHeight();if(o=A,r&&r>i||a&&a>n)break}}let h=t;if(n){const[e,t]=s.getOrigin(),[A,i]=o.getResolution(s);h=[Math.round((n[0]-e)/A),Math.round((n[1]-t)/i),Math.round((n[2]-e)/A),Math.round((n[3]-t)/i)],h=[Math.min(h[0],h[2]),Math.min(h[1],h[3]),Math.max(h[0],h[2]),Math.max(h[1],h[3])]}return o.readRasters({...e,window:h})}}class xa extends va{constructor(e,t,A,i,r={}){super(),this.source=e,this.littleEndian=t,this.bigTiff=A,this.firstIFDOffset=i,this.cache=r.cache||!1,this.ifdRequests=[],this.ghostValues=null}async getSlice(e,t){const A=this.bigTiff?4048:1024;return new Ca((await this.source.fetch([{offset:e,length:void 0!==t?t:A}]))[0],e,this.littleEndian,this.bigTiff)}async parseFileDirectoryAt(e){const t=this.bigTiff?20:12,A=this.bigTiff?8:2;let i=await this.getSlice(e);const r=this.bigTiff?i.readUint64(e):i.readUint16(e),a=r*t+(this.bigTiff?16:6);i.covers(e,a)||(i=await this.getSlice(e,a));const n={};let s=e+(this.bigTiff?8:2);for(let e=0;e<r;s+=t,++e){const e=i.readUint16(s),t=i.readUint16(s+2),A=this.bigTiff?i.readUint64(s+4):i.readUint32(s+4);let r,a;const o=_a(t),l=s+(this.bigTiff?12:8);if(o*A<=(this.bigTiff?8:4))r=ba(i,t,A,l);else{const e=i.readOffset(l),a=_a(t)*A;if(i.covers(e,a))r=ba(i,t,A,e);else{r=ba(await this.getSlice(e,a),t,A,e)}}a=1===A&&-1===Hr.indexOf(e)&&t!==Vr.RATIONAL&&t!==Vr.SRATIONAL?r[0]:r,n[Jr[e]]=a}const o=function(e){const t=e.GeoKeyDirectory;if(!t)return null;const A={};for(let i=4;i<=4*t[3];i+=4){const r=sa[t[i]],a=t[i+1]?Jr[t[i+1]]:null,n=t[i+2],s=t[i+3];let o=null;if(a){if(o=e[a],null==o)throw new Error(`Could not get value of geoKey '${r}'.`);"string"==typeof o?o=o.substring(s,s+n-1):o.subarray&&(o=o.subarray(s,s+n),1===n&&(o=o[0]))}else o=s;A[r]=o}return A}(n),l=i.readOffset(e+A+t*r);return new Da(n,o,l)}async requestIFD(e){if(this.ifdRequests[e])return this.ifdRequests[e];if(0===e)return this.ifdRequests[e]=this.parseFileDirectoryAt(this.firstIFDOffset),this.ifdRequests[e];if(!this.ifdRequests[e-1])try{this.ifdRequests[e-1]=this.requestIFD(e-1)}catch(t){if(t instanceof ka)throw new ka(e);throw t}return this.ifdRequests[e]=(async()=>{const t=await this.ifdRequests[e-1];if(0===t.nextIFDByteOffset)throw new ka(e);return this.parseFileDirectoryAt(t.nextIFDByteOffset)})(),this.ifdRequests[e]}async getImage(e=0){const t=await this.requestIFD(e);return new ua(t.fileDirectory,t.geoKeyDirectory,this.dataView,this.littleEndian,this.cache,this.source)}async getImageCount(){let e=0,t=!0;for(;t;)try{await this.requestIFD(e),++e}catch(e){if(!(e instanceof ka))throw e;t=!1}return e}async getGhostValues(){const e=this.bigTiff?16:8;if(this.ghostValues)return this.ghostValues;const t="GDAL_STRUCTURAL_METADATA_SIZE=",A=t.length+100;let i=await this.getSlice(e,A);if(t===ba(i,Vr.ASCII,t.length,e)){const t=ba(i,Vr.ASCII,A,e).split("\n")[0],r=Number(t.split("=")[1].split(" ")[0])+t.length;r>A&&(i=await this.getSlice(e,r));const a=ba(i,Vr.ASCII,r,e);this.ghostValues={},a.split("\n").filter((e=>e.length>0)).map((e=>e.split("="))).forEach((([e,t])=>{this.ghostValues[e]=t}))}return this.ghostValues}static async fromSource(e,t,A){const i=(await e.fetch([{offset:0,length:1024}],A))[0],r=new Ba(i),a=r.getUint16(0,0);let n;if(18761===a)n=!0;else{if(19789!==a)throw new TypeError("Invalid byte order value.");n=!1}const s=r.getUint16(2,n);let o;if(42===s)o=!1;else{if(43!==s)throw new TypeError("Invalid magic number.");o=!0;if(8!==r.getUint16(4,n))throw new Error("Unsupported offset byte-size.")}const l=o?r.getUint64(8,n):r.getUint32(4,n);return new xa(e,n,o,l,t)}close(){return"function"==typeof this.source.close&&this.source.close()}}async function Sa(e,t){return xa.fromSource(function(e){return new Qa(e)}(e),t)}class Ga{constructor(e=257){this.gridSize=e;const t=e-1;if(t&t-1)throw new Error(`Expected grid size to be 2^n+1, got ${e}.`);this.numTriangles=t*t*2-2,this.numParentTriangles=this.numTriangles-t*t,this.indices=new Uint32Array(this.gridSize*this.gridSize),this.coords=new Uint16Array(4*this.numTriangles);for(let e=0;e<this.numTriangles;e++){let A=e+2,i=0,r=0,a=0,n=0,s=0,o=0;for(1&A?a=n=s=t:i=r=o=t;(A>>=1)>1;){const e=i+a>>1,t=r+n>>1;1&A?(a=i,n=r,i=s,r=o):(i=a,r=n,a=s,n=o),s=e,o=t}const l=4*e;this.coords[l+0]=i,this.coords[l+1]=r,this.coords[l+2]=a,this.coords[l+3]=n}}createTile(e){return new Ua(e,this)}}class Ua{constructor(e,t){const A=t.gridSize;if(e.length!==A*A)throw new Error(`Expected terrain data of length ${A*A} (${A} x ${A}), got ${e.length}.`);this.terrain=e,this.martini=t,this.errors=new Float32Array(e.length),this.update()}update(){const{numTriangles:e,numParentTriangles:t,coords:A,gridSize:i}=this.martini,{terrain:r,errors:a}=this;for(let n=e-1;n>=0;n--){const e=4*n,s=A[e+0],o=A[e+1],l=A[e+2],g=A[e+3],h=s+l>>1,c=o+g>>1,f=h+c-o,d=c+s-h,I=(r[o*i+s]+r[g*i+l])/2,u=c*i+h,B=Math.abs(I-r[u]);if(a[u]=Math.max(a[u],B),n<t){const e=(o+d>>1)*i+(s+f>>1),t=(g+d>>1)*i+(l+f>>1);a[u]=Math.max(a[u],a[e],a[t])}}}getMesh(e=0){const{gridSize:t,indices:A}=this.martini,{errors:i}=this;let r=0,a=0;const n=t-1;function s(n,o,l,g,h,c){const f=n+l>>1,d=o+g>>1;Math.abs(n-h)+Math.abs(o-c)>1&&i[d*t+f]>e?(s(h,c,n,o,f,d),s(l,g,h,c,f,d)):(A[o*t+n]=A[o*t+n]||++r,A[g*t+l]=A[g*t+l]||++r,A[c*t+h]=A[c*t+h]||++r,a++)}A.fill(0),s(0,0,n,n,n,0),s(n,n,0,0,0,n);const o=new Uint16Array(2*r),l=new Uint32Array(3*a);let g=0;function h(r,a,n,s,c,f){const d=r+n>>1,I=a+s>>1;if(Math.abs(r-c)+Math.abs(a-f)>1&&i[I*t+d]>e)h(c,f,r,a,d,I),h(n,s,c,f,d,I);else{const e=A[a*t+r]-1,i=A[s*t+n]-1,h=A[f*t+c]-1;o[2*e]=r,o[2*e+1]=a,o[2*i]=n,o[2*i+1]=s,o[2*h]=c,o[2*h+1]=f,l[g++]=e,l[g++]=i,l[g++]=h}}return h(0,0,n,n,n,0),h(n,n,0,0,0,n),{vertices:o,triangles:l}}}function Fa(e,t,A,i){const r=i?function(e,t){e.westIndices.sort(((e,A)=>t[3*e+1]-t[3*A+1])),e.eastIndices.sort(((e,A)=>t[3*A+1]-t[3*e+1])),e.southIndices.sort(((e,A)=>t[3*A]-t[3*e])),e.northIndices.sort(((e,A)=>t[3*e]-t[3*A]));const A=[];for(const t in e){const i=e[t];for(let e=0;e<i.length-1;e++)A.push([i[e],i[e+1]])}return A}(i,e.POSITION.value):function(e){var t,A;const i=[];for(let t=0;t<e.length;t+=3)i.push([e[t],e[t+1]]),i.push([e[t+1],e[t+2]]),i.push([e[t+2],e[t]]);i.sort(((e,t)=>Math.min(...e)-Math.min(...t)||Math.max(...e)-Math.max(...t)));const r=[];let a=0;for(;a<i.length;)i[a][0]===(null===(t=i[a+1])||void 0===t?void 0:t[1])&&i[a][1]===(null===(A=i[a+1])||void 0===A?void 0:A[0])?a+=2:(r.push(i[a]),a++);return r}(t),a=new e.POSITION.value.constructor(6*r.length),n=new e.TEXCOORD_0.value.constructor(4*r.length),s=new t.constructor(6*r.length);for(let t=0;t<r.length;t++){Ra({edge:r[t],edgeIndex:t,attributes:e,skirtHeight:A,newPosition:a,newTexcoord0:n,newTriangles:s})}e.POSITION.value=l(e.POSITION.value,a),e.TEXCOORD_0.value=l(e.TEXCOORD_0.value,n);return{attributes:e,triangles:t instanceof Array?t.concat(s):l(t,s)}}function Ra({edge:e,edgeIndex:t,attributes:A,skirtHeight:i,newPosition:r,newTexcoord0:a,newTriangles:n}){const s=A.POSITION.value.length,o=2*t,l=2*t+1;r.set(A.POSITION.value.subarray(3*e[0],3*e[0]+3),3*o),r[3*o+2]=r[3*o+2]-i,r.set(A.POSITION.value.subarray(3*e[1],3*e[1]+3),3*l),r[3*l+2]=r[3*l+2]-i,a.set(A.TEXCOORD_0.value.subarray(2*e[0],2*e[0]+2),2*o),a.set(A.TEXCOORD_0.value.subarray(2*e[1],2*e[1]+2),2*l);const g=2*t*3;n[g]=e[0],n[g+1]=s/3+l,n[g+2]=e[1],n[g+3]=s/3+l,n[g+4]=e[0],n[g+5]=s/3+o}const La={type:"image",format:"uint8",useHeatMap:!0,useColorsBasedOnValues:!1,useAutoRange:!1,useDataForOpacity:!1,useSingleColor:!1,useColorClasses:!1,blurredTexture:!0,clipLow:null,clipHigh:null,multiplier:1,color:[255,0,255,255],colorScale:s.brewer.YlOrRd,colorScaleValueRange:[0,255],colorsBasedOnValues:null,colorClasses:null,alpha:100,useChannel:null,noDataValue:void 0,numOfChannels:void 0,nullColor:[0,0,0,0],unidentifiedColor:[0,0,0,0],clippedColor:[0,0,0,0],terrainColor:[133,133,133,255],terrainSkirtHeight:100,terrainMinValue:0};class Ma{constructor(){this.scale=(e,t,A,i,r)=>(e-t)*(r-i)/(A-t)+i}setUrl(e){return h(this,void 0,void 0,(function*(){const t=yield fetch(e),A=yield t.arrayBuffer(),i=yield Sa(A),r=yield i.getImage(0);this.data=r}))}getMap(e,t){return h(this,void 0,void 0,(function*(){const A=Object.assign(Object.assign({},La),t);switch(console.log("xxx_mergedOptions",A),A.type){case"image":return this.getBitmap(e,A);case"terrain":return this.getHeightmap(e,A);default:return null}}))}getHeightmap(e,t){return h(this,void 0,void 0,(function*(){let A,i,r=[];"string"==typeof e?(yield this.setUrl(e),r=yield this.data.readRasters(),A=this.data.getWidth(),i=this.data.getHeight()):(r=e.rasters,A=e.width,i=e.height);let a=r[0];null!=t.useChannel&&r[t.useChannel]&&(a=r[t.useChannel]);const n=new Float32Array((A+1)*(i+1)),s=a.length/(A*i),l=A*i;console.log("xxx_size",l);let g=null===t.useChannel?0:t.useChannel;for(let e=0,r=0;r<i;r++)for(let i=0;i<A;i++,e++){const A=t.noDataValue&&a[g]===t.noDataValue?t.terrainMinValue:a[g]*t.multiplier;n[e+r]=A,g+=s}console.log("xxx_terrain",n),n[0];for(let e=(A+1)*A,t=0;t<A;t++,e++)n[e]=n[e-A-1];for(let e=i,t=0;t<i+1;t++,e+=i+1)n[e]=n[e-1];const{terrainSkirtHeight:h}=t;let c;console.log("xxx_bounds_0",e.bounds),c=Ta(h,A,n);const{vertices:f}=c;let{triangles:d}=c,I=function(e,t,A,i,r){const a=A+1,n=e.length/2,s=new Float32Array(3*n),o=new Float32Array(2*n);console.log("xxx_bounds",r);const[l,g,h,c]=r||[0,0,A,i],f=(h-l)/A,d=(c-g)/i;for(let r=0;r<n;r++){const n=e[2*r],g=e[2*r+1],h=g*a+n;s[3*r+0]=n*f+l,s[3*r+1]=-g*d+c,s[3*r+2]=t[h],o[2*r+0]=n/A,o[2*r+1]=g/i}return{POSITION:{value:s,size:3},TEXCOORD_0:{value:o,size:2}}}(f,n,A,i,e.bounds);const u=o(I);if(console.log("xxx_skirtHeight",h),h){const{attributes:e,triangles:t}=Fa(I,d,h);I=e,d=t}return{loaderData:{header:{}},header:{vertexCount:d.length,boundingBox:u},mode:4,indices:{value:Uint32Array.from(d),size:1},attributes:I}}))}getBitmap(e,t){return h(this,void 0,void 0,(function*(){const A=Object.assign({},t);let i,r,a,n=[];"string"==typeof e?(yield this.setUrl(e),n=yield this.data.readRasters(),i=n.length,r=this.data.getWidth(),a=this.data.getHeight()):(n=e.rasters,i=n.length,r=e.width,a=e.height);const s=document.createElement("canvas");s.width=r,s.height=a;const o=s.getContext("2d"),l=o.createImageData(r,a);let g,h,c,f;const d=r*a*4;if(t.noDataValue||console.log("Missing noData value. Raster might be displayed incorrectly."),A.unidentifiedColor=this.getColorFromChromaType(A.unidentifiedColor),A.nullColor=this.getColorFromChromaType(A.nullColor),A.clippedColor=this.getColorFromChromaType(A.clippedColor),A.color=this.getColorFromChromaType(A.color),null==A.useChannel){if(1===i){if(n[0].length/(r*a)==1){const e=n[0];A.useAutoRange&&(A.colorScaleValueRange=this.getMinMax(e,A));this.getColorValue(e,A,d).forEach(((e,t)=>{l.data[t]=e}))}if(n[0].length/(r*a)==3){let e=0;for(let t=0;t<d;t+=4){const i=[n[0][e],n[0][e+1],n[0][e+2]],r=this.hasPixelsNoData(i,A.noDataValue)?A.nullColor:[...i,Math.floor(2.55*A.alpha)];[l.data[t],l.data[t+1],l.data[t+2],l.data[t+3]]=r,e+=3}}n[0].length/(r*a)==4&&n[0].forEach(((e,t)=>{l.data[t]=e}))}if(3===i){let e=0;for(let t=0;t<d;t+=4)g=n[0][e],h=n[1][e],c=n[2][e],f=Math.floor(2.55*A.alpha),l.data[t]=g,l.data[t+1]=h,l.data[t+2]=c,l.data[t+3]=f,e+=1}if(4===i){let e=0;for(let t=0;t<d;t+=4)g=n[0][e],h=n[1][e],c=n[2][e],f=Math.floor(2.55*A.alpha),l.data[t]=g,l.data[t+1]=h,l.data[t+2]=c,l.data[t+3]=f,e+=1}}else if(A.useChannel<=A.numOfChannels){let e=n[0];n[A.useChannel]&&(e=n[A.useChannel]),A.useAutoRange&&(A.colorScaleValueRange=this.getMinMax(e,A));const t=e.length/(r*a);this.getColorValue(e,A,d,t).forEach(((e,t)=>{l.data[t]=e}))}else{console.log("Defined channel does not exist, displaying only grey values");this.getDefaultColor(d,A.nullColor).forEach(((e,t)=>{l.data[t]=e}))}o.putImageData(l,0,0);return s.toDataURL("image/png")}))}getMinMax(e,t){let A=t.maxValue?t.maxValue:Number.MIN_VALUE,i=t.minValue?t.minValue:Number.MAX_VALUE;for(let r=0;r<e.length;r+=1)void 0!==t.noDataValue&&e[r]===t.noDataValue||(e[r]>A&&(A=e[r]),e[r]<i&&(i=e[r]));return[i,A]}getColorValue(e,t,A,i=1){const r=s.scale(t.colorScale).domain(t.colorScaleValueRange);let a=null===t.useChannel?0:t.useChannel;const n=new Array(A),o=t.colorsBasedOnValues?t.colorsBasedOnValues.map((([e])=>e)):void 0,l=t.colorsBasedOnValues?t.colorsBasedOnValues.map((([,e])=>[...s(e).rgb(),Math.floor(2.55*t.alpha)])):void 0,g=t.useColorClasses?t.colorClasses.map((([e])=>[...s(e).rgb(),Math.floor(2.55*t.alpha)])):void 0,h=t.useColorClasses?t.colorClasses.map((([,e])=>e)):void 0,c=t.useColorClasses?t.colorClasses.map((([,,e],A)=>void 0!==e?e:A===t.colorClasses.length-1?[!0,!0]:[!0,!1])):void 0;for(let s=0;s<A;s+=4){let A=t.nullColor;if(void 0===t.noDataValue||e[a]!==t.noDataValue)if(null!=t.clipLow&&e[a]<=t.clipLow||null!=t.clipHigh&&e[a]>=t.clipHigh)A=t.clippedColor;else{if(t.useHeatMap&&(A=[...r(e[a]).rgb(),Math.floor(2.55*t.alpha)]),t.useColorsBasedOnValues){const i=o.indexOf(e[a]);A=i>-1?l[i]:t.unidentifiedColor}if(t.useColorClasses){const i=this.findClassIndex(e[a],h,c);A=i>-1?g[i]:t.unidentifiedColor}t.useSingleColor&&(A=t.color),t.useDataForOpacity&&(A[3]=this.scale(e[a],t.colorScaleValueRange[0],t.colorScaleValueRange.slice(-1)[0],0,255))}else Number.isNaN(e[a])&&(A=[0,0,0,0]);[n[s],n[s+1],n[s+2],n[s+3]]=A,a+=i}return n}findClassIndex(e,t,A){for(let i=0;i<t.length;i+=1){const[r,a]=t[i],[n,s]=A[i];if((n?e>=r:e>r)&&(s?e<=a:e<a))return i}return-1}getDefaultColor(e,t){const A=new Array(e);for(let i=0;i<e;i+=4)[A[i],A[i+1],A[i+2],A[i+3]]=t;return A}getColorFromChromaType(e){return Array.isArray(e)&&4===e.length?e:[...s(e).rgb(),255]}hasPixelsNoData(e,t){return void 0!==t&&e.every((e=>e===t))}}function Ta(e,t,A){const i=new Ga(t+1).createTile(A),{vertices:r,triangles:a}=i.getMesh(e);return{vertices:r,triangles:a}}const Na=40075e3,Oa=20037500;class Pa{constructor(e){this.zoomRange=[0,0],this.lowestOriginTileOffset=[0,0],this.lowestOriginTileSize=0,this.loaded=!1,this.geo=new Ma,this.lzw=new _i,this.options=e}initializeCog(e){return h(this,void 0,void 0,(function*(){ee.fetch=(e,t)=>h(this,void 0,void 0,(function*(){return yield fetch(e,t)}));const t=new ee(e);return this.cog=yield Z.create(t),this.cog.images.forEach((e=>{e.loadGeoTiffTags()})),this.tileSize=this.getTileSize(this.cog),this.lowestOriginTileOffset=this.getImageTileIndex(this.cog.images[this.cog.images.length-1]),this.zoomRange=this.getZoomRange(this.cog),this.cog}))}getTileSize(e){return e.images[e.images.length-1].tileSize.width}getZoomRange(e){const t=e.images[e.images.length-1],A=this.getZoomLevelFromResolution(e.images[e.images.length-1].tileSize.width,t.resolution[0]);return[A,A+(e.images.length-1)]}getBoundsAsLatLon(e){const{bbox:t}=e.images[e.images.length-1],A=Math.min(t[0],t[2]),i=Math.max(t[0],t[2]),r=Math.min(t[1],t[3]),a=Math.max(t[1],t[3]),n=this.getLatLon([A,r]),s=this.getLatLon([i,a]);return[n[0],n[1],s[0],s[1]]}getOriginAsLatLon(e){const{origin:t}=e.images[e.images.length-1];return this.getLatLon(t)}getImageTileIndex(e){const t=Oa+e.origin[0],A=-(Oa+(e.origin[1]-Na)),i=e.tileSize.width*this.getResolutionFromZoomLevel(e.tileSize.width,this.getZoomLevelFromResolution(e.tileSize.width,e.resolution[0]));return[Math.round(t/i),Math.round(A/i),this.getZoomLevelFromResolution(e.tileSize.width,e.resolution[0])]}getResolutionFromZoomLevel(e,t){return Na/e/Math.pow(2,t)}getZoomLevelFromResolution(e,t){return Math.round(Math.log2(Na/(t*e)))}getLatLon(e){const t=function(e){const[t,A]=e,i=t/512*(2*ui)-ui,r=2*(Math.atan(Math.exp(A/512*(2*ui)-ui))-Bi);return[i*Ci,r*Ci]}([12776044915782906e-21*(Oa+e[0]),12776044915782906e-21*-(Oa+(e[1]-Na))]);return[t[0],-t[1]]}getTile(e,t,A,i){return h(this,void 0,void 0,(function*(){const r=this.getResolutionFromZoomLevel(this.tileSize,A),a=this.cog.getImageByResolution(r);let n=[0,0];if(A===this.zoomRange[0])n=this.lowestOriginTileOffset;else{const e=Math.pow(2,A-this.zoomRange[0]);n[0]=Math.floor(this.lowestOriginTileOffset[0]*e),n[1]=Math.floor(this.lowestOriginTileOffset[1]*e)}const s=a.tileCount.x,o=a.tileCount.y,l=n[0],g=n[1];let h,c;this.options.numOfChannels=Number(a.tags.get(277).value),this.options.noDataValue=this.getNoDataValue(a.tags),this.options.format||(this.options.format=this.getFormat(a.tags.get(339).value,a.tags.get(258).value));let f=a.tags.get(258).value;if(Array.isArray(f))if("terrain"===this.options.type){let e=0;f.forEach((t=>{e+=t})),f=e}else[f]=f;if(e-l>=0&&t-g>=0&&e-l<s&&t-g<o){const A=yield a.getTile(e-l,t-g);switch(a.compression){case"image/jpeg":c=Ii.decode(A.bytes,{useTArray:!0});break;case"application/deflate":c=yield oi(A.bytes);break;case"application/lzw":c=this.lzw.decodeBlock(A.bytes.buffer);break;default:console.warn(`Unexpected compression method: ${a.compression}`)}let r;switch(this.options.format){case"uint8":r=new Uint8Array(c.buffer);break;case"uint16":r=new Uint16Array(c.buffer);break;case"uint32":r=new Uint32Array(c.buffer);break;case"int8":r=new Int8Array(c.buffer);break;case"int16":r=new Int16Array(c.buffer);break;case"int32":r=new Int32Array(c.buffer);break;case"float32":r=new Float32Array(c.buffer);break;case"float64":r=new Float64Array(c.buffer);break;default:r=null}return h=yield this.geo.getMap({rasters:[r],width:this.tileSize,height:this.tileSize,bounds:i},this.options),h}return null}))}getFormat(e,t){let A,i=e,r=t;switch(Array.isArray(e)&&([i]=e),Array.isArray(t)&&([r]=t),i){case 1:switch(r){case 8:A="uint8";break;case 16:A="uint16";break;case 32:A="uint32";break;default:A=null}break;case 2:switch(r){case 8:A="int8";break;case 16:A="int16";break;case 32:A="int32";break;default:A=null}break;case 3:switch(r){case 32:A="float32";break;case 64:A="float64";break;default:A=null}break;default:throw new Error("Unknown data format.")}return A}getNoDataValue(e){if(e.has(42113)){const t=e.get(42113).value;if("string"==typeof t||t instanceof String){const e=t.replace(/[\0\s]/g,"");return Number(e)}return Number.isNaN(Number(t))?void 0:Number(t)}}testCog(){return h(this,void 0,void 0,(function*(){this.options={type:"image",multiplier:1,useChannel:1,alpha:180,clipLow:1,clipHigh:Number.MAX_VALUE};const e=yield this.initializeCog("https://gisat-gis.eu-central-1.linodeobjects.com/eman/versions/v2/Quadrants/Q3_Bolivia_ASTER_2002_RGB_COG_LZW.tif"),t=e.images[Math.floor(e.images.length/2)];console.log(t);const A=this.getImageTileIndex(t);console.log(A);const i=Math.floor(t.tileCount.x/2),r=Math.floor(t.tileCount.y/2);console.log(e.getTile(i,r,Math.floor(e.images.length/2)));const a=i+A[0],n=r+A[1],s=A[2],o=yield this.getTile(a,n,s);!1===o?console.log("couldn't retrieve tile"):console.log(o)}))}}class za extends e{constructor(e,t,A){super({}),this.id="",this.id=e,this.cogTiles=new Pa(A),this.blurredTexture=A.blurredTexture,this.url=t}initializeState(){this.state={initialized:!1},this.init(this.url)}init(e){return h(this,void 0,void 0,(function*(){const t=yield this.cogTiles.initializeCog(e);this.setState({initialized:!0}),this.tileSize=this.cogTiles.getTileSize(t);const A=this.cogTiles.getZoomRange(t);[this.minZoom,this.maxZoom]=A}))}renderLayers(){if(this.cogTiles.cog){return new i({id:`${this.id}-${String(performance.now())}`,getTileData:e=>this.cogTiles.getTile(e.index.x,e.index.y,e.index.z),minZoom:this.minZoom,maxZoom:this.maxZoom,tileSize:this.tileSize,maxRequests:6,extent:this.cogTiles.cog?this.cogTiles.getBoundsAsLatLon(this.cogTiles.cog):null,renderSubLayers:e=>{var t,A,i,s,o,l,g;const{bbox:{west:h,south:c,east:f,north:d}}=e.tile;return new r(e,Object.assign({data:null,image:e.data,bounds:[h,c,f,d],opacity:1,textureParameters:{[n.TEXTURE_MIN_FILTER]:this.blurredTexture?n.LINEAR:n.NEAREST},extensions:(null===(A=null===(t=this.cogTiles)||void 0===t?void 0:t.options)||void 0===A?void 0:A.clampToTerrain)?[new a]:[]},(null===(o=null===(s=null===(i=this.cogTiles)||void 0===i?void 0:i.options)||void 0===s?void 0:s.clampToTerrain)||void 0===o?void 0:o.terrainDrawMode)?{terrainDrawMode:null===(g=null===(l=this.cogTiles)||void 0===l?void 0:l.options)||void 0===g?void 0:g.clampToTerrain.terrainDrawMode}:{}))}})}return null}}za.layerName="CogBitmapLayer",za.displayName="CogBitmapLayer";const Ka={type:"object",value:null,validate:(e,t)=>t.optional&&null===e||"string"==typeof e||Array.isArray(e)&&e.every((e=>"string"==typeof e)),equal:(e,t)=>{if(e===t)return!0;if(!Array.isArray(e)||!Array.isArray(t))return!1;const A=e.length;if(A!==t.length)return!1;for(let i=0;i<A;i++)if(e[i]!==t[i])return!1;return!0}},Ja=[1],qa=Object.assign(Object.assign({},i.defaultProps),{elevationData:Ka,texture:Object.assign(Object.assign({},Ka),{optional:!0}),meshMaxError:{type:"number",value:4},bounds:{type:"array",value:null,optional:!0,compare:!0},color:{type:"color",value:[255,255,255]},elevationDecoder:{type:"object",value:{rScaler:1,gScaler:0,bScaler:0,offset:0}},workerUrl:"",wireframe:!1,material:!0});class Ha extends e{constructor(e,t){super(e),console.log("xxx_terrainOptions",t),this.terrainCogTiles=new Pa(t)}initializeState(e){const t=Object.create(null,{initializeState:{get:()=>super.initializeState}});return h(this,void 0,void 0,(function*(){t.initializeState.call(this,e),this.setState({initialized:!1}),yield this.init(this.terrainUrl)}))}init(e){return h(this,void 0,void 0,(function*(){console.log("xxx_LAYER INITIALIZE STATE");const e=yield this.terrainCogTiles.initializeCog(this.props.elevationData);console.log("xxx_LAYER INITIALIZE STATE",e);const t=this.terrainCogTiles.getZoomRange(e);console.log("xxx_LAYER INITIALIZE STATE",t),[this.minZoom,this.maxZoom]=t,this.setState({initialized:!0})}))}updateState({props:e,oldProps:A}){const i=e.elevationData!==A.elevationData;if(i){const{elevationData:t}=e,A=t&&(Array.isArray(t)||t.includes("{x}")&&t.includes("{y}"))||this.props.isTiled;this.setState({isTiled:A})}const r=i||e.meshMaxError!==A.meshMaxError||e.elevationDecoder!==A.elevationDecoder||e.bounds!==A.bounds;if(!this.state.isTiled&&r){const t=this.loadTerrain(e);this.setState({terrain:t})}e.workerUrl&&t.removed("workerUrl","loadOptions.terrain.workerUrl")()}loadTerrain({elevationData:e,bounds:t,elevationDecoder:A,meshMaxError:i,signal:r}){if(!e)return null;let a=this.getLoadOptions();a=Object.assign(Object.assign({},a),{_workerType:"test",terrain:Object.assign(Object.assign({skirtHeight:this.state.isTiled?2*i:0},null==a?void 0:a.terrain),{bounds:t,meshMaxError:i,elevationDecoder:A})});const{fetch:n}=this.props;return console.log("xxx_loaddata"),n(e,{propName:"elevationData",layer:this,loadOptions:a,signal:r})}getTiledTerrainData(e){return h(this,void 0,void 0,(function*(){this.props;const{viewport:t}=this.context;let A=[0,0],i=[0,0];if(t.isGeospatial){const r=e.bbox;console.log("xxx_coords",r.west,r.south,r.east,r.north),A=t.projectFlat([r.west,r.south]),i=t.projectFlat([r.east,r.north])}else{const t=e.bbox;A=[t.left,t.bottom],i=[t.right,t.top]}const r=[A[0],A[1],i[0],i[1]],a=yield this.terrainCogTiles.getTile(e.index.x,e.index.y,e.index.z,r);return console.log("xxx_TILE",a,r),Promise.all([a])}))}renderSubLayers(e){const t=this.getSubLayerClass("mesh",g),{color:i,wireframe:r,material:a}=this.props,{data:n}=e;if(!n)return null;const[s]=n;return new t(Object.assign(Object.assign({},e),{tileSize:256}),{data:Ja,mesh:s,_instanced:!1,coordinateSystem:A.CARTESIAN,getPosition:e=>[0,0,0],getColor:i,wireframe:r,material:a})}onViewportLoad(e){if(!e)return;const{zRange:t}=this.state,A=e.map((e=>e.content)).filter((e=>e&&e[0])).map((e=>{var t,A;const i=null===(A=null===(t=e[0])||void 0===t?void 0:t.header)||void 0===A?void 0:A.boundingBox;return null==i?void 0:i.map((e=>e[2]))}));if(0===A.length)return;const i=Math.min(...A.map((e=>e[0]))),r=Math.max(...A.map((e=>e[1])));console.log("xxx_ranges",A),(!t||i<t[0]||r>t[1])&&this.setState({zRange:[Number.isFinite(i)?i:0,Number.isFinite(r)?r:0]})}renderLayers(){const{color:e,material:t,elevationData:A,texture:r,wireframe:a,meshMaxError:n,elevationDecoder:s,tileSize:o,maxZoom:l,minZoom:g,extent:h,maxRequests:c,onTileLoad:f,onTileUnload:d,onTileError:I,maxCacheSize:u,maxCacheByteSize:B,refinementStrategy:C}=this.props;if(console.log("xxx_renderLayers",this.state.initialized),this.state.isTiled&&this.state.initialized)return new i(this.getSubLayerProps({id:"tiles"}),{getTileData:this.getTiledTerrainData.bind(this),renderSubLayers:this.renderSubLayers.bind(this),updateTriggers:{getTileData:{elevationData:(E=A,Array.isArray(E)?E.join(";"):E||""),meshMaxError:n,elevationDecoder:s}},onViewportLoad:this.onViewportLoad.bind(this),zRange:this.state.zRange||null,tileSize:o,maxZoom:l,minZoom:g,extent:h,maxRequests:c,onTileLoad:f,onTileUnload:d,onTileError:I,maxCacheSize:u,maxCacheByteSize:B,refinementStrategy:C});var E}}Ha.defaultProps=qa,Ha.layerName="TerrainLayer";var Ya={CogBitmapLayer:za,CogTerrainLayer:Ha,cogtiles:Pa,GeoImage:Ma};var Va=Object.freeze({__proto__:null,default:class extends ya{decodeBlock(e){return e}}});const Za=257;function ja(e,t){for(let A=t.length-1;A>=0;A--)e.push(t[A]);return e}function Xa(e){const t=new Uint16Array(4093),A=new Uint8Array(4093);for(let e=0;e<=257;e++)t[e]=4096,A[e]=e;let i=258,r=9,a=0;function n(){i=258,r=9}function s(e){const t=function(e,t,A){const i=t%8,r=Math.floor(t/8),a=8-i,n=t+A-8*(r+1);let s=8*(r+2)-(t+A);const o=8*(r+2)-t;if(s=Math.max(0,s),r>=e.length)return console.warn("ran off the end of the buffer before finding EOI_CODE (end on input code)"),Za;let l=e[r]&2**(8-i)-1;l<<=A-a;let g=l;if(r+1<e.length){let t=e[r+1]>>>s;t<<=Math.max(0,A-o),g+=t}if(n>8&&r+2<e.length){const i=8*(r+3)-(t+A);g+=e[r+2]>>>i}return g}(e,a,r);return a+=r,t}function o(e,r){return A[i]=r,t[i]=e,i++,i-1}function l(e){const i=[];for(let r=e;4096!==r;r=t[r])i.push(A[r]);return i}const g=[];n();const h=new Uint8Array(e);let c,f=s(h);for(;f!==Za;){if(256===f){for(n(),f=s(h);256===f;)f=s(h);if(f===Za)break;if(f>256)throw new Error(`corrupted code at scanline ${f}`);ja(g,l(f)),c=f}else if(f<i){const e=l(f);ja(g,e),o(c,e[e.length-1]),c=f}else{const e=l(c);if(!e)throw new Error(`Bogus entry. Not in dictionary, ${c} / ${i}, position: ${a}`);ja(g,e),g.push(e[e.length-1]),o(c,e[e.length-1]),c=f}i+1>=2**r&&(12===r?c=void 0:r++),f=s(h)}return new Uint8Array(g)}var Wa=Object.freeze({__proto__:null,default:class extends ya{decodeBlock(e){return Xa(e).buffer}}});const $a=new Int32Array([0,1,8,16,9,2,3,10,17,24,32,25,18,11,4,5,12,19,26,33,40,48,41,34,27,20,13,6,7,14,21,28,35,42,49,56,57,50,43,36,29,22,15,23,30,37,44,51,58,59,52,45,38,31,39,46,53,60,61,54,47,55,62,63]),en=4017,tn=799,An=3406,rn=2276,an=1567,nn=3784,sn=5793,on=2896;function ln(e,t){let A=0;const i=[];let r=16;for(;r>0&&!e[r-1];)--r;i.push({children:[],index:0});let a,n=i[0];for(let s=0;s<r;s++){for(let r=0;r<e[s];r++){for(n=i.pop(),n.children[n.index]=t[A];n.index>0;)n=i.pop();for(n.index++,i.push(n);i.length<=s;)i.push(a={children:[],index:0}),n.children[n.index]=a.children,n=a;A++}s+1<r&&(i.push(a={children:[],index:0}),n.children[n.index]=a.children,n=a)}return i[0].children}function gn(e,t,A,i,r,a,n,s,o){const{mcusPerLine:l,progressive:g}=A,h=t;let c=t,f=0,d=0;function I(){if(d>0)return d--,f>>d&1;if(f=e[c++],255===f){const t=e[c++];if(t)throw new Error(`unexpected marker: ${(f<<8|t).toString(16)}`)}return d=7,f>>>7}function u(e){let t,A=e;for(;null!==(t=I());){if(A=A[t],"number"==typeof A)return A;if("object"!=typeof A)throw new Error("invalid huffman sequence")}return null}function B(e){let t=e,A=0;for(;t>0;){const e=I();if(null===e)return;A=A<<1|e,--t}return A}function C(e){const t=B(e);return t>=1<<e-1?t:t+(-1<<e)+1}let E=0;let w,Q=0;function m(e,t,A,i,r){const a=A%l,n=(A/l|0)*e.v+i,s=a*e.h+r;t(e,e.blocks[n][s])}function p(e,t,A){const i=A/e.blocksPerLine|0,r=A%e.blocksPerLine;t(e,e.blocks[i][r])}const y=i.length;let _,b,D,k,v,x;x=g?0===a?0===s?function(e,t){const A=u(e.huffmanTableDC),i=0===A?0:C(A)<<o;e.pred+=i,t[0]=e.pred}:function(e,t){t[0]|=I()<<o}:0===s?function(e,t){if(E>0)return void E--;let A=a;const i=n;for(;A<=i;){const i=u(e.huffmanTableAC),r=15&i,a=i>>4;if(0===r){if(a<15){E=B(a)+(1<<a)-1;break}A+=16}else A+=a,t[$a[A]]=C(r)*(1<<o),A++}}:function(e,t){let A=a;const i=n;let r=0;for(;A<=i;){const i=$a[A],a=t[i]<0?-1:1;switch(Q){case 0:{const t=u(e.huffmanTableAC),A=15&t;if(r=t>>4,0===A)r<15?(E=B(r)+(1<<r),Q=4):(r=16,Q=1);else{if(1!==A)throw new Error("invalid ACn encoding");w=C(A),Q=r?2:3}continue}case 1:case 2:t[i]?t[i]+=(I()<<o)*a:(r--,0===r&&(Q=2===Q?3:0));break;case 3:t[i]?t[i]+=(I()<<o)*a:(t[i]=w<<o,Q=0);break;case 4:t[i]&&(t[i]+=(I()<<o)*a)}A++}4===Q&&(E--,0===E&&(Q=0))}:function(e,t){const A=u(e.huffmanTableDC),i=0===A?0:C(A);e.pred+=i,t[0]=e.pred;let r=1;for(;r<64;){const A=u(e.huffmanTableAC),i=15&A,a=A>>4;if(0===i){if(a<15)break;r+=16}else r+=a,t[$a[r]]=C(i),r++}};let S,G,U=0;G=1===y?i[0].blocksPerLine*i[0].blocksPerColumn:l*A.mcusPerColumn;const F=r||G;for(;U<G;){for(b=0;b<y;b++)i[b].pred=0;if(E=0,1===y)for(_=i[0],v=0;v<F;v++)p(_,x,U),U++;else for(v=0;v<F;v++){for(b=0;b<y;b++){_=i[b];const{h:e,v:t}=_;for(D=0;D<t;D++)for(k=0;k<e;k++)m(_,x,U,D,k)}if(U++,U===G)break}if(d=0,S=e[c]<<8|e[c+1],S<65280)throw new Error("marker was not found");if(!(S>=65488&&S<=65495))break;c+=2}return c-h}function hn(e,t){const A=[],{blocksPerLine:i,blocksPerColumn:r}=t,a=i<<3,n=new Int32Array(64),s=new Uint8Array(64);function o(e,A,i){const r=t.quantizationTable;let a,n,s,o,l,g,h,c,f;const d=i;let I;for(I=0;I<64;I++)d[I]=e[I]*r[I];for(I=0;I<8;++I){const e=8*I;0!==d[1+e]||0!==d[2+e]||0!==d[3+e]||0!==d[4+e]||0!==d[5+e]||0!==d[6+e]||0!==d[7+e]?(a=sn*d[0+e]+128>>8,n=sn*d[4+e]+128>>8,s=d[2+e],o=d[6+e],l=on*(d[1+e]-d[7+e])+128>>8,c=on*(d[1+e]+d[7+e])+128>>8,g=d[3+e]<<4,h=d[5+e]<<4,f=a-n+1>>1,a=a+n+1>>1,n=f,f=s*nn+o*an+128>>8,s=s*an-o*nn+128>>8,o=f,f=l-h+1>>1,l=l+h+1>>1,h=f,f=c+g+1>>1,g=c-g+1>>1,c=f,f=a-o+1>>1,a=a+o+1>>1,o=f,f=n-s+1>>1,n=n+s+1>>1,s=f,f=l*rn+c*An+2048>>12,l=l*An-c*rn+2048>>12,c=f,f=g*tn+h*en+2048>>12,g=g*en-h*tn+2048>>12,h=f,d[0+e]=a+c,d[7+e]=a-c,d[1+e]=n+h,d[6+e]=n-h,d[2+e]=s+g,d[5+e]=s-g,d[3+e]=o+l,d[4+e]=o-l):(f=sn*d[0+e]+512>>10,d[0+e]=f,d[1+e]=f,d[2+e]=f,d[3+e]=f,d[4+e]=f,d[5+e]=f,d[6+e]=f,d[7+e]=f)}for(I=0;I<8;++I){const e=I;0!==d[8+e]||0!==d[16+e]||0!==d[24+e]||0!==d[32+e]||0!==d[40+e]||0!==d[48+e]||0!==d[56+e]?(a=sn*d[0+e]+2048>>12,n=sn*d[32+e]+2048>>12,s=d[16+e],o=d[48+e],l=on*(d[8+e]-d[56+e])+2048>>12,c=on*(d[8+e]+d[56+e])+2048>>12,g=d[24+e],h=d[40+e],f=a-n+1>>1,a=a+n+1>>1,n=f,f=s*nn+o*an+2048>>12,s=s*an-o*nn+2048>>12,o=f,f=l-h+1>>1,l=l+h+1>>1,h=f,f=c+g+1>>1,g=c-g+1>>1,c=f,f=a-o+1>>1,a=a+o+1>>1,o=f,f=n-s+1>>1,n=n+s+1>>1,s=f,f=l*rn+c*An+2048>>12,l=l*An-c*rn+2048>>12,c=f,f=g*tn+h*en+2048>>12,g=g*en-h*tn+2048>>12,h=f,d[0+e]=a+c,d[56+e]=a-c,d[8+e]=n+h,d[48+e]=n-h,d[16+e]=s+g,d[40+e]=s-g,d[24+e]=o+l,d[32+e]=o-l):(f=sn*i[I+0]+8192>>14,d[0+e]=f,d[8+e]=f,d[16+e]=f,d[24+e]=f,d[32+e]=f,d[40+e]=f,d[48+e]=f,d[56+e]=f)}for(I=0;I<64;++I){const e=128+(d[I]+8>>4);A[I]=e<0?0:e>255?255:e}}for(let e=0;e<r;e++){const r=e<<3;for(let e=0;e<8;e++)A.push(new Uint8Array(a));for(let a=0;a<i;a++){o(t.blocks[e][a],s,n);let i=0;const l=a<<3;for(let e=0;e<8;e++){const t=A[r+e];for(let e=0;e<8;e++)t[l+e]=s[i++]}}}return A}class cn{constructor(){this.jfif=null,this.adobe=null,this.quantizationTables=[],this.huffmanTablesAC=[],this.huffmanTablesDC=[],this.resetFrames()}resetFrames(){this.frames=[]}parse(e){let t=0;function A(){const A=e[t]<<8|e[t+1];return t+=2,A}function i(){const i=A(),r=e.subarray(t,t+i-2);return t+=r.length,r}function r(e){let t,A,i=0,r=0;for(A in e.components)e.components.hasOwnProperty(A)&&(t=e.components[A],i<t.h&&(i=t.h),r<t.v&&(r=t.v));const a=Math.ceil(e.samplesPerLine/8/i),n=Math.ceil(e.scanLines/8/r);for(A in e.components)if(e.components.hasOwnProperty(A)){t=e.components[A];const s=Math.ceil(Math.ceil(e.samplesPerLine/8)*t.h/i),o=Math.ceil(Math.ceil(e.scanLines/8)*t.v/r),l=a*t.h,g=n*t.v,h=[];for(let e=0;e<g;e++){const e=[];for(let t=0;t<l;t++)e.push(new Int32Array(64));h.push(e)}t.blocksPerLine=s,t.blocksPerColumn=o,t.blocks=h}e.maxH=i,e.maxV=r,e.mcusPerLine=a,e.mcusPerColumn=n}let a=A();if(65496!==a)throw new Error("SOI not found");for(a=A();65497!==a;){switch(a){case 65280:break;case 65504:case 65505:case 65506:case 65507:case 65508:case 65509:case 65510:case 65511:case 65512:case 65513:case 65514:case 65515:case 65516:case 65517:case 65518:case 65519:case 65534:{const e=i();65504===a&&74===e[0]&&70===e[1]&&73===e[2]&&70===e[3]&&0===e[4]&&(this.jfif={version:{major:e[5],minor:e[6]},densityUnits:e[7],xDensity:e[8]<<8|e[9],yDensity:e[10]<<8|e[11],thumbWidth:e[12],thumbHeight:e[13],thumbData:e.subarray(14,14+3*e[12]*e[13])}),65518===a&&65===e[0]&&100===e[1]&&111===e[2]&&98===e[3]&&101===e[4]&&0===e[5]&&(this.adobe={version:e[6],flags0:e[7]<<8|e[8],flags1:e[9]<<8|e[10],transformCode:e[11]});break}case 65499:{const i=A()+t-2;for(;t<i;){const i=e[t++],r=new Int32Array(64);if(i>>4==0)for(let A=0;A<64;A++){r[$a[A]]=e[t++]}else{if(i>>4!=1)throw new Error("DQT: invalid table spec");for(let e=0;e<64;e++){r[$a[e]]=A()}}this.quantizationTables[15&i]=r}break}case 65472:case 65473:case 65474:{A();const i={extended:65473===a,progressive:65474===a,precision:e[t++],scanLines:A(),samplesPerLine:A(),components:{},componentsOrder:[]},n=e[t++];let s;for(let A=0;A<n;A++){s=e[t];const A=e[t+1]>>4,r=15&e[t+1],a=e[t+2];i.componentsOrder.push(s),i.components[s]={h:A,v:r,quantizationIdx:a},t+=3}r(i),this.frames.push(i);break}case 65476:{const i=A();for(let A=2;A<i;){const i=e[t++],r=new Uint8Array(16);let a=0;for(let A=0;A<16;A++,t++)r[A]=e[t],a+=r[A];const n=new Uint8Array(a);for(let A=0;A<a;A++,t++)n[A]=e[t];A+=17+a,i>>4==0?this.huffmanTablesDC[15&i]=ln(r,n):this.huffmanTablesAC[15&i]=ln(r,n)}break}case 65501:A(),this.resetInterval=A();break;case 65498:{A();const i=e[t++],r=[],a=this.frames[0];for(let A=0;A<i;A++){const A=a.components[e[t++]],i=e[t++];A.huffmanTableDC=this.huffmanTablesDC[i>>4],A.huffmanTableAC=this.huffmanTablesAC[15&i],r.push(A)}const n=e[t++],s=e[t++],o=e[t++],l=gn(e,t,a,r,this.resetInterval,n,s,o>>4,15&o);t+=l;break}case 65535:255!==e[t]&&t--;break;default:if(255===e[t-3]&&e[t-2]>=192&&e[t-2]<=254){t-=3;break}throw new Error(`unknown JPEG marker ${a.toString(16)}`)}a=A()}}getResult(){const{frames:e}=this;if(0===this.frames.length)throw new Error("no frames were decoded");this.frames.length>1&&console.warn("more than one frame is not supported");for(let e=0;e<this.frames.length;e++){const t=this.frames[e].components;for(const e of Object.keys(t))t[e].quantizationTable=this.quantizationTables[t[e].quantizationIdx],delete t[e].quantizationIdx}const t=e[0],{components:A,componentsOrder:i}=t,r=[],a=t.samplesPerLine,n=t.scanLines;for(let e=0;e<i.length;e++){const a=A[i[e]];r.push({lines:hn(0,a),scaleX:a.h/t.maxH,scaleY:a.v/t.maxV})}const s=new Uint8Array(a*n*r.length);let o=0;for(let e=0;e<n;++e)for(let t=0;t<a;++t)for(let A=0;A<r.length;++A){const i=r[A];s[o]=i.lines[0|e*i.scaleY][0|t*i.scaleX],++o}return s}}var fn=Object.freeze({__proto__:null,default:class extends ya{constructor(e){super(),this.reader=new cn,e.JPEGTables&&this.reader.parse(e.JPEGTables)}decodeBlock(e){return this.reader.resetFrames(),this.reader.parse(new Uint8Array(e)),this.reader.getResult().buffer}}});
|
|
3
|
+
/*! pako 2.1.0 https://github.com/nodeca/pako @license (MIT AND Zlib) */function dn(e){let t=e.length;for(;--t>=0;)e[t]=0}const In=256,un=286,Bn=30,Cn=15,En=new Uint8Array([0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0]),wn=new Uint8Array([0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13]),Qn=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),mn=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),pn=new Array(576);dn(pn);const yn=new Array(60);dn(yn);const _n=new Array(512);dn(_n);const bn=new Array(256);dn(bn);const Dn=new Array(29);dn(Dn);const kn=new Array(Bn);function vn(e,t,A,i,r){this.static_tree=e,this.extra_bits=t,this.extra_base=A,this.elems=i,this.max_length=r,this.has_stree=e&&e.length}let xn,Sn,Gn;function Un(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}dn(kn);const Fn=e=>e<256?_n[e]:_n[256+(e>>>7)],Rn=(e,t)=>{e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255},Ln=(e,t,A)=>{e.bi_valid>16-A?(e.bi_buf|=t<<e.bi_valid&65535,Rn(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=A-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=A)},Mn=(e,t,A)=>{Ln(e,A[2*t],A[2*t+1])},Tn=(e,t)=>{let A=0;do{A|=1&e,e>>>=1,A<<=1}while(--t>0);return A>>>1},Nn=(e,t,A)=>{const i=new Array(16);let r,a,n=0;for(r=1;r<=Cn;r++)n=n+A[r-1]<<1,i[r]=n;for(a=0;a<=t;a++){let t=e[2*a+1];0!==t&&(e[2*a]=Tn(i[t]++,t))}},On=e=>{let t;for(t=0;t<un;t++)e.dyn_ltree[2*t]=0;for(t=0;t<Bn;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.sym_next=e.matches=0},Pn=e=>{e.bi_valid>8?Rn(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0},zn=(e,t,A,i)=>{const r=2*t,a=2*A;return e[r]<e[a]||e[r]===e[a]&&i[t]<=i[A]},Kn=(e,t,A)=>{const i=e.heap[A];let r=A<<1;for(;r<=e.heap_len&&(r<e.heap_len&&zn(t,e.heap[r+1],e.heap[r],e.depth)&&r++,!zn(t,i,e.heap[r],e.depth));)e.heap[A]=e.heap[r],A=r,r<<=1;e.heap[A]=i},Jn=(e,t,A)=>{let i,r,a,n,s=0;if(0!==e.sym_next)do{i=255&e.pending_buf[e.sym_buf+s++],i+=(255&e.pending_buf[e.sym_buf+s++])<<8,r=e.pending_buf[e.sym_buf+s++],0===i?Mn(e,r,t):(a=bn[r],Mn(e,a+In+1,t),n=En[a],0!==n&&(r-=Dn[a],Ln(e,r,n)),i--,a=Fn(i),Mn(e,a,A),n=wn[a],0!==n&&(i-=kn[a],Ln(e,i,n)))}while(s<e.sym_next);Mn(e,256,t)},qn=(e,t)=>{const A=t.dyn_tree,i=t.stat_desc.static_tree,r=t.stat_desc.has_stree,a=t.stat_desc.elems;let n,s,o,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<a;n++)0!==A[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):A[2*n+1]=0;for(;e.heap_len<2;)o=e.heap[++e.heap_len]=l<2?++l:0,A[2*o]=1,e.depth[o]=0,e.opt_len--,r&&(e.static_len-=i[2*o+1]);for(t.max_code=l,n=e.heap_len>>1;n>=1;n--)Kn(e,A,n);o=a;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],Kn(e,A,1),s=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=s,A[2*o]=A[2*n]+A[2*s],e.depth[o]=(e.depth[n]>=e.depth[s]?e.depth[n]:e.depth[s])+1,A[2*n+1]=A[2*s+1]=o,e.heap[1]=o++,Kn(e,A,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],((e,t)=>{const A=t.dyn_tree,i=t.max_code,r=t.stat_desc.static_tree,a=t.stat_desc.has_stree,n=t.stat_desc.extra_bits,s=t.stat_desc.extra_base,o=t.stat_desc.max_length;let l,g,h,c,f,d,I=0;for(c=0;c<=Cn;c++)e.bl_count[c]=0;for(A[2*e.heap[e.heap_max]+1]=0,l=e.heap_max+1;l<573;l++)g=e.heap[l],c=A[2*A[2*g+1]+1]+1,c>o&&(c=o,I++),A[2*g+1]=c,g>i||(e.bl_count[c]++,f=0,g>=s&&(f=n[g-s]),d=A[2*g],e.opt_len+=d*(c+f),a&&(e.static_len+=d*(r[2*g+1]+f)));if(0!==I){do{for(c=o-1;0===e.bl_count[c];)c--;e.bl_count[c]--,e.bl_count[c+1]+=2,e.bl_count[o]--,I-=2}while(I>0);for(c=o;0!==c;c--)for(g=e.bl_count[c];0!==g;)h=e.heap[--l],h>i||(A[2*h+1]!==c&&(e.opt_len+=(c-A[2*h+1])*A[2*h],A[2*h+1]=c),g--)}})(e,t),Nn(A,l,e.bl_count)},Hn=(e,t,A)=>{let i,r,a=-1,n=t[1],s=0,o=7,l=4;for(0===n&&(o=138,l=3),t[2*(A+1)+1]=65535,i=0;i<=A;i++)r=n,n=t[2*(i+1)+1],++s<o&&r===n||(s<l?e.bl_tree[2*r]+=s:0!==r?(r!==a&&e.bl_tree[2*r]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,s=0,a=r,0===n?(o=138,l=3):r===n?(o=6,l=3):(o=7,l=4))},Yn=(e,t,A)=>{let i,r,a=-1,n=t[1],s=0,o=7,l=4;for(0===n&&(o=138,l=3),i=0;i<=A;i++)if(r=n,n=t[2*(i+1)+1],!(++s<o&&r===n)){if(s<l)do{Mn(e,r,e.bl_tree)}while(0!=--s);else 0!==r?(r!==a&&(Mn(e,r,e.bl_tree),s--),Mn(e,16,e.bl_tree),Ln(e,s-3,2)):s<=10?(Mn(e,17,e.bl_tree),Ln(e,s-3,3)):(Mn(e,18,e.bl_tree),Ln(e,s-11,7));s=0,a=r,0===n?(o=138,l=3):r===n?(o=6,l=3):(o=7,l=4)}};let Vn=!1;const Zn=(e,t,A,i)=>{Ln(e,0+(i?1:0),3),Pn(e),Rn(e,A),Rn(e,~A),A&&e.pending_buf.set(e.window.subarray(t,t+A),e.pending),e.pending+=A};var jn=(e,t,A,i)=>{let r,a,n=0;e.level>0?(2===e.strm.data_type&&(e.strm.data_type=(e=>{let t,A=4093624447;for(t=0;t<=31;t++,A>>>=1)if(1&A&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<In;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0})(e)),qn(e,e.l_desc),qn(e,e.d_desc),n=(e=>{let t;for(Hn(e,e.dyn_ltree,e.l_desc.max_code),Hn(e,e.dyn_dtree,e.d_desc.max_code),qn(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*mn[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t})(e),r=e.opt_len+3+7>>>3,a=e.static_len+3+7>>>3,a<=r&&(r=a)):r=a=A+5,A+4<=r&&-1!==t?Zn(e,t,A,i):4===e.strategy||a===r?(Ln(e,2+(i?1:0),3),Jn(e,pn,yn)):(Ln(e,4+(i?1:0),3),((e,t,A,i)=>{let r;for(Ln(e,t-257,5),Ln(e,A-1,5),Ln(e,i-4,4),r=0;r<i;r++)Ln(e,e.bl_tree[2*mn[r]+1],3);Yn(e,e.dyn_ltree,t-1),Yn(e,e.dyn_dtree,A-1)})(e,e.l_desc.max_code+1,e.d_desc.max_code+1,n+1),Jn(e,e.dyn_ltree,e.dyn_dtree)),On(e),i&&Pn(e)},Xn={_tr_init:e=>{Vn||((()=>{let e,t,A,i,r;const a=new Array(16);for(A=0,i=0;i<28;i++)for(Dn[i]=A,e=0;e<1<<En[i];e++)bn[A++]=i;for(bn[A-1]=i,r=0,i=0;i<16;i++)for(kn[i]=r,e=0;e<1<<wn[i];e++)_n[r++]=i;for(r>>=7;i<Bn;i++)for(kn[i]=r<<7,e=0;e<1<<wn[i]-7;e++)_n[256+r++]=i;for(t=0;t<=Cn;t++)a[t]=0;for(e=0;e<=143;)pn[2*e+1]=8,e++,a[8]++;for(;e<=255;)pn[2*e+1]=9,e++,a[9]++;for(;e<=279;)pn[2*e+1]=7,e++,a[7]++;for(;e<=287;)pn[2*e+1]=8,e++,a[8]++;for(Nn(pn,287,a),e=0;e<Bn;e++)yn[2*e+1]=5,yn[2*e]=Tn(e,5);xn=new vn(pn,En,257,un,Cn),Sn=new vn(yn,wn,0,Bn,Cn),Gn=new vn(new Array(0),Qn,0,19,7)})(),Vn=!0),e.l_desc=new Un(e.dyn_ltree,xn),e.d_desc=new Un(e.dyn_dtree,Sn),e.bl_desc=new Un(e.bl_tree,Gn),e.bi_buf=0,e.bi_valid=0,On(e)},_tr_stored_block:Zn,_tr_flush_block:jn,_tr_tally:(e,t,A)=>(e.pending_buf[e.sym_buf+e.sym_next++]=t,e.pending_buf[e.sym_buf+e.sym_next++]=t>>8,e.pending_buf[e.sym_buf+e.sym_next++]=A,0===t?e.dyn_ltree[2*A]++:(e.matches++,t--,e.dyn_ltree[2*(bn[A]+In+1)]++,e.dyn_dtree[2*Fn(t)]++),e.sym_next===e.sym_end),_tr_align:e=>{Ln(e,2,3),Mn(e,256,pn),(e=>{16===e.bi_valid?(Rn(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)})(e)}};var Wn=(e,t,A,i)=>{let r=65535&e|0,a=e>>>16&65535|0,n=0;for(;0!==A;){n=A>2e3?2e3:A,A-=n;do{r=r+t[i++]|0,a=a+r|0}while(--n);r%=65521,a%=65521}return r|a<<16|0};const $n=new Uint32Array((()=>{let e,t=[];for(var A=0;A<256;A++){e=A;for(var i=0;i<8;i++)e=1&e?3988292384^e>>>1:e>>>1;t[A]=e}return t})());var es=(e,t,A,i)=>{const r=$n,a=i+A;e^=-1;for(let A=i;A<a;A++)e=e>>>8^r[255&(e^t[A])];return-1^e},ts={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"},As={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8};const{_tr_init:is,_tr_stored_block:rs,_tr_flush_block:as,_tr_tally:ns,_tr_align:ss}=Xn,{Z_NO_FLUSH:os,Z_PARTIAL_FLUSH:ls,Z_FULL_FLUSH:gs,Z_FINISH:hs,Z_BLOCK:cs,Z_OK:fs,Z_STREAM_END:ds,Z_STREAM_ERROR:Is,Z_DATA_ERROR:us,Z_BUF_ERROR:Bs,Z_DEFAULT_COMPRESSION:Cs,Z_FILTERED:Es,Z_HUFFMAN_ONLY:ws,Z_RLE:Qs,Z_FIXED:ms,Z_DEFAULT_STRATEGY:ps,Z_UNKNOWN:ys,Z_DEFLATED:_s}=As,bs=258,Ds=262,ks=42,vs=113,xs=666,Ss=(e,t)=>(e.msg=ts[t],t),Gs=e=>2*e-(e>4?9:0),Us=e=>{let t=e.length;for(;--t>=0;)e[t]=0},Fs=e=>{let t,A,i,r=e.w_size;t=e.hash_size,i=t;do{A=e.head[--i],e.head[i]=A>=r?A-r:0}while(--t);t=r,i=t;do{A=e.prev[--i],e.prev[i]=A>=r?A-r:0}while(--t)};let Rs=(e,t,A)=>(t<<e.hash_shift^A)&e.hash_mask;const Ls=e=>{const t=e.state;let A=t.pending;A>e.avail_out&&(A=e.avail_out),0!==A&&(e.output.set(t.pending_buf.subarray(t.pending_out,t.pending_out+A),e.next_out),e.next_out+=A,t.pending_out+=A,e.total_out+=A,e.avail_out-=A,t.pending-=A,0===t.pending&&(t.pending_out=0))},Ms=(e,t)=>{as(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Ls(e.strm)},Ts=(e,t)=>{e.pending_buf[e.pending++]=t},Ns=(e,t)=>{e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t},Os=(e,t,A,i)=>{let r=e.avail_in;return r>i&&(r=i),0===r?0:(e.avail_in-=r,t.set(e.input.subarray(e.next_in,e.next_in+r),A),1===e.state.wrap?e.adler=Wn(e.adler,t,r,A):2===e.state.wrap&&(e.adler=es(e.adler,t,r,A)),e.next_in+=r,e.total_in+=r,r)},Ps=(e,t)=>{let A,i,r=e.max_chain_length,a=e.strstart,n=e.prev_length,s=e.nice_match;const o=e.strstart>e.w_size-Ds?e.strstart-(e.w_size-Ds):0,l=e.window,g=e.w_mask,h=e.prev,c=e.strstart+bs;let f=l[a+n-1],d=l[a+n];e.prev_length>=e.good_match&&(r>>=2),s>e.lookahead&&(s=e.lookahead);do{if(A=t,l[A+n]===d&&l[A+n-1]===f&&l[A]===l[a]&&l[++A]===l[a+1]){a+=2,A++;do{}while(l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&l[++a]===l[++A]&&a<c);if(i=bs-(c-a),a=c-bs,i>n){if(e.match_start=t,n=i,i>=s)break;f=l[a+n-1],d=l[a+n]}}}while((t=h[t&g])>o&&0!=--r);return n<=e.lookahead?n:e.lookahead},zs=e=>{const t=e.w_size;let A,i,r;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=t+(t-Ds)&&(e.window.set(e.window.subarray(t,t+t-i),0),e.match_start-=t,e.strstart-=t,e.block_start-=t,e.insert>e.strstart&&(e.insert=e.strstart),Fs(e),i+=t),0===e.strm.avail_in)break;if(A=Os(e.strm,e.window,e.strstart+e.lookahead,i),e.lookahead+=A,e.lookahead+e.insert>=3)for(r=e.strstart-e.insert,e.ins_h=e.window[r],e.ins_h=Rs(e,e.ins_h,e.window[r+1]);e.insert&&(e.ins_h=Rs(e,e.ins_h,e.window[r+3-1]),e.prev[r&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=r,r++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<Ds&&0!==e.strm.avail_in)},Ks=(e,t)=>{let A,i,r,a=e.pending_buf_size-5>e.w_size?e.w_size:e.pending_buf_size-5,n=0,s=e.strm.avail_in;do{if(A=65535,r=e.bi_valid+42>>3,e.strm.avail_out<r)break;if(r=e.strm.avail_out-r,i=e.strstart-e.block_start,A>i+e.strm.avail_in&&(A=i+e.strm.avail_in),A>r&&(A=r),A<a&&(0===A&&t!==hs||t===os||A!==i+e.strm.avail_in))break;n=t===hs&&A===i+e.strm.avail_in?1:0,rs(e,0,0,n),e.pending_buf[e.pending-4]=A,e.pending_buf[e.pending-3]=A>>8,e.pending_buf[e.pending-2]=~A,e.pending_buf[e.pending-1]=~A>>8,Ls(e.strm),i&&(i>A&&(i=A),e.strm.output.set(e.window.subarray(e.block_start,e.block_start+i),e.strm.next_out),e.strm.next_out+=i,e.strm.avail_out-=i,e.strm.total_out+=i,e.block_start+=i,A-=i),A&&(Os(e.strm,e.strm.output,e.strm.next_out,A),e.strm.next_out+=A,e.strm.avail_out-=A,e.strm.total_out+=A)}while(0===n);return s-=e.strm.avail_in,s&&(s>=e.w_size?(e.matches=2,e.window.set(e.strm.input.subarray(e.strm.next_in-e.w_size,e.strm.next_in),0),e.strstart=e.w_size,e.insert=e.strstart):(e.window_size-e.strstart<=s&&(e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,e.insert>e.strstart&&(e.insert=e.strstart)),e.window.set(e.strm.input.subarray(e.strm.next_in-s,e.strm.next_in),e.strstart),e.strstart+=s,e.insert+=s>e.w_size-e.insert?e.w_size-e.insert:s),e.block_start=e.strstart),e.high_water<e.strstart&&(e.high_water=e.strstart),n?4:t!==os&&t!==hs&&0===e.strm.avail_in&&e.strstart===e.block_start?2:(r=e.window_size-e.strstart,e.strm.avail_in>r&&e.block_start>=e.w_size&&(e.block_start-=e.w_size,e.strstart-=e.w_size,e.window.set(e.window.subarray(e.w_size,e.w_size+e.strstart),0),e.matches<2&&e.matches++,r+=e.w_size,e.insert>e.strstart&&(e.insert=e.strstart)),r>e.strm.avail_in&&(r=e.strm.avail_in),r&&(Os(e.strm,e.window,e.strstart,r),e.strstart+=r,e.insert+=r>e.w_size-e.insert?e.w_size-e.insert:r),e.high_water<e.strstart&&(e.high_water=e.strstart),r=e.bi_valid+42>>3,r=e.pending_buf_size-r>65535?65535:e.pending_buf_size-r,a=r>e.w_size?e.w_size:r,i=e.strstart-e.block_start,(i>=a||(i||t===hs)&&t!==os&&0===e.strm.avail_in&&i<=r)&&(A=i>r?r:i,n=t===hs&&0===e.strm.avail_in&&A===i?1:0,rs(e,e.block_start,A,n),e.block_start+=A,Ls(e.strm)),n?3:1)},Js=(e,t)=>{let A,i;for(;;){if(e.lookahead<Ds){if(zs(e),e.lookahead<Ds&&t===os)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=Rs(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==A&&e.strstart-A<=e.w_size-Ds&&(e.match_length=Ps(e,A)),e.match_length>=3)if(i=ns(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){e.match_length--;do{e.strstart++,e.ins_h=Rs(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart}while(0!=--e.match_length);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=Rs(e,e.ins_h,e.window[e.strstart+1]);else i=ns(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(i&&(Ms(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,t===hs?(Ms(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ms(e,!1),0===e.strm.avail_out)?1:2},qs=(e,t)=>{let A,i,r;for(;;){if(e.lookahead<Ds){if(zs(e),e.lookahead<Ds&&t===os)return 1;if(0===e.lookahead)break}if(A=0,e.lookahead>=3&&(e.ins_h=Rs(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==A&&e.prev_length<e.max_lazy_match&&e.strstart-A<=e.w_size-Ds&&(e.match_length=Ps(e,A),e.match_length<=5&&(e.strategy===Es||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){r=e.strstart+e.lookahead-3,i=ns(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++e.strstart<=r&&(e.ins_h=Rs(e,e.ins_h,e.window[e.strstart+3-1]),A=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,i&&(Ms(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if(i=ns(e,0,e.window[e.strstart-1]),i&&Ms(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(i=ns(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,t===hs?(Ms(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ms(e,!1),0===e.strm.avail_out)?1:2};function Hs(e,t,A,i,r){this.good_length=e,this.max_lazy=t,this.nice_length=A,this.max_chain=i,this.func=r}const Ys=[new Hs(0,0,0,0,Ks),new Hs(4,4,8,4,Js),new Hs(4,5,16,8,Js),new Hs(4,6,32,32,Js),new Hs(4,4,16,16,qs),new Hs(8,16,32,32,qs),new Hs(8,16,128,128,qs),new Hs(8,32,128,256,qs),new Hs(32,128,258,1024,qs),new Hs(32,258,258,4096,qs)];function Vs(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=_s,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new Uint16Array(1146),this.dyn_dtree=new Uint16Array(122),this.bl_tree=new Uint16Array(78),Us(this.dyn_ltree),Us(this.dyn_dtree),Us(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Uint16Array(16),this.heap=new Uint16Array(573),Us(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),Us(this.depth),this.sym_buf=0,this.lit_bufsize=0,this.sym_next=0,this.sym_end=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}const Zs=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.status!==ks&&57!==t.status&&69!==t.status&&73!==t.status&&91!==t.status&&103!==t.status&&t.status!==vs&&t.status!==xs?1:0},js=e=>{if(Zs(e))return Ss(e,Is);e.total_in=e.total_out=0,e.data_type=ys;const t=e.state;return t.pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=2===t.wrap?57:t.wrap?ks:vs,e.adler=2===t.wrap?0:1,t.last_flush=-2,is(t),fs},Xs=e=>{const t=js(e);var A;return t===fs&&((A=e.state).window_size=2*A.w_size,Us(A.head),A.max_lazy_match=Ys[A.level].max_lazy,A.good_match=Ys[A.level].good_length,A.nice_match=Ys[A.level].nice_length,A.max_chain_length=Ys[A.level].max_chain,A.strstart=0,A.block_start=0,A.lookahead=0,A.insert=0,A.match_length=A.prev_length=2,A.match_available=0,A.ins_h=0),t},Ws=(e,t,A,i,r,a)=>{if(!e)return Is;let n=1;if(t===Cs&&(t=6),i<0?(n=0,i=-i):i>15&&(n=2,i-=16),r<1||r>9||A!==_s||i<8||i>15||t<0||t>9||a<0||a>ms||8===i&&1!==n)return Ss(e,Is);8===i&&(i=9);const s=new Vs;return e.state=s,s.strm=e,s.status=ks,s.wrap=n,s.gzhead=null,s.w_bits=i,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=r+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Uint8Array(2*s.w_size),s.head=new Uint16Array(s.hash_size),s.prev=new Uint16Array(s.w_size),s.lit_bufsize=1<<r+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Uint8Array(s.pending_buf_size),s.sym_buf=s.lit_bufsize,s.sym_end=3*(s.lit_bufsize-1),s.level=t,s.strategy=a,s.method=A,Xs(e)};var $s={deflateInit:(e,t)=>Ws(e,t,_s,15,8,ps),deflateInit2:Ws,deflateReset:Xs,deflateResetKeep:js,deflateSetHeader:(e,t)=>Zs(e)||2!==e.state.wrap?Is:(e.state.gzhead=t,fs),deflate:(e,t)=>{if(Zs(e)||t>cs||t<0)return e?Ss(e,Is):Is;const A=e.state;if(!e.output||0!==e.avail_in&&!e.input||A.status===xs&&t!==hs)return Ss(e,0===e.avail_out?Bs:Is);const i=A.last_flush;if(A.last_flush=t,0!==A.pending){if(Ls(e),0===e.avail_out)return A.last_flush=-1,fs}else if(0===e.avail_in&&Gs(t)<=Gs(i)&&t!==hs)return Ss(e,Bs);if(A.status===xs&&0!==e.avail_in)return Ss(e,Bs);if(A.status===ks&&0===A.wrap&&(A.status=vs),A.status===ks){let t=_s+(A.w_bits-8<<4)<<8,i=-1;if(i=A.strategy>=ws||A.level<2?0:A.level<6?1:6===A.level?2:3,t|=i<<6,0!==A.strstart&&(t|=32),t+=31-t%31,Ns(A,t),0!==A.strstart&&(Ns(A,e.adler>>>16),Ns(A,65535&e.adler)),e.adler=1,A.status=vs,Ls(e),0!==A.pending)return A.last_flush=-1,fs}if(57===A.status)if(e.adler=0,Ts(A,31),Ts(A,139),Ts(A,8),A.gzhead)Ts(A,(A.gzhead.text?1:0)+(A.gzhead.hcrc?2:0)+(A.gzhead.extra?4:0)+(A.gzhead.name?8:0)+(A.gzhead.comment?16:0)),Ts(A,255&A.gzhead.time),Ts(A,A.gzhead.time>>8&255),Ts(A,A.gzhead.time>>16&255),Ts(A,A.gzhead.time>>24&255),Ts(A,9===A.level?2:A.strategy>=ws||A.level<2?4:0),Ts(A,255&A.gzhead.os),A.gzhead.extra&&A.gzhead.extra.length&&(Ts(A,255&A.gzhead.extra.length),Ts(A,A.gzhead.extra.length>>8&255)),A.gzhead.hcrc&&(e.adler=es(e.adler,A.pending_buf,A.pending,0)),A.gzindex=0,A.status=69;else if(Ts(A,0),Ts(A,0),Ts(A,0),Ts(A,0),Ts(A,0),Ts(A,9===A.level?2:A.strategy>=ws||A.level<2?4:0),Ts(A,3),A.status=vs,Ls(e),0!==A.pending)return A.last_flush=-1,fs;if(69===A.status){if(A.gzhead.extra){let t=A.pending,i=(65535&A.gzhead.extra.length)-A.gzindex;for(;A.pending+i>A.pending_buf_size;){let r=A.pending_buf_size-A.pending;if(A.pending_buf.set(A.gzhead.extra.subarray(A.gzindex,A.gzindex+r),A.pending),A.pending=A.pending_buf_size,A.gzhead.hcrc&&A.pending>t&&(e.adler=es(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex+=r,Ls(e),0!==A.pending)return A.last_flush=-1,fs;t=0,i-=r}let r=new Uint8Array(A.gzhead.extra);A.pending_buf.set(r.subarray(A.gzindex,A.gzindex+i),A.pending),A.pending+=i,A.gzhead.hcrc&&A.pending>t&&(e.adler=es(e.adler,A.pending_buf,A.pending-t,t)),A.gzindex=0}A.status=73}if(73===A.status){if(A.gzhead.name){let t,i=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(e.adler=es(e.adler,A.pending_buf,A.pending-i,i)),Ls(e),0!==A.pending)return A.last_flush=-1,fs;i=0}t=A.gzindex<A.gzhead.name.length?255&A.gzhead.name.charCodeAt(A.gzindex++):0,Ts(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>i&&(e.adler=es(e.adler,A.pending_buf,A.pending-i,i)),A.gzindex=0}A.status=91}if(91===A.status){if(A.gzhead.comment){let t,i=A.pending;do{if(A.pending===A.pending_buf_size){if(A.gzhead.hcrc&&A.pending>i&&(e.adler=es(e.adler,A.pending_buf,A.pending-i,i)),Ls(e),0!==A.pending)return A.last_flush=-1,fs;i=0}t=A.gzindex<A.gzhead.comment.length?255&A.gzhead.comment.charCodeAt(A.gzindex++):0,Ts(A,t)}while(0!==t);A.gzhead.hcrc&&A.pending>i&&(e.adler=es(e.adler,A.pending_buf,A.pending-i,i))}A.status=103}if(103===A.status){if(A.gzhead.hcrc){if(A.pending+2>A.pending_buf_size&&(Ls(e),0!==A.pending))return A.last_flush=-1,fs;Ts(A,255&e.adler),Ts(A,e.adler>>8&255),e.adler=0}if(A.status=vs,Ls(e),0!==A.pending)return A.last_flush=-1,fs}if(0!==e.avail_in||0!==A.lookahead||t!==os&&A.status!==xs){let i=0===A.level?Ks(A,t):A.strategy===ws?((e,t)=>{let A;for(;;){if(0===e.lookahead&&(zs(e),0===e.lookahead)){if(t===os)return 1;break}if(e.match_length=0,A=ns(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,A&&(Ms(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===hs?(Ms(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ms(e,!1),0===e.strm.avail_out)?1:2})(A,t):A.strategy===Qs?((e,t)=>{let A,i,r,a;const n=e.window;for(;;){if(e.lookahead<=bs){if(zs(e),e.lookahead<=bs&&t===os)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=e.strstart-1,i=n[r],i===n[++r]&&i===n[++r]&&i===n[++r])){a=e.strstart+bs;do{}while(i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&i===n[++r]&&r<a);e.match_length=bs-(a-r),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(A=ns(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(A=ns(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),A&&(Ms(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,t===hs?(Ms(e,!0),0===e.strm.avail_out?3:4):e.sym_next&&(Ms(e,!1),0===e.strm.avail_out)?1:2})(A,t):Ys[A.level].func(A,t);if(3!==i&&4!==i||(A.status=xs),1===i||3===i)return 0===e.avail_out&&(A.last_flush=-1),fs;if(2===i&&(t===ls?ss(A):t!==cs&&(rs(A,0,0,!1),t===gs&&(Us(A.head),0===A.lookahead&&(A.strstart=0,A.block_start=0,A.insert=0))),Ls(e),0===e.avail_out))return A.last_flush=-1,fs}return t!==hs?fs:A.wrap<=0?ds:(2===A.wrap?(Ts(A,255&e.adler),Ts(A,e.adler>>8&255),Ts(A,e.adler>>16&255),Ts(A,e.adler>>24&255),Ts(A,255&e.total_in),Ts(A,e.total_in>>8&255),Ts(A,e.total_in>>16&255),Ts(A,e.total_in>>24&255)):(Ns(A,e.adler>>>16),Ns(A,65535&e.adler)),Ls(e),A.wrap>0&&(A.wrap=-A.wrap),0!==A.pending?fs:ds)},deflateEnd:e=>{if(Zs(e))return Is;const t=e.state.status;return e.state=null,t===vs?Ss(e,us):fs},deflateSetDictionary:(e,t)=>{let A=t.length;if(Zs(e))return Is;const i=e.state,r=i.wrap;if(2===r||1===r&&i.status!==ks||i.lookahead)return Is;if(1===r&&(e.adler=Wn(e.adler,t,A,0)),i.wrap=0,A>=i.w_size){0===r&&(Us(i.head),i.strstart=0,i.block_start=0,i.insert=0);let e=new Uint8Array(i.w_size);e.set(t.subarray(A-i.w_size,A),0),t=e,A=i.w_size}const a=e.avail_in,n=e.next_in,s=e.input;for(e.avail_in=A,e.next_in=0,e.input=t,zs(i);i.lookahead>=3;){let e=i.strstart,t=i.lookahead-2;do{i.ins_h=Rs(i,i.ins_h,i.window[e+3-1]),i.prev[e&i.w_mask]=i.head[i.ins_h],i.head[i.ins_h]=e,e++}while(--t);i.strstart=e,i.lookahead=2,zs(i)}return i.strstart+=i.lookahead,i.block_start=i.strstart,i.insert=i.lookahead,i.lookahead=0,i.match_length=i.prev_length=2,i.match_available=0,e.next_in=n,e.input=s,e.avail_in=a,i.wrap=r,fs},deflateInfo:"pako deflate (from Nodeca project)"};const eo=(e,t)=>Object.prototype.hasOwnProperty.call(e,t);var to={assign:function(e){const t=Array.prototype.slice.call(arguments,1);for(;t.length;){const A=t.shift();if(A){if("object"!=typeof A)throw new TypeError(A+"must be non-object");for(const t in A)eo(A,t)&&(e[t]=A[t])}}return e},flattenChunks:e=>{let t=0;for(let A=0,i=e.length;A<i;A++)t+=e[A].length;const A=new Uint8Array(t);for(let t=0,i=0,r=e.length;t<r;t++){let r=e[t];A.set(r,i),i+=r.length}return A}};let Ao=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Ao=!1}const io=new Uint8Array(256);for(let e=0;e<256;e++)io[e]=e>=252?6:e>=248?5:e>=240?4:e>=224?3:e>=192?2:1;io[254]=io[254]=1;var ro={string2buf:e=>{if("function"==typeof TextEncoder&&TextEncoder.prototype.encode)return(new TextEncoder).encode(e);let t,A,i,r,a,n=e.length,s=0;for(r=0;r<n;r++)A=e.charCodeAt(r),55296==(64512&A)&&r+1<n&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(A=65536+(A-55296<<10)+(i-56320),r++)),s+=A<128?1:A<2048?2:A<65536?3:4;for(t=new Uint8Array(s),a=0,r=0;a<s;r++)A=e.charCodeAt(r),55296==(64512&A)&&r+1<n&&(i=e.charCodeAt(r+1),56320==(64512&i)&&(A=65536+(A-55296<<10)+(i-56320),r++)),A<128?t[a++]=A:A<2048?(t[a++]=192|A>>>6,t[a++]=128|63&A):A<65536?(t[a++]=224|A>>>12,t[a++]=128|A>>>6&63,t[a++]=128|63&A):(t[a++]=240|A>>>18,t[a++]=128|A>>>12&63,t[a++]=128|A>>>6&63,t[a++]=128|63&A);return t},buf2string:(e,t)=>{const A=t||e.length;if("function"==typeof TextDecoder&&TextDecoder.prototype.decode)return(new TextDecoder).decode(e.subarray(0,t));let i,r;const a=new Array(2*A);for(r=0,i=0;i<A;){let t=e[i++];if(t<128){a[r++]=t;continue}let n=io[t];if(n>4)a[r++]=65533,i+=n-1;else{for(t&=2===n?31:3===n?15:7;n>1&&i<A;)t=t<<6|63&e[i++],n--;n>1?a[r++]=65533:t<65536?a[r++]=t:(t-=65536,a[r++]=55296|t>>10&1023,a[r++]=56320|1023&t)}}return((e,t)=>{if(t<65534&&e.subarray&&Ao)return String.fromCharCode.apply(null,e.length===t?e:e.subarray(0,t));let A="";for(let i=0;i<t;i++)A+=String.fromCharCode(e[i]);return A})(a,r)},utf8border:(e,t)=>{(t=t||e.length)>e.length&&(t=e.length);let A=t-1;for(;A>=0&&128==(192&e[A]);)A--;return A<0||0===A?t:A+io[e[A]]>t?A:t}};var ao=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0};const no=Object.prototype.toString,{Z_NO_FLUSH:so,Z_SYNC_FLUSH:oo,Z_FULL_FLUSH:lo,Z_FINISH:go,Z_OK:ho,Z_STREAM_END:co,Z_DEFAULT_COMPRESSION:fo,Z_DEFAULT_STRATEGY:Io,Z_DEFLATED:uo}=As;function Bo(e){this.options=to.assign({level:fo,method:uo,chunkSize:16384,windowBits:15,memLevel:8,strategy:Io},e||{});let t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ao,this.strm.avail_out=0;let A=$s.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(A!==ho)throw new Error(ts[A]);if(t.header&&$s.deflateSetHeader(this.strm,t.header),t.dictionary){let e;if(e="string"==typeof t.dictionary?ro.string2buf(t.dictionary):"[object ArrayBuffer]"===no.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,A=$s.deflateSetDictionary(this.strm,e),A!==ho)throw new Error(ts[A]);this._dict_set=!0}}Bo.prototype.push=function(e,t){const A=this.strm,i=this.options.chunkSize;let r,a;if(this.ended)return!1;for(a=t===~~t?t:!0===t?go:so,"string"==typeof e?A.input=ro.string2buf(e):"[object ArrayBuffer]"===no.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;)if(0===A.avail_out&&(A.output=new Uint8Array(i),A.next_out=0,A.avail_out=i),(a===oo||a===lo)&&A.avail_out<=6)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else{if(r=$s.deflate(A,a),r===co)return A.next_out>0&&this.onData(A.output.subarray(0,A.next_out)),r=$s.deflateEnd(this.strm),this.onEnd(r),this.ended=!0,r===ho;if(0!==A.avail_out){if(a>0&&A.next_out>0)this.onData(A.output.subarray(0,A.next_out)),A.avail_out=0;else if(0===A.avail_in)break}else this.onData(A.output)}return!0},Bo.prototype.onData=function(e){this.chunks.push(e)},Bo.prototype.onEnd=function(e){e===ho&&(this.result=to.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};const Co=16209;var Eo=function(e,t){let A,i,r,a,n,s,o,l,g,h,c,f,d,I,u,B,C,E,w,Q,m,p,y,_;const b=e.state;A=e.next_in,y=e.input,i=A+(e.avail_in-5),r=e.next_out,_=e.output,a=r-(t-e.avail_out),n=r+(e.avail_out-257),s=b.dmax,o=b.wsize,l=b.whave,g=b.wnext,h=b.window,c=b.hold,f=b.bits,d=b.lencode,I=b.distcode,u=(1<<b.lenbits)-1,B=(1<<b.distbits)-1;e:do{f<15&&(c+=y[A++]<<f,f+=8,c+=y[A++]<<f,f+=8),C=d[c&u];t:for(;;){if(E=C>>>24,c>>>=E,f-=E,E=C>>>16&255,0===E)_[r++]=65535&C;else{if(!(16&E)){if(0==(64&E)){C=d[(65535&C)+(c&(1<<E)-1)];continue t}if(32&E){b.mode=16191;break e}e.msg="invalid literal/length code",b.mode=Co;break e}w=65535&C,E&=15,E&&(f<E&&(c+=y[A++]<<f,f+=8),w+=c&(1<<E)-1,c>>>=E,f-=E),f<15&&(c+=y[A++]<<f,f+=8,c+=y[A++]<<f,f+=8),C=I[c&B];A:for(;;){if(E=C>>>24,c>>>=E,f-=E,E=C>>>16&255,!(16&E)){if(0==(64&E)){C=I[(65535&C)+(c&(1<<E)-1)];continue A}e.msg="invalid distance code",b.mode=Co;break e}if(Q=65535&C,E&=15,f<E&&(c+=y[A++]<<f,f+=8,f<E&&(c+=y[A++]<<f,f+=8)),Q+=c&(1<<E)-1,Q>s){e.msg="invalid distance too far back",b.mode=Co;break e}if(c>>>=E,f-=E,E=r-a,Q>E){if(E=Q-E,E>l&&b.sane){e.msg="invalid distance too far back",b.mode=Co;break e}if(m=0,p=h,0===g){if(m+=o-E,E<w){w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}}else if(g<E){if(m+=o+g-E,E-=g,E<w){w-=E;do{_[r++]=h[m++]}while(--E);if(m=0,g<w){E=g,w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}}}else if(m+=g-E,E<w){w-=E;do{_[r++]=h[m++]}while(--E);m=r-Q,p=_}for(;w>2;)_[r++]=p[m++],_[r++]=p[m++],_[r++]=p[m++],w-=3;w&&(_[r++]=p[m++],w>1&&(_[r++]=p[m++]))}else{m=r-Q;do{_[r++]=_[m++],_[r++]=_[m++],_[r++]=_[m++],w-=3}while(w>2);w&&(_[r++]=_[m++],w>1&&(_[r++]=_[m++]))}break}}break}}while(A<i&&r<n);w=f>>3,A-=w,f-=w<<3,c&=(1<<f)-1,e.next_in=A,e.next_out=r,e.avail_in=A<i?i-A+5:5-(A-i),e.avail_out=r<n?n-r+257:257-(r-n),b.hold=c,b.bits=f};const wo=15,Qo=new Uint16Array([3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0]),mo=new Uint8Array([16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78]),po=new Uint16Array([1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0]),yo=new Uint8Array([16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64]);var _o=(e,t,A,i,r,a,n,s)=>{const o=s.bits;let l,g,h,c,f,d,I=0,u=0,B=0,C=0,E=0,w=0,Q=0,m=0,p=0,y=0,_=null;const b=new Uint16Array(16),D=new Uint16Array(16);let k,v,x,S=null;for(I=0;I<=wo;I++)b[I]=0;for(u=0;u<i;u++)b[t[A+u]]++;for(E=o,C=wo;C>=1&&0===b[C];C--);if(E>C&&(E=C),0===C)return r[a++]=20971520,r[a++]=20971520,s.bits=1,0;for(B=1;B<C&&0===b[B];B++);for(E<B&&(E=B),m=1,I=1;I<=wo;I++)if(m<<=1,m-=b[I],m<0)return-1;if(m>0&&(0===e||1!==C))return-1;for(D[1]=0,I=1;I<wo;I++)D[I+1]=D[I]+b[I];for(u=0;u<i;u++)0!==t[A+u]&&(n[D[t[A+u]]++]=u);if(0===e?(_=S=n,d=20):1===e?(_=Qo,S=mo,d=257):(_=po,S=yo,d=0),y=0,u=0,I=B,f=a,w=E,Q=0,h=-1,p=1<<E,c=p-1,1===e&&p>852||2===e&&p>592)return 1;for(;;){k=I-Q,n[u]+1<d?(v=0,x=n[u]):n[u]>=d?(v=S[n[u]-d],x=_[n[u]-d]):(v=96,x=0),l=1<<I-Q,g=1<<w,B=g;do{g-=l,r[f+(y>>Q)+g]=k<<24|v<<16|x|0}while(0!==g);for(l=1<<I-1;y&l;)l>>=1;if(0!==l?(y&=l-1,y+=l):y=0,u++,0==--b[I]){if(I===C)break;I=t[A+n[u]]}if(I>E&&(y&c)!==h){for(0===Q&&(Q=E),f+=B,w=I-Q,m=1<<w;w+Q<C&&(m-=b[w+Q],!(m<=0));)w++,m<<=1;if(p+=1<<w,1===e&&p>852||2===e&&p>592)return 1;h=y&c,r[h]=E<<24|w<<16|f-a|0}}return 0!==y&&(r[f+y]=I-Q<<24|64<<16|0),s.bits=E,0};const{Z_FINISH:bo,Z_BLOCK:Do,Z_TREES:ko,Z_OK:vo,Z_STREAM_END:xo,Z_NEED_DICT:So,Z_STREAM_ERROR:Go,Z_DATA_ERROR:Uo,Z_MEM_ERROR:Fo,Z_BUF_ERROR:Ro,Z_DEFLATED:Lo}=As,Mo=16180,To=16190,No=16191,Oo=16192,Po=16194,zo=16199,Ko=16200,Jo=16206,qo=16209,Ho=e=>(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24);function Yo(){this.strm=null,this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new Uint16Array(320),this.work=new Uint16Array(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}const Vo=e=>{if(!e)return 1;const t=e.state;return!t||t.strm!==e||t.mode<Mo||t.mode>16211?1:0},Zo=e=>{if(Vo(e))return Go;const t=e.state;return e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=Mo,t.last=0,t.havedict=0,t.flags=-1,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new Int32Array(852),t.distcode=t.distdyn=new Int32Array(592),t.sane=1,t.back=-1,vo},jo=e=>{if(Vo(e))return Go;const t=e.state;return t.wsize=0,t.whave=0,t.wnext=0,Zo(e)},Xo=(e,t)=>{let A;if(Vo(e))return Go;const i=e.state;return t<0?(A=0,t=-t):(A=5+(t>>4),t<48&&(t&=15)),t&&(t<8||t>15)?Go:(null!==i.window&&i.wbits!==t&&(i.window=null),i.wrap=A,i.wbits=t,jo(e))},Wo=(e,t)=>{if(!e)return Go;const A=new Yo;e.state=A,A.strm=e,A.window=null,A.mode=Mo;const i=Xo(e,t);return i!==vo&&(e.state=null),i};let $o,el,tl=!0;const Al=e=>{if(tl){$o=new Int32Array(512),el=new Int32Array(32);let t=0;for(;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(_o(1,e.lens,0,288,$o,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;_o(2,e.lens,0,32,el,0,e.work,{bits:5}),tl=!1}e.lencode=$o,e.lenbits=9,e.distcode=el,e.distbits=5},il=(e,t,A,i)=>{let r;const a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new Uint8Array(a.wsize)),i>=a.wsize?(a.window.set(t.subarray(A-a.wsize,A),0),a.wnext=0,a.whave=a.wsize):(r=a.wsize-a.wnext,r>i&&(r=i),a.window.set(t.subarray(A-i,A-i+r),a.wnext),(i-=r)?(a.window.set(t.subarray(A-i,A),0),a.wnext=i,a.whave=a.wsize):(a.wnext+=r,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=r))),0};var rl={inflateReset:jo,inflateReset2:Xo,inflateResetKeep:Zo,inflateInit:e=>Wo(e,15),inflateInit2:Wo,inflate:(e,t)=>{let A,i,r,a,n,s,o,l,g,h,c,f,d,I,u,B,C,E,w,Q,m,p,y=0;const _=new Uint8Array(4);let b,D;const k=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(Vo(e)||!e.output||!e.input&&0!==e.avail_in)return Go;A=e.state,A.mode===No&&(A.mode=Oo),n=e.next_out,r=e.output,o=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=A.hold,g=A.bits,h=s,c=o,p=vo;e:for(;;)switch(A.mode){case Mo:if(0===A.wrap){A.mode=Oo;break}for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(2&A.wrap&&35615===l){0===A.wbits&&(A.wbits=15),A.check=0,_[0]=255&l,_[1]=l>>>8&255,A.check=es(A.check,_,2,0),l=0,g=0,A.mode=16181;break}if(A.head&&(A.head.done=!1),!(1&A.wrap)||(((255&l)<<8)+(l>>8))%31){e.msg="incorrect header check",A.mode=qo;break}if((15&l)!==Lo){e.msg="unknown compression method",A.mode=qo;break}if(l>>>=4,g-=4,m=8+(15&l),0===A.wbits&&(A.wbits=m),m>15||m>A.wbits){e.msg="invalid window size",A.mode=qo;break}A.dmax=1<<A.wbits,A.flags=0,e.adler=A.check=1,A.mode=512&l?16189:No,l=0,g=0;break;case 16181:for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(A.flags=l,(255&A.flags)!==Lo){e.msg="unknown compression method",A.mode=qo;break}if(57344&A.flags){e.msg="unknown header flags set",A.mode=qo;break}A.head&&(A.head.text=l>>8&1),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=es(A.check,_,2,0)),l=0,g=0,A.mode=16182;case 16182:for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.head&&(A.head.time=l),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,_[2]=l>>>16&255,_[3]=l>>>24&255,A.check=es(A.check,_,4,0)),l=0,g=0,A.mode=16183;case 16183:for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.head&&(A.head.xflags=255&l,A.head.os=l>>8),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=es(A.check,_,2,0)),l=0,g=0,A.mode=16184;case 16184:if(1024&A.flags){for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.length=l,A.head&&(A.head.extra_len=l),512&A.flags&&4&A.wrap&&(_[0]=255&l,_[1]=l>>>8&255,A.check=es(A.check,_,2,0)),l=0,g=0}else A.head&&(A.head.extra=null);A.mode=16185;case 16185:if(1024&A.flags&&(f=A.length,f>s&&(f=s),f&&(A.head&&(m=A.head.extra_len-A.length,A.head.extra||(A.head.extra=new Uint8Array(A.head.extra_len)),A.head.extra.set(i.subarray(a,a+f),m)),512&A.flags&&4&A.wrap&&(A.check=es(A.check,i,f,a)),s-=f,a+=f,A.length-=f),A.length))break e;A.length=0,A.mode=16186;case 16186:if(2048&A.flags){if(0===s)break e;f=0;do{m=i[a+f++],A.head&&m&&A.length<65536&&(A.head.name+=String.fromCharCode(m))}while(m&&f<s);if(512&A.flags&&4&A.wrap&&(A.check=es(A.check,i,f,a)),s-=f,a+=f,m)break e}else A.head&&(A.head.name=null);A.length=0,A.mode=16187;case 16187:if(4096&A.flags){if(0===s)break e;f=0;do{m=i[a+f++],A.head&&m&&A.length<65536&&(A.head.comment+=String.fromCharCode(m))}while(m&&f<s);if(512&A.flags&&4&A.wrap&&(A.check=es(A.check,i,f,a)),s-=f,a+=f,m)break e}else A.head&&(A.head.comment=null);A.mode=16188;case 16188:if(512&A.flags){for(;g<16;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(4&A.wrap&&l!==(65535&A.check)){e.msg="header crc mismatch",A.mode=qo;break}l=0,g=0}A.head&&(A.head.hcrc=A.flags>>9&1,A.head.done=!0),e.adler=A.check=0,A.mode=No;break;case 16189:for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}e.adler=A.check=Ho(l),l=0,g=0,A.mode=To;case To:if(0===A.havedict)return e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,So;e.adler=A.check=1,A.mode=No;case No:if(t===Do||t===ko)break e;case Oo:if(A.last){l>>>=7&g,g-=7&g,A.mode=Jo;break}for(;g<3;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}switch(A.last=1&l,l>>>=1,g-=1,3&l){case 0:A.mode=16193;break;case 1:if(Al(A),A.mode=zo,t===ko){l>>>=2,g-=2;break e}break;case 2:A.mode=16196;break;case 3:e.msg="invalid block type",A.mode=qo}l>>>=2,g-=2;break;case 16193:for(l>>>=7&g,g-=7&g;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if((65535&l)!=(l>>>16^65535)){e.msg="invalid stored block lengths",A.mode=qo;break}if(A.length=65535&l,l=0,g=0,A.mode=Po,t===ko)break e;case Po:A.mode=16195;case 16195:if(f=A.length,f){if(f>s&&(f=s),f>o&&(f=o),0===f)break e;r.set(i.subarray(a,a+f),n),s-=f,a+=f,o-=f,n+=f,A.length-=f;break}A.mode=No;break;case 16196:for(;g<14;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(A.nlen=257+(31&l),l>>>=5,g-=5,A.ndist=1+(31&l),l>>>=5,g-=5,A.ncode=4+(15&l),l>>>=4,g-=4,A.nlen>286||A.ndist>30){e.msg="too many length or distance symbols",A.mode=qo;break}A.have=0,A.mode=16197;case 16197:for(;A.have<A.ncode;){for(;g<3;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.lens[k[A.have++]]=7&l,l>>>=3,g-=3}for(;A.have<19;)A.lens[k[A.have++]]=0;if(A.lencode=A.lendyn,A.lenbits=7,b={bits:A.lenbits},p=_o(0,A.lens,0,19,A.lencode,0,A.work,b),A.lenbits=b.bits,p){e.msg="invalid code lengths set",A.mode=qo;break}A.have=0,A.mode=16198;case 16198:for(;A.have<A.nlen+A.ndist;){for(;y=A.lencode[l&(1<<A.lenbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(C<16)l>>>=u,g-=u,A.lens[A.have++]=C;else{if(16===C){for(D=u+2;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(l>>>=u,g-=u,0===A.have){e.msg="invalid bit length repeat",A.mode=qo;break}m=A.lens[A.have-1],f=3+(3&l),l>>>=2,g-=2}else if(17===C){for(D=u+3;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=u,g-=u,m=0,f=3+(7&l),l>>>=3,g-=3}else{for(D=u+7;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=u,g-=u,m=0,f=11+(127&l),l>>>=7,g-=7}if(A.have+f>A.nlen+A.ndist){e.msg="invalid bit length repeat",A.mode=qo;break}for(;f--;)A.lens[A.have++]=m}}if(A.mode===qo)break;if(0===A.lens[256]){e.msg="invalid code -- missing end-of-block",A.mode=qo;break}if(A.lenbits=9,b={bits:A.lenbits},p=_o(1,A.lens,0,A.nlen,A.lencode,0,A.work,b),A.lenbits=b.bits,p){e.msg="invalid literal/lengths set",A.mode=qo;break}if(A.distbits=6,A.distcode=A.distdyn,b={bits:A.distbits},p=_o(2,A.lens,A.nlen,A.ndist,A.distcode,0,A.work,b),A.distbits=b.bits,p){e.msg="invalid distances set",A.mode=qo;break}if(A.mode=zo,t===ko)break e;case zo:A.mode=Ko;case Ko:if(s>=6&&o>=258){e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,Eo(e,c),n=e.next_out,r=e.output,o=e.avail_out,a=e.next_in,i=e.input,s=e.avail_in,l=A.hold,g=A.bits,A.mode===No&&(A.back=-1);break}for(A.back=0;y=A.lencode[l&(1<<A.lenbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(B&&0==(240&B)){for(E=u,w=B,Q=C;y=A.lencode[Q+((l&(1<<E+w)-1)>>E)],u=y>>>24,B=y>>>16&255,C=65535&y,!(E+u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=E,g-=E,A.back+=E}if(l>>>=u,g-=u,A.back+=u,A.length=C,0===B){A.mode=16205;break}if(32&B){A.back=-1,A.mode=No;break}if(64&B){e.msg="invalid literal/length code",A.mode=qo;break}A.extra=15&B,A.mode=16201;case 16201:if(A.extra){for(D=A.extra;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.length+=l&(1<<A.extra)-1,l>>>=A.extra,g-=A.extra,A.back+=A.extra}A.was=A.length,A.mode=16202;case 16202:for(;y=A.distcode[l&(1<<A.distbits)-1],u=y>>>24,B=y>>>16&255,C=65535&y,!(u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(0==(240&B)){for(E=u,w=B,Q=C;y=A.distcode[Q+((l&(1<<E+w)-1)>>E)],u=y>>>24,B=y>>>16&255,C=65535&y,!(E+u<=g);){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}l>>>=E,g-=E,A.back+=E}if(l>>>=u,g-=u,A.back+=u,64&B){e.msg="invalid distance code",A.mode=qo;break}A.offset=C,A.extra=15&B,A.mode=16203;case 16203:if(A.extra){for(D=A.extra;g<D;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}A.offset+=l&(1<<A.extra)-1,l>>>=A.extra,g-=A.extra,A.back+=A.extra}if(A.offset>A.dmax){e.msg="invalid distance too far back",A.mode=qo;break}A.mode=16204;case 16204:if(0===o)break e;if(f=c-o,A.offset>f){if(f=A.offset-f,f>A.whave&&A.sane){e.msg="invalid distance too far back",A.mode=qo;break}f>A.wnext?(f-=A.wnext,d=A.wsize-f):d=A.wnext-f,f>A.length&&(f=A.length),I=A.window}else I=r,d=n-A.offset,f=A.length;f>o&&(f=o),o-=f,A.length-=f;do{r[n++]=I[d++]}while(--f);0===A.length&&(A.mode=Ko);break;case 16205:if(0===o)break e;r[n++]=A.length,o--,A.mode=Ko;break;case Jo:if(A.wrap){for(;g<32;){if(0===s)break e;s--,l|=i[a++]<<g,g+=8}if(c-=o,e.total_out+=c,A.total+=c,4&A.wrap&&c&&(e.adler=A.check=A.flags?es(A.check,r,c,n-c):Wn(A.check,r,c,n-c)),c=o,4&A.wrap&&(A.flags?l:Ho(l))!==A.check){e.msg="incorrect data check",A.mode=qo;break}l=0,g=0}A.mode=16207;case 16207:if(A.wrap&&A.flags){for(;g<32;){if(0===s)break e;s--,l+=i[a++]<<g,g+=8}if(4&A.wrap&&l!==(4294967295&A.total)){e.msg="incorrect length check",A.mode=qo;break}l=0,g=0}A.mode=16208;case 16208:p=xo;break e;case qo:p=Uo;break e;case 16210:return Fo;default:return Go}return e.next_out=n,e.avail_out=o,e.next_in=a,e.avail_in=s,A.hold=l,A.bits=g,(A.wsize||c!==e.avail_out&&A.mode<qo&&(A.mode<Jo||t!==bo))&&il(e,e.output,e.next_out,c-e.avail_out),h-=e.avail_in,c-=e.avail_out,e.total_in+=h,e.total_out+=c,A.total+=c,4&A.wrap&&c&&(e.adler=A.check=A.flags?es(A.check,r,c,e.next_out-c):Wn(A.check,r,c,e.next_out-c)),e.data_type=A.bits+(A.last?64:0)+(A.mode===No?128:0)+(A.mode===zo||A.mode===Po?256:0),(0===h&&0===c||t===bo)&&p===vo&&(p=Ro),p},inflateEnd:e=>{if(Vo(e))return Go;let t=e.state;return t.window&&(t.window=null),e.state=null,vo},inflateGetHeader:(e,t)=>{if(Vo(e))return Go;const A=e.state;return 0==(2&A.wrap)?Go:(A.head=t,t.done=!1,vo)},inflateSetDictionary:(e,t)=>{const A=t.length;let i,r,a;return Vo(e)?Go:(i=e.state,0!==i.wrap&&i.mode!==To?Go:i.mode===To&&(r=1,r=Wn(r,t,A,0),r!==i.check)?Uo:(a=il(e,t,A,A),a?(i.mode=16210,Fo):(i.havedict=1,vo)))},inflateInfo:"pako inflate (from Nodeca project)"};var al=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1};const nl=Object.prototype.toString,{Z_NO_FLUSH:sl,Z_FINISH:ol,Z_OK:ll,Z_STREAM_END:gl,Z_NEED_DICT:hl,Z_STREAM_ERROR:cl,Z_DATA_ERROR:fl,Z_MEM_ERROR:dl}=As;function Il(e){this.options=to.assign({chunkSize:65536,windowBits:15,to:""},e||{});const t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ao,this.strm.avail_out=0;let A=rl.inflateInit2(this.strm,t.windowBits);if(A!==ll)throw new Error(ts[A]);if(this.header=new al,rl.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=ro.string2buf(t.dictionary):"[object ArrayBuffer]"===nl.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(A=rl.inflateSetDictionary(this.strm,t.dictionary),A!==ll)))throw new Error(ts[A])}function ul(e,t){const A=new Il(t);if(A.push(e),A.err)throw A.msg||ts[A.err];return A.result}Il.prototype.push=function(e,t){const A=this.strm,i=this.options.chunkSize,r=this.options.dictionary;let a,n,s;if(this.ended)return!1;for(n=t===~~t?t:!0===t?ol:sl,"[object ArrayBuffer]"===nl.call(e)?A.input=new Uint8Array(e):A.input=e,A.next_in=0,A.avail_in=A.input.length;;){for(0===A.avail_out&&(A.output=new Uint8Array(i),A.next_out=0,A.avail_out=i),a=rl.inflate(A,n),a===hl&&r&&(a=rl.inflateSetDictionary(A,r),a===ll?a=rl.inflate(A,n):a===fl&&(a=hl));A.avail_in>0&&a===gl&&A.state.wrap>0&&0!==e[A.next_in];)rl.inflateReset(A),a=rl.inflate(A,n);switch(a){case cl:case fl:case hl:case dl:return this.onEnd(a),this.ended=!0,!1}if(s=A.avail_out,A.next_out&&(0===A.avail_out||a===gl))if("string"===this.options.to){let e=ro.utf8border(A.output,A.next_out),t=A.next_out-e,r=ro.buf2string(A.output,e);A.next_out=t,A.avail_out=i-t,t&&A.output.set(A.output.subarray(e,e+t),0),this.onData(r)}else this.onData(A.output.length===A.next_out?A.output:A.output.subarray(0,A.next_out));if(a!==ll||0!==s){if(a===gl)return a=rl.inflateEnd(this.strm),this.onEnd(a),this.ended=!0,!0;if(0===A.avail_in)break}}return!0},Il.prototype.onData=function(e){this.chunks.push(e)},Il.prototype.onEnd=function(e){e===ll&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=to.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Bl={Inflate:Il,inflate:ul,inflateRaw:function(e,t){return(t=t||{}).raw=!0,ul(e,t)},ungzip:ul,constants:As};const{Inflate:Cl,inflate:El,inflateRaw:wl,ungzip:Ql}=Bl;var ml=El;var pl=Object.freeze({__proto__:null,default:class extends ya{decodeBlock(e){return ml(new Uint8Array(e)).buffer}}});var yl=Object.freeze({__proto__:null,default:class extends ya{decodeBlock(e){const t=new DataView(e),A=[];for(let i=0;i<e.byteLength;++i){let e=t.getInt8(i);if(e<0){const r=t.getUint8(i+1);e=-e;for(let t=0;t<=e;++t)A.push(r);i+=1}else{for(let r=0;r<=e;++r)A.push(t.getUint8(i+r+1));i+=e+1}}return new Uint8Array(A).buffer}}}),_l={exports:{}};!function(e){
|
|
4
4
|
/* Copyright 2015-2021 Esri. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 @preserve */
|
|
5
|
-
!function(){var t,i,r,s,n,a,o,A,l,h,c,g,u,d,f,p,I=(t={defaultNoDataValue:-34027999387901484e22,decode:function(e,a){var o=(a=a||{}).encodedMaskData||null===a.encodedMaskData,A=n(e,a.inputOffset||0,o),l=null!==a.noDataValue?a.noDataValue:t.defaultNoDataValue,h=i(A,a.pixelType||Float32Array,a.encodedMaskData,l,a.returnMask),c={width:A.width,height:A.height,pixelData:h.resultPixels,minValue:h.minValue,maxValue:A.pixels.maxValue,noDataValue:l};return h.resultMask&&(c.maskData=h.resultMask),a.returnEncodedMask&&A.mask&&(c.encodedMaskData=A.mask.bitset?A.mask.bitset:null),a.returnFileInfo&&(c.fileInfo=r(A),a.computeUsedBitDepths&&(c.fileInfo.bitDepths=s(A))),c}},i=function(e,t,i,r,s){var n,o,A,l=0,h=e.pixels.numBlocksX,c=e.pixels.numBlocksY,g=Math.floor(e.width/h),u=Math.floor(e.height/c),d=2*e.maxZError,f=Number.MAX_VALUE;i=i||(e.mask?e.mask.bitset:null),o=new t(e.width*e.height),s&&i&&(A=new Uint8Array(e.width*e.height));for(var p,I,m=new Float32Array(g*u),_=0;_<=c;_++){var w=_!==c?u:e.height%c;if(0!==w)for(var C=0;C<=h;C++){var B=C!==h?g:e.width%h;if(0!==B){var E,y,Q,b,k=_*e.width*u+C*g,x=e.width-B,v=e.pixels.blocks[l];if(v.encoding<2?(0===v.encoding?E=v.rawData:(a(v.stuffedData,v.bitsPerPixel,v.numValidPixels,v.offset,d,m,e.pixels.maxValue),E=m),y=0):Q=2===v.encoding?0:v.offset,i)for(I=0;I<w;I++){for(7&k&&(b=i[k>>3],b<<=7&k),p=0;p<B;p++)7&k||(b=i[k>>3]),128&b?(A&&(A[k]=1),f=f>(n=v.encoding<2?E[y++]:Q)?n:f,o[k++]=n):(A&&(A[k]=0),o[k++]=r),b<<=1;k+=x}else if(v.encoding<2)for(I=0;I<w;I++){for(p=0;p<B;p++)f=f>(n=E[y++])?n:f,o[k++]=n;k+=x}else for(f=f>Q?Q:f,I=0;I<w;I++){for(p=0;p<B;p++)o[k++]=Q;k+=x}if(1===v.encoding&&y!==v.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:o,resultMask:A,minValue:f}},r=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},s=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,i={},r=0;r<t;r++){var s=e.pixels.blocks[r];0===s.encoding?i.float32=!0:1===s.encoding?i[s.bitsPerPixel]=!0:i[0]=!0}return Object.keys(i)},n=function(e,t,i){var r={},s=new Uint8Array(e,t,10);if(r.fileIdentifierString=String.fromCharCode.apply(null,s),"CntZImage"!==r.fileIdentifierString.trim())throw"Unexpected file identifier string: "+r.fileIdentifierString;t+=10;var n=new DataView(e,t,24);if(r.fileVersion=n.getInt32(0,!0),r.imageType=n.getInt32(4,!0),r.height=n.getUint32(8,!0),r.width=n.getUint32(12,!0),r.maxZError=n.getFloat64(16,!0),t+=24,!i)if(n=new DataView(e,t,16),r.mask={},r.mask.numBlocksY=n.getUint32(0,!0),r.mask.numBlocksX=n.getUint32(4,!0),r.mask.numBytes=n.getUint32(8,!0),r.mask.maxValue=n.getFloat32(12,!0),t+=16,r.mask.numBytes>0){var a=new Uint8Array(Math.ceil(r.width*r.height/8)),o=(n=new DataView(e,t,r.mask.numBytes)).getInt16(0,!0),A=2,l=0;do{if(o>0)for(;o--;)a[l++]=n.getUint8(A++);else{var h=n.getUint8(A++);for(o=-o;o--;)a[l++]=h}o=n.getInt16(A,!0),A+=2}while(A<r.mask.numBytes);if(-32768!==o||l<a.length)throw"Unexpected end of mask RLE encoding";r.mask.bitset=a,t+=r.mask.numBytes}else 0==(r.mask.numBytes|r.mask.numBlocksY|r.mask.maxValue)&&(r.mask.bitset=new Uint8Array(Math.ceil(r.width*r.height/8)));n=new DataView(e,t,16),r.pixels={},r.pixels.numBlocksY=n.getUint32(0,!0),r.pixels.numBlocksX=n.getUint32(4,!0),r.pixels.numBytes=n.getUint32(8,!0),r.pixels.maxValue=n.getFloat32(12,!0),t+=16;var c=r.pixels.numBlocksX,g=r.pixels.numBlocksY,u=c+(r.width%c>0?1:0),d=g+(r.height%g>0?1:0);r.pixels.blocks=new Array(u*d);for(var f=0,p=0;p<d;p++)for(var I=0;I<u;I++){var m=0,_=e.byteLength-t;n=new DataView(e,t,Math.min(10,_));var w={};r.pixels.blocks[f++]=w;var C=n.getUint8(0);if(m++,w.encoding=63&C,w.encoding>3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==C&&2!==C){if(C>>=6,w.offsetType=C,2===C)w.offset=n.getInt8(1),m++;else if(1===C)w.offset=n.getInt16(1,!0),m+=2;else{if(0!==C)throw"Invalid block offset type";w.offset=n.getFloat32(1,!0),m+=4}if(1===w.encoding)if(C=n.getUint8(m),m++,w.bitsPerPixel=63&C,C>>=6,w.numValidPixelsType=C,2===C)w.numValidPixels=n.getUint8(m),m++;else if(1===C)w.numValidPixels=n.getUint16(m,!0),m+=2;else{if(0!==C)throw"Invalid valid pixel count type";w.numValidPixels=n.getUint32(m,!0),m+=4}}var B;if(t+=m,3!==w.encoding)if(0===w.encoding){var E=(r.pixels.numBytes-1)/4;if(E!==Math.floor(E))throw"uncompressed block has invalid length";B=new ArrayBuffer(4*E),new Uint8Array(B).set(new Uint8Array(e,t,4*E));var y=new Float32Array(B);w.rawData=y,t+=4*E}else if(1===w.encoding){var Q=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),b=Math.ceil(Q/4);B=new ArrayBuffer(4*b),new Uint8Array(B).set(new Uint8Array(e,t,Q)),w.stuffedData=new Uint32Array(B),t+=Q}}else t++}return r.eofOffset=t,r},a=function(e,t,i,r,s,n,a){var o,A,l,h=(1<<t)-1,c=0,g=0,u=Math.ceil((a-r)/s),d=4*e.length-Math.ceil(t*i/8);for(e[e.length-1]<<=8*d,o=0;o<i;o++){if(0===g&&(l=e[c++],g=32),g>=t)A=l>>>g-t&h,g-=t;else{var f=t-g;A=(l&h)<<f&h,A+=(l=e[c++])>>>(g=32-f)}n[o]=A<u?r+A*s:a}return n},t),m=(o=function(e,t,i,r,s,n,a,o){var A,l,h,c,g,u=(1<<i)-1,d=0,f=0,p=4*e.length-Math.ceil(i*r/8);if(e[e.length-1]<<=8*p,s)for(A=0;A<r;A++)0===f&&(h=e[d++],f=32),f>=i?(l=h>>>f-i&u,f-=i):(l=(h&u)<<(c=i-f)&u,l+=(h=e[d++])>>>(f=32-c)),t[A]=s[l];else for(g=Math.ceil((o-n)/a),A=0;A<r;A++)0===f&&(h=e[d++],f=32),f>=i?(l=h>>>f-i&u,f-=i):(l=(h&u)<<(c=i-f)&u,l+=(h=e[d++])>>>(f=32-c)),t[A]=l<g?n+l*a:o},A=function(e,t,i,r,s,n){var a,o=(1<<t)-1,A=0,l=0,h=0,c=0,g=0,u=[],d=4*e.length-Math.ceil(t*i/8);e[e.length-1]<<=8*d;var f=Math.ceil((n-r)/s);for(l=0;l<i;l++)0===c&&(a=e[A++],c=32),c>=t?(g=a>>>c-t&o,c-=t):(g=(a&o)<<(h=t-c)&o,g+=(a=e[A++])>>>(c=32-h)),u[l]=g<f?r+g*s:n;return u.unshift(r),u},l=function(e,t,i,r,s,n,a,o){var A,l,h,c,g=(1<<i)-1,u=0,d=0,f=0;if(s)for(A=0;A<r;A++)0===d&&(h=e[u++],d=32,f=0),d>=i?(l=h>>>f&g,d-=i,f+=i):(l=h>>>f&g,d=32-(c=i-d),l|=((h=e[u++])&(1<<c)-1)<<i-c,f=c),t[A]=s[l];else{var p=Math.ceil((o-n)/a);for(A=0;A<r;A++)0===d&&(h=e[u++],d=32,f=0),d>=i?(l=h>>>f&g,d-=i,f+=i):(l=h>>>f&g,d=32-(c=i-d),l|=((h=e[u++])&(1<<c)-1)<<i-c,f=c),t[A]=l<p?n+l*a:o}return t},h=function(e,t,i,r,s,n){var a,o=(1<<t)-1,A=0,l=0,h=0,c=0,g=0,u=0,d=[],f=Math.ceil((n-r)/s);for(l=0;l<i;l++)0===c&&(a=e[A++],c=32,u=0),c>=t?(g=a>>>u&o,c-=t,u+=t):(g=a>>>u&o,c=32-(h=t-c),g|=((a=e[A++])&(1<<h)-1)<<t-h,u=h),d[l]=g<f?r+g*s:n;return d.unshift(r),d},c=function(e,t,i,r){var s,n,a,o,A=(1<<i)-1,l=0,h=0,c=4*e.length-Math.ceil(i*r/8);for(e[e.length-1]<<=8*c,s=0;s<r;s++)0===h&&(a=e[l++],h=32),h>=i?(n=a>>>h-i&A,h-=i):(n=(a&A)<<(o=i-h)&A,n+=(a=e[l++])>>>(h=32-o)),t[s]=n;return t},g=function(e,t,i,r){var s,n,a,o,A=(1<<i)-1,l=0,h=0,c=0;for(s=0;s<r;s++)0===h&&(a=e[l++],h=32,c=0),h>=i?(n=a>>>c&A,h-=i,c+=i):(n=a>>>c&A,h=32-(o=i-h),n|=((a=e[l++])&(1<<o)-1)<<i-o,c=o),t[s]=n;return t},u={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,i=65535,r=e.length,s=Math.floor(r/2),n=0;s;){var a=s>=359?359:s;s-=a;do{t+=e[n++]<<8,i+=t+=e[n++]}while(--a);t=(65535&t)+(t>>>16),i=(65535&i)+(i>>>16)}return 1&r&&(i+=t+=e[n]<<8),((i=(65535&i)+(i>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var i=t.ptr,r=new Uint8Array(e,i,6),s={};if(s.fileIdentifierString=String.fromCharCode.apply(null,r),0!==s.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+s.fileIdentifierString;i+=6;var n,a=new DataView(e,i,8),o=a.getInt32(0,!0);if(s.fileVersion=o,i+=4,o>=3&&(s.checksum=a.getUint32(4,!0),i+=4),a=new DataView(e,i,12),s.height=a.getUint32(0,!0),s.width=a.getUint32(4,!0),i+=8,o>=4?(s.numDims=a.getUint32(8,!0),i+=4):s.numDims=1,a=new DataView(e,i,40),s.numValidPixel=a.getUint32(0,!0),s.microBlockSize=a.getInt32(4,!0),s.blobSize=a.getInt32(8,!0),s.imageType=a.getInt32(12,!0),s.maxZError=a.getFloat64(16,!0),s.zMin=a.getFloat64(24,!0),s.zMax=a.getFloat64(32,!0),i+=40,t.headerInfo=s,t.ptr=i,o>=3&&(n=o>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,i-n,s.blobSize-14))!==s.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var i=t.headerInfo,r=this.getDataTypeArray(i.imageType),s=i.numDims*this.getDataTypeSize(i.imageType),n=this.readSubArray(e,t.ptr,r,s),a=this.readSubArray(e,t.ptr+s,r,s);t.ptr+=2*s;var o,A=!0;for(o=0;o<i.numDims;o++)if(n[o]!==a[o]){A=!1;break}return i.minValues=n,i.maxValues=a,A},readSubArray:function(e,t,i,r){var s;if(i===Uint8Array)s=new Uint8Array(e,t,r);else{var n=new ArrayBuffer(r);new Uint8Array(n).set(new Uint8Array(e,t,r)),s=new i(n)}return s},readMask:function(e,t){var i,r,s=t.ptr,n=t.headerInfo,a=n.width*n.height,o=n.numValidPixel,A=new DataView(e,s,4),l={};if(l.numBytes=A.getUint32(0,!0),s+=4,(0===o||a===o)&&0!==l.numBytes)throw"invalid mask";if(0===o)i=new Uint8Array(Math.ceil(a/8)),l.bitset=i,r=new Uint8Array(a),t.pixels.resultMask=r,s+=l.numBytes;else if(l.numBytes>0){i=new Uint8Array(Math.ceil(a/8));var h=(A=new DataView(e,s,l.numBytes)).getInt16(0,!0),c=2,g=0,u=0;do{if(h>0)for(;h--;)i[g++]=A.getUint8(c++);else for(u=A.getUint8(c++),h=-h;h--;)i[g++]=u;h=A.getInt16(c,!0),c+=2}while(c<l.numBytes);if(-32768!==h||g<i.length)throw"Unexpected end of mask RLE encoding";r=new Uint8Array(a);var d=0,f=0;for(f=0;f<a;f++)7&f?(d=i[f>>3],d<<=7&f):d=i[f>>3],128&d&&(r[f]=1);t.pixels.resultMask=r,l.bitset=i,s+=l.numBytes}return t.ptr=s,t.mask=l,!0},readDataOneSweep:function(e,t,i,r){var s,n=t.ptr,a=t.headerInfo,o=a.numDims,A=a.width*a.height,l=a.imageType,h=a.numValidPixel*u.getDataTypeSize(l)*o,c=t.pixels.resultMask;if(i===Uint8Array)s=new Uint8Array(e,n,h);else{var g=new ArrayBuffer(h);new Uint8Array(g).set(new Uint8Array(e,n,h)),s=new i(g)}if(s.length===A*o)t.pixels.resultPixels=r?u.swapDimensionOrder(s,A,o,i,!0):s;else{t.pixels.resultPixels=new i(A*o);var d=0,f=0,p=0,I=0;if(o>1){if(r){for(f=0;f<A;f++)if(c[f])for(I=f,p=0;p<o;p++,I+=A)t.pixels.resultPixels[I]=s[d++]}else for(f=0;f<A;f++)if(c[f])for(I=f*o,p=0;p<o;p++)t.pixels.resultPixels[I+p]=s[d++]}else for(f=0;f<A;f++)c[f]&&(t.pixels.resultPixels[f]=s[d++])}return n+=h,t.ptr=n,!0},readHuffmanTree:function(e,t){var i=this.HUFFMAN_LUT_BITS_MAX,r=new DataView(e,t.ptr,16);if(t.ptr+=16,r.getInt32(0,!0)<2)throw"unsupported Huffman version";var s=r.getInt32(4,!0),n=r.getInt32(8,!0),a=r.getInt32(12,!0);if(n>=a)return!1;var o=new Uint32Array(a-n);u.decodeBits(e,t,o);var A,l,h,c,g=[];for(A=n;A<a;A++)g[l=A-(A<s?0:s)]={first:o[A-n],second:null};var f=e.byteLength-t.ptr,p=Math.ceil(f/4),I=new ArrayBuffer(4*p);new Uint8Array(I).set(new Uint8Array(e,t.ptr,f));var m,_=new Uint32Array(I),w=0,C=0;for(m=_[0],A=n;A<a;A++)(c=g[l=A-(A<s?0:s)].first)>0&&(g[l].second=m<<w>>>32-c,32-w>=c?32===(w+=c)&&(w=0,m=_[++C]):(w+=c-32,m=_[++C],g[l].second|=m>>>32-w));var B=0,E=0,y=new d;for(A=0;A<g.length;A++)void 0!==g[A]&&(B=Math.max(B,g[A].first));E=B>=i?i:B;var Q,b,k,x,v,D=[];for(A=n;A<a;A++)if((c=g[l=A-(A<s?0:s)].first)>0)if(Q=[c,l],c<=E)for(b=g[l].second<<E-c,k=1<<E-c,h=0;h<k;h++)D[b|h]=Q;else for(b=g[l].second,v=y,x=c-1;x>=0;x--)b>>>x&1?(v.right||(v.right=new d),v=v.right):(v.left||(v.left=new d),v=v.left),0!==x||v.val||(v.val=Q[1]);return{decodeLut:D,numBitsLUTQick:E,numBitsLUT:B,tree:y,stuffedData:_,srcPtr:C,bitPos:w}},readHuffman:function(e,t,i,r){var s,n,a,o,A,l,h,c,g,d=t.headerInfo.numDims,f=t.headerInfo.height,p=t.headerInfo.width,I=p*f,m=this.readHuffmanTree(e,t),_=m.decodeLut,w=m.tree,C=m.stuffedData,B=m.srcPtr,E=m.bitPos,y=m.numBitsLUTQick,Q=m.numBitsLUT,b=0===t.headerInfo.imageType?128:0,k=t.pixels.resultMask,x=0;E>0&&(B++,E=0);var v,D=C[B],S=1===t.encodeMode,M=new i(I*d),U=M;if(d<2||S){for(v=0;v<d;v++)if(d>1&&(U=new i(M.buffer,I*v,I),x=0),t.headerInfo.numValidPixel===p*f)for(c=0,l=0;l<f;l++)for(h=0;h<p;h++,c++){if(n=0,A=o=D<<E>>>32-y,32-E<y&&(A=o|=C[B+1]>>>64-E-y),_[A])n=_[A][1],E+=_[A][0];else for(A=o=D<<E>>>32-Q,32-E<Q&&(A=o|=C[B+1]>>>64-E-Q),s=w,g=0;g<Q;g++)if(!(s=o>>>Q-g-1&1?s.right:s.left).left&&!s.right){n=s.val,E=E+g+1;break}E>=32&&(E-=32,D=C[++B]),a=n-b,S?(a+=h>0?x:l>0?U[c-p]:x,a&=255,U[c]=a,x=a):U[c]=a}else for(c=0,l=0;l<f;l++)for(h=0;h<p;h++,c++)if(k[c]){if(n=0,A=o=D<<E>>>32-y,32-E<y&&(A=o|=C[B+1]>>>64-E-y),_[A])n=_[A][1],E+=_[A][0];else for(A=o=D<<E>>>32-Q,32-E<Q&&(A=o|=C[B+1]>>>64-E-Q),s=w,g=0;g<Q;g++)if(!(s=o>>>Q-g-1&1?s.right:s.left).left&&!s.right){n=s.val,E=E+g+1;break}E>=32&&(E-=32,D=C[++B]),a=n-b,S?(h>0&&k[c-1]?a+=x:l>0&&k[c-p]?a+=U[c-p]:a+=x,a&=255,U[c]=a,x=a):U[c]=a}}else for(c=0,l=0;l<f;l++)for(h=0;h<p;h++)if(c=l*p+h,!k||k[c])for(v=0;v<d;v++,c+=I){if(n=0,A=o=D<<E>>>32-y,32-E<y&&(A=o|=C[B+1]>>>64-E-y),_[A])n=_[A][1],E+=_[A][0];else for(A=o=D<<E>>>32-Q,32-E<Q&&(A=o|=C[B+1]>>>64-E-Q),s=w,g=0;g<Q;g++)if(!(s=o>>>Q-g-1&1?s.right:s.left).left&&!s.right){n=s.val,E=E+g+1;break}E>=32&&(E-=32,D=C[++B]),a=n-b,U[c]=a}t.ptr=t.ptr+4*(B+1)+(E>0?4:0),t.pixels.resultPixels=M,d>1&&!r&&(t.pixels.resultPixels=u.swapDimensionOrder(M,I,d,i))},decodeBits:function(e,t,i,r,s){var n=t.headerInfo,a=n.fileVersion,u=0,d=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,f=new DataView(e,t.ptr,d),p=f.getUint8(0);u++;var I=p>>6,m=0===I?4:3-I,_=(32&p)>0,w=31&p,C=0;if(1===m)C=f.getUint8(u),u++;else if(2===m)C=f.getUint16(u,!0),u+=2;else{if(4!==m)throw"Invalid valid pixel count type";C=f.getUint32(u,!0),u+=4}var B,E,y,Q,b,k,x,v,D,S=2*n.maxZError,M=n.numDims>1?n.maxValues[s]:n.zMax;if(_){for(t.counter.lut++,v=f.getUint8(u),u++,Q=Math.ceil((v-1)*w/8),b=Math.ceil(Q/4),E=new ArrayBuffer(4*b),y=new Uint8Array(E),t.ptr+=u,y.set(new Uint8Array(e,t.ptr,Q)),x=new Uint32Array(E),t.ptr+=Q,D=0;v-1>>>D;)D++;Q=Math.ceil(C*D/8),b=Math.ceil(Q/4),E=new ArrayBuffer(4*b),(y=new Uint8Array(E)).set(new Uint8Array(e,t.ptr,Q)),B=new Uint32Array(E),t.ptr+=Q,k=a>=3?h(x,w,v-1,r,S,M):A(x,w,v-1,r,S,M),a>=3?l(B,i,D,C,k):o(B,i,D,C,k)}else t.counter.bitstuffer++,D=w,t.ptr+=u,D>0&&(Q=Math.ceil(C*D/8),b=Math.ceil(Q/4),E=new ArrayBuffer(4*b),(y=new Uint8Array(E)).set(new Uint8Array(e,t.ptr,Q)),B=new Uint32Array(E),t.ptr+=Q,a>=3?null==r?g(B,i,D,C):l(B,i,D,C,!1,r,S,M):null==r?c(B,i,D,C):o(B,i,D,C,!1,r,S,M))},readTiles:function(e,t,i,r){var s=t.headerInfo,n=s.width,a=s.height,o=n*a,A=s.microBlockSize,l=s.imageType,h=u.getDataTypeSize(l),c=Math.ceil(n/A),g=Math.ceil(a/A);t.pixels.numBlocksY=g,t.pixels.numBlocksX=c,t.pixels.ptr=0;var d,f,p,I,m,_,w,C,B,E,y=0,Q=0,b=0,k=0,x=0,v=0,D=0,S=0,M=0,U=0,G=0,T=0,F=0,R=0,L=0,N=new i(A*A),O=a%A||A,P=n%A||A,z=s.numDims,q=t.pixels.resultMask,K=t.pixels.resultPixels,H=s.fileVersion>=5?14:15,V=s.zMax;for(b=0;b<g;b++)for(x=b!==g-1?A:O,k=0;k<c;k++)for(U=b*n*A+k*A,G=n-(v=k!==c-1?A:P),C=0;C<z;C++){if(z>1?(E=K,U=b*n*A+k*A,K=new i(t.pixels.resultPixels.buffer,o*C*h,o),V=s.maxValues[C]):E=null,D=e.byteLength-t.ptr,f={},L=0,S=(d=new DataView(e,t.ptr,Math.min(10,D))).getUint8(0),L++,B=s.fileVersion>=5?4&S:0,M=S>>6&255,(S>>2&H)!=(k*A>>3&H))throw"integrity issue";if(B&&0===C)throw"integrity issue";if((m=3&S)>3)throw t.ptr+=L,"Invalid block encoding ("+m+")";if(2!==m)if(0===m){if(B)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=L,T=(T=x*v*h)<(F=e.byteLength-t.ptr)?T:F,p=new ArrayBuffer(T%h==0?T:T+h-T%h),new Uint8Array(p).set(new Uint8Array(e,t.ptr,T)),I=new i(p),R=0,q)for(y=0;y<x;y++){for(Q=0;Q<v;Q++)q[U]&&(K[U]=I[R++]),U++;U+=G}else for(y=0;y<x;y++){for(Q=0;Q<v;Q++)K[U++]=I[R++];U+=G}t.ptr+=R*h}else if(_=u.getDataTypeUsed(B&&l<6?4:l,M),w=u.getOnePixel(f,L,_,d),L+=u.getDataTypeSize(_),3===m)if(t.ptr+=L,t.counter.constantoffset++,q)for(y=0;y<x;y++){for(Q=0;Q<v;Q++)q[U]&&(K[U]=B?Math.min(V,E[U]+w):w),U++;U+=G}else for(y=0;y<x;y++){for(Q=0;Q<v;Q++)K[U]=B?Math.min(V,E[U]+w):w,U++;U+=G}else if(t.ptr+=L,u.decodeBits(e,t,N,w,C),L=0,B)if(q)for(y=0;y<x;y++){for(Q=0;Q<v;Q++)q[U]&&(K[U]=N[L++]+E[U]),U++;U+=G}else for(y=0;y<x;y++){for(Q=0;Q<v;Q++)K[U]=N[L++]+E[U],U++;U+=G}else if(q)for(y=0;y<x;y++){for(Q=0;Q<v;Q++)q[U]&&(K[U]=N[L++]),U++;U+=G}else for(y=0;y<x;y++){for(Q=0;Q<v;Q++)K[U++]=N[L++];U+=G}else{if(B)if(q)for(y=0;y<x;y++)for(Q=0;Q<v;Q++)q[U]&&(K[U]=E[U]),U++;else for(y=0;y<x;y++)for(Q=0;Q<v;Q++)K[U]=E[U],U++;t.counter.constant++,t.ptr+=L}}z>1&&!r&&(t.pixels.resultPixels=u.swapDimensionOrder(t.pixels.resultPixels,o,z,i))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:u.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var i=e.headerInfo.zMax,r=e.headerInfo.zMin,s=e.headerInfo.maxValues,n=e.headerInfo.numDims,a=e.headerInfo.height*e.headerInfo.width,o=0,A=0,l=0,h=e.pixels.resultMask,c=e.pixels.resultPixels;if(h)if(n>1){if(t)for(o=0;o<n;o++)for(l=o*a,i=s[o],A=0;A<a;A++)h[A]&&(c[l+A]=i);else for(A=0;A<a;A++)if(h[A])for(l=A*n,o=0;o<n;o++)c[l+n]=s[o]}else for(A=0;A<a;A++)h[A]&&(c[A]=i);else if(n>1&&r!==i)if(t)for(o=0;o<n;o++)for(l=o*a,i=s[o],A=0;A<a;A++)c[l+A]=i;else for(A=0;A<a;A++)for(l=A*n,o=0;o<n;o++)c[l+o]=s[o];else for(A=0;A<a*n;A++)c[A]=i},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var i;switch(e){case 0:i=t>=-128&&t<=127;break;case 1:i=t>=0&&t<=255;break;case 2:i=t>=-32768&&t<=32767;break;case 3:i=t>=0&&t<=65536;break;case 4:i=t>=-2147483648&&t<=2147483647;break;case 5:i=t>=0&&t<=4294967296;break;case 6:i=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:i=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:i=!1}return i},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var i=e;switch(e){case 2:case 4:i=e-t;break;case 3:case 5:i=e-2*t;break;case 6:i=0===t?e:1===t?2:1;break;case 7:i=0===t?e:e-2*t+1;break;default:i=e}return i},getOnePixel:function(e,t,i,r){var s=0;switch(i){case 0:s=r.getInt8(t);break;case 1:s=r.getUint8(t);break;case 2:s=r.getInt16(t,!0);break;case 3:s=r.getUint16(t,!0);break;case 4:s=r.getInt32(t,!0);break;case 5:s=r.getUInt32(t,!0);break;case 6:s=r.getFloat32(t,!0);break;case 7:s=r.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return s},swapDimensionOrder:function(e,t,i,r,s){var n=0,a=0,o=0,A=0,l=e;if(i>1)if(l=new r(t*i),s)for(n=0;n<t;n++)for(A=n,o=0;o<i;o++,A+=t)l[A]=e[a++];else for(n=0;n<t;n++)for(A=n,o=0;o<i;o++,A+=t)l[a++]=e[A];return l}},d=function(e,t,i){this.val=e,this.left=t,this.right=i},{decode:function(e,t){var i=(t=t||{}).noDataValue,r=0,s={};if(s.ptr=t.inputOffset||0,s.pixels={},u.readHeaderInfo(e,s)){var n=s.headerInfo,a=n.fileVersion,o=u.getDataTypeArray(n.imageType);if(a>5)throw"unsupported lerc version 2."+a;u.readMask(e,s),n.numValidPixel===n.width*n.height||s.pixels.resultMask||(s.pixels.resultMask=t.maskData);var A=n.width*n.height;s.pixels.resultPixels=new o(A*n.numDims),s.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,h=!t.returnPixelInterleavedDims;if(0!==n.numValidPixel)if(n.zMax===n.zMin)u.constructConstantSurface(s,h);else if(a>=4&&u.checkMinMaxRanges(e,s))u.constructConstantSurface(s,h);else{var c=new DataView(e,s.ptr,2),g=c.getUint8(0);if(s.ptr++,g)u.readDataOneSweep(e,s,o,h);else if(a>1&&n.imageType<=1&&Math.abs(n.maxZError-.5)<1e-5){var d=c.getUint8(1);if(s.ptr++,s.encodeMode=d,d>2||a<4&&d>1)throw"Invalid Huffman flag "+d;d?u.readHuffman(e,s,o,h):u.readTiles(e,s,o,h)}else u.readTiles(e,s,o,h)}s.eofOffset=s.ptr,t.inputOffset?(l=s.headerInfo.blobSize+t.inputOffset-s.ptr,Math.abs(l)>=1&&(s.eofOffset=t.inputOffset+s.headerInfo.blobSize)):(l=s.headerInfo.blobSize-s.ptr,Math.abs(l)>=1&&(s.eofOffset=s.headerInfo.blobSize));var f={width:n.width,height:n.height,pixelData:s.pixels.resultPixels,minValue:n.zMin,maxValue:n.zMax,validPixelCount:n.numValidPixel,dimCount:n.numDims,dimStats:{minValues:n.minValues,maxValues:n.maxValues},maskData:s.pixels.resultMask};if(s.pixels.resultMask&&u.isValidPixelValue(n.imageType,i)){var p=s.pixels.resultMask;for(r=0;r<A;r++)p[r]||(f.pixelData[r]=i);f.noDataValue=i}return s.noDataValue=i,t.returnFileInfo&&(f.fileInfo=u.formatFileInfo(s)),f}},getBandCount:function(e){for(var t=0,i=0,r={ptr:0,pixels:{}};i<e.byteLength-58;)u.readHeaderInfo(e,r),i+=r.headerInfo.blobSize,t++,r.ptr=i;return t}}),_=(f=new ArrayBuffer(4),p=new Uint8Array(f),new Uint32Array(f)[0]=1,1===p[0]),w={decode:function(e,t){if(!_)throw"Big endian system is not supported.";var i,r,s=(t=t||{}).inputOffset||0,n=new Uint8Array(e,s,10),a=String.fromCharCode.apply(null,n);if("CntZImage"===a.trim())i=I,r=1;else{if("Lerc2"!==a.substring(0,5))throw"Unexpected file identifier string: "+a;i=m,r=2}for(var o,A,l,h,c,g,u=0,d=e.byteLength-10,f=[],p={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},w=0;s<d;){var C=i.decode(e,{inputOffset:s,encodedMaskData:o,maskData:l,returnMask:0===u,returnEncodedMask:0===u,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});s=C.fileInfo.eofOffset,l=C.maskData,0===u&&(o=C.encodedMaskData,p.width=C.width,p.height=C.height,p.dimCount=C.dimCount||1,p.pixelType=C.pixelType||C.fileInfo.pixelType,p.mask=l),r>1&&(l&&f.push(l),C.fileInfo.mask&&C.fileInfo.mask.numBytes>0&&w++),u++,p.pixels.push(C.pixelData),p.statistics.push({minValue:C.minValue,maxValue:C.maxValue,noDataValue:C.noDataValue,dimStats:C.dimStats})}if(r>1&&w>1){for(g=p.width*p.height,p.bandMasks=f,(l=new Uint8Array(g)).set(f[0]),h=1;h<f.length;h++)for(A=f[h],c=0;c<g;c++)l[c]=l[c]&A[c];p.maskData=l}return p}};e.exports?e.exports=w:this.Lerc=w}()}(Tg);var Fg=oa(Tg.exports);let Rg,Lg,Ng;const Og={env:{emscripten_notify_memory_growth:function(e){Ng=new Uint8Array(Lg.exports.memory.buffer)}}};const Pg="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAA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EQCAAIQIMAQsgA0F8aiIEIABJBEAgACECDAELIAAhAgNAIAIgAS0AADoAACACIAEtAAE6AAEgAiABLQACOgACIAIgAS0AAzoAAyABQQRqIQEgAkEEaiICIARNDQALCyACIANJBEADQCACIAEtAAA6AAAgAUEBaiEBIAJBAWoiAiADRw0ACwsgAAsMACAAIAEpAAA3AAALQQECfyAAKAIIIgEgACgCEEkEQEEDDwsgACAAKAIEIgJBB3E2AgQgACABIAJBA3ZrIgE2AgggACABKAAANgIAQQALDAAgACABKAIANgAAC/cCAQJ/AkAgACABRg0AAkAgASACaiAASwRAIAAgAmoiBCABSw0BCyAAIAEgAhALDwsgACABc0EDcSEDAkACQCAAIAFJBEAgAwRAIAAhAwwDCyAAQQNxRQRAIAAhAwwCCyAAIQMDQCACRQ0EIAMgAS0AADoAACABQQFqIQEgAkF/aiECIANBAWoiA0EDcQ0ACwwBCwJAIAMNACAEQQNxBEADQCACRQ0FIAAgAkF/aiICaiIDIAEgAmotAAA6AAAgA0EDcQ0ACwsgAkEDTQ0AA0AgACACQXxqIgJqIAEgAmooAgA2AgAgAkEDSw0ACwsgAkUNAgNAIAAgAkF/aiICaiABIAJqLQAAOgAAIAINAAsMAgsgAkEDTQ0AIAIhBANAIAMgASgCADYCACABQQRqIQEgA0EEaiEDIARBfGoiBEEDSw0ACyACQQNxIQILIAJFDQADQCADIAEtAAA6AAAgA0EBaiEDIAFBAWohASACQX9qIgINAAsLIAAL8wICAn8BfgJAIAJFDQAgACACaiIDQX9qIAE6AAAgACABOgAAIAJBA0kNACADQX5qIAE6AAAgACABOgABIANBfWogAToAACAAIAE6AAIgAkEHSQ0AIANBfGogAToAACAAIAE6AAMgAkEJSQ0AIABBACAAa0EDcSIEaiIDIAFB/wFxQYGChAhsIgE2AgAgAyACIARrQXxxIgRqIgJBfGogATYCACAEQQlJDQAgAyABNgIIIAMgATYCBCACQXhqIAE2AgAgAkF0aiABNgIAIARBGUkNACADIAE2AhggAyABNgIUIAMgATYCECADIAE2Ag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YCACADQQF2QXhqIgFBCCABQQhLG2dBH3NBAnRBgB9qIgEoAgAgAEEIakYEQCABIAAoAgw2AgALIAAoAggiAQRAIAEgACgCDDYCBAsgACgCDCIBBEAgASAAKAIINgIACyACECchAkEAIQFBhCAoAgAhACACDQEgACAAKAIAQX5xNgIAQQAPCyACQQ9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEB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aiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahASOgAAIAMgBEEIaiAEQRhqEBI6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0FIAEgBEEQaiAEQRhqEBI6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBSABIARBCGogBEEYahASOgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEjoAACABIAJqIABrIQIMAwsgAyAEQRBqIARBGGoQEjoAAiADIARBCGogBEEYahASOgADIANBBGohAwwAAAsACyAEQRhqIAEgAhAGIgIQAw0AIARBEGogBEEYaiADEBwgBEEIaiAEQRhqIAMQHCAAIQMDQAJAIARBGGoQBCADIAZPckUEQCADIARBEGogBEEYahAROgAAIAMgBEEIaiAEQRhqEBE6AAEgBEEYahAERQ0BIANBAmohAwsgBUF+aiEFAn8DQEG6fyECIAMiASAFSw0EIAEgBEEQaiAEQRhqEBE6AAAgAUEBaiEDIARBGGoQBEEDRgRAQQIhAiAEQQhqDAILIAMgBUsNBCABIARBCGogBEEYahAROgABIAFBAmohA0EDIQIgBEEYahAEQQNHDQALIARBEGoLIQUgAyAFIARBGGoQEToAACABIAJqIABrIQIMAgsgAyAEQRBqIARBGGoQEToAAiADIARBCGogBEEYahAROgADIANBBGohAwwAAAsACyAEQTBqJAAgAgtpAQF/An8CQAJAIAJBB00NACABKAAAQbfIwuF+Rw0AIAAgASgABDYCmOIBQWIgAEEQaiABIAIQPiIDEAMNAhogAEKBgICAEDcDiOEBIAAgASADaiACIANrECoMAQsgACABIAIQKgtBAAsLrQMBBn8jAEGAAWsiAyQAQWIhCAJAIAJBCUkNACAAQZjQAGogAUEIaiIEIAJBeGogAEGY0AAQMyIFEAMiBg0AIANBHzYCfCADIANB/ABqIANB+ABqIAQgBCAFaiAGGyIEIAEgAmoiAiAEaxAVIg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EIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2Aggg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AAAAABh0AAAAAAAAGIAAAAAAAEAYDAAEAAAAPBgOAAAAAAA4GA0AAAAAADQYDIAAAAAAMBgMQAAAAAAsGAwgAAAAACgYDBABBpB0L2QEBAAAAAwAAAAcAAAAPAAAAHwAAAD8AAAB/AAAA/wAAAP8BAAD/AwAA/wcAAP8PAAD/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",zg=new class{init(){return Rg||(Rg="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+Pg).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,Og))).then(this._init):WebAssembly.instantiate(Buffer.from(Pg,"base64"),Og).then(this._init),Rg)}_init(e){Lg=e.instance,Og.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!Lg)throw new Error("ZSTDDecoder: Await .init() before decoding.");const i=e.byteLength,r=Lg.exports.malloc(i);Ng.set(e,r),t=t||Number(Lg.exports.ZSTD_findDecompressedSize(r,i));const s=Lg.exports.malloc(t),n=Lg.exports.ZSTD_decompress(s,t,r,i),a=Ng.slice(s,s+n);return Lg.exports.free(r),Lg.exports.free(s),a}};var qg=Object.freeze({__proto__:null,default:class extends EA{constructor(e){super(),this.planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,this.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[iA]}decodeBlock(e){switch(this.addCompression){case rA:break;case sA:e=Mg(new Uint8Array(e)).buffer;break;case nA:e=zg.decode(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return Fg.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}},zstd:zg});var Kg=Object.freeze({__proto__:null,default:class extends EA{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(e,t){const i=new Blob([t]),r=await createImageBitmap(i);let s;"undefined"!=typeof document?(s=document.createElement("canvas"),s.width=r.width,s.height=r.height):s=new OffscreenCanvas(r.width,r.height);const n=s.getContext("2d");return n.drawImage(r,0,0),n.getImageData(0,0,r.width,r.height).data.buffer}}});export{nl as default};
|
|
5
|
+
!function(){var t,A,i,r,a,n,s,o,l,g,h,c,f,d,I,u,B=(t={defaultNoDataValue:-34027999387901484e22,decode:function(e,n){var s=(n=n||{}).encodedMaskData||null===n.encodedMaskData,o=a(e,n.inputOffset||0,s),l=null!==n.noDataValue?n.noDataValue:t.defaultNoDataValue,g=A(o,n.pixelType||Float32Array,n.encodedMaskData,l,n.returnMask),h={width:o.width,height:o.height,pixelData:g.resultPixels,minValue:g.minValue,maxValue:o.pixels.maxValue,noDataValue:l};return g.resultMask&&(h.maskData=g.resultMask),n.returnEncodedMask&&o.mask&&(h.encodedMaskData=o.mask.bitset?o.mask.bitset:null),n.returnFileInfo&&(h.fileInfo=i(o),n.computeUsedBitDepths&&(h.fileInfo.bitDepths=r(o))),h}},A=function(e,t,A,i,r){var a,s,o,l=0,g=e.pixels.numBlocksX,h=e.pixels.numBlocksY,c=Math.floor(e.width/g),f=Math.floor(e.height/h),d=2*e.maxZError,I=Number.MAX_VALUE;A=A||(e.mask?e.mask.bitset:null),s=new t(e.width*e.height),r&&A&&(o=new Uint8Array(e.width*e.height));for(var u,B,C=new Float32Array(c*f),E=0;E<=h;E++){var w=E!==h?f:e.height%h;if(0!==w)for(var Q=0;Q<=g;Q++){var m=Q!==g?c:e.width%g;if(0!==m){var p,y,_,b,D=E*e.width*f+Q*c,k=e.width-m,v=e.pixels.blocks[l];if(v.encoding<2?(0===v.encoding?p=v.rawData:(n(v.stuffedData,v.bitsPerPixel,v.numValidPixels,v.offset,d,C,e.pixels.maxValue),p=C),y=0):_=2===v.encoding?0:v.offset,A)for(B=0;B<w;B++){for(7&D&&(b=A[D>>3],b<<=7&D),u=0;u<m;u++)7&D||(b=A[D>>3]),128&b?(o&&(o[D]=1),I=I>(a=v.encoding<2?p[y++]:_)?a:I,s[D++]=a):(o&&(o[D]=0),s[D++]=i),b<<=1;D+=k}else if(v.encoding<2)for(B=0;B<w;B++){for(u=0;u<m;u++)I=I>(a=p[y++])?a:I,s[D++]=a;D+=k}else for(I=I>_?_:I,B=0;B<w;B++){for(u=0;u<m;u++)s[D++]=_;D+=k}if(1===v.encoding&&y!==v.numValidPixels)throw"Block and Mask do not match";l++}}}return{resultPixels:s,resultMask:o,minValue:I}},i=function(e){return{fileIdentifierString:e.fileIdentifierString,fileVersion:e.fileVersion,imageType:e.imageType,height:e.height,width:e.width,maxZError:e.maxZError,eofOffset:e.eofOffset,mask:e.mask?{numBlocksX:e.mask.numBlocksX,numBlocksY:e.mask.numBlocksY,numBytes:e.mask.numBytes,maxValue:e.mask.maxValue}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,numBytes:e.pixels.numBytes,maxValue:e.pixels.maxValue,noDataValue:e.noDataValue}}},r=function(e){for(var t=e.pixels.numBlocksX*e.pixels.numBlocksY,A={},i=0;i<t;i++){var r=e.pixels.blocks[i];0===r.encoding?A.float32=!0:1===r.encoding?A[r.bitsPerPixel]=!0:A[0]=!0}return Object.keys(A)},a=function(e,t,A){var i={},r=new Uint8Array(e,t,10);if(i.fileIdentifierString=String.fromCharCode.apply(null,r),"CntZImage"!==i.fileIdentifierString.trim())throw"Unexpected file identifier string: "+i.fileIdentifierString;t+=10;var a=new DataView(e,t,24);if(i.fileVersion=a.getInt32(0,!0),i.imageType=a.getInt32(4,!0),i.height=a.getUint32(8,!0),i.width=a.getUint32(12,!0),i.maxZError=a.getFloat64(16,!0),t+=24,!A)if(a=new DataView(e,t,16),i.mask={},i.mask.numBlocksY=a.getUint32(0,!0),i.mask.numBlocksX=a.getUint32(4,!0),i.mask.numBytes=a.getUint32(8,!0),i.mask.maxValue=a.getFloat32(12,!0),t+=16,i.mask.numBytes>0){var n=new Uint8Array(Math.ceil(i.width*i.height/8)),s=(a=new DataView(e,t,i.mask.numBytes)).getInt16(0,!0),o=2,l=0;do{if(s>0)for(;s--;)n[l++]=a.getUint8(o++);else{var g=a.getUint8(o++);for(s=-s;s--;)n[l++]=g}s=a.getInt16(o,!0),o+=2}while(o<i.mask.numBytes);if(-32768!==s||l<n.length)throw"Unexpected end of mask RLE encoding";i.mask.bitset=n,t+=i.mask.numBytes}else 0==(i.mask.numBytes|i.mask.numBlocksY|i.mask.maxValue)&&(i.mask.bitset=new Uint8Array(Math.ceil(i.width*i.height/8)));a=new DataView(e,t,16),i.pixels={},i.pixels.numBlocksY=a.getUint32(0,!0),i.pixels.numBlocksX=a.getUint32(4,!0),i.pixels.numBytes=a.getUint32(8,!0),i.pixels.maxValue=a.getFloat32(12,!0),t+=16;var h=i.pixels.numBlocksX,c=i.pixels.numBlocksY,f=h+(i.width%h>0?1:0),d=c+(i.height%c>0?1:0);i.pixels.blocks=new Array(f*d);for(var I=0,u=0;u<d;u++)for(var B=0;B<f;B++){var C=0,E=e.byteLength-t;a=new DataView(e,t,Math.min(10,E));var w={};i.pixels.blocks[I++]=w;var Q=a.getUint8(0);if(C++,w.encoding=63&Q,w.encoding>3)throw"Invalid block encoding ("+w.encoding+")";if(2!==w.encoding){if(0!==Q&&2!==Q){if(Q>>=6,w.offsetType=Q,2===Q)w.offset=a.getInt8(1),C++;else if(1===Q)w.offset=a.getInt16(1,!0),C+=2;else{if(0!==Q)throw"Invalid block offset type";w.offset=a.getFloat32(1,!0),C+=4}if(1===w.encoding)if(Q=a.getUint8(C),C++,w.bitsPerPixel=63&Q,Q>>=6,w.numValidPixelsType=Q,2===Q)w.numValidPixels=a.getUint8(C),C++;else if(1===Q)w.numValidPixels=a.getUint16(C,!0),C+=2;else{if(0!==Q)throw"Invalid valid pixel count type";w.numValidPixels=a.getUint32(C,!0),C+=4}}var m;if(t+=C,3!==w.encoding)if(0===w.encoding){var p=(i.pixels.numBytes-1)/4;if(p!==Math.floor(p))throw"uncompressed block has invalid length";m=new ArrayBuffer(4*p),new Uint8Array(m).set(new Uint8Array(e,t,4*p));var y=new Float32Array(m);w.rawData=y,t+=4*p}else if(1===w.encoding){var _=Math.ceil(w.numValidPixels*w.bitsPerPixel/8),b=Math.ceil(_/4);m=new ArrayBuffer(4*b),new Uint8Array(m).set(new Uint8Array(e,t,_)),w.stuffedData=new Uint32Array(m),t+=_}}else t++}return i.eofOffset=t,i},n=function(e,t,A,i,r,a,n){var s,o,l,g=(1<<t)-1,h=0,c=0,f=Math.ceil((n-i)/r),d=4*e.length-Math.ceil(t*A/8);for(e[e.length-1]<<=8*d,s=0;s<A;s++){if(0===c&&(l=e[h++],c=32),c>=t)o=l>>>c-t&g,c-=t;else{var I=t-c;o=(l&g)<<I&g,o+=(l=e[h++])>>>(c=32-I)}a[s]=o<f?i+o*r:n}return a},t),C=(s=function(e,t,A,i,r,a,n,s){var o,l,g,h,c,f=(1<<A)-1,d=0,I=0,u=4*e.length-Math.ceil(A*i/8);if(e[e.length-1]<<=8*u,r)for(o=0;o<i;o++)0===I&&(g=e[d++],I=32),I>=A?(l=g>>>I-A&f,I-=A):(l=(g&f)<<(h=A-I)&f,l+=(g=e[d++])>>>(I=32-h)),t[o]=r[l];else for(c=Math.ceil((s-a)/n),o=0;o<i;o++)0===I&&(g=e[d++],I=32),I>=A?(l=g>>>I-A&f,I-=A):(l=(g&f)<<(h=A-I)&f,l+=(g=e[d++])>>>(I=32-h)),t[o]=l<c?a+l*n:s},o=function(e,t,A,i,r,a){var n,s=(1<<t)-1,o=0,l=0,g=0,h=0,c=0,f=[],d=4*e.length-Math.ceil(t*A/8);e[e.length-1]<<=8*d;var I=Math.ceil((a-i)/r);for(l=0;l<A;l++)0===h&&(n=e[o++],h=32),h>=t?(c=n>>>h-t&s,h-=t):(c=(n&s)<<(g=t-h)&s,c+=(n=e[o++])>>>(h=32-g)),f[l]=c<I?i+c*r:a;return f.unshift(i),f},l=function(e,t,A,i,r,a,n,s){var o,l,g,h,c=(1<<A)-1,f=0,d=0,I=0;if(r)for(o=0;o<i;o++)0===d&&(g=e[f++],d=32,I=0),d>=A?(l=g>>>I&c,d-=A,I+=A):(l=g>>>I&c,d=32-(h=A-d),l|=((g=e[f++])&(1<<h)-1)<<A-h,I=h),t[o]=r[l];else{var u=Math.ceil((s-a)/n);for(o=0;o<i;o++)0===d&&(g=e[f++],d=32,I=0),d>=A?(l=g>>>I&c,d-=A,I+=A):(l=g>>>I&c,d=32-(h=A-d),l|=((g=e[f++])&(1<<h)-1)<<A-h,I=h),t[o]=l<u?a+l*n:s}return t},g=function(e,t,A,i,r,a){var n,s=(1<<t)-1,o=0,l=0,g=0,h=0,c=0,f=0,d=[],I=Math.ceil((a-i)/r);for(l=0;l<A;l++)0===h&&(n=e[o++],h=32,f=0),h>=t?(c=n>>>f&s,h-=t,f+=t):(c=n>>>f&s,h=32-(g=t-h),c|=((n=e[o++])&(1<<g)-1)<<t-g,f=g),d[l]=c<I?i+c*r:a;return d.unshift(i),d},h=function(e,t,A,i){var r,a,n,s,o=(1<<A)-1,l=0,g=0,h=4*e.length-Math.ceil(A*i/8);for(e[e.length-1]<<=8*h,r=0;r<i;r++)0===g&&(n=e[l++],g=32),g>=A?(a=n>>>g-A&o,g-=A):(a=(n&o)<<(s=A-g)&o,a+=(n=e[l++])>>>(g=32-s)),t[r]=a;return t},c=function(e,t,A,i){var r,a,n,s,o=(1<<A)-1,l=0,g=0,h=0;for(r=0;r<i;r++)0===g&&(n=e[l++],g=32,h=0),g>=A?(a=n>>>h&o,g-=A,h+=A):(a=n>>>h&o,g=32-(s=A-g),a|=((n=e[l++])&(1<<s)-1)<<A-s,h=s),t[r]=a;return t},f={HUFFMAN_LUT_BITS_MAX:12,computeChecksumFletcher32:function(e){for(var t=65535,A=65535,i=e.length,r=Math.floor(i/2),a=0;r;){var n=r>=359?359:r;r-=n;do{t+=e[a++]<<8,A+=t+=e[a++]}while(--n);t=(65535&t)+(t>>>16),A=(65535&A)+(A>>>16)}return 1&i&&(A+=t+=e[a]<<8),((A=(65535&A)+(A>>>16))<<16|(t=(65535&t)+(t>>>16)))>>>0},readHeaderInfo:function(e,t){var A=t.ptr,i=new Uint8Array(e,A,6),r={};if(r.fileIdentifierString=String.fromCharCode.apply(null,i),0!==r.fileIdentifierString.lastIndexOf("Lerc2",0))throw"Unexpected file identifier string (expect Lerc2 ): "+r.fileIdentifierString;A+=6;var a,n=new DataView(e,A,8),s=n.getInt32(0,!0);if(r.fileVersion=s,A+=4,s>=3&&(r.checksum=n.getUint32(4,!0),A+=4),n=new DataView(e,A,12),r.height=n.getUint32(0,!0),r.width=n.getUint32(4,!0),A+=8,s>=4?(r.numDims=n.getUint32(8,!0),A+=4):r.numDims=1,n=new DataView(e,A,40),r.numValidPixel=n.getUint32(0,!0),r.microBlockSize=n.getInt32(4,!0),r.blobSize=n.getInt32(8,!0),r.imageType=n.getInt32(12,!0),r.maxZError=n.getFloat64(16,!0),r.zMin=n.getFloat64(24,!0),r.zMax=n.getFloat64(32,!0),A+=40,t.headerInfo=r,t.ptr=A,s>=3&&(a=s>=4?52:48,this.computeChecksumFletcher32(new Uint8Array(e,A-a,r.blobSize-14))!==r.checksum))throw"Checksum failed.";return!0},checkMinMaxRanges:function(e,t){var A=t.headerInfo,i=this.getDataTypeArray(A.imageType),r=A.numDims*this.getDataTypeSize(A.imageType),a=this.readSubArray(e,t.ptr,i,r),n=this.readSubArray(e,t.ptr+r,i,r);t.ptr+=2*r;var s,o=!0;for(s=0;s<A.numDims;s++)if(a[s]!==n[s]){o=!1;break}return A.minValues=a,A.maxValues=n,o},readSubArray:function(e,t,A,i){var r;if(A===Uint8Array)r=new Uint8Array(e,t,i);else{var a=new ArrayBuffer(i);new Uint8Array(a).set(new Uint8Array(e,t,i)),r=new A(a)}return r},readMask:function(e,t){var A,i,r=t.ptr,a=t.headerInfo,n=a.width*a.height,s=a.numValidPixel,o=new DataView(e,r,4),l={};if(l.numBytes=o.getUint32(0,!0),r+=4,(0===s||n===s)&&0!==l.numBytes)throw"invalid mask";if(0===s)A=new Uint8Array(Math.ceil(n/8)),l.bitset=A,i=new Uint8Array(n),t.pixels.resultMask=i,r+=l.numBytes;else if(l.numBytes>0){A=new Uint8Array(Math.ceil(n/8));var g=(o=new DataView(e,r,l.numBytes)).getInt16(0,!0),h=2,c=0,f=0;do{if(g>0)for(;g--;)A[c++]=o.getUint8(h++);else for(f=o.getUint8(h++),g=-g;g--;)A[c++]=f;g=o.getInt16(h,!0),h+=2}while(h<l.numBytes);if(-32768!==g||c<A.length)throw"Unexpected end of mask RLE encoding";i=new Uint8Array(n);var d=0,I=0;for(I=0;I<n;I++)7&I?(d=A[I>>3],d<<=7&I):d=A[I>>3],128&d&&(i[I]=1);t.pixels.resultMask=i,l.bitset=A,r+=l.numBytes}return t.ptr=r,t.mask=l,!0},readDataOneSweep:function(e,t,A,i){var r,a=t.ptr,n=t.headerInfo,s=n.numDims,o=n.width*n.height,l=n.imageType,g=n.numValidPixel*f.getDataTypeSize(l)*s,h=t.pixels.resultMask;if(A===Uint8Array)r=new Uint8Array(e,a,g);else{var c=new ArrayBuffer(g);new Uint8Array(c).set(new Uint8Array(e,a,g)),r=new A(c)}if(r.length===o*s)t.pixels.resultPixels=i?f.swapDimensionOrder(r,o,s,A,!0):r;else{t.pixels.resultPixels=new A(o*s);var d=0,I=0,u=0,B=0;if(s>1){if(i){for(I=0;I<o;I++)if(h[I])for(B=I,u=0;u<s;u++,B+=o)t.pixels.resultPixels[B]=r[d++]}else for(I=0;I<o;I++)if(h[I])for(B=I*s,u=0;u<s;u++)t.pixels.resultPixels[B+u]=r[d++]}else for(I=0;I<o;I++)h[I]&&(t.pixels.resultPixels[I]=r[d++])}return a+=g,t.ptr=a,!0},readHuffmanTree:function(e,t){var A=this.HUFFMAN_LUT_BITS_MAX,i=new DataView(e,t.ptr,16);if(t.ptr+=16,i.getInt32(0,!0)<2)throw"unsupported Huffman version";var r=i.getInt32(4,!0),a=i.getInt32(8,!0),n=i.getInt32(12,!0);if(a>=n)return!1;var s=new Uint32Array(n-a);f.decodeBits(e,t,s);var o,l,g,h,c=[];for(o=a;o<n;o++)c[l=o-(o<r?0:r)]={first:s[o-a],second:null};var I=e.byteLength-t.ptr,u=Math.ceil(I/4),B=new ArrayBuffer(4*u);new Uint8Array(B).set(new Uint8Array(e,t.ptr,I));var C,E=new Uint32Array(B),w=0,Q=0;for(C=E[0],o=a;o<n;o++)(h=c[l=o-(o<r?0:r)].first)>0&&(c[l].second=C<<w>>>32-h,32-w>=h?32===(w+=h)&&(w=0,C=E[++Q]):(w+=h-32,C=E[++Q],c[l].second|=C>>>32-w));var m=0,p=0,y=new d;for(o=0;o<c.length;o++)void 0!==c[o]&&(m=Math.max(m,c[o].first));p=m>=A?A:m;var _,b,D,k,v,x=[];for(o=a;o<n;o++)if((h=c[l=o-(o<r?0:r)].first)>0)if(_=[h,l],h<=p)for(b=c[l].second<<p-h,D=1<<p-h,g=0;g<D;g++)x[b|g]=_;else for(b=c[l].second,v=y,k=h-1;k>=0;k--)b>>>k&1?(v.right||(v.right=new d),v=v.right):(v.left||(v.left=new d),v=v.left),0!==k||v.val||(v.val=_[1]);return{decodeLut:x,numBitsLUTQick:p,numBitsLUT:m,tree:y,stuffedData:E,srcPtr:Q,bitPos:w}},readHuffman:function(e,t,A,i){var r,a,n,s,o,l,g,h,c,d=t.headerInfo.numDims,I=t.headerInfo.height,u=t.headerInfo.width,B=u*I,C=this.readHuffmanTree(e,t),E=C.decodeLut,w=C.tree,Q=C.stuffedData,m=C.srcPtr,p=C.bitPos,y=C.numBitsLUTQick,_=C.numBitsLUT,b=0===t.headerInfo.imageType?128:0,D=t.pixels.resultMask,k=0;p>0&&(m++,p=0);var v,x=Q[m],S=1===t.encodeMode,G=new A(B*d),U=G;if(d<2||S){for(v=0;v<d;v++)if(d>1&&(U=new A(G.buffer,B*v,B),k=0),t.headerInfo.numValidPixel===u*I)for(h=0,l=0;l<I;l++)for(g=0;g<u;g++,h++){if(a=0,o=s=x<<p>>>32-y,32-p<y&&(o=s|=Q[m+1]>>>64-p-y),E[o])a=E[o][1],p+=E[o][0];else for(o=s=x<<p>>>32-_,32-p<_&&(o=s|=Q[m+1]>>>64-p-_),r=w,c=0;c<_;c++)if(!(r=s>>>_-c-1&1?r.right:r.left).left&&!r.right){a=r.val,p=p+c+1;break}p>=32&&(p-=32,x=Q[++m]),n=a-b,S?(n+=g>0?k:l>0?U[h-u]:k,n&=255,U[h]=n,k=n):U[h]=n}else for(h=0,l=0;l<I;l++)for(g=0;g<u;g++,h++)if(D[h]){if(a=0,o=s=x<<p>>>32-y,32-p<y&&(o=s|=Q[m+1]>>>64-p-y),E[o])a=E[o][1],p+=E[o][0];else for(o=s=x<<p>>>32-_,32-p<_&&(o=s|=Q[m+1]>>>64-p-_),r=w,c=0;c<_;c++)if(!(r=s>>>_-c-1&1?r.right:r.left).left&&!r.right){a=r.val,p=p+c+1;break}p>=32&&(p-=32,x=Q[++m]),n=a-b,S?(g>0&&D[h-1]?n+=k:l>0&&D[h-u]?n+=U[h-u]:n+=k,n&=255,U[h]=n,k=n):U[h]=n}}else for(h=0,l=0;l<I;l++)for(g=0;g<u;g++)if(h=l*u+g,!D||D[h])for(v=0;v<d;v++,h+=B){if(a=0,o=s=x<<p>>>32-y,32-p<y&&(o=s|=Q[m+1]>>>64-p-y),E[o])a=E[o][1],p+=E[o][0];else for(o=s=x<<p>>>32-_,32-p<_&&(o=s|=Q[m+1]>>>64-p-_),r=w,c=0;c<_;c++)if(!(r=s>>>_-c-1&1?r.right:r.left).left&&!r.right){a=r.val,p=p+c+1;break}p>=32&&(p-=32,x=Q[++m]),n=a-b,U[h]=n}t.ptr=t.ptr+4*(m+1)+(p>0?4:0),t.pixels.resultPixels=G,d>1&&!i&&(t.pixels.resultPixels=f.swapDimensionOrder(G,B,d,A))},decodeBits:function(e,t,A,i,r){var a=t.headerInfo,n=a.fileVersion,f=0,d=e.byteLength-t.ptr>=5?5:e.byteLength-t.ptr,I=new DataView(e,t.ptr,d),u=I.getUint8(0);f++;var B=u>>6,C=0===B?4:3-B,E=(32&u)>0,w=31&u,Q=0;if(1===C)Q=I.getUint8(f),f++;else if(2===C)Q=I.getUint16(f,!0),f+=2;else{if(4!==C)throw"Invalid valid pixel count type";Q=I.getUint32(f,!0),f+=4}var m,p,y,_,b,D,k,v,x,S=2*a.maxZError,G=a.numDims>1?a.maxValues[r]:a.zMax;if(E){for(t.counter.lut++,v=I.getUint8(f),f++,_=Math.ceil((v-1)*w/8),b=Math.ceil(_/4),p=new ArrayBuffer(4*b),y=new Uint8Array(p),t.ptr+=f,y.set(new Uint8Array(e,t.ptr,_)),k=new Uint32Array(p),t.ptr+=_,x=0;v-1>>>x;)x++;_=Math.ceil(Q*x/8),b=Math.ceil(_/4),p=new ArrayBuffer(4*b),(y=new Uint8Array(p)).set(new Uint8Array(e,t.ptr,_)),m=new Uint32Array(p),t.ptr+=_,D=n>=3?g(k,w,v-1,i,S,G):o(k,w,v-1,i,S,G),n>=3?l(m,A,x,Q,D):s(m,A,x,Q,D)}else t.counter.bitstuffer++,x=w,t.ptr+=f,x>0&&(_=Math.ceil(Q*x/8),b=Math.ceil(_/4),p=new ArrayBuffer(4*b),(y=new Uint8Array(p)).set(new Uint8Array(e,t.ptr,_)),m=new Uint32Array(p),t.ptr+=_,n>=3?null==i?c(m,A,x,Q):l(m,A,x,Q,!1,i,S,G):null==i?h(m,A,x,Q):s(m,A,x,Q,!1,i,S,G))},readTiles:function(e,t,A,i){var r=t.headerInfo,a=r.width,n=r.height,s=a*n,o=r.microBlockSize,l=r.imageType,g=f.getDataTypeSize(l),h=Math.ceil(a/o),c=Math.ceil(n/o);t.pixels.numBlocksY=c,t.pixels.numBlocksX=h,t.pixels.ptr=0;var d,I,u,B,C,E,w,Q,m,p,y=0,_=0,b=0,D=0,k=0,v=0,x=0,S=0,G=0,U=0,F=0,R=0,L=0,M=0,T=0,N=new A(o*o),O=n%o||o,P=a%o||o,z=r.numDims,K=t.pixels.resultMask,J=t.pixels.resultPixels,q=r.fileVersion>=5?14:15,H=r.zMax;for(b=0;b<c;b++)for(k=b!==c-1?o:O,D=0;D<h;D++)for(U=b*a*o+D*o,F=a-(v=D!==h-1?o:P),Q=0;Q<z;Q++){if(z>1?(p=J,U=b*a*o+D*o,J=new A(t.pixels.resultPixels.buffer,s*Q*g,s),H=r.maxValues[Q]):p=null,x=e.byteLength-t.ptr,I={},T=0,S=(d=new DataView(e,t.ptr,Math.min(10,x))).getUint8(0),T++,m=r.fileVersion>=5?4&S:0,G=S>>6&255,(S>>2&q)!=(D*o>>3&q))throw"integrity issue";if(m&&0===Q)throw"integrity issue";if((C=3&S)>3)throw t.ptr+=T,"Invalid block encoding ("+C+")";if(2!==C)if(0===C){if(m)throw"integrity issue";if(t.counter.uncompressed++,t.ptr+=T,R=(R=k*v*g)<(L=e.byteLength-t.ptr)?R:L,u=new ArrayBuffer(R%g==0?R:R+g-R%g),new Uint8Array(u).set(new Uint8Array(e,t.ptr,R)),B=new A(u),M=0,K)for(y=0;y<k;y++){for(_=0;_<v;_++)K[U]&&(J[U]=B[M++]),U++;U+=F}else for(y=0;y<k;y++){for(_=0;_<v;_++)J[U++]=B[M++];U+=F}t.ptr+=M*g}else if(E=f.getDataTypeUsed(m&&l<6?4:l,G),w=f.getOnePixel(I,T,E,d),T+=f.getDataTypeSize(E),3===C)if(t.ptr+=T,t.counter.constantoffset++,K)for(y=0;y<k;y++){for(_=0;_<v;_++)K[U]&&(J[U]=m?Math.min(H,p[U]+w):w),U++;U+=F}else for(y=0;y<k;y++){for(_=0;_<v;_++)J[U]=m?Math.min(H,p[U]+w):w,U++;U+=F}else if(t.ptr+=T,f.decodeBits(e,t,N,w,Q),T=0,m)if(K)for(y=0;y<k;y++){for(_=0;_<v;_++)K[U]&&(J[U]=N[T++]+p[U]),U++;U+=F}else for(y=0;y<k;y++){for(_=0;_<v;_++)J[U]=N[T++]+p[U],U++;U+=F}else if(K)for(y=0;y<k;y++){for(_=0;_<v;_++)K[U]&&(J[U]=N[T++]),U++;U+=F}else for(y=0;y<k;y++){for(_=0;_<v;_++)J[U++]=N[T++];U+=F}else{if(m)if(K)for(y=0;y<k;y++)for(_=0;_<v;_++)K[U]&&(J[U]=p[U]),U++;else for(y=0;y<k;y++)for(_=0;_<v;_++)J[U]=p[U],U++;t.counter.constant++,t.ptr+=T}}z>1&&!i&&(t.pixels.resultPixels=f.swapDimensionOrder(t.pixels.resultPixels,s,z,A))},formatFileInfo:function(e){return{fileIdentifierString:e.headerInfo.fileIdentifierString,fileVersion:e.headerInfo.fileVersion,imageType:e.headerInfo.imageType,height:e.headerInfo.height,width:e.headerInfo.width,numValidPixel:e.headerInfo.numValidPixel,microBlockSize:e.headerInfo.microBlockSize,blobSize:e.headerInfo.blobSize,maxZError:e.headerInfo.maxZError,pixelType:f.getPixelType(e.headerInfo.imageType),eofOffset:e.eofOffset,mask:e.mask?{numBytes:e.mask.numBytes}:null,pixels:{numBlocksX:e.pixels.numBlocksX,numBlocksY:e.pixels.numBlocksY,maxValue:e.headerInfo.zMax,minValue:e.headerInfo.zMin,noDataValue:e.noDataValue}}},constructConstantSurface:function(e,t){var A=e.headerInfo.zMax,i=e.headerInfo.zMin,r=e.headerInfo.maxValues,a=e.headerInfo.numDims,n=e.headerInfo.height*e.headerInfo.width,s=0,o=0,l=0,g=e.pixels.resultMask,h=e.pixels.resultPixels;if(g)if(a>1){if(t)for(s=0;s<a;s++)for(l=s*n,A=r[s],o=0;o<n;o++)g[o]&&(h[l+o]=A);else for(o=0;o<n;o++)if(g[o])for(l=o*a,s=0;s<a;s++)h[l+a]=r[s]}else for(o=0;o<n;o++)g[o]&&(h[o]=A);else if(a>1&&i!==A)if(t)for(s=0;s<a;s++)for(l=s*n,A=r[s],o=0;o<n;o++)h[l+o]=A;else for(o=0;o<n;o++)for(l=o*a,s=0;s<a;s++)h[l+s]=r[s];else for(o=0;o<n*a;o++)h[o]=A},getDataTypeArray:function(e){var t;switch(e){case 0:t=Int8Array;break;case 1:t=Uint8Array;break;case 2:t=Int16Array;break;case 3:t=Uint16Array;break;case 4:t=Int32Array;break;case 5:t=Uint32Array;break;case 6:default:t=Float32Array;break;case 7:t=Float64Array}return t},getPixelType:function(e){var t;switch(e){case 0:t="S8";break;case 1:t="U8";break;case 2:t="S16";break;case 3:t="U16";break;case 4:t="S32";break;case 5:t="U32";break;case 6:default:t="F32";break;case 7:t="F64"}return t},isValidPixelValue:function(e,t){if(null==t)return!1;var A;switch(e){case 0:A=t>=-128&&t<=127;break;case 1:A=t>=0&&t<=255;break;case 2:A=t>=-32768&&t<=32767;break;case 3:A=t>=0&&t<=65536;break;case 4:A=t>=-2147483648&&t<=2147483647;break;case 5:A=t>=0&&t<=4294967296;break;case 6:A=t>=-34027999387901484e22&&t<=34027999387901484e22;break;case 7:A=t>=-17976931348623157e292&&t<=17976931348623157e292;break;default:A=!1}return A},getDataTypeSize:function(e){var t=0;switch(e){case 0:case 1:t=1;break;case 2:case 3:t=2;break;case 4:case 5:case 6:t=4;break;case 7:t=8;break;default:t=e}return t},getDataTypeUsed:function(e,t){var A=e;switch(e){case 2:case 4:A=e-t;break;case 3:case 5:A=e-2*t;break;case 6:A=0===t?e:1===t?2:1;break;case 7:A=0===t?e:e-2*t+1;break;default:A=e}return A},getOnePixel:function(e,t,A,i){var r=0;switch(A){case 0:r=i.getInt8(t);break;case 1:r=i.getUint8(t);break;case 2:r=i.getInt16(t,!0);break;case 3:r=i.getUint16(t,!0);break;case 4:r=i.getInt32(t,!0);break;case 5:r=i.getUInt32(t,!0);break;case 6:r=i.getFloat32(t,!0);break;case 7:r=i.getFloat64(t,!0);break;default:throw"the decoder does not understand this pixel type"}return r},swapDimensionOrder:function(e,t,A,i,r){var a=0,n=0,s=0,o=0,l=e;if(A>1)if(l=new i(t*A),r)for(a=0;a<t;a++)for(o=a,s=0;s<A;s++,o+=t)l[o]=e[n++];else for(a=0;a<t;a++)for(o=a,s=0;s<A;s++,o+=t)l[n++]=e[o];return l}},d=function(e,t,A){this.val=e,this.left=t,this.right=A},{decode:function(e,t){var A=(t=t||{}).noDataValue,i=0,r={};if(r.ptr=t.inputOffset||0,r.pixels={},f.readHeaderInfo(e,r)){var a=r.headerInfo,n=a.fileVersion,s=f.getDataTypeArray(a.imageType);if(n>5)throw"unsupported lerc version 2."+n;f.readMask(e,r),a.numValidPixel===a.width*a.height||r.pixels.resultMask||(r.pixels.resultMask=t.maskData);var o=a.width*a.height;r.pixels.resultPixels=new s(o*a.numDims),r.counter={onesweep:0,uncompressed:0,lut:0,bitstuffer:0,constant:0,constantoffset:0};var l,g=!t.returnPixelInterleavedDims;if(0!==a.numValidPixel)if(a.zMax===a.zMin)f.constructConstantSurface(r,g);else if(n>=4&&f.checkMinMaxRanges(e,r))f.constructConstantSurface(r,g);else{var h=new DataView(e,r.ptr,2),c=h.getUint8(0);if(r.ptr++,c)f.readDataOneSweep(e,r,s,g);else if(n>1&&a.imageType<=1&&Math.abs(a.maxZError-.5)<1e-5){var d=h.getUint8(1);if(r.ptr++,r.encodeMode=d,d>2||n<4&&d>1)throw"Invalid Huffman flag "+d;d?f.readHuffman(e,r,s,g):f.readTiles(e,r,s,g)}else f.readTiles(e,r,s,g)}r.eofOffset=r.ptr,t.inputOffset?(l=r.headerInfo.blobSize+t.inputOffset-r.ptr,Math.abs(l)>=1&&(r.eofOffset=t.inputOffset+r.headerInfo.blobSize)):(l=r.headerInfo.blobSize-r.ptr,Math.abs(l)>=1&&(r.eofOffset=r.headerInfo.blobSize));var I={width:a.width,height:a.height,pixelData:r.pixels.resultPixels,minValue:a.zMin,maxValue:a.zMax,validPixelCount:a.numValidPixel,dimCount:a.numDims,dimStats:{minValues:a.minValues,maxValues:a.maxValues},maskData:r.pixels.resultMask};if(r.pixels.resultMask&&f.isValidPixelValue(a.imageType,A)){var u=r.pixels.resultMask;for(i=0;i<o;i++)u[i]||(I.pixelData[i]=A);I.noDataValue=A}return r.noDataValue=A,t.returnFileInfo&&(I.fileInfo=f.formatFileInfo(r)),I}},getBandCount:function(e){for(var t=0,A=0,i={ptr:0,pixels:{}};A<e.byteLength-58;)f.readHeaderInfo(e,i),A+=i.headerInfo.blobSize,t++,i.ptr=A;return t}}),E=(I=new ArrayBuffer(4),u=new Uint8Array(I),new Uint32Array(I)[0]=1,1===u[0]),w={decode:function(e,t){if(!E)throw"Big endian system is not supported.";var A,i,r=(t=t||{}).inputOffset||0,a=new Uint8Array(e,r,10),n=String.fromCharCode.apply(null,a);if("CntZImage"===n.trim())A=B,i=1;else{if("Lerc2"!==n.substring(0,5))throw"Unexpected file identifier string: "+n;A=C,i=2}for(var s,o,l,g,h,c,f=0,d=e.byteLength-10,I=[],u={width:0,height:0,pixels:[],pixelType:t.pixelType,mask:null,statistics:[]},w=0;r<d;){var Q=A.decode(e,{inputOffset:r,encodedMaskData:s,maskData:l,returnMask:0===f,returnEncodedMask:0===f,returnFileInfo:!0,returnPixelInterleavedDims:t.returnPixelInterleavedDims,pixelType:t.pixelType||null,noDataValue:t.noDataValue||null});r=Q.fileInfo.eofOffset,l=Q.maskData,0===f&&(s=Q.encodedMaskData,u.width=Q.width,u.height=Q.height,u.dimCount=Q.dimCount||1,u.pixelType=Q.pixelType||Q.fileInfo.pixelType,u.mask=l),i>1&&(l&&I.push(l),Q.fileInfo.mask&&Q.fileInfo.mask.numBytes>0&&w++),f++,u.pixels.push(Q.pixelData),u.statistics.push({minValue:Q.minValue,maxValue:Q.maxValue,noDataValue:Q.noDataValue,dimStats:Q.dimStats})}if(i>1&&w>1){for(c=u.width*u.height,u.bandMasks=I,(l=new Uint8Array(c)).set(I[0]),g=1;g<I.length;g++)for(o=I[g],h=0;h<c;h++)l[h]=l[h]&o[h];u.maskData=l}return u}};e.exports?e.exports=w:this.Lerc=w}()}(_l);var bl=li(_l.exports);let Dl,kl,vl;const xl={env:{emscripten_notify_memory_growth:function(e){vl=new Uint8Array(kl.exports.memory.buffer)}}};const Sl="AGFzbQEAAAABpQEVYAF/AX9gAn9/AGADf39/AX9gBX9/f39/AX9gAX8AYAJ/fwF/YAR/f39/AX9gA39/fwBgBn9/f39/fwF/YAd/f39/f39/AX9gAn9/AX5gAn5+AX5gAABgBX9/f39/AGAGf39/f39/AGAIf39/f39/f38AYAl/f39/f39/f38AYAABf2AIf39/f39/f38Bf2ANf39/f39/f39/f39/fwF/YAF/AX4CJwEDZW52H2Vtc2NyaXB0ZW5fbm90aWZ5X21lbW9yeV9ncm93dGgABANpaAEFAAAFAgEFCwACAQABAgIFBQcAAwABDgsBAQcAEhMHAAUBDAQEAAANBwQCAgYCBAgDAwMDBgEACQkHBgICAAYGAgQUBwYGAwIGAAMCAQgBBwUGCgoEEQAEBAEIAwgDBQgDEA8IAAcABAUBcAECAgUEAQCAAgYJAX8BQaCgwAILB2AHBm1lbW9yeQIABm1hbGxvYwAoBGZyZWUAJgxaU1REX2lzRXJyb3IAaBlaU1REX2ZpbmREZWNvbXByZXNzZWRTaXplAFQPWlNURF9kZWNvbXByZXNzAEoGX3N0YXJ0ACQJBwEAQQELASQKussBaA8AIAAgACgCBCABajYCBAsZACAAKAIAIAAoAgRBH3F0QQAgAWtBH3F2CwgAIABBiH9LC34BBH9BAyEBIAAoAgQiA0EgTQRAIAAoAggiASAAKAIQTwRAIAAQDQ8LIAAoAgwiAiABRgRAQQFBAiADQSBJGw8LIAAgASABIAJrIANBA3YiBCABIARrIAJJIgEbIgJrIgQ2AgggACADIAJBA3RrNgIEIAAgBCgAADYCAAsgAQsUAQF/IAAgARACIQIgACABEAEgAgv3AQECfyACRQRAIABCADcCACAAQQA2AhAgAEIANwIIQbh/DwsgACABNgIMIAAgAUEEajYCECACQQRPBE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Q9qQXhxIgMQHSICQX9GDQIgAkEHakF4cSIAIAJHBEAgACACaxAdQX9GDQMLAkBBhCAoAgAiAUUEQEGAICAANgIADAELIAAgATYCBAtBhCAgADYCACAAIANBAXRBAXI2AgAMAQsgAEUNAQsgAEEIaiEBCyABC7kDAQJ/IAAgA2ohBQJAIANBB0wEQANAIAAgBU8NAiAAIAItAAA6AAAgAEEBaiEAIAJBAWohAgwAAAsACyAEQQFGBEACQCAAIAJrIgZBB00EQCAAIAItAAA6AAAgACACLQABOgABIAAgAi0AAjoAAiAAIAItAAM6AAMgAEEEaiACIAZBAnQiBkHAHmooAgBqIgIQFyACIAZB4B5qKAIAayECDAELIAAgAhAMCyACQQhqIQIgAEEIaiEACwJAAkACQAJAIAUgAU0EQCAAIANqIQEgBEEBRyAAIAJrQQ9Kcg0BA0AgACACEAwgAkEIaiECIABBCGoiACABSQ0ACwwFCyAAIAFLBEAgACEBDAQLIARBAUcgACACa0EPSnINASAAIQMgAiEEA0AgAyAEEAwgBEEIaiEEIANBCGoiAyABSQ0ACwwCCwNAIAAgAhAHIAJBEGohAiAAQRBqIgAgAUkNAAsMAwsgACEDIAIhBANAIAMgBBAHIARBEGohBCADQRBqIgMgAUkNAAsLIAIgASAAa2ohAgsDQCABIAVPDQEgASACLQAAOgAAIAFBAWohASACQQFqIQIMAAALAAsLQQECfyAAIAAoArjgASIDNgLE4AEgACgCvOABIQQgACABNgK84AEgACABIAJqNgK44AEgACABIAQgA2tqNgLA4AELpgEBAX8gACAAKALs4QEQFjYCyOABIABCADcD+OABIABCADcDuOABIABBwOABakIANwMAIABBqNAAaiIBQYyAgOAANgIAIABBADYCmOIBIABCADcDiOEBIABCAzcDgOEBIABBrNABakHgEikCADcCACAAQbTQAWpB6BIoAgA2AgAgACABNgIMIAAgAEGYIGo2AgggACAAQaAwajYCBCAAIABBEGo2AgALYQEBf0G4fyEDAkAgAUEDSQ0AIAIgABAhIgFBA3YiADYCCCACIAFBAXE2AgQgAiABQQF2QQNxI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cgCGohCEEBIQwgBigCDCEDIAYoAgghBAwBCwsgBiADNgIMIAYgBDYCCEG4fyEHIAQNASAIIAFrIQcMAQsgBiADNgIMIAYgBDYCCAsgBkEQaiQAIAcLRgECfyABIAAoArjgASICRwRAIAAgAjYCxOABIAAgATYCuOABIAAoArzgASEDIAAgATYCvOABIAAgASADIAJrajYCwOABCwutAgIEfwF+IwBBQGoiBCQAAkACQCACQQhJDQAgASgAAEFwcUHQ1LTCAUcNACABIAIQIiEBIABCADcDCCAAQQA2AgQgACABNgIADAELIARBGGogASACEC0iAxADBEAgACADEBoMAQsgAwRAIABBuH8QGgwBCyACIAQoAjAiA2shAiABIANqIQMDQAJAIAAgAyACIARBCGoQLCIFEAMEfyAFBSACIAVBA2oiBU8NAUG4fwsQGgwCCyAGQQFqIQYgAiAFayECIAMgBWohAyAEKAIMRQ0ACyAEKAI4BEAgAkEDTQRAIABBuH8QGgwCCyADQQRqIQMLIAQoAighAiAEKQMYIQcgAEEANgIEIAAgAyABazYCACAAIAIgBmytIAcgB0J/URs3AwgLIARBQGskAAslAQF/IwBBEGsiAiQAIAIgACABEFEgAigCACEAIAJBEGokACAAC30BBH8jAEGQBGsiBCQAIARB/wE2AggCQCAEQRBqIARBCGogBEEMaiABIAIQFSIGEAMEQCAGIQUMAQtBVCEFIAQoAgwiB0EGSw0AIAMgBEEQaiAEKAIIIAcQQSIFEAMNACAAIAEgBmogAiAGayADEDwhBQsgBEGQBGokACAFC4cBAgJ/An5BABAWIQMCQANAIAEgA08EQAJAIAAoAABBcHFB0NS0wgFGBEAgACABECIiAhADRQ0BQn4PCyAAIAEQVSIEQn1WDQMgBCAFfCIFIARUIQJCfiEEIAINAyAAIAEQUiICEAMNAwsgASACayEBIAAgAmohAAwBCwtCfiAFIAEbIQQLIAQLPwIBfwF+IwBBMGsiAiQAAn5CfiACQQhqIAAgARAtDQAaQgAgAigCHEEBRg0AGiACKQMICyEDIAJBMGokACADC40BAQJ/IwBBMGsiASQAAkAgAEUNACAAKAKI4gENACABIABB/OEBaigCADYCKCABIAApAvThATcDICAAEDAgACgCqOIBIQIgASABKAIoNgIYIAEgASkDIDcDECACIAFBEGoQGyAAQQA2AqjiASABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALKgECfyMAQRBrIgAkACAAQQA2AgggAEIANwMAIAAQWCEBIABBEGokACABC4cBAQN/IwBBEGsiAiQAAkAgACgCAEUgACgCBEVzDQAgAiAAKAIINgIIIAIgACkCADcDAAJ/IAIoAgAiAQRAIAIoAghBqOMJIAERBQAMAQtBqOMJECgLIgFFDQAgASAAKQIANwL04QEgAUH84QFqIAAoAgg2AgAgARBZIAEhAwsgAkEQaiQAIAMLywEBAn8jAEEgayIBJAAgAEGBgIDAADYCtOIBIABBADYCiOIBIABBADYC7OEBIABCADcDkOIBIABBADYCpOMJIABBADYC3OIBIABCADcCzOIBIABBADYCvOIBIABBADYCxOABIABCADcCnOIBIABBpOIBakIANwIAIABBrOIBakEANgIAIAFCADcCECABQgA3AhggASABKQMYNwMIIAEgASkDEDcDACABKAIIQQh2QQFxIQIgAEEANgLg4gEgACACNgKM4gEgAUEgaiQAC3YBA38jAEEwayIBJAAgAARAIAEgAEHE0AFqIgIoAgA2AiggASAAKQK80AE3AyAgACgCACEDIAEgAigCADYCGCABIAApArzQATcDECADIAFBEGoQGyABIAEoAig2AgggASABKQMgNwMAIAAgARAbCyABQTBqJAALzAEBAX8gACABKAK00AE2ApjiASAAIAEoAgQiAjYCwOABIAAgAjYCvOABIAAgAiABKAIIaiICNgK44AEgACACNgLE4AEgASgCuNABBEAgAEKBgICAEDcDiOEBIAAgAUGk0ABqNgIMIAAgAUGUIGo2AgggACABQZwwajYCBCAAIAFBDGo2AgAgAEGs0AFqIAFBqNABaigCADYCACAAQbDQAWogAUGs0AFqKAIANgIAIABBtNABaiABQbDQAWooAgA2AgAPCyAAQgA3A4jhAQs7ACACRQRAQbp/DwsgBEUEQEFsDwsgAiAEEGAEQCAAIAEgAiADIAQgBRB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/HwAA/z8AAP9/AAD//wAA//8BAP//AwD//wcA//8PAP//HwD//z8A//9/AP///wD///8B////A////wf///8P////H////z////9/AAAAAAEAAAACAAAABAAAAAAAAAACAAAABAAAAAgAAAAAAAAAAQAAAAIAAAABAAAABAAAAAQAAAAEAAAABAAAAAgAAAAIAAAACAAAAAcAAAAIAAAACQAAAAoAAAALAEGgIAsDwBBQ",Gl=new class{init(){return Dl||(Dl="undefined"!=typeof fetch?fetch("data:application/wasm;base64,"+Sl).then((e=>e.arrayBuffer())).then((e=>WebAssembly.instantiate(e,xl))).then(this._init):WebAssembly.instantiate(Buffer.from(Sl,"base64"),xl).then(this._init),Dl)}_init(e){kl=e.instance,xl.env.emscripten_notify_memory_growth(0)}decode(e,t=0){if(!kl)throw new Error("ZSTDDecoder: Await .init() before decoding.");const A=e.byteLength,i=kl.exports.malloc(A);vl.set(e,i),t=t||Number(kl.exports.ZSTD_findDecompressedSize(i,A));const r=kl.exports.malloc(t),a=kl.exports.ZSTD_decompress(r,t,i,A),n=vl.slice(r,r+a);return kl.exports.free(i),kl.exports.free(r),n}};var Ul=Object.freeze({__proto__:null,default:class extends ya{constructor(e){super(),this.planarConfiguration=void 0!==e.PlanarConfiguration?e.PlanarConfiguration:1,this.samplesPerPixel=void 0!==e.SamplesPerPixel?e.SamplesPerPixel:1,this.addCompression=e.LercParameters[ia]}decodeBlock(e){switch(this.addCompression){case ra:break;case aa:e=ml(new Uint8Array(e)).buffer;break;case na:e=Gl.decode(new Uint8Array(e)).buffer;break;default:throw new Error(`Unsupported LERC additional compression method identifier: ${this.addCompression}`)}return bl.decode(e,{returnPixelInterleavedDims:1===this.planarConfiguration}).pixels[0].buffer}},zstd:Gl});var Fl=Object.freeze({__proto__:null,default:class extends ya{constructor(){if(super(),"undefined"==typeof createImageBitmap)throw new Error("Cannot decode WebImage as `createImageBitmap` is not available");if("undefined"==typeof document&&"undefined"==typeof OffscreenCanvas)throw new Error("Cannot decode WebImage as neither `document` nor `OffscreenCanvas` is not available")}async decode(e,t){const A=new Blob([t]),i=await createImageBitmap(A);let r;"undefined"!=typeof document?(r=document.createElement("canvas"),r.width=i.width,r.height=i.height):r=new OffscreenCanvas(i.width,i.height);const a=r.getContext("2d");return a.drawImage(i,0,0),a.getImageData(0,0,i.width,i.height).data.buffer}}});export{Ya as default};
|
|
6
6
|
//# sourceMappingURL=index.min.js.map
|