@bimdata/viewer 2.15.0-beta.6 → 2.15.0-beta.7

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.
@@ -1381,7 +1381,7 @@ Fragment shader:
1381
1381
  } catch (error) {
1382
1382
  console.error(error);
1383
1383
  throw error;
1384
- }`}function wde(t,e=!0,i){const r=i||new Set;if(t){if(Cde(t))r.add(t);else if(Cde(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&typeof t=="object")for(const o in t)wde(t[o],e,r)}return i===void 0?Array.from(r):[]}function Cde(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const IU=()=>{};class SU{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Ec||typeof BU<"u"&&!Ec}constructor(e){const{name:i,source:r,url:o}=e;Hh(r||o),this.name=i,this.source=r,this.url=o,this.onMessage=IU,this.onError=n=>console.log(n),this.worker=Ec?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=IU,this.onError=IU,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,i){i=i||wde(e),this.worker.postMessage(e,i)}_getErrorFromErrorEvent(e){let i="Failed to load ";return i+=`worker ${this.name} from ${this.url}. `,e.message&&(i+=`${e.message} in `),e.lineno&&(i+=`:${e.lineno}:${e.colno}`),new Error(i)}_createBrowserWorker(){this._loadableURL=Wqt({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=i=>{i.data?this.onMessage(i.data):this.onError(new Error("No data received"))},e.onerror=i=>{this.onError(this._getErrorFromErrorEvent(i)),this.terminated=!0},e.onmessageerror=i=>console.error(i),e}_createNodeWorker(){let e;if(this.url){const i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new BU(i,{eval:!1})}else if(this.source)e=new BU(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",i=>{this.onMessage(i)}),e.on("error",i=>{this.onError(i)}),e.on("exit",i=>{}),e}}class Xqt{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return SU.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,i=(o,n,s)=>o.done(s),r=(o,n)=>o.error(n)){const o=new Promise(n=>(this.jobQueue.push({name:e,onMessage:i,onError:r,onStart:n}),this));return this._startQueuedJob(),await o}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const i=this.jobQueue.shift();if(i){this.onDebug({message:"Starting job",name:i.name,workerThread:e,backlog:this.jobQueue.length});const r=new Kqt(i.name,e);e.onMessage=o=>i.onMessage(r,o.type,o.payload),e.onError=o=>i.onError(r,o),i.onStart(r);try{await r.result}catch(o){console.error(`Worker exception: ${o}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Ec||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new SU({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Qqt?this.maxMobileConcurrency:this.maxConcurrency}}const Yqt={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class b0{props;workerPools=new Map;static _workerFarm;static isSupported(){return SU.isSupported()}static getWorkerFarm(e={}){return b0._workerFarm=b0._workerFarm||new b0({}),b0._workerFarm.setProps(e),b0._workerFarm}constructor(e){this.props={...Yqt},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const i of this.workerPools.values())i.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:i,source:r,url:o}=e;let n=this.workerPools.get(i);return n||(n=new Xqt({name:i,source:r,url:o}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(i,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function $qt(t,e={}){const i=e[t.id]||{},r=Ec?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let o=i.workerUrl;if(!o&&t.id==="compression"&&(o=e.workerUrl),e._workerType==="test"&&(Ec?o=`modules/${t.module}/dist/${r}`:o=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!o){let n=t.version;n==="latest"&&(n=qqt);const s=n?`@${n}`:"";o=`https://unpkg.com/@loaders.gl/${t.module}${s}/dist/${r}`}return Hh(o),o}function eGt(t,e=vde){Hh(t,"no worker provided");const i=t.version;return!(!e||!i)}const TU={};async function Tf(t,e=null,i={},r=null){return e&&(t=tGt(t,e,i,r)),TU[t]=TU[t]||iGt(t),await TU[t]}function tGt(t,e,i={},r=null){if(!i.useLocalLibraries&&t.startsWith("http"))return t;r=r||t;const o=i.modules||{};return o[r]?o[r]:Ec?i.CDN?(Hh(i.CDN.startsWith("http")),`${i.CDN}/${e}@${vde}/dist/libs/${r}`):EU?`../src/libs/${r}`:`modules/${e}/src/libs/${r}`:`modules/${e}/dist/libs/${r}`}async function iGt(t){if(t.endsWith("wasm"))return await oGt(t);if(!Ec)try{const{requireFromFile:i}=globalThis.loaders||{};return await i?.(t)}catch(i){return console.error(i),null}if(EU)return importScripts(t);const e=await nGt(t);return rGt(e,t)}function rGt(t,e){if(!Ec){const{requireFromString:r}=globalThis.loaders||{};return r?.(t,e)}if(EU)return eval.call(globalThis,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch{i.text=t}return document.body.appendChild(i),null}async function oGt(t){const{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Ec||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function nGt(t){const{readFileAsText:e}=globalThis.loaders||{};return Ec||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function sGt(t,e){return!b0.isSupported()||!Ec&&!e?._nodeWorkers?!1:t.worker&&e?.worker}async function aGt(t,e,i,r,o){const n=t.id,s=$qt(t,i),a=b0.getWorkerFarm(i).getWorkerPool({name:n,url:s});i=JSON.parse(JSON.stringify(i)),r=JSON.parse(JSON.stringify(r||{}));const l=await a.startJob("process-on-worker",lGt.bind(null,o));return l.postMessage("process",{input:e,options:i,context:r}),await(await l.result).result}async function lGt(t,e,i,r){switch(i){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:o,input:n,options:s}=r;try{const a=await t(n,s);e.postMessage("done",{id:o,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:o,error:l})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function cGt(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?xde(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?xde(t,0,e):""}function xde(t,e,i){if(t.byteLength<=e+i)return"";const r=new DataView(t);let o="";for(let n=0;n<i;n++)o+=String.fromCharCode(r.getUint8(e+n));return o}function dGt(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${cGt(t)}"`)}}function uGt(t,e,i){if(i=i||t.byteLength,t.byteLength<i||e.byteLength<i)return!1;const r=new Uint8Array(t),o=new Uint8Array(e);for(let n=0;n<r.length;++n)if(r[n]!==o[n])return!1;return!0}function hGt(...t){return pGt(t)}function pGt(t){const e=t.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),i=e.reduce((n,s)=>n+s.byteLength,0),r=new Uint8Array(i);let o=0;for(const n of e)r.set(n,o),o+=n.byteLength;return r.buffer}function kde(t,e,i){const r=i!==void 0?new Uint8Array(t).subarray(e,e+i):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}function g7(t,e){return jh(t>=0),jh(e>0),t+(e-1)&-4}function fGt(t,e,i){let r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{const o=t.byteOffset,n=t.byteLength;r=new Uint8Array(t.buffer||t.arrayBuffer,o,n)}return e.set(r,i),i+g7(r.byteLength,4)}async function gGt(t){const e=[];for await(const i of t)e.push(i);return hGt(...e)}let AGt="";const Mde={};function mGt(t){for(const e in Mde)if(t.startsWith(e)){const i=Mde[e];t=t.replace(e,i)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${AGt}${t}`),t}function vGt(t){return t&&typeof t=="object"&&t.isBuffer}function Ede(t){if(vGt(t)||t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Bde(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function yGt(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const bGt=t=>typeof t=="boolean",A7=t=>typeof t=="function",m7=t=>t!==null&&typeof t=="object",Pde=t=>m7(t)&&t.constructor==={}.constructor,wGt=t=>!!t&&typeof t[Symbol.iterator]=="function",CGt=t=>t&&typeof t[Symbol.asyncIterator]=="function",Rf=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,TA=t=>typeof Blob<"u"&&t instanceof Blob,xGt=t=>t&&typeof t=="object"&&t.isBuffer,kGt=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||m7(t)&&A7(t.tee)&&A7(t.cancel)&&A7(t.getReader),MGt=t=>m7(t)&&A7(t.read)&&A7(t.pipe)&&bGt(t.readable),Ide=t=>kGt(t)||MGt(t);class EGt extends Error{constructor(e,i){super(e),this.reason=i.reason,this.url=i.url,this.response=i.response}reason;url;response}const BGt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,PGt=/^([-\w.]+\/[-\w.+]+)/;function Sde(t,e){return t.toLowerCase()===e.toLowerCase()}function IGt(t){const e=PGt.exec(t);return e?e[1]:t}function Tde(t){const e=BGt.exec(t);return e?e[1]:""}const Rde=/\?.*/;function SGt(t){const e=t.match(Rde);return e&&e[0]}function RU(t){return t.replace(Rde,"")}function TGt(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function ME(t){return Rf(t)?t.url:TA(t)?t.name||"":typeof t=="string"?t:""}function DU(t){if(Rf(t)){const e=t,i=e.headers.get("content-type")||"",r=RU(e.url);return IGt(i)||Tde(r)}return TA(t)?t.type||"":typeof t=="string"?Tde(t):""}function RGt(t){return Rf(t)?t.headers["content-length"]||-1:TA(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function Dde(t){if(Rf(t))return t;const e={},i=RGt(t);i>=0&&(e["content-length"]=String(i));const r=ME(t),o=DU(t);o&&(e["content-type"]=o);const n=await LGt(t);n&&(e["x-first-bytes"]=n),typeof t=="string"&&(t=new TextEncoder().encode(t));const s=new Response(t,{headers:e});return Object.defineProperty(s,"url",{value:r}),s}async function DGt(t){if(!t.ok)throw await _Gt(t)}async function _Gt(t){const e=TGt(t.url);let i=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;i=i.length>100?`${i.slice(0,100)}...`:i;const r={reason:t.statusText,url:t.url,response:t};try{const o=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&o?.includes("application/json")?await t.json():await t.text()}catch{}return new EGt(i,r)}async function LGt(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(i=>{const r=new FileReader;r.onload=o=>i(o?.target?.result),r.readAsDataURL(e)})}if(t instanceof ArrayBuffer){const e=t.slice(0,5);return`data:base64,${FGt(e)}`}return null}function FGt(t){let e="";const i=new Uint8Array(t);for(let r=0;r<i.byteLength;r++)e+=String.fromCharCode(i[r]);return btoa(e)}function OGt(t){return!UGt(t)&&!NGt(t)}function UGt(t){return t.startsWith("http:")||t.startsWith("https:")}function NGt(t){return t.startsWith("data:")}async function _de(t,e){if(typeof t=="string"){const i=mGt(t);return OGt(i)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(i,e):await fetch(i,e)}return await Dde(t)}const Lde=new kU({id:"loaders.gl"});class jGt{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class HGt{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const Fde={fetch:null,mimeType:void 0,nothrow:!1,log:new HGt,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:xE,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},zGt={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function Ode(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function Ude(){const t=Ode();return t.globalOptions=t.globalOptions||{...Fde},t.globalOptions}function VGt(t,e,i,r){return i=i||[],i=Array.isArray(i)?i:[i],qGt(t,i),QGt(e,t,r)}function qGt(t,e){Nde(t,null,Fde,zGt,e);for(const i of e){const r=t&&t[i.id]||{},o=i.options&&i.options[i.id]||{},n=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Nde(r,i.id,o,n,e)}}function Nde(t,e,i,r,o){const n=e||"Top level",s=e?`${e}.`:"";for(const a in t){const l=!e&&m7(t[a]),c=a==="baseUri"&&!e,d=a==="workerUrl"&&e;if(!(a in i)&&!c&&!d){if(a in r)Lde.warn(`${n} loader option '${s}${a}' no longer supported, use '${r[a]}'`)();else if(!l){const u=GGt(a,o);Lde.warn(`${n} loader option '${s}${a}' not recognized. ${u}`)()}}}}function GGt(t,e){const i=t.toLowerCase();let r="";for(const o of e)for(const n in o.options){if(t===n)return`Did you mean '${o.id}.${n}'?`;const s=n.toLowerCase();(i.startsWith(s)||s.startsWith(i))&&(r=r||`Did you mean '${o.id}.${n}'?`)}return r}function QGt(t,e,i){const r={...t.options||{}};return KGt(r,i),r.log===null&&(r.log=new jGt),jde(r,Ude()),jde(r,e),r}function jde(t,e){for(const i in e)if(i in e){const r=e[i];Pde(r)&&Pde(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}function KGt(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function Hde(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t?.extensions)):!1}function zde(t){jh(t,"null loader"),jh(Hde(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t?.parseTextSync||t?.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const WGt=()=>{const t=Ode();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function JGt(){return WGt()}const ZGt=/\.([^.]+)$/;async function XGt(t,e=[],i,r){if(!qde(t))return null;let o=Vde(t,e,{...i,nothrow:!0},r);if(o)return o;if(TA(t)&&(t=await t.slice(0,10).arrayBuffer(),o=Vde(t,e,i,r)),!o&&!i?.nothrow)throw new Error(Gde(t));return o}function Vde(t,e=[],i,r){if(!qde(t))return null;if(e&&!Array.isArray(e))return zde(e);let o=[];e&&(o=o.concat(e)),i?.ignoreRegisteredLoaders||o.push(...JGt()),$Gt(o);const n=YGt(t,o,i,r);if(!n&&!i?.nothrow)throw new Error(Gde(t));return n}function YGt(t,e,i,r){const o=ME(t),n=DU(t),s=RU(o)||r?.url;let a=null,l="";return i?.mimeType&&(a=_U(e,i?.mimeType),l=`match forced by supplied MIME type ${i?.mimeType}`),a=a||eQt(e,s),l=l||(a?`matched url ${s}`:""),a=a||_U(e,n),l=l||(a?`matched MIME type ${n}`:""),a=a||iQt(e,t),l=l||(a?`matched initial data ${Kde(t)}`:""),i?.fallbackMimeType&&(a=a||_U(e,i?.fallbackMimeType),l=l||(a?`matched fallback MIME type ${n}`:"")),l&&jqt.log(1,`selectLoader selected ${a?.name}: ${l}.`),a}function qde(t){return!(t instanceof Response&&t.status===204)}function Gde(t){const e=ME(t),i=DU(t);let r="No valid loader found (";r+=e?`${Bde(e)}, `:"no url provided, ",r+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const o=t?Kde(t):"";return r+=o?` first bytes: "${o}"`:"first bytes: not available",r+=")",r}function $Gt(t){for(const e of t)zde(e)}function eQt(t,e){const i=e&&ZGt.exec(e),r=i&&i[1];return r?tQt(t,r):null}function tQt(t,e){e=e.toLowerCase();for(const i of t)for(const r of i.extensions)if(r.toLowerCase()===e)return i;return null}function _U(t,e){for(const i of t)if(i.mimeTypes?.some(r=>Sde(e,r))||Sde(e,`application/x.${i.id}`))return i;return null}function iQt(t,e){if(!e)return null;for(const i of t)if(typeof e=="string"){if(rQt(e,i))return i}else if(ArrayBuffer.isView(e)){if(Qde(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer&&Qde(e,0,i))return i;return null}function rQt(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>t.startsWith(i))}function Qde(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(r=>oQt(t,e,i,r))}function oQt(t,e,i,r){if(r instanceof ArrayBuffer)return uGt(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const o=LU(t,e,r.length);return r===o;default:return!1}}function Kde(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?LU(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?LU(t,0,e):""}function LU(t,e,i){if(t.byteLength<e+i)return"";const r=new DataView(t);let o="";for(let n=0;n<i;n++)o+=String.fromCharCode(r.getUint8(e+n));return o}const nQt=256*1024;function*sQt(t,e){const i=e?.chunkSize||nQt;let r=0;const o=new TextEncoder;for(;r<t.length;){const n=Math.min(t.length-r,i),s=t.slice(r,r+n);r+=n,yield o.encode(s)}}const aQt=256*1024;function*lQt(t,e={}){const{chunkSize:i=aQt}=e;let r=0;for(;r<t.byteLength;){const o=Math.min(t.byteLength-r,i),n=new ArrayBuffer(o),s=new Uint8Array(t,r,o);new Uint8Array(n).set(s),r+=o,yield n}}const cQt=1024*1024;async function*dQt(t,e){const i=e?.chunkSize||cQt;let r=0;for(;r<t.size;){const o=r+i,n=await t.slice(r,o).arrayBuffer();r=o,yield n}}function Wde(t,e){return xE?uQt(t,e):hQt(t)}async function*uQt(t,e){const i=t.getReader();let r;try{for(;;){const o=r||i.read();e?._streamReadAhead&&(r=i.read());const{done:n,value:s}=await o;if(n)return;yield Ede(s)}}catch{i.releaseLock()}}async function*hQt(t,e){for await(const i of t)yield Ede(i)}function pQt(t,e){if(typeof t=="string")return sQt(t,e);if(t instanceof ArrayBuffer)return lQt(t,e);if(TA(t))return dQt(t,e);if(Ide(t))return Wde(t,e);if(Rf(t))return Wde(t.body,e);throw new Error("makeIterator")}const Jde="Cannot convert supplied data type";function fQt(t,e,i){if(e.text&&typeof t=="string")return t;if(xGt(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let r=t.buffer;const o=t.byteLength||t.length;return(t.byteOffset!==0||o!==r.byteLength)&&(r=r.slice(t.byteOffset,t.byteOffset+o)),r}throw new Error(Jde)}async function gQt(t,e,i){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if(typeof t=="string"||r)return fQt(t,e);if(TA(t)&&(t=await Dde(t)),Rf(t)){const o=t;return await DGt(o),e.binary?await o.arrayBuffer():await o.text()}if(Ide(t)&&(t=pQt(t,i)),wGt(t)||CGt(t))return gGt(t);throw new Error(Jde)}function AQt(t,e){const i=Ude(),r=t||i;return typeof r.fetch=="function"?r.fetch:m7(r.fetch)?o=>_de(o,r.fetch):e?.fetch?e?.fetch:_de}function mQt(t,e,i){if(i)return i;const r={fetch:AQt(e,t),...t};if(r.url){const o=RU(r.url);r.baseUrl=o,r.queryString=SGt(r.url),r.filename=Bde(o),r.baseUrl=yGt(o)}return Array.isArray(r.loaders)||(r.loaders=null),r}function vQt(t,e){if(t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...r]:r}return i&&i.length?i:void 0}async function FU(t,e,i,r){e&&!Array.isArray(e)&&!Hde(e)&&(r=void 0,i=e,e=void 0),t=await t,i=i||{};const o=ME(t),n=vQt(e,r),s=await XGt(t,n,i);return s?(i=VGt(i,s,n,o),r=mQt({url:o,_parse:FU,loaders:n},i,r||null),await yQt(s,t,i,r)):null}async function yQt(t,e,i,r){if(eGt(t),i=Hqt(t.options,i),Rf(e)){const n=e,{ok:s,redirected:a,status:l,statusText:c,type:d,url:u}=n,h=Object.fromEntries(n.headers.entries());r.response={headers:h,ok:s,redirected:a,status:l,statusText:c,type:d,url:u}}e=await gQt(e,t,i);const o=t;if(o.parseTextSync&&typeof e=="string")return o.parseTextSync(e,i,r);if(sGt(t,i))return await aGt(t,e,i,r,FU);if(o.parseText&&typeof e=="string")return await o.parseText(e,i,r);if(o.parse)return await o.parse(e,i,r);throw Hh(!o.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}function bQt(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function wQt(t){let e=1/0,i=1/0,r=1/0,o=-1/0,n=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const d=a[c],u=a[c+1],h=a[c+2];e=d<e?d:e,i=u<i?u:i,r=h<r?h:r,o=d>o?d:o,n=u>n?u:n,s=h>s?h:s}return[[e,i,r],[o,n,s]]}function CQt(t,e,i){const r=bQt(e.value),o=i||xQt(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:r}]},nullable:!1,metadata:o}}function xQt(t){const e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}const kQt="4.3.3",MQt=globalThis.loaders?.parseImageNode,OU=typeof Image<"u",UU=typeof ImageBitmap<"u",EQt=!!MQt,NU=xE?!0:EQt;function BQt(t){switch(t){case"auto":return UU||OU||NU;case"imagebitmap":return UU;case"image":return OU;case"data":return NU;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function PQt(){if(UU)return"imagebitmap";if(OU)return"image";if(NU)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function IQt(t){const e=SQt(t);if(!e)throw new Error("Not an image");return e}function Zde(t){switch(IQt(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function SQt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const TQt=/^data:image\/svg\+xml/,RQt=/\.svg((\?|#).*)?$/;function jU(t){return t&&(TQt.test(t)||RQt.test(t))}function DQt(t,e){if(jU(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(r){throw new Error(r.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Xde(t,e)}function Xde(t,e){if(jU(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Yde(t,e,i){const r=DQt(t,i),o=self.URL||self.webkitURL,n=typeof r!="string"&&o.createObjectURL(r);try{return await _Qt(n||r,e)}finally{n&&o.revokeObjectURL(n)}}async function _Qt(t,e){const i=new Image;return i.src=t,e.image&&e.image.decode&&i.decode?(await i.decode(),i):await new Promise((r,o)=>{try{i.onload=()=>r(i),i.onerror=n=>{const s=n instanceof Error?n.message:"error";o(new Error(s))}}catch(n){o(n)}})}const LQt={};let $de=!0;async function FQt(t,e,i){let r;jU(i)?r=await Yde(t,e,i):r=Xde(t,i);const o=e&&e.imagebitmap;return await OQt(r,o)}async function OQt(t,e=null){if((UQt(e)||!$de)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),$de=!1}return await createImageBitmap(t)}function UQt(t){for(const e in t||LQt)return!1;return!0}function NQt(t){return!VQt(t,"ftyp",4)||(t[8]&96)===0?null:jQt(t)}function jQt(t){switch(HQt(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function HQt(t,e,i){return String.fromCharCode(...t.slice(e,i))}function zQt(t){return[...t].map(e=>e.charCodeAt(0))}function VQt(t,e,i=0){const r=zQt(e);for(let o=0;o<r.length;++o)if(r[o]!==t[o+i])return!1;return!0}const wu=!1,v7=!0;function HU(t){const e=y7(t);return GQt(e)||WQt(e)||QQt(e)||KQt(e)||qQt(e)}function qQt(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),i=NQt(e);return i?{mimeType:i.mimeType,width:0,height:0}:null}function GQt(t){const e=y7(t);return e.byteLength>=24&&e.getUint32(0,wu)===2303741511?{mimeType:"image/png",width:e.getUint32(16,wu),height:e.getUint32(20,wu)}:null}function QQt(t){const e=y7(t);return e.byteLength>=10&&e.getUint32(0,wu)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,v7),height:e.getUint16(8,v7)}:null}function KQt(t){const e=y7(t);return e.byteLength>=14&&e.getUint16(0,wu)===16973&&e.getUint32(2,v7)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,v7),height:e.getUint32(22,v7)}:null}function WQt(t){const e=y7(t);if(!(e.byteLength>=3&&e.getUint16(0,wu)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:i,sofMarkers:r}=JQt();let o=2;for(;o+9<e.byteLength;){const n=e.getUint16(o,wu);if(r.has(n))return{mimeType:"image/jpeg",height:e.getUint16(o+5,wu),width:e.getUint16(o+7,wu)};if(!i.has(n))return null;o+=2,o+=e.getUint16(o,wu)}return null}function JQt(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function y7(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function ZQt(t,e){const{mimeType:i}=HU(t)||{},r=globalThis.loaders?.parseImageNode;return jh(r),await r(t,i)}async function XQt(t,e,i){e=e||{};const r=(e.image||{}).type||"auto",{url:o}=i||{},n=YQt(r);let s;switch(n){case"imagebitmap":s=await FQt(t,e,o);break;case"image":s=await Yde(t,e,o);break;case"data":s=await ZQt(t);break;default:jh(!1)}return r==="data"&&(s=Zde(s)),s}function YQt(t){switch(t){case"auto":case"data":return PQt();default:return BQt(t),t}}const $Qt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],eKt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],tKt={image:{type:"auto",decode:!0}},iKt={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:kQt,mimeTypes:eKt,extensions:$Qt,parse:XQt,tests:[t=>!!HU(new DataView(t))],options:tKt},zU={};function rKt(t){if(zU[t]===void 0){const e=xE?nKt(t):oKt(t);zU[t]=e}return zU[t]}function oKt(t){const e=["image/png","image/jpeg","image/gif"],i=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&i.includes(t)}function nKt(t){switch(t){case"image/avif":case"image/webp":return sKt(t);default:return!0}}function sKt(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function Gl(t,e){if(!t)throw new Error(e||"assert failed: gltf")}const eue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tue={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},iue=["SCALAR","VEC2","VEC3","VEC4"],aKt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],lKt=new Map(aKt),cKt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},dKt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uKt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function rue(t){return iue[t-1]||iue[0]}function EE(t){const e=lKt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function VU(t,e){const i=uKt[t.componentType],r=cKt[t.type],o=dKt[t.componentType],n=t.count*r,s=t.count*r*o;Gl(s>=0&&s<=e.byteLength);const a=tue[t.componentType],l=eue[t.type];return{ArrayType:i,length:n,byteLength:s,componentByteSize:a,numberOfComponentsInElement:l}}function hKt(t,e,i){const r=t.bufferViews[i];Gl(r);const o=r.buffer,n=e[o];Gl(n);const s=(r.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,r.byteLength)}function pKt(t,e,i){const r=typeof i=="number"?t.accessors?.[i]:i;if(!r)throw new Error(`No gltf accessor ${JSON.stringify(i)}`);const o=t.bufferViews?.[r.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);const{arrayBuffer:n,byteOffset:s}=e[o.buffer],a=(s||0)+(r.byteOffset||0)+(o.byteOffset||0),{ArrayType:l,length:c,componentByteSize:d,numberOfComponentsInElement:u}=VU(r,o),h=d*u,p=o.byteStride||h;if(typeof o.byteStride>"u"||o.byteStride===h)return new l(n,a,c);const g=new l(c);for(let f=0;f<r.count;f++){const m=new l(n,a+f*p,u);g.set(m,f*u)}return g}function fKt(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}class os{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||fKt(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){const i=this.getUsedExtensions().find(o=>o===e),r=this.getRequiredExtensions().find(o=>o===e);return typeof i=="string"||typeof r=="string"}getExtension(e){const i=this.getUsedExtensions().find(o=>o===e),r=this.json.extensions||{};return i?r[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,i){return(e.extensions||{})[i]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,i){if(typeof i=="object")return i;const r=this.json[e]&&this.json[e][i];if(!r)throw new Error(`glTF file error: Could not find ${e}[${i}]`);return r}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=e.buffer,r=this.gltf.buffers[i];Gl(r);const o=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){const i=this.getAccessor(e);return pKt(this.gltf.json,this.gltf.buffers,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const i=this.getBufferView(e.bufferView),r=this.getBuffer(i.buffer).data,o=i.byteOffset||0;return new Uint8Array(r,o,i.byteLength)}addApplicationData(e,i){return this.json[e]=i,this}addExtraData(e,i){return this.json.extras=this.json.extras||{},this.json.extras[e]=i,this}addObjectExtension(e,i,r){return e.extensions=e.extensions||{},e.extensions[i]=r,this.registerUsedExtension(i),this}setObjectExtension(e,i,r){const o=e.extensions||{};o[i]=r}removeObjectExtension(e,i){const r=e?.extensions||{};if(r[i]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const o=this.json.extensionsRemoved;o.includes(i)||o.push(i)}delete r[i]}addExtension(e,i={}){return Gl(i),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=i,this.registerUsedExtension(e),i}addRequiredExtension(e,i={}){return Gl(i),this.addExtension(e,i),this.registerRequiredExtension(e),i}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(i=>i===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(i=>i===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const i=this.json.extensionsRemoved;i.includes(e)||i.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:i}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:i}),this.json.scenes.length-1}addNode(e){const{meshIndex:i,matrix:r}=e;this.json.nodes=this.json.nodes||[];const o={mesh:i};return r&&(o.matrix=r),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){const{attributes:i,indices:r,material:o,mode:n=4}=e,s={primitives:[{attributes:this._addAttributes(i),mode:n}]};if(r){const a=this._addIndices(r);s.primitives[0].indices=a}return Number.isFinite(o)&&(s.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,i){const r=HU(e),o=i||r?.mimeType,n={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(n),this.json.images.length-1}addBufferView(e,i=0,r=this.byteLength){const o=e.byteLength;Gl(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const n={buffer:i,byteOffset:r,byteLength:o};return this.byteLength+=g7(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(e,i){const r={bufferView:e,type:rue(i.size),componentType:i.componentType,count:i.count,max:i.max,min:i.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,i={size:3}){const r=this.addBufferView(e);let o={min:i.min,max:i.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,i.size));const n={size:i.size,componentType:EE(e),count:Math.round(e.length/i.size),min:o.min,max:o.max};return this.addAccessor(r,Object.assign(n,i))}addTexture(e){const{imageIndex:i}=e,r={source:i};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){const e=this.byteLength,i=new ArrayBuffer(e),r=new Uint8Array(i);let o=0;for(const n of this.sourceBuffers||[])o=fGt(n,r,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=i,this.sourceBuffers=[i],this.gltf.buffers=[{arrayBuffer:i,byteOffset:0,byteLength:i.byteLength}]}_removeStringFromArray(e,i){let r=!0;for(;r;){const o=e.indexOf(i);o>-1?e.splice(o,1):r=!1}}_addAttributes(e={}){const i={};for(const r in e){const o=e[r],n=this._getGltfAttributeName(r),s=this.addBinaryBuffer(o.value,o);i[n]=s}return i}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,i){const r={min:null,max:null};if(e.length<i)return r;r.min=[],r.max=[];const o=e.subarray(0,i);for(const n of o)r.min.push(n),r.max.push(n);for(let n=i;n<e.length;n+=i)for(let s=0;s<i;s++)r.min[0+s]=Math.min(r.min[0+s],e[n+s]),r.max[0+s]=Math.max(r.max[0+s],e[n+s]);return r}}function oue(t){return(t%1+1)%1}const nue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},gKt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},sue={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function qU(t,e){return sue[e]*nue[t]}function BE(t,e,i,r){if(i!=="UINT8"&&i!=="UINT16"&&i!=="UINT32"&&i!=="UINT64")return null;const o=t.getTypedArrayForBufferView(e),n=PE(o,"SCALAR",i,r+1);return n instanceof BigInt64Array||n instanceof BigUint64Array?null:n}function PE(t,e,i,r=1){const o=nue[e],n=gKt[i],s=sue[i],a=r*o,l=a*s;let c=t.buffer,d=t.byteOffset;return d%s!==0&&(c=new Uint8Array(c).slice(d,d+l).buffer,d=0),new n(c,d,a)}function GU(t,e,i){const r=`TEXCOORD_${e.texCoord||0}`,o=i.attributes[r],n=t.getTypedArrayForAccessor(o),s=t.gltf.json,a=e.index,l=s.textures?.[a]?.source;if(typeof l<"u"){const c=s.images?.[l]?.mimeType,d=t.gltf.images?.[l];if(d&&typeof d.width<"u"){const u=[];for(let h=0;h<n.length;h+=2){const p=AKt(d,c,n,h,e.channels);u.push(p)}return u}}return[]}function aue(t,e,i,r,o){if(!i?.length)return;const n=[];for(const d of i){let u=r.findIndex(h=>h===d);u===-1&&(u=r.push(d)-1),n.push(u)}const s=new Uint32Array(n),a=t.gltf.buffers.push({arrayBuffer:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength})-1,l=t.addBufferView(s,a,0),c=t.addAccessor(l,{size:1,componentType:EE(s),count:s.length});o.attributes[e]=c}function AKt(t,e,i,r,o=[0]){const n={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},s=i[r],a=i[r+1];let l=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(l=4);const c=mKt(s,a,t,l);let d=0;for(const u of o){const h=typeof u=="number"?Object.values(n)[u]:n[u],p=c+h.offset,g=Zde(t);if(g.data.length<=p)throw new Error(`${g.data.length} <= ${p}`);const f=g.data[p];d|=f<<h.shift}return d}function mKt(t,e,i,r=1){const o=i.width,n=oue(t)*(o-1),s=Math.round(n),a=i.height,l=oue(e)*(a-1),c=Math.round(l),d=i.components?i.components:r;return(c*o+s)*d}function lue(t,e,i,r,o){const n=[];for(let s=0;s<e;s++){const a=i[s],l=i[s+1]-i[s];if(l+a>r)break;const c=a/o,d=l/o;n.push(t.slice(c,c+d))}return n}function cue(t,e,i){const r=[];for(let o=0;o<e;o++){const n=o*i;r.push(t.slice(n,n+i))}return r}function due(t,e,i,r){if(i)throw new Error("Not implemented - arrayOffsets for strings is specified");if(r){const o=[],n=new TextDecoder("utf8");let s=0;for(let a=0;a<t;a++){const l=r[a+1]-r[a];if(l+s<=e.length){const c=e.subarray(s,l+s),d=n.decode(c);o.push(d),s+=l}}return o}return[]}const RA="EXT_mesh_features",vKt=RA;async function yKt(t,e){const i=new os(t);wKt(i,e)}function bKt(t,e){const i=new os(t);return xKt(i),i.createBinaryChunk(),i.gltf}function wKt(t,e){const i=t.gltf.json;if(i.meshes)for(const r of i.meshes)for(const o of r.primitives)CKt(t,o,e)}function CKt(t,e,i){if(!i?.gltf?.loadBuffers)return;const r=e.extensions?.[RA]?.featureIds;if(r)for(const o of r){let n;if(typeof o.attribute<"u"){const s=`_FEATURE_ID_${o.attribute}`,a=e.attributes[s];n=t.getTypedArrayForAccessor(a)}else typeof o.texture<"u"&&i?.gltf?.loadImages?n=GU(t,o.texture,e):n=[];o.data=n}}function xKt(t,e){const i=t.gltf.json.meshes;if(i)for(const r of i)for(const o of r.primitives)MKt(t,o)}function kKt(t,e,i,r){e.extensions||(e.extensions={});let o=e.extensions[RA];o||(o={featureIds:[]},e.extensions[RA]=o);const{featureIds:n}=o,s={featureCount:i.length,propertyTable:r,data:i};n.push(s),t.addObjectExtension(e,RA,o)}function MKt(t,e){const i=e.extensions?.[RA];if(!i)return;const r=i.featureIds;r.forEach((o,n)=>{if(o.data){const{accessorKey:s,index:a}=EKt(e.attributes),l=new Uint32Array(o.data);r[n]={featureCount:l.length,propertyTable:o.propertyTable,attribute:a},t.gltf.buffers.push({arrayBuffer:l.buffer,byteOffset:l.byteOffset,byteLength:l.byteLength});const c=t.addBufferView(l),d=t.addAccessor(c,{size:1,componentType:EE(l),count:l.length});e.attributes[s]=d}})}function EKt(t){const e="_FEATURE_ID_",i=Object.keys(t).filter(o=>o.indexOf(e)===0);let r=-1;for(const o of i){const n=Number(o.substring(e.length));n>r&&(r=n)}return r++,{accessorKey:`${e}${r}`,index:r}}const BKt=Object.freeze(Object.defineProperty({__proto__:null,createExtMeshFeatures:kKt,decode:yKt,encode:bKt,name:vKt},Symbol.toStringTag,{value:"Module"})),DA="EXT_structural_metadata",PKt=DA;async function IKt(t,e){const i=new os(t);TKt(i,e)}function SKt(t,e){const i=new os(t);return KKt(i),i.createBinaryChunk(),i.gltf}function TKt(t,e){if(!e.gltf?.loadBuffers)return;const i=t.getExtension(DA);i&&(e.gltf?.loadImages&&RKt(t,i),DKt(t,i))}function RKt(t,e){const i=e.propertyTextures,r=t.gltf.json;if(i&&r.meshes)for(const o of r.meshes)for(const n of o.primitives)LKt(t,i,n,e)}function DKt(t,e){const i=e.schema;if(!i)return;const r=i.classes,o=e.propertyTables;if(r&&o)for(const n in r){const s=_Kt(o,n);s&&OKt(t,i,s)}}function _Kt(t,e){for(const i of t)if(i.class===e)return i;return null}function LKt(t,e,i,r){if(!e)return;const o=i.extensions?.[DA]?.propertyTextures;if(o)for(const n of o){const s=e[n];FKt(t,s,i,r)}}function FKt(t,e,i,r){if(!e.properties)return;r.dataAttributeNames||(r.dataAttributeNames=[]);const o=e.class;for(const n in e.properties){const s=`${o}_${n}`,a=e.properties?.[n];if(!a)continue;a.data||(a.data=[]);const l=a.data,c=GU(t,a,i);c!==null&&(aue(t,s,c,l,i),a.data=l,r.dataAttributeNames.push(s))}}function OKt(t,e,i){const r=e.classes?.[i.class];if(!r)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${i.class}`);const o=i.count;for(const n in r.properties){const s=r.properties[n],a=i.properties?.[n];if(a){const l=UKt(t,e,s,o,a);a.data=l}}}function UKt(t,e,i,r,o){let n=[];const s=o.values,a=t.getTypedArrayForBufferView(s),l=NKt(t,i,o,r),c=jKt(t,o,r);switch(i.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{n=HKt(i,r,a,l);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${i.type}`);case"STRING":{n=due(r,a,l,c);break}case"ENUM":{n=zKt(e,i,r,a,l);break}default:throw new Error(`Unknown classProperty type ${i.type}`)}return n}function NKt(t,e,i,r){return e.array&&typeof e.count>"u"&&typeof i.arrayOffsets<"u"?BE(t,i.arrayOffsets,i.arrayOffsetType||"UINT32",r):null}function jKt(t,e,i){return typeof e.stringOffsets<"u"?BE(t,e.stringOffsets,e.stringOffsetType||"UINT32",i):null}function HKt(t,e,i,r){const o=t.array,n=t.count,s=qU(t.type,t.componentType),a=i.byteLength/s;let l;return t.componentType?l=PE(i,t.type,t.componentType,a):l=i,o?r?lue(l,e,r,i.length,s):n?cue(l,e,n):[]:l}function zKt(t,e,i,r,o){const n=e.enumType;if(!n)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");const s=t.enums?.[n];if(!s)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${n}`);const a=s.valueType||"UINT16",l=qU(e.type,a),c=r.byteLength/l;let d=PE(r,e.type,a,c);if(d||(d=r),e.array){if(o)return VKt({valuesData:d,numberOfElements:i,arrayOffsets:o,valuesDataBytesLength:r.length,elementSize:l,enumEntry:s});const u=e.count;return u?qKt(d,i,u,s):[]}return QU(d,0,i,s)}function VKt(t){const{valuesData:e,numberOfElements:i,arrayOffsets:r,valuesDataBytesLength:o,elementSize:n,enumEntry:s}=t,a=[];for(let l=0;l<i;l++){const c=r[l],d=r[l+1]-r[l];if(d+c>o)break;const u=c/n,h=d/n,p=QU(e,u,h,s);a.push(p)}return a}function qKt(t,e,i,r){const o=[];for(let n=0;n<e;n++){const s=i*n,a=QU(t,s,i,r);o.push(a)}return o}function QU(t,e,i,r){const o=[];for(let n=0;n<i;n++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{const s=t[e+n],a=GKt(r,s);a?o.push(a.name):o.push("")}return o}function GKt(t,e){for(const i of t.values)if(i.value===e)return i;return null}const QKt="schemaClassId";function KKt(t,e){const i=t.getExtension(DA);if(i&&i.propertyTables)for(const r of i.propertyTables){const o=r.class,n=i.schema?.classes?.[o];r.properties&&n&&WKt(r,n,t)}}function WKt(t,e,i){for(const r in t.properties){const o=t.properties[r].data;if(o){const n=e.properties[r];if(n){const s=YKt(o,n,i);t.properties[r]=s}}}}function JKt(t,e,i=QKt){let r=t.getExtension(DA);r||(r=t.addExtension(DA)),r.schema=ZKt(e,i,r.schema);const o=XKt(e,i,r.schema);return r.propertyTables||(r.propertyTables=[]),r.propertyTables.push(o)-1}function ZKt(t,e,i){const r=i??{id:"schema_id"},o={properties:{}};for(const n of t){const s={type:n.elementType,componentType:n.componentType};o.properties[n.name]=s}return r.classes={},r.classes[e]=o,r}function XKt(t,e,i){const r={class:e,count:0};let o=0;const n=i.classes?.[e];for(const s of t){if(o===0&&(o=s.values.length),o!==s.values.length&&s.values.length)throw new Error("Illegal values in attributes");n?.properties[s.name]&&(r.properties||(r.properties={}),r.properties[s.name]={values:0,data:s.values})}return r.count=o,r}function YKt(t,e,i){const r={values:0};if(e.type==="STRING"){const{stringData:o,stringOffsets:n}=tWt(t);r.stringOffsets=KU(n,i),r.values=KU(o,i)}else if(e.type==="SCALAR"&&e.componentType){const o=eWt(t,e.componentType);r.values=KU(o,i)}return r}const $Kt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function eWt(t,e){const i=[];for(const o of t)i.push(Number(o));const r=$Kt[e];if(!r)throw new Error("Illegal component type");return new r(i)}function tWt(t){const e=new TextEncoder,i=[];let r=0;for(const l of t){const c=e.encode(l);r+=c.length,i.push(c)}const o=new Uint8Array(r),n=[];let s=0;for(const l of i)o.set(l,s),n.push(s),s+=l.length;n.push(s);const a=new Uint32Array(n);return{stringData:o,stringOffsets:a}}function KU(t,e){return e.gltf.buffers.push({arrayBuffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}),e.addBufferView(t)}const iWt=Object.freeze(Object.defineProperty({__proto__:null,createExtStructuralMetadata:JKt,decode:IKt,encode:SKt,name:PKt},Symbol.toStringTag,{value:"Module"})),uue="EXT_feature_metadata",rWt=uue;async function oWt(t,e){const i=new os(t);nWt(i,e)}function nWt(t,e){if(!e.gltf?.loadBuffers)return;const i=t.getExtension(uue);i&&(e.gltf?.loadImages&&sWt(t,i),aWt(t,i))}function sWt(t,e){const i=e.schema;if(!i)return;const r=i.classes,{featureTextures:o}=e;if(r&&o)for(const n in r){const s=r[n],a=cWt(o,n);a&&uWt(t,a,s)}}function aWt(t,e){const i=e.schema;if(!i)return;const r=i.classes,o=e.featureTables;if(r&&o)for(const n in r){const s=lWt(o,n);s&&dWt(t,i,s)}}function lWt(t,e){for(const i in t){const r=t[i];if(r.class===e)return r}return null}function cWt(t,e){for(const i in t){const r=t[i];if(r.class===e)return r}return null}function dWt(t,e,i){if(!i.class)return;const r=e.classes?.[i.class];if(!r)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${i.class}`);const o=i.count;for(const n in r.properties){const s=r.properties[n],a=i.properties?.[n];if(a){const l=hWt(t,e,s,o,a);a.data=l}}}function uWt(t,e,i){const r=e.class;for(const o in i.properties){const n=e?.properties?.[o];if(n){const s=mWt(t,n,r);n.data=s}}}function hWt(t,e,i,r,o){let n=[];const s=o.bufferView,a=t.getTypedArrayForBufferView(s),l=pWt(t,i,o,r),c=fWt(t,i,o,r);return i.type==="STRING"||i.componentType==="STRING"?n=due(r,a,l,c):gWt(i)&&(n=AWt(i,r,a,l)),n}function pWt(t,e,i,r){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof i.arrayOffsetBufferView<"u"?BE(t,i.arrayOffsetBufferView,i.offsetType||"UINT32",r):null}function fWt(t,e,i,r){return typeof i.stringOffsetBufferView<"u"?BE(t,i.stringOffsetBufferView,i.offsetType||"UINT32",r):null}function gWt(t){const e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function AWt(t,e,i,r){const o=t.type==="ARRAY",n=t.componentCount,s="SCALAR",a=t.componentType||t.type,l=qU(s,a),c=i.byteLength/l,d=PE(i,s,a,c);return o?r?lue(d,e,r,i.length,l):n?cue(d,e,n):[]:d}function mWt(t,e,i){const r=t.gltf.json;if(!r.meshes)return[];const o=[];for(const n of r.meshes)for(const s of n.primitives)vWt(t,i,e,o,s);return o}function vWt(t,e,i,r,o){const n={channels:i.channels,...i.texture},s=GU(t,n,o);s&&aue(t,e,s,r,o)}const yWt=Object.freeze(Object.defineProperty({__proto__:null,decode:oWt,name:rWt},Symbol.toStringTag,{value:"Module"})),bWt="4.3.3",wWt="4.3.3",IE={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"};let hue;async function pue(t){return zqt(t.modules),Vqt("basis")||(hue||=CWt(t),await hue)}async function CWt(t){let e=null,i=null;return[e,i]=await Promise.all([await Tf(IE.TRANSCODER,"textures",t),await Tf(IE.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await xWt(e,i)}function xWt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t(i).then(o=>{const{BasisFile:n,initializeBasis:s}=o;s(),r({BasisFile:n})})})}let WU;async function fue(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(WU=WU||kWt(t),await WU)}async function kWt(t){let e=null,i=null;return[e,i]=await Promise.all([await Tf(IE.ENCODER,"textures",t),await Tf(IE.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await MWt(e,i)}function MWt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t(i).then(o=>{const{BasisFile:n,KTX2File:s,initializeBasis:a,BasisEncoder:l}=o;a(),r({BasisFile:n,KTX2File:s,BasisEncoder:l})})})}const _A={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_ASTC_4X4_KHR:37808},EWt=["","WEBKIT_","MOZ_"],gue={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let SE=null;function BWt(t){if(!SE){t=t||PWt()||void 0,SE=new Set;for(const e of EWt)for(const i in gue)if(t&&t.getExtension(`${e}${i}`)){const r=gue[i];SE.add(r)}}return SE}function PWt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}const Ql=[171,75,84,88,32,50,48,187,13,10,26,10];function IWt(t){const e=new Uint8Array(t);return!(e.byteLength<Ql.length||e[0]!==Ql[0]||e[1]!==Ql[1]||e[2]!==Ql[2]||e[3]!==Ql[3]||e[4]!==Ql[4]||e[5]!==Ql[5]||e[6]!==Ql[6]||e[7]!==Ql[7]||e[8]!==Ql[8]||e[9]!==Ql[9]||e[10]!==Ql[10]||e[11]!==Ql[11])}const SWt={etc1:{basisFormat:0,compressed:!0,format:_A.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:_A.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:_A.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:_A.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:_A.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:_A.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function TWt(t,e){if(e.basis.containerFormat==="auto"){if(IWt(t)){const r=await fue(e);return Aue(r.KTX2File,t,e)}const{BasisFile:i}=await pue(e);return JU(i,t,e)}switch(e.basis.module){case"encoder":const i=await fue(e);switch(e.basis.containerFormat){case"ktx2":return Aue(i.KTX2File,t,e);case"basis":default:return JU(i.BasisFile,t,e)}case"transcoder":default:const{BasisFile:r}=await pue(e);return JU(r,t,e)}}function JU(t,e,i){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("Failed to start basis transcoding");const o=r.getNumImages(),n=[];for(let s=0;s<o;s++){const a=r.getNumLevels(s),l=[];for(let c=0;c<a;c++)l.push(RWt(r,s,c,i));n.push(l)}return n}finally{r.close(),r.delete()}}function RWt(t,e,i,r){const o=t.getImageWidth(e,i),n=t.getImageHeight(e,i),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=mue(r,s),d=t.getImageTranscodedSizeInBytes(e,i,c),u=new Uint8Array(d);if(!t.transcodeImage(u,e,i,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:n,data:u,compressed:a,format:l,hasAlpha:s}}function Aue(t,e,i){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("failed to start KTX2 transcoding");const o=r.getLevels(),n=[];for(let s=0;s<o;s++)n.push(DWt(r,s,i));return[n]}finally{r.close(),r.delete()}}function DWt(t,e,i){const{alphaFlag:r,height:o,width:n}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=mue(i,r),c=t.getImageTranscodedSizeInBytes(e,0,0,l),d=new Uint8Array(c);if(!t.transcodeImage(d,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:o,data:d,compressed:s,levelSize:c,hasAlpha:r,format:a}}function mue(t,e){let i=t&&t.basis&&t.basis.format;return i==="auto"&&(i=vue()),typeof i=="object"&&(i=e?i.alpha:i.noAlpha),i=i.toLowerCase(),SWt[i]}function vue(){const t=BWt();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const _Wt={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:wWt,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},LWt={..._Wt,parse:TWt},LA=!0,yue=1735152710,ZU=12,TE=8,FWt=1313821514,OWt=5130562,UWt=0,NWt=0,jWt=1;function HWt(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function zWt(t,e=0,i={}){const r=new DataView(t),{magic:o=yue}=i,n=r.getUint32(e,!1);return n===o||n===yue}function VWt(t,e,i=0,r={}){const o=new DataView(e),n=HWt(o,i+0),s=o.getUint32(i+4,LA),a=o.getUint32(i+8,LA);switch(Object.assign(t,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:n,version:s,json:{},binChunks:[]}),i+=ZU,t.version){case 1:return qWt(t,o,i);case 2:return GWt(t,o,i,r={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function qWt(t,e,i){jh(t.header.byteLength>ZU+TE);const r=e.getUint32(i+0,LA),o=e.getUint32(i+4,LA);return i+=TE,jh(o===UWt),XU(t,e,i,r),i+=r,i+=YU(t,e,i,t.header.byteLength),i}function GWt(t,e,i,r){return jh(t.header.byteLength>ZU+TE),QWt(t,e,i,r),i+t.header.byteLength}function QWt(t,e,i,r){for(;i+8<=t.header.byteLength;){const o=e.getUint32(i+0,LA),n=e.getUint32(i+4,LA);switch(i+=TE,n){case FWt:XU(t,e,i,o);break;case OWt:YU(t,e,i,o);break;case NWt:r.strict||XU(t,e,i,o);break;case jWt:r.strict||YU(t,e,i,o);break}i+=g7(o,4)}return i}function XU(t,e,i,r){const o=new Uint8Array(e.buffer,i,r),n=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(n),g7(r,4)}function YU(t,e,i,r){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:i,byteLength:r,arrayBuffer:e.buffer}),g7(r,4)}function bue(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const i=e.baseUri||e.uri;if(!i)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return i.substr(0,i.lastIndexOf("/")+1)+t}const KWt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",WWt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",JWt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),ZWt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),XWt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},YWt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function $Wt(t,e,i,r,o,n="NONE"){const s=await eJt();rJt(s,s.exports[YWt[o]],t,e,i,r,s.exports[XWt[n||"NONE"]])}let $U;async function eJt(){return $U||($U=tJt()),$U}async function tJt(){let t=KWt;WebAssembly.validate(JWt)&&(t=WWt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(iJt(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function iJt(t){const e=new Uint8Array(t.length);for(let r=0;r<t.length;++r){const o=t.charCodeAt(r);e[r]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let i=0;for(let r=0;r<t.length;++r)e[i++]=e[r]<60?ZWt[e[r]]:(e[r]-60)*64+e[++r];return e.buffer.slice(0,i)}function rJt(t,e,i,r,o,n,s){const a=t.exports.sbrk,l=r+3&-4,c=a(l*o),d=a(n.length),u=new Uint8Array(t.exports.memory.buffer);u.set(n,d);const h=e(c,r,o,d,n.length);if(h===0&&s&&s(c,l,o),i.set(u.subarray(c,c+r*o)),a(c-a(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}const RE="EXT_meshopt_compression",oJt=RE;async function nJt(t,e){const i=new os(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;const r=[];for(const o of t.json.bufferViews||[])r.push(sJt(i,o));await Promise.all(r),i.removeExtension(RE)}async function sJt(t,e){const i=t.getObjectExtension(e,RE);if(i){const{byteOffset:r=0,byteLength:o=0,byteStride:n,count:s,mode:a,filter:l="NONE",buffer:c}=i,d=t.gltf.buffers[c],u=new Uint8Array(d.arrayBuffer,d.byteOffset+r,o),h=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await $Wt(h,s,n,u,a,l),t.removeObjectExtension(e,RE)}}const aJt=Object.freeze(Object.defineProperty({__proto__:null,decode:nJt,name:oJt},Symbol.toStringTag,{value:"Module"})),FA="EXT_texture_webp",lJt=FA;function cJt(t,e){const i=new os(t);if(!rKt("image/webp")){if(i.getRequiredExtensions().includes(FA))throw new Error(`gltf: Required extension ${FA} not supported by browser`);return}const{json:r}=i;for(const o of r.textures||[]){const n=i.getObjectExtension(o,FA);n&&(o.source=n.source),i.removeObjectExtension(o,FA)}i.removeExtension(FA)}const dJt=Object.freeze(Object.defineProperty({__proto__:null,name:lJt,preprocess:cJt},Symbol.toStringTag,{value:"Module"})),DE="KHR_texture_basisu",uJt=DE;function hJt(t,e){const i=new os(t),{json:r}=i;for(const o of r.textures||[]){const n=i.getObjectExtension(o,DE);n&&(o.source=n.source,i.removeObjectExtension(o,DE))}i.removeExtension(DE)}const pJt=Object.freeze(Object.defineProperty({__proto__:null,name:uJt,preprocess:hJt},Symbol.toStringTag,{value:"Module"})),fJt="4.3.3",gJt={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:fJt,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function AJt(t,e,i){const r=Cue(e.metadata),o=[],n=mJt(e.attributes);for(const s in t){const a=t[s],l=wue(s,a,n[s]);o.push(l)}if(i){const s=wue("indices",i);o.push(s)}return{fields:o,metadata:r}}function mJt(t){const e={};for(const i in t){const r=t[i];e[r.name||"undefined"]=r}return e}function wue(t,e,i){const r=i?Cue(i.metadata):void 0;return CQt(t,e,r)}function Cue(t){Object.entries(t);const e={};for(const i in t)e[`${i}.string`]=JSON.stringify(t[i]);return e}const xue={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vJt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},yJt=4;class bJt{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,i={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(i);const o=this.decoder.GetEncodedGeometryType(r),n=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(o){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(r,n);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(r,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!n.ptr){const u=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(u)}const a=this._getDracoLoaderData(n,o,i),l=this._getMeshData(n,a,i),c=wQt(l.attributes),d=AJt(l.attributes,a,l.indices);return{loader:"draco",loaderData:a,header:{vertexCount:n.num_points(),boundingBox:c},...l,schema:d}}finally{this.draco.destroy(r),n&&this.draco.destroy(n)}}_getDracoLoaderData(e,i,r){const o=this._getTopLevelMetadata(e),n=this._getDracoAttributes(e,r);return{geometry_type:i,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:n}}_getDracoAttributes(e,i){const r={};for(let o=0;o<e.num_attributes();o++){const n=this.decoder.GetAttribute(e,o),s=this._getAttributeMetadata(e,o);r[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:o,metadata:s};const a=this._getQuantizationTransform(n,i);a&&(r[n.unique_id()].quantization_transform=a);const l=this._getOctahedronTransform(n,i);l&&(r[n.unique_id()].octahedron_transform=l)}return r}_getMeshData(e,i,r){const o=this._getMeshAttributes(i,e,r);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,i,r){const o={};for(const n of Object.values(e.attributes)){const s=this._deduceAttributeName(n,r);n.name=s;const a=this._getAttributeValues(i,n);if(a){const{value:l,size:c}=a;o[s]={value:l,size:c,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return o}_getTriangleListIndices(e){const i=e.num_faces()*3,r=i*yJt,o=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,o),new Uint32Array(this.draco.HEAPF32.buffer,o,i).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){const i=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,i),xJt(i)}finally{this.draco.destroy(i)}}_getAttributeValues(e,i){const r=vJt[i.data_type];if(!r)return console.warn(`DRACO: Unsupported attribute type ${i.data_type}`),null;const o=i.num_components,n=e.num_points()*o,s=n*r.BYTES_PER_ELEMENT,a=wJt(this.draco,r);let l;const c=this.draco._malloc(s);try{const d=this.decoder.GetAttribute(e,i.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,a,s,c),l=new r(this.draco.HEAPF32.buffer,c,n).slice()}finally{this.draco._free(c)}return{value:l,size:o}}_deduceAttributeName(e,i){const r=e.unique_id;for(const[s,a]of Object.entries(i.extraAttributes||{}))if(a===r)return s;const o=e.attribute_type;for(const s in xue)if(this.draco[s]===o)return xue[s];const n=i.attributeNameEntry||"name";return e.metadata[n]?e.metadata[n].string:`CUSTOM_ATTRIBUTE_${r}`}_getTopLevelMetadata(e){const i=this.decoder.GetMetadata(e);return this._getDracoMetadata(i)}_getAttributeMetadata(e,i){const r=this.decoder.GetAttributeMetadata(e,i);return this._getDracoMetadata(r)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const i={},r=this.metadataQuerier.NumEntries(e);for(let o=0;o<r;o++){const n=this.metadataQuerier.GetEntryName(e,o);i[n]=this._getDracoMetadataField(e,n)}return i}_getDracoMetadataField(e,i){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,i,r);const o=CJt(r);return{int:this.metadataQuerier.GetIntEntry(e,i),string:this.metadataQuerier.GetStringEntry(e,i),double:this.metadataQuerier.GetDoubleEntry(e,i),intArray:o}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(e){const{quantizedAttributes:i=[],octahedronAttributes:r=[]}=e,o=[...i,...r];for(const n of o)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(e,i){const{quantizedAttributes:r=[]}=i,o=e.attribute_type();if(r.map(n=>this.decoder[n]).includes(o)){const n=new this.draco.AttributeQuantizationTransform;try{if(n.InitFromAttribute(e))return{quantization_bits:n.quantization_bits(),range:n.range(),min_values:new Float32Array([1,2,3]).map(s=>n.min_value(s))}}finally{this.draco.destroy(n)}}return null}_getOctahedronTransform(e,i){const{octahedronAttributes:r=[]}=i,o=e.attribute_type();if(r.map(n=>this.decoder[n]).includes(o)){const n=new this.draco.AttributeQuantizationTransform;try{if(n.InitFromAttribute(e))return{quantization_bits:n.quantization_bits()}}finally{this.draco.destroy(n)}}return null}}function wJt(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function CJt(t){const e=t.size(),i=new Int32Array(e);for(let r=0;r<e;r++)i[r]=t.GetValue(r);return i}function xJt(t){const e=t.size(),i=new Int32Array(e);for(let r=0;r<e;r++)i[r]=t.GetValue(r);return i}const kJt="1.5.6",MJt="1.4.1",eN=`https://www.gstatic.com/draco/versioned/decoders/${kJt}`,gl={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},tN={[gl.DECODER]:`${eN}/${gl.DECODER}`,[gl.DECODER_WASM]:`${eN}/${gl.DECODER_WASM}`,[gl.FALLBACK_DECODER]:`${eN}/${gl.FALLBACK_DECODER}`,[gl.ENCODER]:`https://raw.githubusercontent.com/google/draco/${MJt}/javascript/${gl.ENCODER}`};let iN;async function EJt(t){const e=t.modules||{};return e.draco3d?iN||=e.draco3d.createDecoderModule({}).then(i=>({draco:i})):iN||=BJt(t),await iN}async function BJt(t){let e,i;switch(t.draco&&t.draco.decoderType){case"js":e=await Tf(tN[gl.FALLBACK_DECODER],"draco",t,gl.FALLBACK_DECODER);break;case"wasm":default:[e,i]=await Promise.all([await Tf(tN[gl.DECODER],"draco",t,gl.DECODER),await Tf(tN[gl.DECODER_WASM],"draco",t,gl.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await PJt(e,i)}function PJt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t({...i,onModuleLoaded:o=>r({draco:o})})})}const IJt={...gJt,parse:SJt};async function SJt(t,e){const{draco:i}=await EJt(e),r=new bJt(i);try{return r.parseSync(t,e?.draco)}finally{r.destroy()}}function TJt(t){const e={};for(const i in t){const r=t[i];if(i!=="indices"){const o=kue(r);e[i]=o}}return e}function kue(t){const{buffer:e,size:i,count:r}=RJt(t);return{value:e,size:i,byteOffset:0,count:r,type:rue(i),componentType:EE(e)}}function RJt(t){let e=t,i=1,r=0;return t&&t.value&&(e=t.value,i=t.size||1),e&&(ArrayBuffer.isView(e)||(e=DJt(e,Float32Array)),r=e.length/i),{buffer:e,size:i,count:r}}function DJt(t,e,i=!1){return t?Array.isArray(t)?new e(t):i&&!(t instanceof e)?new e(t):t:null}const Mp="KHR_draco_mesh_compression",_Jt=Mp;function LJt(t,e,i){const r=new os(t);for(const o of Mue(r))r.getObjectExtension(o,Mp)}async function FJt(t,e,i){if(!e?.gltf?.decompressMeshes)return;const r=new os(t),o=[];for(const n of Mue(r))r.getObjectExtension(n,Mp)&&o.push(UJt(r,n,e,i));await Promise.all(o),r.removeExtension(Mp)}function OJt(t,e={}){const i=new os(t);for(const r of i.json.meshes||[])NJt(r),i.addRequiredExtension(Mp)}async function UJt(t,e,i,r){const o=t.getObjectExtension(e,Mp);if(!o)return;const n=t.getTypedArrayForBufferView(o.bufferView),s=kde(n.buffer,n.byteOffset),a={...i};delete a["3d-tiles"];const l=await ade(s,IJt,a,r),c=TJt(l.attributes);for(const[d,u]of Object.entries(c))if(d in e.attributes){const h=e.attributes[d],p=t.getAccessor(h);p?.min&&p?.max&&(u.min=p.min,u.max=p.max)}e.attributes=c,l.indices&&(e.indices=kue(l.indices)),t.removeObjectExtension(e,Mp),jJt(e)}function NJt(t,e,i=4,r,o){if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const n=r.DracoWriter.encodeSync({attributes:t}),s=o?.parseSync?.({attributes:t}),a=r._addFauxAttributes(s.attributes),l=r.addBufferView(n);return{primitives:[{attributes:a,mode:i,extensions:{[Mp]:{bufferView:l,attributes:a}}}]}}function jJt(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Mue(t){for(const e of t.json.meshes||[])for(const i of e.primitives)yield i}const HJt=Object.freeze(Object.defineProperty({__proto__:null,decode:FJt,encode:OJt,name:_Jt,preprocess:LJt},Symbol.toStringTag,{value:"Module"})),zJt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...zJt}};const Bc=globalThis.mathgl.config;function VJt(t,{precision:e=Bc.precision}={}){return t=qJt(t),`${parseFloat(t.toPrecision(e))}`}function _E(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Eue(t,e,i){const r=Bc.EPSILON;try{if(t===e)return!0;if(_E(t)&&_E(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!Eue(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=Bc.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Bc.EPSILON=r}}function qJt(t){return Math.round(t/Bc.EPSILON)*Bc.EPSILON}class Bue extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,i=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+i];return this.check()}toArray(e=[],i=0){for(let r=0;r<this.ELEMENTS;++r)e[i+r]=this[r];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:_E(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bc)}formatString(e){let i="";for(let r=0;r<this.ELEMENTS;++r)i+=(r>0?", ":"")+VJt(this[r],e);return`${e.printTypes?this.constructor.name:""}[${i}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i<this.ELEMENTS;++i)if(!Eue(this[i],e[i]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i<this.ELEMENTS;++i)if(this[i]!==e[i])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,i,r){if(r===void 0)return this.lerp(this,e,i);for(let o=0;o<this.ELEMENTS;++o){const n=e[o],s=typeof i=="number"?i:i[o];this[o]=n+r*(s-n)}return this.check()}min(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(e[i],this[i]);return this.check()}max(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.max(e[i],this[i]);return this.check()}clamp(e,i){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),i[r]);return this.check()}add(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]+=i[r];return this.check()}subtract(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]-=i[r];return this.check()}scale(e){if(typeof e=="number")for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;else for(let i=0;i<this.ELEMENTS&&i<e.length;++i)this[i]*=e[i];return this.check()}multiplyByScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;return this.check()}check(){if(Bc.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let i=0;i<this.ELEMENTS;++i)e=e&&Number.isFinite(this[i]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=e;return this.check()}addScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,i){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),i);return this.check()}get elements(){return this}}function GJt(t,e){if(t.length!==e)return!1;for(let i=0;i<t.length;++i)if(!Number.isFinite(t[i]))return!1;return!0}function Kl(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function QJt(t,e,i=""){if(Bc.debug&&!GJt(t,e))throw new Error(`math.gl: ${i} some fields set to invalid numbers'`);return t}function Pue(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}class KJt extends Bue{get x(){return this[0]}set x(e){this[0]=Kl(e)}get y(){return this[1]}set y(e){this[1]=Kl(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let i=0;i<this.ELEMENTS;++i)e+=this[i]*this[i];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let i=0;for(let r=0;r<this.ELEMENTS;++r){const o=this[r]-e[r];i+=o*o}return Kl(i)}dot(e){let i=0;for(let r=0;r<this.ELEMENTS;++r)i+=this[r]*e[r];return Kl(i)}normalize(){const e=this.magnitude();if(e!==0)for(let i=0;i<this.ELEMENTS;++i)this[i]/=e;return this.check()}multiply(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]*=i[r];return this.check()}divide(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]/=i[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Pue(e>=0&&e<this.ELEMENTS,"index is out of range"),Kl(this[e])}setComponent(e,i){return Pue(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=i,this.check()}addVectors(e,i){return this.copy(e).add(i)}subVectors(e,i){return this.copy(e).subtract(i)}multiplyVectors(e,i){return this.copy(e).multiply(i)}addScaledVector(e,i){return this.add(new this.constructor(e).multiplyScalar(i))}}let LE=typeof Float32Array<"u"?Float32Array:Array;function WJt(){const t=new LE(2);return LE!=Float32Array&&(t[0]=0,t[1]=0),t}function JJt(t,e,i){const r=e[0],o=e[1];return t[0]=i[0]*r+i[3]*o+i[6],t[1]=i[1]*r+i[4]*o+i[7],t}(function(){const t=WJt();return function(e,i,r,o,n,s){let a,l;for(i||(i=2),r||(r=0),o?l=Math.min(o*i+r,e.length):l=e.length,a=r;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],n(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}})();function ZJt(t,e,i){const r=e[0],o=e[1],n=e[2],s=i[3]*r+i[7]*o+i[11]*n||1;return t[0]=(i[0]*r+i[4]*o+i[8]*n)/s,t[1]=(i[1]*r+i[5]*o+i[9]*n)/s,t[2]=(i[2]*r+i[6]*o+i[10]*n)/s,t}function XJt(t,e,i){const r=e[0],o=e[1];return t[0]=i[0]*r+i[2]*o,t[1]=i[1]*r+i[3]*o,t[2]=e[2],t}function YJt(t,e,i){const r=e[0],o=e[1],n=e[2];return t[0]=i[0]*r+i[3]*o+i[6]*n,t[1]=i[1]*r+i[4]*o+i[7]*n,t[2]=i[2]*r+i[5]*o+i[8]*n,t[3]=e[3],t}function $Jt(){const t=new LE(3);return LE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function eZt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=i[0],a=i[1],l=i[2];return t[0]=o*l-n*a,t[1]=n*s-r*l,t[2]=r*a-o*s,t}function iZt(t,e,i){const r=e[0],o=e[1],n=e[2];let s=i[3]*r+i[7]*o+i[11]*n+i[15];return s=s||1,t[0]=(i[0]*r+i[4]*o+i[8]*n+i[12])/s,t[1]=(i[1]*r+i[5]*o+i[9]*n+i[13])/s,t[2]=(i[2]*r+i[6]*o+i[10]*n+i[14])/s,t}function Iue(t,e,i){const r=e[0],o=e[1],n=e[2];return t[0]=r*i[0]+o*i[3]+n*i[6],t[1]=r*i[1]+o*i[4]+n*i[7],t[2]=r*i[2]+o*i[5]+n*i[8],t}function rZt(t,e,i){const r=i[0],o=i[1],n=i[2],s=i[3],a=e[0],l=e[1],c=e[2];let d=o*c-n*l,u=n*a-r*c,h=r*l-o*a,p=o*h-n*u,g=n*d-r*h,f=r*u-o*d;const m=s*2;return d*=m,u*=m,h*=m,p*=2,g*=2,f*=2,t[0]=a+d+p,t[1]=l+u+g,t[2]=c+h+f,t}function oZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[0],n[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),n[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function nZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),n[1]=o[1],n[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function sZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),n[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),n[2]=o[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function aZt(t,e){const i=t[0],r=t[1],o=t[2],n=e[0],s=e[1],a=e[2],l=Math.sqrt((i*i+r*r+o*o)*(n*n+s*s+a*a)),c=l&&eZt(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}(function(){const t=$Jt();return function(e,i,r,o,n,s){let a,l;for(i||(i=3),r||(r=0),o?l=Math.min(o*i+r,e.length):l=e.length,a=r;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],n(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}})();const rN=[0,0,0];let FE,lZt=class pxe extends KJt{static get ZERO(){return FE||(FE=new pxe(0,0,0),Object.freeze(FE)),FE}constructor(e=0,i=0,r=0){super(-0,-0,-0),arguments.length===1&&_E(e)?this.copy(e):(Bc.debug&&(Kl(e),Kl(i),Kl(r)),this[0]=e,this[1]=i,this[2]=r)}set(e,i,r){return this[0]=e,this[1]=i,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return Bc.debug&&(Kl(e.x),Kl(e.y),Kl(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Kl(e)}angle(e){return aZt(this,e)}cross(e){return tZt(this,this,e),this.check()}rotateX({radians:e,origin:i=rN}){return oZt(this,this,i,e),this.check()}rotateY({radians:e,origin:i=rN}){return nZt(this,this,i,e),this.check()}rotateZ({radians:e,origin:i=rN}){return sZt(this,this,i,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return iZt(this,this,e),this.check()}transformAsVector(e){return ZJt(this,this,e),this.check()}transformByMatrix3(e){return Iue(this,this,e),this.check()}transformByMatrix2(e){return XJt(this,this,e),this.check()}transformByQuaternion(e){return rZt(this,this,e),this.check()}};class cZt extends Bue{toString(){let e="[";if(Bc.printRowMajor){e+="row-major:";for(let i=0;i<this.RANK;++i)for(let r=0;r<this.RANK;++r)e+=` ${this[r*this.RANK+i]}`}else{e+="column-major:";for(let i=0;i<this.ELEMENTS;++i)e+=` ${this[i]}`}return e+="]",e}getElementIndex(e,i){return i*this.RANK+e}getElement(e,i){return this[i*this.RANK+e]}setElement(e,i,r){return this[i*this.RANK+e]=Kl(r),this}getColumn(e,i=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let o=0;o<this.RANK;++o)i[o]=this[r+o];return i}setColumn(e,i){const r=e*this.RANK;for(let o=0;o<this.RANK;++o)this[r+o]=i[o];return this}}function dZt(t,e){if(t===e){const i=e[1],r=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function uZt(t,e){const i=e[0],r=e[1],o=e[2],n=e[3],s=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=d*s-a*c,h=-d*n+a*l,p=c*n-s*l;let g=i*u+r*h+o*p;return g?(g=1/g,t[0]=u*g,t[1]=(-d*r+o*c)*g,t[2]=(a*r-o*s)*g,t[3]=h*g,t[4]=(d*i-o*l)*g,t[5]=(-a*i+o*n)*g,t[6]=p*g,t[7]=(-c*i+r*l)*g,t[8]=(s*i-r*n)*g,t):null}function hZt(t){const e=t[0],i=t[1],r=t[2],o=t[3],n=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*n-s*l)+i*(-c*o+s*a)+r*(l*o-n*a)}function Sue(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=i[0],p=i[1],g=i[2],f=i[3],m=i[4],A=i[5],v=i[6],y=i[7],b=i[8];return t[0]=h*r+p*s+g*c,t[1]=h*o+p*a+g*d,t[2]=h*n+p*l+g*u,t[3]=f*r+m*s+A*c,t[4]=f*o+m*a+A*d,t[5]=f*n+m*l+A*u,t[6]=v*r+y*s+b*c,t[7]=v*o+y*a+b*d,t[8]=v*n+y*l+b*u,t}function pZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=i[0],p=i[1];return t[0]=r,t[1]=o,t[2]=n,t[3]=s,t[4]=a,t[5]=l,t[6]=h*r+p*s+c,t[7]=h*o+p*a+d,t[8]=h*n+p*l+u,t}function fZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=Math.sin(i),p=Math.cos(i);return t[0]=p*r+h*s,t[1]=p*o+h*a,t[2]=p*n+h*l,t[3]=p*s-h*r,t[4]=p*a-h*o,t[5]=p*l-h*n,t[6]=c,t[7]=d,t[8]=u,t}function Tue(t,e,i){const r=i[0],o=i[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function gZt(t,e){const i=e[0],r=e[1],o=e[2],n=e[3],s=i+i,a=r+r,l=o+o,c=i*s,d=r*s,u=r*a,h=o*s,p=o*a,g=o*l,f=n*s,m=n*a,A=n*l;return t[0]=1-u-g,t[3]=d-A,t[6]=h+m,t[1]=d+A,t[4]=1-c-g,t[7]=p-f,t[2]=h-m,t[5]=p+f,t[8]=1-c-u,t}var oN;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(oN||(oN={}));const AZt=Object.freeze([1,0,0,0,1,0,0,0,1]);let b7=class extends cZt{static get IDENTITY(){return vZt()}static get ZERO(){return mZt()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return oN}constructor(t,...e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):e.length>0?this.copy([t,...e]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(AZt)}fromObject(t){return this.check()}fromQuaternion(t){return gZt(this,t),this.check()}set(t,e,i,r,o,n,s,a,l){return this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=o,this[5]=n,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,i,r,o,n,s,a,l){return this[0]=t,this[1]=r,this[2]=s,this[3]=e,this[4]=o,this[5]=a,this[6]=i,this[7]=n,this[8]=l,this.check()}determinant(){return hZt(this)}transpose(){return dZt(this,this),this.check()}invert(){return uZt(this,this),this.check()}multiplyLeft(t){return Sue(this,t,this),this.check()}multiplyRight(t){return Sue(this,this,t),this.check()}rotate(t){return fZt(this,this,t),this.check()}scale(t){return Array.isArray(t)?Tue(this,this,t):Tue(this,this,[t,t]),this.check()}translate(t){return pZt(this,this,t),this.check()}transform(t,e){let i;switch(t.length){case 2:i=JJt(e||[-0,-0],t,this);break;case 3:i=Iue(e||[-0,-0,-0],t,this);break;case 4:i=YJt(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return QJt(i,t.length),i}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}},OE,UE=null;function mZt(){return OE||(OE=new b7([0,0,0,0,0,0,0,0,0]),Object.freeze(OE)),OE}function vZt(){return UE||(UE=new b7,Object.freeze(UE)),UE}const NE="KHR_texture_transform",yZt=NE,jE=new lZt,bZt=new b7,wZt=new b7;async function CZt(t,e){if(!new os(t).hasExtension(NE)||!e.gltf?.loadBuffers)return;const i=t.json.materials||[];for(let r=0;r<i.length;r++)xZt(r,t)}function xZt(t,e){const i=e.json.materials?.[t],r=[i?.pbrMetallicRoughness?.baseColorTexture,i?.emissiveTexture,i?.normalTexture,i?.occlusionTexture,i?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(const n of r)n&&n?.extensions?.[NE]&&kZt(e,t,n,o)}function kZt(t,e,i,r){const o=MZt(i,r);if(!o)return;const n=t.json.meshes||[];for(const s of n)for(const a of s.primitives){const l=a.material;Number.isFinite(l)&&e===l&&EZt(t,a,o)}}function MZt(t,e){const i=t.extensions?.[NE],{texCoord:r=0}=t,{texCoord:o=r}=i;if(e.findIndex(([n,s])=>n===r&&s===o)===-1){const n=IZt(i);return r!==o&&(t.texCoord=o),e.push([r,o]),{originalTexCoord:r,texCoord:o,matrix:n}}return null}function EZt(t,e,i){const{originalTexCoord:r,texCoord:o,matrix:n}=i,s=e.attributes[`TEXCOORD_${r}`];if(Number.isFinite(s)){const a=t.json.accessors?.[s];if(a&&a.bufferView){const l=t.json.bufferViews?.[a.bufferView];if(l){const{arrayBuffer:c,byteOffset:d}=t.buffers[l.buffer],u=(d||0)+(a.byteOffset||0)+(l.byteOffset||0),{ArrayType:h,length:p}=VU(a,l),g=tue[a.componentType],f=eue[a.type],m=l.byteStride||g*f,A=new Float32Array(p);for(let v=0;v<a.count;v++){const y=new h(c,u+v*m,2);jE.set(y[0],y[1],1),jE.transformByMatrix3(n),A.set([jE[0],jE[1]],v*f)}r===o?BZt(a,l,t.buffers,A):PZt(o,a,e,t,A)}}}}function BZt(t,e,i,r){t.componentType=5126,i.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength}),e.buffer=i.length-1,e.byteLength=r.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function PZt(t,e,i,r,o){r.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});const n=r.json.bufferViews;if(!n)return;n.push({buffer:r.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});const s=r.json.accessors;s&&(s.push({bufferView:n?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),i.attributes[`TEXCOORD_${t}`]=s.length-1)}function IZt(t){const{offset:e=[0,0],rotation:i=0,scale:r=[1,1]}=t,o=new b7().set(1,0,0,0,1,0,e[0],e[1],1),n=bZt.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),s=wZt.set(r[0],0,0,0,r[1],0,0,0,1);return o.multiplyRight(n).multiplyRight(s)}const SZt=Object.freeze(Object.defineProperty({__proto__:null,decode:CZt,name:yZt},Symbol.toStringTag,{value:"Module"})),Df="KHR_lights_punctual",TZt=Df;async function RZt(t){const e=new os(t),{json:i}=e,r=e.getExtension(Df);r&&(e.json.lights=r.lights,e.removeExtension(Df));for(const o of i.nodes||[]){const n=e.getObjectExtension(o,Df);n&&(o.light=n.light),e.removeObjectExtension(o,Df)}}async function DZt(t){const e=new os(t),{json:i}=e;if(i.lights){const r=e.addExtension(Df);Gl(!r.lights),r.lights=i.lights,delete i.lights}if(e.json.lights){for(const r of e.json.lights){const o=r.node;e.addObjectExtension(o,Df,r)}delete e.json.lights}}const _Zt=Object.freeze(Object.defineProperty({__proto__:null,decode:RZt,encode:DZt,name:TZt},Symbol.toStringTag,{value:"Module"})),w7="KHR_materials_unlit",LZt=w7;async function FZt(t){const e=new os(t),{json:i}=e;for(const r of i.materials||[])r.extensions&&r.extensions.KHR_materials_unlit&&(r.unlit=!0),e.removeObjectExtension(r,w7);e.removeExtension(w7)}function OZt(t){const e=new os(t),{json:i}=e;if(e.materials)for(const r of i.materials||[])r.unlit&&(delete r.unlit,e.addObjectExtension(r,w7,{}),e.addExtension(w7))}const UZt=Object.freeze(Object.defineProperty({__proto__:null,decode:FZt,encode:OZt,name:LZt},Symbol.toStringTag,{value:"Module"})),C7="KHR_techniques_webgl",NZt=C7;async function jZt(t){const e=new os(t),{json:i}=e,r=e.getExtension(C7);if(r){const o=zZt(r,e);for(const n of i.materials||[]){const s=e.getObjectExtension(n,C7);s&&(n.technique=Object.assign({},s,o[s.technique]),n.technique.values=VZt(n.technique,e)),e.removeObjectExtension(n,C7)}e.removeExtension(C7)}}async function HZt(t,e){}function zZt(t,e){const{programs:i=[],shaders:r=[],techniques:o=[]}=t,n=new TextDecoder;return r.forEach(s=>{if(Number.isFinite(s.bufferView))s.code=n.decode(e.getTypedArrayForBufferView(s.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),i.forEach(s=>{s.fragmentShader=r[s.fragmentShader],s.vertexShader=r[s.vertexShader]}),o.forEach(s=>{s.program=i[s.program]}),o}function VZt(t,e){const i=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(r=>{t.uniforms[r].value&&!(r in i)&&(i[r]=t.uniforms[r].value)}),Object.keys(i).forEach(r=>{typeof i[r]=="object"&&i[r].index!==void 0&&(i[r].texture=e.getTexture(i[r].index))}),i}const qZt=Object.freeze(Object.defineProperty({__proto__:null,decode:jZt,encode:HZt,name:NZt},Symbol.toStringTag,{value:"Module"})),Rue=[iWt,BKt,aJt,dJt,pJt,HJt,_Zt,UZt,qZt,SZt,yWt];function GZt(t,e={},i){const r=Rue.filter(o=>Due(o.name,e));for(const o of r)o.preprocess?.(t,e,i)}async function QZt(t,e={},i){const r=Rue.filter(o=>Due(o.name,e));for(const o of r)await o.decode?.(t,e,i)}function Due(t,e){const i=e?.gltf?.excludeExtensions||{};return!(t in i&&!i[t])}const nN="KHR_binary_glTF";function KZt(t){const e=new os(t),{json:i}=e;for(const r of i.images||[]){const o=e.getObjectExtension(r,nN);o&&Object.assign(r,o),e.removeObjectExtension(r,nN)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,e.removeExtension(nN)}const _ue={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},WZt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class JZt{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,i){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${r.asset.version}`);return}if(!i.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),KZt(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const i in _ue)this._convertTopLevelObjectToArray(e,i)}_convertTopLevelObjectToArray(e,i){const r=e[i];if(!(!r||Array.isArray(r))){e[i]=[];for(const o in r){const n=r[o];n.id=n.id||o;const s=e[i].length;e[i].push(n),this.idToIndexMap[i][o]=s}}}_convertObjectIdsToArrayIndices(e){for(const i in _ue)this._convertIdsToIndices(e,i);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const i of e.textures)this._convertTextureIds(i);for(const i of e.meshes)this._convertMeshIds(i);for(const i of e.nodes)this._convertNodeIds(i);for(const i of e.scenes)this._convertSceneIds(i)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const i of e.primitives){const{attributes:r,indices:o,material:n}=i;for(const s in r)r[s]=this._convertIdToIndex(r[s],"accessor");o&&(i.indices=this._convertIdToIndex(o,"accessor")),n&&(i.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(i=>this._convertIdToIndex(i,"node"))),e.meshes&&(e.meshes=e.meshes.map(i=>this._convertIdToIndex(i,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(i=>this._convertIdToIndex(i,"node")))}_convertIdsToIndices(e,i){e[i]||(console.warn(`gltf v1: json doesn't contain attribute ${i}`),e[i]=[]);for(const r of e[i])for(const o in r){const n=r[o],s=this._convertIdToIndex(n,o);r[o]=s}}_convertIdToIndex(e,i){const r=WZt[i];if(r in this.idToIndexMap){const o=this.idToIndexMap[r][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${i} with id ${e}`);return o}return e}_updateObjects(e){for(const i of this.json.buffers)delete i.type}_updateMaterial(e){for(const i of e.materials){i.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=i.values?.tex||i.values?.texture2d_0||i.values?.diffuseTex,o=e.textures.findIndex(n=>n.id===r);o!==-1&&(i.pbrMetallicRoughness.baseColorTexture={index:o})}}}function ZZt(t,e={}){return new JZt().normalize(t,e)}async function XZt(t,e,i=0,r,o){return YZt(t,e,i,r),ZZt(t,{normalize:r?.gltf?.normalize}),GZt(t,r,o),r?.gltf?.loadBuffers&&t.json.buffers&&await $Zt(t,r,o),r?.gltf?.loadImages&&await eXt(t,r,o),await QZt(t,r,o),t}function YZt(t,e,i,r){if(r.uri&&(t.baseUri=r.uri),e instanceof ArrayBuffer&&!zWt(e,i,r)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=dGt(e);else if(e instanceof ArrayBuffer){const s={};i=VWt(s,e,i,r.glb),Gl(s.type==="glTF",`Invalid GLB magic string ${s.type}`),t._glb=s,t.json=s.json}else Gl(!1,"GLTF: must be ArrayBuffer or string");const o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:s}=t._glb;t.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}const n=t.json.images||[];t.images=new Array(n.length).fill({})}async function $Zt(t,e,i){const r=t.json.buffers||[];for(let o=0;o<r.length;++o){const n=r[o];if(n.uri){const{fetch:s}=i;Gl(s);const a=bue(n.uri,e),l=await(await i?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete n.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(n.byteLength),byteOffset:0,byteLength:n.byteLength})}}async function eXt(t,e,i){const r=tXt(t),o=t.json.images||[],n=[];for(const s of r)n.push(iXt(t,o[s],s,e,i));return await Promise.all(n)}function tXt(t){const e=new Set,i=t.json.textures||[];for(const r of i)r.source!==void 0&&e.add(r.source);return Array.from(e).sort()}async function iXt(t,e,i,r,o){let n;if(e.uri&&!e.hasOwnProperty("bufferView")){const a=bue(e.uri,r),{fetch:l}=o;n=await(await l(a)).arrayBuffer(),e.bufferView={data:n}}if(Number.isFinite(e.bufferView)){const a=hKt(t.json,t.buffers,e.bufferView);n=kde(a.buffer,a.byteOffset,a.byteLength)}Gl(n,"glTF image has no data");let s=await ade(n,[iKt,LWt],{...r,mimeType:e.mimeType,basis:r.basis||{format:vue()}},o);s&&s[0]&&(s={compressed:!0,mipmaps:!1,width:s[0].width,height:s[0].height,data:s[0]}),t.images=t.images||[],t.images[i]=s}const sN={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:bWt,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:rXt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function rXt(t,e={},i){e={...sN.options,...e},e.gltf={...sN.options.gltf,...e.gltf};const{byteOffset:r=0}=e;return await XZt({},t,r,e,i)}const oXt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nXt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Pc={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},sXt={magFilter:Pc.TEXTURE_MAG_FILTER,minFilter:Pc.TEXTURE_MIN_FILTER,wrapS:Pc.TEXTURE_WRAP_S,wrapT:Pc.TEXTURE_WRAP_T},aXt={[Pc.TEXTURE_MAG_FILTER]:Pc.LINEAR,[Pc.TEXTURE_MIN_FILTER]:Pc.NEAREST_MIPMAP_LINEAR,[Pc.TEXTURE_WRAP_S]:Pc.REPEAT,[Pc.TEXTURE_WRAP_T]:Pc.REPEAT};function lXt(){return{id:"default-sampler",parameters:aXt}}function cXt(t){return nXt[t]}function dXt(t){return oXt[t]}class uXt{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,i={}){const{json:r,buffers:o=[],images:n=[]}=e,{baseUri:s=""}=e;return Gl(r),this.baseUri=s,this.buffers=o,this.images=n,this.jsonUnprocessed=r,this.json=this._resolveTree(e.json,i),this.json}_resolveTree(e,i={}){const r={...e};return this.json=r,e.bufferViews&&(r.bufferViews=e.bufferViews.map((o,n)=>this._resolveBufferView(o,n))),e.images&&(r.images=e.images.map((o,n)=>this._resolveImage(o,n))),e.samplers&&(r.samplers=e.samplers.map((o,n)=>this._resolveSampler(o,n))),e.textures&&(r.textures=e.textures.map((o,n)=>this._resolveTexture(o,n))),e.accessors&&(r.accessors=e.accessors.map((o,n)=>this._resolveAccessor(o,n))),e.materials&&(r.materials=e.materials.map((o,n)=>this._resolveMaterial(o,n))),e.meshes&&(r.meshes=e.meshes.map((o,n)=>this._resolveMesh(o,n))),e.nodes&&(r.nodes=e.nodes.map((o,n)=>this._resolveNode(o,n)),r.nodes=r.nodes.map((o,n)=>this._resolveNodeChildren(o))),e.skins&&(r.skins=e.skins.map((o,n)=>this._resolveSkin(o,n))),e.scenes&&(r.scenes=e.scenes.map((o,n)=>this._resolveScene(o,n))),typeof this.json.scene=="number"&&r.scenes&&(r.scene=r.scenes[this.json.scene]),r}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,i){if(typeof i=="object")return i;const r=e&&e[i];return r||console.warn(`glTF file error: Could not find ${e}[${i}]`),r}_resolveScene(e,i){return{...e,id:e.id||`scene-${i}`,nodes:(e.nodes||[]).map(r=>this.getNode(r))}}_resolveNode(e,i){const r={...e,id:e?.id||`node-${i}`};return e.mesh!==void 0&&(r.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(r.camera=this.getCamera(e.camera)),e.skin!==void 0&&(r.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(r.mesh=e.meshes.reduce((o,n)=>{const s=this.getMesh(n);return o.id=s.id,o.primitives=o.primitives.concat(s.primitives),o},{primitives:[]})),r}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(i=>this.getNode(i))),e}_resolveSkin(e,i){const r=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${i}`,inverseBindMatrices:r}}_resolveMesh(e,i){const r={...e,id:e.id||`mesh-${i}`,primitives:[]};return e.primitives&&(r.primitives=e.primitives.map(o=>{const n={...o,attributes:{},indices:void 0,material:void 0},s=o.attributes;for(const a in s)n.attributes[a]=this.getAccessor(s[a]);return o.indices!==void 0&&(n.indices=this.getAccessor(o.indices)),o.material!==void 0&&(n.material=this.getMaterial(o.material)),n})),r}_resolveMaterial(e,i){const r={...e,id:e.id||`material-${i}`};if(r.normalTexture&&(r.normalTexture={...r.normalTexture},r.normalTexture.texture=this.getTexture(r.normalTexture.index)),r.occlusionTexture&&(r.occlusionTexture={...r.occlusionTexture},r.occlusionTexture.texture=this.getTexture(r.occlusionTexture.index)),r.emissiveTexture&&(r.emissiveTexture={...r.emissiveTexture},r.emissiveTexture.texture=this.getTexture(r.emissiveTexture.index)),r.emissiveFactor||(r.emissiveFactor=r.emissiveTexture?[1,1,1]:[0,0,0]),r.pbrMetallicRoughness){r.pbrMetallicRoughness={...r.pbrMetallicRoughness};const o=r.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return r}_resolveAccessor(e,i){const r=cXt(e.componentType),o=dXt(e.type),n=r*o,s={...e,id:e.id||`accessor-${i}`,bytesPerComponent:r,components:o,bytesPerElement:n,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(s.bufferView=this.getBufferView(e.bufferView)),s.bufferView){const a=s.bufferView.buffer,{ArrayType:l,byteLength:c}=VU(s,s.bufferView),d=(s.bufferView.byteOffset||0)+(s.byteOffset||0)+a.byteOffset;let u=a.arrayBuffer.slice(d,d+c);s.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(a,d,s.bufferView.byteStride,s.bytesPerElement,s.count)),s.value=new l(u)}return s}_getValueFromInterleavedBuffer(e,i,r,o,n){const s=new Uint8Array(n*o);for(let a=0;a<n;a++){const l=i+a*r;s.set(new Uint8Array(e.arrayBuffer.slice(l,l+o)),a*o)}return s.buffer}_resolveTexture(e,i){return{...e,id:e.id||`texture-${i}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):lXt(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,i){const r={id:e.id||`sampler-${i}`,...e,parameters:{}};for(const o in r){const n=this._enumSamplerParameter(o);n!==void 0&&(r.parameters[n]=r[o])}return r}_enumSamplerParameter(e){return sXt[e]}_resolveImage(e,i){const r={...e,id:e.id||`image-${i}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[i];return o&&(r.image=o),r}_resolveBufferView(e,i){const r=e.buffer,o=this.buffers[r].arrayBuffer;let n=this.buffers[r].byteOffset||0;return e.byteOffset&&(n+=e.byteOffset),{id:`bufferView-${i}`,...e,buffer:this.buffers[r],data:new Uint8Array(o,n,e.byteLength)}}_resolveCamera(e,i){const r={...e,id:e.id||`camera-${i}`};return r.perspective,r.orthographic,r}}function hXt(t,e){return new uXt().postProcess(t,e)}class pXt{constructor(e){}load(e,i,r,o,n,s,a){o=o||{},fXt(e,i,r,o,n,function(){uo.scheduleTask(function(){n.scene.fire("modelLoaded",n.id),n.fire("loaded",!0,!1)}),s&&s()},function(l){e.error(l),a&&a(l),n.fire("error",l)})}parse(e,i,r,o,n,s,a){o=o||{},aN(e,"",i,r,o,n,function(){n.scene.fire("modelLoaded",n.id),n.fire("loaded",!0,!1),s&&s()},function(l){n.error(l),n.fire("error",l),a&&a(l)})}}function fXt(t,e,i,r,o,n,s){const a=t.viewer.scene.canvas.spinner;a.processes++,e.split(".").pop()==="glb"?t.dataSource.getGLB(e,l=>{r.basePath=Lue(e),aN(t,e,l,i,r,o,n,s),a.processes--},l=>{a.processes--,s(l)}):t.dataSource.getGLTF(e,l=>{r.basePath=Lue(e),aN(t,e,l,i,r,o,n,s),a.processes--},l=>{a.processes--,s(l)})}function Lue(t){const e=t.lastIndexOf("/");return e!==0?t.substring(0,e+1):""}function aN(t,e,i,r,o,n,s,a){const l=t.viewer.scene.canvas.spinner;l.processes++,FU(i,sN,{baseUri:o.basePath}).then(c=>{const d=hXt(c),u={entityId:o.entityId,autoMetaModel:o.autoMetaModel,globalizeObjectIds:o.globalizeObjectIds,metaObjects:[],loadBuffer:o.loadBuffer,basePath:o.basePath,handlenode:o.handlenode,backfaces:!!o.backfaces,gltfData:d,scene:n.scene,plugin:t,sceneModel:n,numObjects:0,nextId:0};gXt(u),mXt(u),o.autoMetaModel&&u.metaObjects.push({id:n.id,type:"Default",name:n.id}),bXt(u),n.finalize(),o.autoMetaModel&&t.viewer.metaScene.createMetaModel(n.id,{metaObjects:u.metaObjects}),l.processes--,s()}).catch(c=>{a&&a(c)})}function gXt(t){const e=t.gltfData.textures;if(e)for(let i=0,r=e.length;i<r;i++)AXt(t,e[i])}function AXt(t,e){if(!e.source||!e.source.image)return;const i=`texture-${t.nextId++}`;let r=aA;switch(e.sampler.minFilter){case 9728:r=xf;break;case 9729:r=aa;break;case 9984:r=D9;break;case 9985:r=_9;break;case 9986:r=aA;break;case 9987:r=lA;break}let o=aa;switch(e.sampler.magFilter){case 9728:o=xf;break;case 9729:o=aa;break}let n=Eo;switch(e.sampler.wrapS){case 33071:n=sa;break;case 33648:n=Th;break;case 10497:n=Eo;break}let s=Eo;switch(e.sampler.wrapT){case 33071:s=sa;break;case 33648:s=Th;break;case 10497:s=Eo;break}let a=Eo;switch(e.sampler.wrapR){case 33071:a=sa;break;case 33648:a=Th;break;case 10497:a=Eo;break}t.sceneModel.createTexture({id:i,image:e.source.image,flipY:!!e.flipY,minFilter:r,magFilter:o,wrapS:n,wrapT:s,wrapR:a,encoding:ho}),e._textureId=i}function mXt(t){const e=t.gltfData.materials;if(e)for(let i=0,r=e.length;i<r;i++){const o=e[i];o._textureSetId=vXt(t,o),o._attributes=yXt(t,o)}}function vXt(t,e){const i={};switch(e.normalTexture&&(i.normalTextureId=e.normalTexture.texture._textureId),e.occlusionTexture&&(i.occlusionTextureId=e.occlusionTexture.texture._textureId),e.emissiveTexture&&(i.emissiveTextureId=e.emissiveTexture.texture._textureId),e.alphaMode){case"OPAQUE":break;case"MASK":const n=e.alphaCutoff;i.alphaCutoff=n!==void 0?n:.5;break}const r=e.pbrMetallicRoughness;if(e.pbrMetallicRoughness){const n=e.pbrMetallicRoughness,s=n.baseColorTexture||n.colorTexture;s&&(s.texture?i.colorTextureId=s.texture._textureId:i.colorTextureId=t.gltfData.textures[s.index]._textureId),r.metallicRoughnessTexture&&(i.metallicRoughnessTextureId=r.metallicRoughnessTexture.texture._textureId)}const o=e.extensions;if(o){const n=o.KHR_materials_pbrSpecularGlossiness;if(n){n.specularTexture;const s=n.specularColorTexture;s!=null&&(i.colorTextureId=t.gltfData.textures[s.index]._textureId)}}return i.normalTextureId!==void 0||i.occlusionTextureId!==void 0||i.emissiveTextureId!==void 0||i.colorTextureId!==void 0||i.metallicRoughnessTextureId!==void 0?(i.id=`textureSet-${t.nextId++};`,t.sceneModel.createTextureSet(i),i.id):null}function yXt(t,e){const i=e.extensions,r={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:!0};if(i){const n=i.KHR_materials_pbrSpecularGlossiness;if(n){const a=n.diffuseFactor;a!=null&&r.color.set(a)}const s=i.KHR_materials_common;if(s){const a=s.technique,l=s.values||{},c=a==="BLINN",d=a==="PHONG",u=a==="LAMBERT",h=l.diffuse;h&&(c||d||u)&&(Tt.isString(h)||r.color.set(h));const p=l.transparency;p!=null&&(r.opacity=p);const g=l.transparent;g!=null&&(r.opacity=g)}}const o=e.pbrMetallicRoughness;if(o){const n=o.baseColorFactor;n&&(r.color[0]=n[0],r.color[1]=n[1],r.color[2]=n[2],r.opacity=n[3]);const s=o.metallicFactor;s!=null&&(r.metallic=s);const a=o.roughnessFactor;a!=null&&(r.roughness=a)}return r.doubleSided=e.doubleSided!==!1,r}function bXt(t){const e=t.gltfData,i=e.scene||e.scenes[0];if(!i){xXt(t,"glTF has no default scene");return}const r=i.nodes;if(!r)return;(function s(a){a.forEach(l=>{const c=l.mesh;c&&(c.instances||=0,c.instances+=1),l.children&&s(l.children)})})(r);const o=[];let n=null;(function s(a,l,c){a.forEach(d=>{const u=d.name;let h=u!=null&&u||l===0&&"entity-"+t.nextId++;if(h){for(;t.sceneModel.objects[h];)h="entity-"+t.nextId++;o.push(n),n=[]}const p=wXt(d,c);if(d.mesh&&CXt(d,t,p,n),d.children&&s(d.children,l+1,p),h){if(n.length>0){const g=t.globalizeObjectIds?k.globalizeObjectId(t.sceneModel.id,h):h;t.sceneModel.createEntity({id:g,meshIds:n,isObject:!0}),t.autoMetaModel&&t.metaObjects.push({id:g,type:"Default",name:g,parent:t.sceneModel.id})}n=o.pop()}})})(r,0,null)}function wXt(t,e){let i;return t.matrix&&(i=t.matrix,e?e=k.mulMat4(e,i,k.mat4()):e=i),t.translation&&(i=k.translationMat4v(t.translation),e?e=k.mulMat4(e,i,k.mat4()):e=i),t.rotation&&(i=k.quaternionToMat4(t.rotation),e?e=k.mulMat4(e,i,k.mat4()):e=i),t.scale&&(i=k.scalingMat4v(t.scale),e?e=k.mulMat4(e,i,k.mat4()):e=i),e}function CXt(t,e,i,r){const o=t.mesh;if(!o)return;const n=o.primitives.length;if(n>0)for(let s=0;s<n;s++){const a=o.primitives[s];if(a.mode<4)continue;const l={id:e.sceneModel.id+"."+e.numObjects++},c=a.material;c?(l.textureSetId=c._textureSetId,l.color=c._attributes.color,l.opacity=c._attributes.opacity,l.metallic=c._attributes.metallic,l.roughness=c._attributes.roughness):(l.color=new Float32Array([1,1,1]),l.opacity=1);const d=e.backfaces!==!1||c&&c.doubleSided!==!1;switch(a.mode){case 0:l.primitive="points";break;case 1:l.primitive="lines";break;case 2:l.primitive="lines";break;case 3:l.primitive="lines";break;case 4:l.primitive=d?"triangles":"solid";break;case 5:l.primitive=d?"triangles":"solid";break;case 6:l.primitive=d?"triangles":"solid";break;default:l.primitive=d?"triangles":"solid"}const u=a.attributes.POSITION;if(!u)continue;l.localPositions=u.value,l.positions=new Float64Array(l.localPositions.length),a.attributes.NORMAL&&(l.normals=a.attributes.NORMAL.value),a.attributes.TEXCOORD_0&&(l.uv=a.attributes.TEXCOORD_0.value),a.indices&&(l.indices=a.indices.value),i?k.transformPositions3(i,l.localPositions,l.positions):l.positions.set(l.localPositions);const h=k.vec3();fM(l.positions,l.positions,h)&&(l.origin=h),e.sceneModel.createMesh(l),r.push(l.id)}}function xXt(t,e){t.plugin.error(e)}const Fue={DEFAULT:{}};class lN extends kc{constructor(e,i={}){super("GLTFLoader",e,i),this._sceneModelLoader=new pXt(this,i),this.dataSource=i.dataSource,this.objectDefaults=i.objectDefaults}set dataSource(e){this._dataSource=e||new sde}get dataSource(){return this._dataSource}set objectDefaults(e){this._objectDefaults=e||Fue}get objectDefaults(){return this._objectDefaults}load(e={}){e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id);const i=new i7(this.viewer.scene,Tt.apply(e,{isModel:!0,dtxEnabled:e.dtxEnabled})),r=i.id;if(!e.src&&!e.gltf)return this.error("load() param expected: src or gltf"),i;if(e.metaModelSrc||e.metaModelJSON){const o=n=>{this.viewer.metaScene.createMetaModel(r,n,{}),this.viewer.scene.canvas.spinner.processes--,e.src?this._sceneModelLoader.load(this,e.src,n,e,i):this._sceneModelLoader.parse(this,e.gltf,n,e,i)};if(e.metaModelSrc){const n=e.metaModelSrc;this.viewer.scene.canvas.spinner.processes++,this._dataSource.getMetaModel(n,s=>{this.viewer.scene.canvas.spinner.processes--,o(s)},s=>{this.error(`load(): Failed to load model metadata for model '${r} from '${n}' - ${s}`),this.viewer.scene.canvas.spinner.processes--})}else e.metaModelJSON&&o(e.metaModelJSON)}else e.src?this._sceneModelLoader.load(this,e.src,null,e,i):this._sceneModelLoader.parse(this,e.gltf,null,e,i);return i.once("destroyed",()=>{this.viewer.metaScene.destroyMetaModel(r)}),i}destroy(){super.destroy()}}function kXt(t,e,i={}){const r="lightgrey",o=i.hoverColor||"rgba(0,0,0,0.4)",n=i.textColor||"black",s=i.canvasElement||document.body,a=500,l=a+a/3,c=l/24,d=[{boundary:[6,6,6,6],color:i.frontColor||i.color||"#55FF55"},{boundary:[18,6,6,6],color:i.backColor||i.color||"#55FF55"},{boundary:[12,6,6,6],color:i.rightColor||i.color||"#FF5555"},{boundary:[0,6,6,6],color:i.leftColor||i.color||"#FF5555"},{boundary:[6,0,6,6],color:i.topColor||i.color||"#7777FF"},{boundary:[6,12,6,6],color:i.bottomColor||i.color||"#7777FF"}],u=[{label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,1,0],up:[0,0,1]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,-1,0],up:[0,0,1]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,0,1]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,0,1]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,0,1],up:[0,-1,0]},{boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,0,-1],up:[1,0,1]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-1,-1],up:[0,-1,1]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,0,-1],up:[-1,0,1]},{boundaries:[[7,11,4,2]],dir:[0,1,1],up:[0,-1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,0,1],up:[-1,0,1]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-1,1],up:[0,1,1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,0,1],up:[1,0,1]},{boundaries:[[5,7,2,4]],dir:[1,1,0],up:[0,0,1]},{boundaries:[[11,7,2,4]],dir:[-1,1,0],up:[0,0,1]},{boundaries:[[17,7,2,4]],dir:[-1,-1,0],up:[0,0,1]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,-1,0],up:[0,0,1]},{boundaries:[[5,11,2,2]],dir:[1,1,1],up:[-1,-1,1]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[1,-1,1],up:[-1,1,1]},{boundaries:[[5,5,2,2]],dir:[1,1,-1],up:[1,1,1]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-1,-1,1],up:[1,1,1]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-1,-1,-1],up:[-1,-1,1]},{boundaries:[[11,11,2,2]],dir:[-1,1,1],up:[1,-1,1]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[1,-1,-1],up:[1,-1,1]},{boundaries:[[11,5,2,2]],dir:[-1,1,-1],up:[-1,1,1]}];i.frontColor||i.color,i.backColor||i.color,i.rightColor||i.color,i.leftColor||i.color,i.topColor||i.color,i.bottomColor||i.color;const h=[{yUp:"",label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,1,0]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,1,0]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,1,0]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,-1,0],up:[0,0,-1]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,1,0],up:[0,0,1]},{boundaries:[[7,5,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,-1,0],up:[1,1,0]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{boundaries:[[7,11,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,1,0],up:[-1,1,0]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,1,1],up:[0,1,-1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,1,0],up:[1,1,0]},{boundaries:[[5,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{boundaries:[[11,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{boundaries:[[17,7,2,4]],dir:[-1,0,1],up:[0,1,0]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,0,1],up:[0,1,0]},{boundaries:[[5,11,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{boundaries:[[5,5,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{boundaries:[[11,11,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{boundaries:[[11,5,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]}];for(let v=0,y=u.length;v<y;v++)k.normalizeVec3(u[v].dir,u[v].dir),k.normalizeVec3(u[v].up,u[v].up);for(let v=0,y=h.length;v<y;v++)k.normalizeVec3(h[v].dir,h[v].dir),k.normalizeVec3(h[v].up,h[v].up);var p=h;this._textureCanvas=document.createElement("canvas"),this._textureCanvas.width=l,this._textureCanvas.height=a,this._textureCanvas.style.width=l+"px",this._textureCanvas.style.height=a+"px",this._textureCanvas.style.padding="0",this._textureCanvas.style.margin="0",this._textureCanvas.style.top="0",this._textureCanvas.style.background=r,this._textureCanvas.style.position="absolute",this._textureCanvas.style.opacity="1.0",this._textureCanvas.style.visibility="hidden",this._textureCanvas.style["z-index"]=2e6,s.appendChild(this._textureCanvas);const g=this._textureCanvas.getContext("2d");let f=!1;function m(){for(let C=0,M=d.length;C<M;C++){const E=d[C],B=E.boundary,S=Math.round(B[0]*c),I=Math.round(B[1]*c),T=Math.round(B[2]*c),_=Math.round(B[3]*c);g.fillStyle=E.color,g.fillRect(S,I,T,_)}for(let C=0,M=p.length;C<M;C++){let E,B,S,I;const T=p[C],_=T.boundaries;for(var v=0,y=_.length;v<y;v++){const O=_[v];E=Math.round(O[0]*c),B=Math.round(O[1]*c),S=Math.round(O[2]*c),I=Math.round(O[3]*c),T.highlighted&&(g.fillStyle=T.highlighted?o:T.color||r,g.fillRect(E,B,S,I))}if(T.label){g.fillStyle=n,g.font="60px sans-serif",g.textAlign="center";var b=E+S*.5,w=B+I*.7;g.fillText(A(T.label),b,w,80)}}e.glRedraw()}const A=(function(){const v={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},y={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},b={"NavCube.front":"FRONT","NavCube.back":"BACK","NavCube.right":"RIGHT","NavCube.left":"LEFT","NavCube.top":"TOP","NavCube.bottom":"BOTTOM"};return function(w){const C=f?y:v,M=C?C[w]:null;return M?t.localeService.translate(M)||b[M]||M:w}})();this.setZUp=function(){f=!0,p=u,this.clear()},this.setYUp=function(){f=!1,p=h,this.clear()},this.clear=function(){g.fillStyle=r,g.fillRect(0,0,l,a);for(var v=0,y=p.length;v<y;v++){const b=p[v];b.highlighted=!1}m()},this.getArea=function(v){const y=v[0]*l,b=a-v[1]*a;for(var w=0,C=p.length;w<C;w++){const B=p[w].boundaries;for(var M=0,E=B.length;M<E;M++){const S=B[M];if(y>=S[0]*c&&y<=(S[0]+S[2])*c&&b>=S[1]*c&&b<=(S[1]+S[3])*c)return w}}return-1},this.setAreaHighlighted=function(v,y){var b=p[v];if(!b)throw"Area not found: "+v;b.highlighted=!!y,m()},this.getAreaDir=function(v){var y=p[v];if(!y)throw"Unknown area: "+v;return y.dir},this.getAreaUp=function(v){var y=p[v];if(!y)throw"Unknown area: "+v;return y.up},this.getImage=function(){return this._textureCanvas},this.destroy=function(){this._textureCanvas&&(this._textureCanvas.parentNode.removeChild(this._textureCanvas),this._textureCanvas=null)}}const Oue=k.vec3(),Uue=k.vec3();k.mat4();class cN extends kc{constructor(e,i={}){super("NavCube",e,i),e.navCube=this;try{this._navCubeScene=new eE(e,{canvasId:i.canvasId,canvasElement:i.canvasElement,transparent:!0}),this._navCubeCanvas=this._navCubeScene.canvas.canvas,this._navCubeScene.input.keyboardEnabled=!1}catch(A){this.error(A);return}const r=this._navCubeScene;r.clearLights(),new Ad(r,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new Ad(r,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new Ad(r,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._navCubeCamera=r.camera,this._navCubeCamera.ortho.scale=7,this._navCubeCamera.ortho.near=.1,this._navCubeCamera.ortho.far=2e3,r.edgeMaterial.edgeColor=[.2,.2,.2],r.edgeMaterial.edgeAlpha=.6,this._zUp=!!e.camera.zUp;var o=this;this.setIsProjectNorth(i.isProjectNorth),this.setProjectNorthOffsetAngle(i.projectNorthOffsetAngle);const n=(function(){const A=k.mat4();return function(v,y,b){return k.identityMat4(A),k.rotationMat4v(v*o._projectNorthOffsetAngle*k.DEGTORAD,[0,1,0],A),k.transformVec3(A,y,b)}})();this._synchCamera=(function(){var A=k.rotationMat4c(-90*k.DEGTORAD,1,0,0),v=k.vec3(),y=k.vec3(),b=k.vec3();return function(){var w=e.camera.eye,C=e.camera.look,M=e.camera.up;v=k.mulVec3Scalar(k.normalizeVec3(k.subVec3(w,C,v)),5),o._isProjectNorth&&o._projectNorthOffsetAngle&&(v=n(-1,v,Oue),M=n(-1,M,Uue)),o._zUp?(k.transformVec3(A,v,y),k.transformVec3(A,M,b),o._navCubeCamera.look=[0,0,0],o._navCubeCamera.eye=k.transformVec3(A,v,y),o._navCubeCamera.up=k.transformPoint3(A,M,b)):(o._navCubeCamera.look=[0,0,0],o._navCubeCamera.eye=v,o._navCubeCamera.up=M)}})(),this._cubeTextureCanvas=new kXt(e,r,i),this._cubeSampler=new cA(r,{image:this._cubeTextureCanvas.getImage(),flipY:!0,wrapS:sa,wrapT:sa}),this._cubeMesh=new nr(r,{geometry:new mo(r,{primitive:"triangles",normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),material:new vo(r,{diffuse:[.4,.4,.4],specular:[.4,.4,.4],emissive:[.6,.6,.6],diffuseMap:this._cubeSampler,emissiveMap:this._cubeSampler}),visible:!0,edges:!0}),this._shadow=i.shadowVisible===!1?null:new nr(r,{geometry:new mo(r,oA({center:[0,0,0],radiusTop:.001,radiusBottom:1.4,height:.01,radialSegments:20,heightSegments:1,openEnded:!0})),material:new vo(r,{diffuse:[0,0,0],specular:[0,0,0],emissive:[0,0,0],alpha:.5}),position:[0,-1.5,0],visible:!0,pickable:!1,backfaces:!1}),this._onCameraMatrix=e.camera.on("matrix",this._synchCamera),this._onCameraWorldAxis=e.camera.on("worldAxis",()=>{e.camera.zUp?(this._zUp=!0,this._cubeTextureCanvas.setZUp(),this._repaint(),this._synchCamera()):e.camera.yUp&&(this._zUp=!1,this._cubeTextureCanvas.setYUp(),this._repaint(),this._synchCamera())}),this._onCameraFOV=e.camera.perspective.on("fov",A=>{this._synchProjection&&(this._navCubeCamera.perspective.fov=A)}),this._onCameraProjection=e.camera.on("projection",A=>{this._synchProjection&&(this._navCubeCamera.projection=A==="ortho"||A==="perspective"?A:"perspective")});var s=-1;function a(A,v){var y=(A-g)*-p,b=(v-f)*-p;e.camera.orbitYaw(y),e.camera.orbitPitch(-b),g=A,f=v}function l(A){const{left:v,top:y}=o._navCubeCanvas.getBoundingClientRect();return[A.clientX-v,A.clientY-y]}{var c=null,d=null,u=!1,h=!1,p=.5,g,f;o._navCubeCanvas.addEventListener("mouseenter",o._onMouseEnter=function(A){h=!0}),o._navCubeCanvas.addEventListener("mouseleave",o._onMouseLeave=function(A){h=!1}),o._navCubeCanvas.addEventListener("mousedown",o._onMouseDown=function(A){if(A.which===1){c=A.x,d=A.y,g=A.clientX,f=A.clientY;var v=l({clientX:A.clientX,clientY:A.clientY}),y=r.pick({canvasPos:v});y?u=!0:u=!1}}),o._navCubeCanvas.addEventListener("mouseup",o._onMouseUp=function(A){if(A.which===1&&(u=!1,c!==null)){var v=l({clientX:A.clientX,clientY:A.clientY}),y=r.pick({canvasPos:v,pickSurface:!0});if(y&&y.uv){var b=o._cubeTextureCanvas.getArea(y.uv);if(b>=0&&(o._navCubeCanvas.style.cursor="pointer",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),b>=0)){if(o._cubeTextureCanvas.setAreaHighlighted(b,!0),s=b,o._repaint(),A.x<c-3||A.x>c+3||A.y<d-3||A.y>d+3)return;var w=o._cubeTextureCanvas.getAreaDir(b);if(w){var C=o._cubeTextureCanvas.getAreaUp(b);o._isProjectNorth&&o._projectNorthOffsetAngle&&(w=n(1,w,Oue),C=n(1,C,Uue)),m(w,C,function(){s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),o._navCubeCanvas.style.cursor="pointer",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),b>=0&&(o._cubeTextureCanvas.setAreaHighlighted(b,!1),s=-1,o._repaint())})}}}}}),o._navCubeCanvas.addEventListener("mousemove",o._onMouseMove=function(A){if(s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),!(A.buttons===1&&!u)){if(u){var v=A.clientX,y=A.clientY;o._navCubeCanvas.style.cursor="move",a(v,y);return}if(h){var b=l({clientX:A.clientX,clientY:A.clientY}),w=r.pick({canvasPos:b,pickSurface:!0});if(w){if(w.uv){o._navCubeCanvas.style.cursor="pointer";var C=o._cubeTextureCanvas.getArea(w.uv);if(C===s)return;s>=0&&o._cubeTextureCanvas.setAreaHighlighted(s,!1),C>=0&&(o._cubeTextureCanvas.setAreaHighlighted(C,!0),o._repaint(),s=C)}}else o._navCubeCanvas.style.cursor="default",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1)}}}),o._navCubeCanvas.addEventListener("touchstart",o._onTouchStart=function(A){if(A.touches.length>0){c=A.touches[0].clientX,d=A.touches[0].clientY,g=A.touches[0].clientX,f=A.touches[0].clientY;var v=l({clientX:A.touches[0].clientX,clientY:A.touches[0].clientY}),y=r.pick({canvasPos:v});y?u=!0:u=!1}},{passive:!1}),o._navCubeCanvas.addEventListener("touchmove",o._onTouchMove=function(A){A.preventDefault();var v=A.touches[0],y=v.clientX,b=v.clientY,w=document.elementFromPoint(y,b);if(h=o._navCubeCanvas===w,!!h&&u){a(y,b);return}},{passive:!1}),o._navCubeCanvas.addEventListener("touchend",o._onTouchEnd=function(A){u=!1});var m=(function(){var A=k.vec3();return function(v,y,b){var w=o._fitVisible?e.scene.getAABB(e.scene.visibleObjectIds):e.scene.aabb,C=k.getAABB3Diag(w);k.getAABB3Center(w,A);var M=Math.abs(C/Math.tan(o._cameraFitFOV*k.DEGTORAD));e.cameraControl.pivotPos=A,o._cameraFly?e.cameraFlight.flyTo({look:A,eye:[A[0]-M*v[0],A[1]-M*v[1],A[2]-M*v[2]],up:y||[0,1,0],orthoScale:C*1.1,fitFOV:o._cameraFitFOV,duration:o._cameraFlyDuration},b):e.cameraFlight.jumpTo({look:A,eye:[A[0]-M*v[0],A[1]-M*v[1],A[2]-M*v[2]],up:y||[0,1,0],orthoScale:C*1.1,fitFOV:o._cameraFitFOV},b)}})()}this._onUpdated=e.localeService.on("updated",()=>{this._cubeTextureCanvas.clear(),this._repaint()}),this.setVisible(i.visible),this.setCameraFitFOV(i.cameraFitFOV),this.setCameraFly(i.cameraFly),this.setCameraFlyDuration(i.cameraFlyDuration),this.setFitVisible(i.fitVisible),this.setSynchProjection(i.synchProjection)}send(e,i){switch(e){case"language":this._cubeTextureCanvas.clear(),this._repaint();break}}_repaint(){const e=this._cubeTextureCanvas.getImage();this._cubeMesh.material.diffuseMap.image=e,this._cubeMesh.material.emissiveMap.image=e}setVisible(e=!0){this._navCubeCanvas&&(this._cubeMesh.visible=e,this._shadow&&(this._shadow.visible=e),this._navCubeCanvas.style.visibility=e?"visible":"hidden")}getVisible(){return this._navCubeCanvas?this._cubeMesh.visible:!1}setFitVisible(e=!1){this._fitVisible=e}getFitVisible(){return this._fitVisible}setCameraFly(e=!0){this._cameraFly=e}getCameraFly(){return this._cameraFly}setCameraFitFOV(e=45){this._cameraFitFOV=e}getCameraFitFOV(){return this._cameraFitFOV}setCameraFlyDuration(e=.5){this._cameraFlyDuration=e}getCameraFlyDuration(){return this._cameraFlyDuration}setSynchProjection(e=!1){this._synchProjection=e}getSynchProjection(){return this._synchProjection}setIsProjectNorth(e=!1){this._isProjectNorth=e}getIsProjectNorth(){return this._isProjectNorth}setProjectNorthOffsetAngle(e){this._projectNorthOffsetAngle=e}getProjectNorthOffsetAngle(){return this._projectNorthOffsetAngle}destroy(){this._navCubeCanvas&&(this.viewer.localeService.off(this._onUpdated),this.viewer.camera.off(this._onCameraMatrix),this.viewer.camera.off(this._onCameraWorldAxis),this.viewer.camera.perspective.off(this._onCameraFOV),this.viewer.camera.off(this._onCameraProjection),this._navCubeCanvas.removeEventListener("mouseenter",this._onMouseEnter),this._navCubeCanvas.removeEventListener("mouseleave",this._onMouseLeave),this._navCubeCanvas.removeEventListener("mousedown",this._onMouseDown),this._navCubeCanvas.removeEventListener("mousemove",this._onMouseMove),this._navCubeCanvas.removeEventListener("mouseup",this._onMouseUp),this._navCubeCanvas.removeEventListener("touchstart",this._onTouchStart),this._navCubeCanvas.removeEventListener("touchmove",this._onTouchMove),this._navCubeCanvas.removeEventListener("touchend",this._onTouchEnd),this._navCubeCanvas=null,this._cubeTextureCanvas.destroy(),this._cubeTextureCanvas=null,this._onMouseEnter=null,this._onMouseLeave=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null),this._navCubeScene.destroy(),this._navCubeScene=null,this._cubeMesh=null,this._shadow=null,super.destroy()}}class MXt{constructor(e){const i=e.cameraControl,r=e.scene,o=r.canvas.canvas,n=!1,s=1,a=.09,l=.01,c=new R9(r,{position:[0,0,0],scale:[5,5,5],isObject:!1}),d=k.vec3();this._setPosition=(function(){const w=k.vec3(),C=k.vec3();return function(M){d.set(M),Cf(M,w,C),c.origin=w,c.position=C}})(),this._setQuaternion=w=>{c.quaternion=w};const u=(w,C)=>new mo(c,oA({radiusTop:.001,radiusBottom:w,radialSegments:32,heightSegments:1,height:C,openEnded:!1})),h=(w,C,M)=>new mo(c,oA({radiusTop:w,radiusBottom:w,radialSegments:M,heightSegments:1,height:C,openEnded:!1})),p=(w,C,M)=>new mo(c,HF({radius:s-.2,tube:w,radialSegments:64,tubeSegments:M,arc:Math.PI*2*C})),g={curve:p(l,.25,14),curveHandle:p(a,.25,14),hoop:p(l,1,8),arrowHead:u(.07,.2),arrowHeadBig:u(.09,.25),arrowHeadHandle:h(a,.37,8),axis:h(l,s,20),axisHandle:h(a,s,20)},f=w=>new vo(c,{diffuse:w,emissive:w,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),m=(w,C)=>new Lh(c,{edges:!1,fill:!0,fillColor:w,fillAlpha:C}),A=new vo(c,{diffuse:[1,1,0],alpha:0,alphaMode:"blend"}),v={},y=(w,C)=>{k.mulVec3Scalar(w,-1,k.vec3());const M=f(w),E=k.quaternionToRotationMat4(C,k.identityMat4());k.mulMat4(k.rotationMat4v(Math.PI,[0,1,0],k.mat4()),E,E);const B=k.scaleMat4v([.6,.6,.6],k.identityMat4()),S=(se,ue)=>{const be=k.translateMat4v(se,k.identityMat4()),he=k.identityMat4();return k.mulMat4(be,ue,he),k.mulMat4(E,he,he),k.mulMat4(he,B,k.identityMat4())},I=c.addChild(new nr(c,{geometry:g.curve,material:M,matrix:E,pickable:!1,collidable:!0,clippable:!1,backfaces:!0,visible:!1,isUI:!0,isObject:!1}),n),T=c.addChild(new nr(c,{geometry:g.curveHandle,material:A,matrix:E,pickable:!0,collidable:!0,clippable:!1,backfaces:!0,visible:!1,isUI:!0,isObject:!1}),n),_=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:S([.8,.07,0],k.rotationMat4v(180*k.DEGTORAD,[0,0,1],k.identityMat4())),pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),O=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:S([.07,.8,0],k.rotationMat4v(90*k.DEGTORAD,[0,0,1],k.identityMat4())),pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),j=c.addChild(new nr(c,{geometry:g.hoop,material:M,highlighted:!0,highlightMaterial:m(w,.6),matrix:E,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),N=k.quaternionToRotationMat4(k.vec3PairToQuaternion([0,1,0],w),k.identityMat4());k.mulMat4(k.rotationMat4v(Math.PI,[0,1,0],k.mat4()),N,N);const G=se=>k.mulMat4(N,k.translateMat4c(0,se,0,k.identityMat4()),k.identityMat4()),q=G(s+.1),X=G(s/2),me=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:q,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ce=c.addChild(new nr(c,{geometry:g.arrowHeadHandle,material:A,matrix:q,pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),xe=c.addChild(new nr(c,{geometry:g.axis,material:M,matrix:X,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),Re=c.addChild(new nr(c,{geometry:g.axisHandle,material:A,matrix:X,pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ge=c.addChild(new nr(c,{geometry:g.arrowHeadBig,material:M,matrix:q,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ee=(se,ue)=>k.vec3ApplyQuaternion(c.quaternion,se,ue),$=(function(){const se=k.vec3(),ue=k.vec3(),be=k.vec3();return(he,Q)=>{ee(w,se);const J=d,te=se;k.canvasPosToWorldRay(o,r.camera.viewMatrix,r.camera.projMatrix,r.camera.projection,he,ue,be);const ne=k.dotVec3(te,be),ae=k.subVec3(ue,J,Q),W=k.dotVec3(ae,te),K=k.dotVec3(ae,be),ve=1-ne*ne;if(Math.abs(ve)>1e-10){const we=(W-ne*K)/ve;return k.addVec3(J,k.mulVec3Scalar(te,we,Q),Q),!0}else return!1}})(),re=k.vec3(),ie=k.vec3();v[ce.id]=v[Re.id]={setActivated:se=>ge.visible=se,initDragAction:se=>$(se,re)&&k.subVec3(re,d,re)&&(ue=>{$(ue,ie)&&(k.subVec3(ie,re,ie),this._setPosition(ie),this._handlers&&this._handlers.onPosition(ie))})},v[T.id]={setActivated:se=>j.visible=se,initDragAction:se=>{const ue=(function(){const he=r.camera.projectWorldPos(d);ee(w,ie),k.transformVec3(r.camera.normalMatrix,ie,ie);const Q=Math.sign(ie[2]);return J=>{const te=J[0]-he[0],ne=J[1]-he[1];return Q*Math.atan2(-ne,te)}})();let be=ue(se);return he=>{const Q=ue(he);c.rotate(w,(Q-be)*180/Math.PI),this._handlers&&this._handlers.onQuaternion(c.quaternion),be=Q}}};let fe=!1,de=!1,Ae=!1;const Ue=()=>{const se=Ae&&fe;ce.visible=Re.visible=me.visible=xe.visible=!!se,se||(ge.visible=!1)},z=()=>{const se=Ae&&de;T.visible=I.visible=_.visible=O.visible=!!se,se||(j.visible=!1)};return{setPositionActive:se=>{fe=se,Ue()},setRotationActive:se=>{de=se,z()},set visible(se){Ae=se,Ue(),z()}}};this._displayMeshes={center:c.addChild(new nr(c,{geometry:new mo(c,nA({radius:.05})),material:new vo(c,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),pickable:!1,collidable:!0,clippable:!1,visible:!1,isObject:!1}),n),x:y([1,0,0],k.vec3PairToQuaternion([1,0,0],[0,0,1])),y:y([0,1,0],k.eulerToQuaternion([90,0,0],"XYZ")),z:y([0,0,1],k.identityQuaternion())};const b=[];{let w=-1;const C=E=>{c.scale[0]!==E&&(c.scale=[E,E,E],this._handlers&&this._handlers.onScreenScale&&this._handlers.onScreenScale(c.scale))},M=r.on("tick",()=>{const E=r.camera,B=Math.abs(k.distVec3(E.eye,d));E.projection==="perspective"?B!==w&&C(.07*B*Math.tan(E.perspective.fov*k.DEGTORAD)):E.projection==="ortho"&&C(E.ortho.scale/10),w=B});b.push(()=>r.off(M))}{let w=null,C=null;b.push(()=>{C&&C.cleanup()});const M=k.vec2(),E=(_,O)=>{O[0]=_.pageX,O[1]=_.pageY,vu(o.ownerDocument.documentElement,o,O)},B=_=>{E(_,M);const O=r.pick({canvasPos:M}),j=O&&O.entity,N=j&&j.id;return N in v&&v[N]},S=(_,O)=>{const j=B(O(_));if(j){C&&C.cleanup();const N=j.initDragAction(M);return N&&(i.pointerEnabled=!1,j.setActivated(!0),C={onChange:G=>{const q=O(G);q&&(E(q,M),N(M))},cleanup:function(){C=null,i.pointerEnabled=!0,j.setActivated(!1)}}),!!N}else return!1},I=(_,O)=>{o.addEventListener(_,O),b.push(()=>o.removeEventListener(_,O))},T=_=>{_.preventDefault(),_.stopPropagation(),_.stopImmediatePropagation()};I("mousedown",_=>{_.which===1&&S(_,O=>O.which===1&&O)&&T(_)}),I("mousemove",_=>{if(C)C.onChange(_),T(_);else{w&&w();const O=B(_);O?(O.setActivated(!0),w=()=>O.setActivated(!1)):w=null}}),I("mouseup",_=>{C&&(C.onChange(_),C.cleanup())}),I("touchstart",_=>{if(_.preventDefault(),_.touches.length===1){const O=_.touches[0].identifier;S(_,j=>[...j.changedTouches].find(N=>N.identifier===O))&&T(_)}}),I("touchmove",_=>{C&&(C.onChange(_),T(_))}),I("touchend",_=>{C&&(C.onChange(_),C.cleanup())})}this.__destroy=()=>{b.forEach(w=>w()),c.destroy();for(let w in v)delete v[w]}}destroy(){this.__destroy()}setHandlers(e){Object.values(this._displayMeshes).forEach(i=>i.visible=!!e),this._handlers=e,this._displayMeshes.x.setPositionActive(e&&e.onPosition),this._displayMeshes.y.setPositionActive(e&&e.onPosition),this._displayMeshes.z.setPositionActive(e&&e.onPosition),this._displayMeshes.x.setRotationActive(e&&e.onQuaternion),this._displayMeshes.y.setRotationActive(e&&e.onQuaternion),this._displayMeshes.z.setRotationActive(e&&e.onQuaternion)}setPosition(e){this._setPosition(e)}setQuaternion(e){this._setQuaternion(e)}}let EXt=class{constructor(t,e,i){this.id=i.id,this._sectionPlane=i,this._mesh=new nr(e,{id:i.id,geometry:new mo(e,UF({xSize:.5,ySize:.5,zSize:.001})),material:new vo(e,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new gO(e,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Lh(e,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Lh(e,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});{const r=k.vec3([0,0,0]),o=k.vec3(),n=k.vec3([0,0,1]),s=k.vec4(4),a=k.vec3(),l=()=>{const c=this._sectionPlane.scene.center,d=[-this._sectionPlane.dir[0],-this._sectionPlane.dir[1],-this._sectionPlane.dir[2]];k.subVec3(c,this._sectionPlane.pos,r);const u=-k.dotVec3(d,r);k.normalizeVec3(d),k.mulVec3Scalar(d,u,o);const h=k.vec3PairToQuaternion(n,this._sectionPlane.dir,s);a[0]=o[0]*.1,a[1]=o[1]*.1,a[2]=o[2]*.1,this._mesh.quaternion=h,this._mesh.position=a};this._onSectionPlanePos=this._sectionPlane.on("pos",l),this._onSectionPlaneDir=this._sectionPlane.on("dir",l)}this._highlighted=!1,this._selected=!1}setHighlighted(t){this._highlighted=!!t,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=t?[0,.7,0]:[0,0,0]}getHighlighted(){return this._highlighted}setSelected(t){this._selected=!!t,this._mesh.edgeMaterial.edgeWidth=t?3:1,this._mesh.highlightMaterial.edgeWidth=t?3:1}getSelected(){return this._selected}destroy(){this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._mesh.destroy()}};class BXt{constructor(e,i){if(!i.onHoverEnterPlane||!i.onHoverLeavePlane||!i.onClickedNothing||!i.onClickedPlane)throw"Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";this.plugin=e,this._viewer=e.viewer,this._onHoverEnterPlane=i.onHoverEnterPlane,this._onHoverLeavePlane=i.onHoverLeavePlane,this._onClickedNothing=i.onClickedNothing,this._onClickedPlane=i.onClickedPlane,this._visible=!0,this._planes={},this._canvas=i.overviewCanvas,this._scene=new eE(this._viewer,{canvasId:this._canvas.id,transparent:!0}),this._scene.clearLights(),new Ad(this._scene,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new Ad(this._scene,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new Ad(this._scene,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._scene.camera,this._scene.camera.perspective.fov=70,this._zUp=!1;{const o=this._scene.camera,n=k.rotationMat4c(-90*k.DEGTORAD,1,0,0),s=k.vec3(),a=k.vec3(),l=k.vec3();this._synchCamera=()=>{const c=this._viewer.camera.eye,d=this._viewer.camera.look,u=this._viewer.camera.up;k.mulVec3Scalar(k.normalizeVec3(k.subVec3(c,d,s)),7),this._zUp?(k.transformVec3(n,s,a),k.transformVec3(n,u,l),o.look=[0,0,0],o.eye=k.transformVec3(n,s,a),o.up=k.transformPoint3(n,u,l)):(o.look=[0,0,0],o.eye=s,o.up=u)}}this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera),this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera),this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",o=>{this._scene.camera.perspective.fov=o});{var r=null;this._onInputMouseMove=this._scene.input.on("mousemove",o=>{const n=this._scene.pick({canvasPos:o});n?(!r||n.entity.id!==r.id)&&(r&&this._planes[r.id]&&this._onHoverLeavePlane(r.id),r=n.entity,this._planes[r.id]&&this._onHoverEnterPlane(r.id)):r&&(this._onHoverLeavePlane(r.id),r=null)}),this._scene.canvas.canvas.addEventListener("mouseup",this._onCanvasMouseUp=()=>{r?this._planes[r.id]&&this._onClickedPlane(r.id):this._onClickedNothing()}),this._scene.canvas.canvas.addEventListener("mouseout",this._onCanvasMouseOut=()=>{r&&(this._onHoverLeavePlane(r.id),r=null)})}this.setVisible(i.overviewVisible)}addSectionPlane(e){this._planes[e.id]=new EXt(this,this._scene,e)}setPlaneHighlighted(e,i){const r=this._planes[e];r&&r.setHighlighted(i)}setPlaneSelected(e,i){const r=this._planes[e];r&&r.setSelected(i)}removeSectionPlane(e){const i=this._planes[e.id];i&&(i.destroy(),delete this._planes[e.id])}setVisible(e=!0){this._visible=e,this._canvas.style.visibility=e?"visible":"hidden"}getVisible(){return this._visible}destroy(){this._viewer.camera.off(this._onViewerCameraMatrix),this._viewer.camera.off(this._onViewerCameraWorldAxis),this._viewer.camera.perspective.off(this._onViewerCameraFOV),this._scene.input.off(this._onInputMouseMove),this._scene.canvas.canvas.removeEventListener("mouseup",this._onCanvasMouseUp),this._scene.canvas.canvas.removeEventListener("mouseout",this._onCanvasMouseOut),this._scene.destroy()}}const zh=k.AABB3(),_f=k.vec3();class PXt extends kc{constructor(e,i={}){if(super("SectionPlanes",e),this._freeControls=[],this._sectionPlanes=e.scene.sectionPlanes,this._controls={},this._shownControlId=null,i.overviewCanvasId!==null&&i.overviewCanvasId!==void 0){const r=document.getElementById(i.overviewCanvasId);r?this._overview=new BXt(this,{overviewCanvas:r,visible:i.overviewVisible,onHoverEnterPlane:(o=>{this._overview.setPlaneHighlighted(o,!0)}),onHoverLeavePlane:(o=>{this._overview.setPlaneHighlighted(o,!1)}),onClickedPlane:(o=>{if(this.getShownControl()===o){this.hideControl();return}this.showControl(o);const n=this.sectionPlanes[o].pos;zh.set(this.viewer.scene.aabb),k.getAABB3Center(zh,_f),zh[0]+=n[0]-_f[0],zh[1]+=n[1]-_f[1],zh[2]+=n[2]-_f[2],zh[3]+=n[0]-_f[0],zh[4]+=n[1]-_f[1],zh[5]+=n[2]-_f[2],this.viewer.cameraFlight.flyTo({aabb:zh,fitFOV:65})}),onClickedNothing:(()=>{this.hideControl()})}):this.warn("Can't find overview canvas: '"+i.overviewCanvasId+"' - will create plugin without overview")}this._onSceneSectionPlaneCreated=e.scene.on("sectionPlaneCreated",r=>{this._sectionPlaneCreated(r)})}setOverviewVisible(e){this._overview&&this._overview.setVisible(e)}getOverviewVisible(){if(this._overview)return this._overview.getVisible()}get sectionPlanes(){return this._sectionPlanes}createSectionPlane(e={}){return e.id!==void 0&&e.id!==null&&this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id),new KO(this.viewer.scene,{id:e.id,pos:e.pos,dir:e.dir,active:!0})}_sectionPlaneCreated(e){const i=this._freeControls.length>0?this._freeControls.pop():(()=>{const r=this.viewer.scene,o=(function(){const u=new R9(r,{isObject:!1});return u.addChild(new nr(u,{geometry:new mo(u,{primitive:"triangles",positions:[.5,.5,0,.5,-.5,0,-.5,-.5,0,-.5,.5,0,.5,.5,-0,.5,-.5,-0,-.5,-.5,-0,-.5,.5,-0],indices:[0,1,2,2,3,0]}),material:new vo(u,{emissive:[0,0,0],diffuse:[0,0,0],backfaces:!0}),opacity:.6,ghosted:!0,ghostMaterial:new Lh(u,{edges:!1,filled:!0,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!1,collidable:!0,clippable:!1,visible:!1,scale:[2.4,2.4,1],isObject:!1})),u.addChild(new nr(u,{geometry:new mo(u,HF({center:[0,0,0],radius:1.7,tube:.02,radialSegments:4,tubeSegments:4,arc:Math.PI*2})),material:new vo(u,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),highlightMaterial:new Lh(u,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,.1],rotation:[0,0,45],isObject:!1})),{setPosition:(function(){const h=k.vec3(),p=k.vec3();return function(g){Cf(g,h,p),u.origin=h,u.position=p}})(),setQuaternion:h=>{u.quaternion=h},setScale:h=>{u.scale=h},setVisible:h=>{u.visible=h},destroy:()=>{u.destroy()}}})();let n=()=>{};const s=new MXt(this.viewer);let a=!1,l=!1,c=null;const d=()=>{const u=l&&!a;o.setVisible(u),s.setHandlers(u&&c)};return{_destroy:()=>{n(),s.destroy(),o.destroy()},setCulled:u=>{a=u,d()},setVisible:u=>{l=u,d()},_setSectionPlane:u=>{if(n(),u){let h=!1;c={onPosition:A=>{o.setPosition(A),u.pos=A},onQuaternion:A=>{o.setQuaternion(A),h=!0,u.quaternion=A},onScreenScale:A=>{o.setScale(A)}};const p=()=>{o.setPosition(u.pos),s.setPosition(u.pos)},g=()=>{o.setQuaternion(u.quaternion),s.setQuaternion(u.quaternion)};p(),g();const f=u.on("pos",p),m=u.on("dir",()=>{h?h=!1:g()});n=()=>{u.off(f),u.off(m),n=()=>{}}}}}})();i._setSectionPlane(e),i.setVisible(!1),this._controls[e.id]=i,this._overview&&this._overview.addSectionPlane(e),e.once("destroyed",()=>{this._sectionPlaneDestroyed(e)})}flipSectionPlanes(){const e=this.viewer.scene.sectionPlanes;for(let i in e)e[i].flipDir()}showControl(e){const i=this._controls[e];if(!i){this.error("Control not found: "+e);return}this.hideControl(),i.setVisible(!0),this._overview&&this._overview.setPlaneSelected(e,!0),this._shownControlId=e}getShownControl(){return this._shownControlId}hideControl(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1));this._shownControlId=null}destroySectionPlane(e){var i=this.viewer.scene.sectionPlanes[e];if(!i){this.error("SectionPlane not found: "+e);return}this._sectionPlaneDestroyed(i),i.destroy(),e===this._shownControlId&&(this._shownControlId=null)}_sectionPlaneDestroyed(e){this._overview&&this._overview.removeSectionPlane(e);const i=this._controls[e.id];i&&(i.setVisible(!1),i._setSectionPlane(null),delete this._controls[e.id],this._freeControls.push(i))}clear(){const e=Object.keys(this._sectionPlanes);for(var i=0,r=e.length;i<r;i++)this.destroySectionPlane(e[i])}send(e,i){switch(e){case"snapshotStarting":for(let r in this._controls)this._controls.hasOwnProperty(r)&&this._controls[r].setCulled(!0);break;case"snapshotFinished":for(let r in this._controls)this._controls.hasOwnProperty(r)&&this._controls[r].setCulled(!1);break;case"clearSectionPlanes":this.clear();break}}destroy(){this.clear(),this._overview&&this._overview.destroy(),this._destroyFreeControls(),super.destroy()}_destroyFreeControls(){for(var e=this._freeControls.pop();e;)e._destroy(),e=this._freeControls.pop();this.viewer.scene.off(this._onSceneSectionPlaneCreated)}}class Nue{constructor(e={}){this.cacheBuster=e.cacheBuster!==!1}_cacheBusterURL(e){if(!this.cacheBuster)return e;const i=new Date().getTime();return e.indexOf("?")>-1?e+"&_="+i:e+"?_="+i}getManifest(e,i,r){Tt.loadJSON(this._cacheBusterURL(e),o=>{i(o)},function(o){r(o)})}getMetaModel(e,i,r){Tt.loadJSON(this._cacheBusterURL(e),o=>{i(o)},function(o){r(o)})}getXKT(e,i,r){var o=()=>{};i=i||o,r=r||o;const n=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(n);if(s){const c=!!s[2];var a=s[3];a=window.decodeURIComponent(a),c&&(a=window.atob(a));try{const d=new ArrayBuffer(a.length),u=new Uint8Array(d);for(var l=0;l<a.length;l++)u[l]=a.charCodeAt(l);i(d)}catch(d){r(d)}}else{const c=new XMLHttpRequest;c.open("GET",this._cacheBusterURL(e),!0),c.responseType="arraybuffer",c.onreadystatechange=function(){c.readyState===4&&(c.status===200?i(c.response):r("getXKT error : "+c.response))},c.send(null)}}}var HE={exports:{}},IXt=HE.exports,jue;function SXt(){return jue||(jue=1,(function(t,e){(function(i,r){r(e)})(IXt,(function(i){function r(L){let oe=L.length;for(;--oe>=0;)L[oe]=0}const o=256,n=286,s=30,a=15,l=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]),c=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]),d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),h=new Array(576);r(h);const p=new Array(60);r(p);const g=new Array(512);r(g);const f=new Array(256);r(f);const m=new Array(29);r(m);const A=new Array(s);function v(L,oe,U,Oe,De){this.static_tree=L,this.extra_bits=oe,this.extra_base=U,this.elems=Oe,this.max_length=De,this.has_stree=L&&L.length}let y,b,w;function C(L,oe){this.dyn_tree=L,this.max_code=0,this.stat_desc=oe}r(A);const M=L=>L<256?g[L]:g[256+(L>>>7)],E=(L,oe)=>{L.pending_buf[L.pending++]=255&oe,L.pending_buf[L.pending++]=oe>>>8&255},B=(L,oe,U)=>{L.bi_valid>16-U?(L.bi_buf|=oe<<L.bi_valid&65535,E(L,L.bi_buf),L.bi_buf=oe>>16-L.bi_valid,L.bi_valid+=U-16):(L.bi_buf|=oe<<L.bi_valid&65535,L.bi_valid+=U)},S=(L,oe,U)=>{B(L,U[2*oe],U[2*oe+1])},I=(L,oe)=>{let U=0;do U|=1&L,L>>>=1,U<<=1;while(--oe>0);return U>>>1},T=(L,oe,U)=>{const Oe=new Array(16);let De,Te,dt=0;for(De=1;De<=a;De++)dt=dt+U[De-1]<<1,Oe[De]=dt;for(Te=0;Te<=oe;Te++){let We=L[2*Te+1];We!==0&&(L[2*Te]=I(Oe[We]++,We))}},_=L=>{let oe;for(oe=0;oe<n;oe++)L.dyn_ltree[2*oe]=0;for(oe=0;oe<s;oe++)L.dyn_dtree[2*oe]=0;for(oe=0;oe<19;oe++)L.bl_tree[2*oe]=0;L.dyn_ltree[512]=1,L.opt_len=L.static_len=0,L.sym_next=L.matches=0},O=L=>{L.bi_valid>8?E(L,L.bi_buf):L.bi_valid>0&&(L.pending_buf[L.pending++]=L.bi_buf),L.bi_buf=0,L.bi_valid=0},j=(L,oe,U,Oe)=>{const De=2*oe,Te=2*U;return L[De]<L[Te]||L[De]===L[Te]&&Oe[oe]<=Oe[U]},N=(L,oe,U)=>{const Oe=L.heap[U];let De=U<<1;for(;De<=L.heap_len&&(De<L.heap_len&&j(oe,L.heap[De+1],L.heap[De],L.depth)&&De++,!j(oe,Oe,L.heap[De],L.depth));)L.heap[U]=L.heap[De],U=De,De<<=1;L.heap[U]=Oe},G=(L,oe,U)=>{let Oe,De,Te,dt,We=0;if(L.sym_next!==0)do Oe=255&L.pending_buf[L.sym_buf+We++],Oe+=(255&L.pending_buf[L.sym_buf+We++])<<8,De=L.pending_buf[L.sym_buf+We++],Oe===0?S(L,De,oe):(Te=f[De],S(L,Te+o+1,oe),dt=l[Te],dt!==0&&(De-=m[Te],B(L,De,dt)),Oe--,Te=M(Oe),S(L,Te,U),dt=c[Te],dt!==0&&(Oe-=A[Te],B(L,Oe,dt)));while(We<L.sym_next);S(L,256,oe)},q=(L,oe)=>{const U=oe.dyn_tree,Oe=oe.stat_desc.static_tree,De=oe.stat_desc.has_stree,Te=oe.stat_desc.elems;let dt,We,Ut,Xe=-1;for(L.heap_len=0,L.heap_max=573,dt=0;dt<Te;dt++)U[2*dt]!==0?(L.heap[++L.heap_len]=Xe=dt,L.depth[dt]=0):U[2*dt+1]=0;for(;L.heap_len<2;)Ut=L.heap[++L.heap_len]=Xe<2?++Xe:0,U[2*Ut]=1,L.depth[Ut]=0,L.opt_len--,De&&(L.static_len-=Oe[2*Ut+1]);for(oe.max_code=Xe,dt=L.heap_len>>1;dt>=1;dt--)N(L,U,dt);Ut=Te;do dt=L.heap[1],L.heap[1]=L.heap[L.heap_len--],N(L,U,1),We=L.heap[1],L.heap[--L.heap_max]=dt,L.heap[--L.heap_max]=We,U[2*Ut]=U[2*dt]+U[2*We],L.depth[Ut]=(L.depth[dt]>=L.depth[We]?L.depth[dt]:L.depth[We])+1,U[2*dt+1]=U[2*We+1]=Ut,L.heap[1]=Ut++,N(L,U,1);while(L.heap_len>=2);L.heap[--L.heap_max]=L.heap[1],((ct,Fi)=>{const ui=Fi.dyn_tree,Nt=Fi.max_code,vn=Fi.stat_desc.static_tree,Er=Fi.stat_desc.has_stree,yi=Fi.stat_desc.extra_bits,Lr=Fi.stat_desc.extra_base,_i=Fi.stat_desc.max_length;let Ht,Si,Fr,Gt,vr,Oi,bi=0;for(Gt=0;Gt<=a;Gt++)ct.bl_count[Gt]=0;for(ui[2*ct.heap[ct.heap_max]+1]=0,Ht=ct.heap_max+1;Ht<573;Ht++)Si=ct.heap[Ht],Gt=ui[2*ui[2*Si+1]+1]+1,Gt>_i&&(Gt=_i,bi++),ui[2*Si+1]=Gt,Si>Nt||(ct.bl_count[Gt]++,vr=0,Si>=Lr&&(vr=yi[Si-Lr]),Oi=ui[2*Si],ct.opt_len+=Oi*(Gt+vr),Er&&(ct.static_len+=Oi*(vn[2*Si+1]+vr)));if(bi!==0){do{for(Gt=_i-1;ct.bl_count[Gt]===0;)Gt--;ct.bl_count[Gt]--,ct.bl_count[Gt+1]+=2,ct.bl_count[_i]--,bi-=2}while(bi>0);for(Gt=_i;Gt!==0;Gt--)for(Si=ct.bl_count[Gt];Si!==0;)Fr=ct.heap[--Ht],Fr>Nt||(ui[2*Fr+1]!==Gt&&(ct.opt_len+=(Gt-ui[2*Fr+1])*ui[2*Fr],ui[2*Fr+1]=Gt),Si--)}})(L,oe),T(U,Xe,L.bl_count)},X=(L,oe,U)=>{let Oe,De,Te=-1,dt=oe[1],We=0,Ut=7,Xe=4;for(dt===0&&(Ut=138,Xe=3),oe[2*(U+1)+1]=65535,Oe=0;Oe<=U;Oe++)De=dt,dt=oe[2*(Oe+1)+1],++We<Ut&&De===dt||(We<Xe?L.bl_tree[2*De]+=We:De!==0?(De!==Te&&L.bl_tree[2*De]++,L.bl_tree[32]++):We<=10?L.bl_tree[34]++:L.bl_tree[36]++,We=0,Te=De,dt===0?(Ut=138,Xe=3):De===dt?(Ut=6,Xe=3):(Ut=7,Xe=4))},me=(L,oe,U)=>{let Oe,De,Te=-1,dt=oe[1],We=0,Ut=7,Xe=4;for(dt===0&&(Ut=138,Xe=3),Oe=0;Oe<=U;Oe++)if(De=dt,dt=oe[2*(Oe+1)+1],!(++We<Ut&&De===dt)){if(We<Xe)do S(L,De,L.bl_tree);while(--We!=0);else De!==0?(De!==Te&&(S(L,De,L.bl_tree),We--),S(L,16,L.bl_tree),B(L,We-3,2)):We<=10?(S(L,17,L.bl_tree),B(L,We-3,3)):(S(L,18,L.bl_tree),B(L,We-11,7));We=0,Te=De,dt===0?(Ut=138,Xe=3):De===dt?(Ut=6,Xe=3):(Ut=7,Xe=4)}};let ce=!1;const xe=(L,oe,U,Oe)=>{B(L,0+(Oe?1:0),3),O(L),E(L,U),E(L,~U),U&&L.pending_buf.set(L.window.subarray(oe,oe+U),L.pending),L.pending+=U};var Re=(L,oe,U,Oe)=>{let De,Te,dt=0;L.level>0?(L.strm.data_type===2&&(L.strm.data_type=(We=>{let Ut,Xe=4093624447;for(Ut=0;Ut<=31;Ut++,Xe>>>=1)if(1&Xe&&We.dyn_ltree[2*Ut]!==0)return 0;if(We.dyn_ltree[18]!==0||We.dyn_ltree[20]!==0||We.dyn_ltree[26]!==0)return 1;for(Ut=32;Ut<o;Ut++)if(We.dyn_ltree[2*Ut]!==0)return 1;return 0})(L)),q(L,L.l_desc),q(L,L.d_desc),dt=(We=>{let Ut;for(X(We,We.dyn_ltree,We.l_desc.max_code),X(We,We.dyn_dtree,We.d_desc.max_code),q(We,We.bl_desc),Ut=18;Ut>=3&&We.bl_tree[2*u[Ut]+1]===0;Ut--);return We.opt_len+=3*(Ut+1)+5+5+4,Ut})(L),De=L.opt_len+3+7>>>3,Te=L.static_len+3+7>>>3,Te<=De&&(De=Te)):De=Te=U+5,U+4<=De&&oe!==-1?xe(L,oe,U,Oe):L.strategy===4||Te===De?(B(L,2+(Oe?1:0),3),G(L,h,p)):(B(L,4+(Oe?1:0),3),((We,Ut,Xe,ct)=>{let Fi;for(B(We,Ut-257,5),B(We,Xe-1,5),B(We,ct-4,4),Fi=0;Fi<ct;Fi++)B(We,We.bl_tree[2*u[Fi]+1],3);me(We,We.dyn_ltree,Ut-1),me(We,We.dyn_dtree,Xe-1)})(L,L.l_desc.max_code+1,L.d_desc.max_code+1,dt+1),G(L,L.dyn_ltree,L.dyn_dtree)),_(L),Oe&&O(L)},ge={_tr_init:L=>{ce||((()=>{let oe,U,Oe,De,Te;const dt=new Array(16);for(Oe=0,De=0;De<28;De++)for(m[De]=Oe,oe=0;oe<1<<l[De];oe++)f[Oe++]=De;for(f[Oe-1]=De,Te=0,De=0;De<16;De++)for(A[De]=Te,oe=0;oe<1<<c[De];oe++)g[Te++]=De;for(Te>>=7;De<s;De++)for(A[De]=Te<<7,oe=0;oe<1<<c[De]-7;oe++)g[256+Te++]=De;for(U=0;U<=a;U++)dt[U]=0;for(oe=0;oe<=143;)h[2*oe+1]=8,oe++,dt[8]++;for(;oe<=255;)h[2*oe+1]=9,oe++,dt[9]++;for(;oe<=279;)h[2*oe+1]=7,oe++,dt[7]++;for(;oe<=287;)h[2*oe+1]=8,oe++,dt[8]++;for(T(h,287,dt),oe=0;oe<s;oe++)p[2*oe+1]=5,p[2*oe]=I(oe,5);y=new v(h,l,257,n,a),b=new v(p,c,0,s,a),w=new v(new Array(0),d,0,19,7)})(),ce=!0),L.l_desc=new C(L.dyn_ltree,y),L.d_desc=new C(L.dyn_dtree,b),L.bl_desc=new C(L.bl_tree,w),L.bi_buf=0,L.bi_valid=0,_(L)},_tr_stored_block:xe,_tr_flush_block:Re,_tr_tally:(L,oe,U)=>(L.pending_buf[L.sym_buf+L.sym_next++]=oe,L.pending_buf[L.sym_buf+L.sym_next++]=oe>>8,L.pending_buf[L.sym_buf+L.sym_next++]=U,oe===0?L.dyn_ltree[2*U]++:(L.matches++,oe--,L.dyn_ltree[2*(f[U]+o+1)]++,L.dyn_dtree[2*M(oe)]++),L.sym_next===L.sym_end),_tr_align:L=>{B(L,2,3),S(L,256,h),(oe=>{oe.bi_valid===16?(E(oe,oe.bi_buf),oe.bi_buf=0,oe.bi_valid=0):oe.bi_valid>=8&&(oe.pending_buf[oe.pending++]=255&oe.bi_buf,oe.bi_buf>>=8,oe.bi_valid-=8)})(L)}},ee=(L,oe,U,Oe)=>{let De=65535&L|0,Te=L>>>16&65535|0,dt=0;for(;U!==0;){dt=U>2e3?2e3:U,U-=dt;do De=De+oe[Oe++]|0,Te=Te+De|0;while(--dt);De%=65521,Te%=65521}return De|Te<<16|0};const $=new Uint32Array((()=>{let L,oe=[];for(var U=0;U<256;U++){L=U;for(var Oe=0;Oe<8;Oe++)L=1&L?3988292384^L>>>1:L>>>1;oe[U]=L}return oe})());var re=(L,oe,U,Oe)=>{const De=$,Te=Oe+U;L^=-1;for(let dt=Oe;dt<Te;dt++)L=L>>>8^De[255&(L^oe[dt])];return-1^L},ie={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"},fe={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:de,_tr_stored_block:Ae,_tr_flush_block:Ue,_tr_tally:z,_tr_align:se}=ge,{Z_NO_FLUSH:ue,Z_PARTIAL_FLUSH:be,Z_FULL_FLUSH:he,Z_FINISH:Q,Z_BLOCK:J,Z_OK:te,Z_STREAM_END:ne,Z_STREAM_ERROR:ae,Z_DATA_ERROR:W,Z_BUF_ERROR:K,Z_DEFAULT_COMPRESSION:ve,Z_FILTERED:we,Z_HUFFMAN_ONLY:pe,Z_RLE:Se,Z_FIXED:Ke,Z_DEFAULT_STRATEGY:Pe,Z_UNKNOWN:Ve,Z_DEFLATED:Ne}=fe,Je=258,at=262,Bt=42,Mt=113,yt=666,xt=(L,oe)=>(L.msg=ie[oe],oe),ze=L=>2*L-(L>4?9:0),At=L=>{let oe=L.length;for(;--oe>=0;)L[oe]=0},Ct=L=>{let oe,U,Oe,De=L.w_size;oe=L.hash_size,Oe=oe;do U=L.head[--Oe],L.head[Oe]=U>=De?U-De:0;while(--oe);oe=De,Oe=oe;do U=L.prev[--Oe],L.prev[Oe]=U>=De?U-De:0;while(--oe)};let st=(L,oe,U)=>(oe<<L.hash_shift^U)&L.hash_mask;const Ie=L=>{const oe=L.state;let U=oe.pending;U>L.avail_out&&(U=L.avail_out),U!==0&&(L.output.set(oe.pending_buf.subarray(oe.pending_out,oe.pending_out+U),L.next_out),L.next_out+=U,oe.pending_out+=U,L.total_out+=U,L.avail_out-=U,oe.pending-=U,oe.pending===0&&(oe.pending_out=0))},le=(L,oe)=>{Ue(L,L.block_start>=0?L.block_start:-1,L.strstart-L.block_start,oe),L.block_start=L.strstart,Ie(L.strm)},Fe=(L,oe)=>{L.pending_buf[L.pending++]=oe},Qe=(L,oe)=>{L.pending_buf[L.pending++]=oe>>>8&255,L.pending_buf[L.pending++]=255&oe},Pt=(L,oe,U,Oe)=>{let De=L.avail_in;return De>Oe&&(De=Oe),De===0?0:(L.avail_in-=De,oe.set(L.input.subarray(L.next_in,L.next_in+De),U),L.state.wrap===1?L.adler=ee(L.adler,oe,De,U):L.state.wrap===2&&(L.adler=re(L.adler,oe,De,U)),L.next_in+=De,L.total_in+=De,De)},bt=(L,oe)=>{let U,Oe,De=L.max_chain_length,Te=L.strstart,dt=L.prev_length,We=L.nice_match;const Ut=L.strstart>L.w_size-at?L.strstart-(L.w_size-at):0,Xe=L.window,ct=L.w_mask,Fi=L.prev,ui=L.strstart+Je;let Nt=Xe[Te+dt-1],vn=Xe[Te+dt];L.prev_length>=L.good_match&&(De>>=2),We>L.lookahead&&(We=L.lookahead);do if(U=oe,Xe[U+dt]===vn&&Xe[U+dt-1]===Nt&&Xe[U]===Xe[Te]&&Xe[++U]===Xe[Te+1]){Te+=2,U++;do;while(Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Te<ui);if(Oe=Je-(ui-Te),Te=ui-Je,Oe>dt){if(L.match_start=oe,dt=Oe,Oe>=We)break;Nt=Xe[Te+dt-1],vn=Xe[Te+dt]}}while((oe=Fi[oe&ct])>Ut&&--De!=0);return dt<=L.lookahead?dt:L.lookahead},ei=L=>{const oe=L.w_size;let U,Oe,De;do{if(Oe=L.window_size-L.lookahead-L.strstart,L.strstart>=oe+(oe-at)&&(L.window.set(L.window.subarray(oe,oe+oe-Oe),0),L.match_start-=oe,L.strstart-=oe,L.block_start-=oe,L.insert>L.strstart&&(L.insert=L.strstart),Ct(L),Oe+=oe),L.strm.avail_in===0)break;if(U=Pt(L.strm,L.window,L.strstart+L.lookahead,Oe),L.lookahead+=U,L.lookahead+L.insert>=3)for(De=L.strstart-L.insert,L.ins_h=L.window[De],L.ins_h=st(L,L.ins_h,L.window[De+1]);L.insert&&(L.ins_h=st(L,L.ins_h,L.window[De+3-1]),L.prev[De&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=De,De++,L.insert--,!(L.lookahead+L.insert<3)););}while(L.lookahead<at&&L.strm.avail_in!==0)},ii=(L,oe)=>{let U,Oe,De,Te=L.pending_buf_size-5>L.w_size?L.w_size:L.pending_buf_size-5,dt=0,We=L.strm.avail_in;do{if(U=65535,De=L.bi_valid+42>>3,L.strm.avail_out<De||(De=L.strm.avail_out-De,Oe=L.strstart-L.block_start,U>Oe+L.strm.avail_in&&(U=Oe+L.strm.avail_in),U>De&&(U=De),U<Te&&(U===0&&oe!==Q||oe===ue||U!==Oe+L.strm.avail_in)))break;dt=oe===Q&&U===Oe+L.strm.avail_in?1:0,Ae(L,0,0,dt),L.pending_buf[L.pending-4]=U,L.pending_buf[L.pending-3]=U>>8,L.pending_buf[L.pending-2]=~U,L.pending_buf[L.pending-1]=~U>>8,Ie(L.strm),Oe&&(Oe>U&&(Oe=U),L.strm.output.set(L.window.subarray(L.block_start,L.block_start+Oe),L.strm.next_out),L.strm.next_out+=Oe,L.strm.avail_out-=Oe,L.strm.total_out+=Oe,L.block_start+=Oe,U-=Oe),U&&(Pt(L.strm,L.strm.output,L.strm.next_out,U),L.strm.next_out+=U,L.strm.avail_out-=U,L.strm.total_out+=U)}while(dt===0);return We-=L.strm.avail_in,We&&(We>=L.w_size?(L.matches=2,L.window.set(L.strm.input.subarray(L.strm.next_in-L.w_size,L.strm.next_in),0),L.strstart=L.w_size,L.insert=L.strstart):(L.window_size-L.strstart<=We&&(L.strstart-=L.w_size,L.window.set(L.window.subarray(L.w_size,L.w_size+L.strstart),0),L.matches<2&&L.matches++,L.insert>L.strstart&&(L.insert=L.strstart)),L.window.set(L.strm.input.subarray(L.strm.next_in-We,L.strm.next_in),L.strstart),L.strstart+=We,L.insert+=We>L.w_size-L.insert?L.w_size-L.insert:We),L.block_start=L.strstart),L.high_water<L.strstart&&(L.high_water=L.strstart),dt?4:oe!==ue&&oe!==Q&&L.strm.avail_in===0&&L.strstart===L.block_start?2:(De=L.window_size-L.strstart,L.strm.avail_in>De&&L.block_start>=L.w_size&&(L.block_start-=L.w_size,L.strstart-=L.w_size,L.window.set(L.window.subarray(L.w_size,L.w_size+L.strstart),0),L.matches<2&&L.matches++,De+=L.w_size,L.insert>L.strstart&&(L.insert=L.strstart)),De>L.strm.avail_in&&(De=L.strm.avail_in),De&&(Pt(L.strm,L.window,L.strstart,De),L.strstart+=De,L.insert+=De>L.w_size-L.insert?L.w_size-L.insert:De),L.high_water<L.strstart&&(L.high_water=L.strstart),De=L.bi_valid+42>>3,De=L.pending_buf_size-De>65535?65535:L.pending_buf_size-De,Te=De>L.w_size?L.w_size:De,Oe=L.strstart-L.block_start,(Oe>=Te||(Oe||oe===Q)&&oe!==ue&&L.strm.avail_in===0&&Oe<=De)&&(U=Oe>De?De:Oe,dt=oe===Q&&L.strm.avail_in===0&&U===Oe?1:0,Ae(L,L.block_start,U,dt),L.block_start+=U,Ie(L.strm)),dt?3:1)},wi=(L,oe)=>{let U,Oe;for(;;){if(L.lookahead<at){if(ei(L),L.lookahead<at&&oe===ue)return 1;if(L.lookahead===0)break}if(U=0,L.lookahead>=3&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart),U!==0&&L.strstart-U<=L.w_size-at&&(L.match_length=bt(L,U)),L.match_length>=3)if(Oe=z(L,L.strstart-L.match_start,L.match_length-3),L.lookahead-=L.match_length,L.match_length<=L.max_lazy_match&&L.lookahead>=3){L.match_length--;do L.strstart++,L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart;while(--L.match_length!=0);L.strstart++}else L.strstart+=L.match_length,L.match_length=0,L.ins_h=L.window[L.strstart],L.ins_h=st(L,L.ins_h,L.window[L.strstart+1]);else Oe=z(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++;if(Oe&&(le(L,!1),L.strm.avail_out===0))return 1}return L.insert=L.strstart<2?L.strstart:2,oe===Q?(le(L,!0),L.strm.avail_out===0?3:4):L.sym_next&&(le(L,!1),L.strm.avail_out===0)?1:2},Ai=(L,oe)=>{let U,Oe,De;for(;;){if(L.lookahead<at){if(ei(L),L.lookahead<at&&oe===ue)return 1;if(L.lookahead===0)break}if(U=0,L.lookahead>=3&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart),L.prev_length=L.match_length,L.prev_match=L.match_start,L.match_length=2,U!==0&&L.prev_length<L.max_lazy_match&&L.strstart-U<=L.w_size-at&&(L.match_length=bt(L,U),L.match_length<=5&&(L.strategy===we||L.match_length===3&&L.strstart-L.match_start>4096)&&(L.match_length=2)),L.prev_length>=3&&L.match_length<=L.prev_length){De=L.strstart+L.lookahead-3,Oe=z(L,L.strstart-1-L.prev_match,L.prev_length-3),L.lookahead-=L.prev_length-1,L.prev_length-=2;do++L.strstart<=De&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart);while(--L.prev_length!=0);if(L.match_available=0,L.match_length=2,L.strstart++,Oe&&(le(L,!1),L.strm.avail_out===0))return 1}else if(L.match_available){if(Oe=z(L,0,L.window[L.strstart-1]),Oe&&le(L,!1),L.strstart++,L.lookahead--,L.strm.avail_out===0)return 1}else L.match_available=1,L.strstart++,L.lookahead--}return L.match_available&&(Oe=z(L,0,L.window[L.strstart-1]),L.match_available=0),L.insert=L.strstart<2?L.strstart:2,oe===Q?(le(L,!0),L.strm.avail_out===0?3:4):L.sym_next&&(le(L,!1),L.strm.avail_out===0)?1:2};function Fo(L,oe,U,Oe,De){this.good_length=L,this.max_lazy=oe,this.nice_length=U,this.max_chain=Oe,this.func=De}const Ji=[new Fo(0,0,0,0,ii),new Fo(4,4,8,4,wi),new Fo(4,5,16,8,wi),new Fo(4,6,32,32,wi),new Fo(4,4,16,16,Ai),new Fo(8,16,32,32,Ai),new Fo(8,16,128,128,Ai),new Fo(8,32,128,256,Ai),new Fo(32,128,258,1024,Ai),new Fo(32,258,258,4096,Ai)];function jg(){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=Ne,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),At(this.dyn_ltree),At(this.dyn_dtree),At(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),At(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),At(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 Hd=L=>{if(!L)return 1;const oe=L.state;return!oe||oe.strm!==L||oe.status!==Bt&&oe.status!==57&&oe.status!==69&&oe.status!==73&&oe.status!==91&&oe.status!==103&&oe.status!==Mt&&oe.status!==yt?1:0},V6=L=>{if(Hd(L))return xt(L,ae);L.total_in=L.total_out=0,L.data_type=Ve;const oe=L.state;return oe.pending=0,oe.pending_out=0,oe.wrap<0&&(oe.wrap=-oe.wrap),oe.status=oe.wrap===2?57:oe.wrap?Bt:Mt,L.adler=oe.wrap===2?0:1,oe.last_flush=-2,de(oe),te},M0=L=>{const oe=V6(L);var U;return oe===te&&((U=L.state).window_size=2*U.w_size,At(U.head),U.max_lazy_match=Ji[U.level].max_lazy,U.good_match=Ji[U.level].good_length,U.nice_match=Ji[U.level].nice_length,U.max_chain_length=Ji[U.level].max_chain,U.strstart=0,U.block_start=0,U.lookahead=0,U.insert=0,U.match_length=U.prev_length=2,U.match_available=0,U.ins_h=0),oe},q6=(L,oe,U,Oe,De,Te)=>{if(!L)return ae;let dt=1;if(oe===ve&&(oe=6),Oe<0?(dt=0,Oe=-Oe):Oe>15&&(dt=2,Oe-=16),De<1||De>9||U!==Ne||Oe<8||Oe>15||oe<0||oe>9||Te<0||Te>Ke||Oe===8&&dt!==1)return xt(L,ae);Oe===8&&(Oe=9);const We=new jg;return L.state=We,We.strm=L,We.status=Bt,We.wrap=dt,We.gzhead=null,We.w_bits=Oe,We.w_size=1<<We.w_bits,We.w_mask=We.w_size-1,We.hash_bits=De+7,We.hash_size=1<<We.hash_bits,We.hash_mask=We.hash_size-1,We.hash_shift=~~((We.hash_bits+3-1)/3),We.window=new Uint8Array(2*We.w_size),We.head=new Uint16Array(We.hash_size),We.prev=new Uint16Array(We.w_size),We.lit_bufsize=1<<De+6,We.pending_buf_size=4*We.lit_bufsize,We.pending_buf=new Uint8Array(We.pending_buf_size),We.sym_buf=We.lit_bufsize,We.sym_end=3*(We.lit_bufsize-1),We.level=oe,We.strategy=Te,We.method=U,M0(L)};var B1={deflateInit:(L,oe)=>q6(L,oe,Ne,15,8,Pe),deflateInit2:q6,deflateReset:M0,deflateResetKeep:V6,deflateSetHeader:(L,oe)=>Hd(L)||L.state.wrap!==2?ae:(L.state.gzhead=oe,te),deflate:(L,oe)=>{if(Hd(L)||oe>J||oe<0)return L?xt(L,ae):ae;const U=L.state;if(!L.output||L.avail_in!==0&&!L.input||U.status===yt&&oe!==Q)return xt(L,L.avail_out===0?K:ae);const Oe=U.last_flush;if(U.last_flush=oe,U.pending!==0){if(Ie(L),L.avail_out===0)return U.last_flush=-1,te}else if(L.avail_in===0&&ze(oe)<=ze(Oe)&&oe!==Q)return xt(L,K);if(U.status===yt&&L.avail_in!==0)return xt(L,K);if(U.status===Bt&&U.wrap===0&&(U.status=Mt),U.status===Bt){let De=Ne+(U.w_bits-8<<4)<<8,Te=-1;if(Te=U.strategy>=pe||U.level<2?0:U.level<6?1:U.level===6?2:3,De|=Te<<6,U.strstart!==0&&(De|=32),De+=31-De%31,Qe(U,De),U.strstart!==0&&(Qe(U,L.adler>>>16),Qe(U,65535&L.adler)),L.adler=1,U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(U.status===57){if(L.adler=0,Fe(U,31),Fe(U,139),Fe(U,8),U.gzhead)Fe(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),Fe(U,255&U.gzhead.time),Fe(U,U.gzhead.time>>8&255),Fe(U,U.gzhead.time>>16&255),Fe(U,U.gzhead.time>>24&255),Fe(U,U.level===9?2:U.strategy>=pe||U.level<2?4:0),Fe(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(Fe(U,255&U.gzhead.extra.length),Fe(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(L.adler=re(L.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69;else if(Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,U.level===9?2:U.strategy>=pe||U.level<2?4:0),Fe(U,3),U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(U.status===69){if(U.gzhead.extra){let De=U.pending,Te=(65535&U.gzhead.extra.length)-U.gzindex;for(;U.pending+Te>U.pending_buf_size;){let We=U.pending_buf_size-U.pending;if(U.pending_buf.set(U.gzhead.extra.subarray(U.gzindex,U.gzindex+We),U.pending),U.pending=U.pending_buf_size,U.gzhead.hcrc&&U.pending>De&&(L.adler=re(L.adler,U.pending_buf,U.pending-De,De)),U.gzindex+=We,Ie(L),U.pending!==0)return U.last_flush=-1,te;De=0,Te-=We}let dt=new Uint8Array(U.gzhead.extra);U.pending_buf.set(dt.subarray(U.gzindex,U.gzindex+Te),U.pending),U.pending+=Te,U.gzhead.hcrc&&U.pending>De&&(L.adler=re(L.adler,U.pending_buf,U.pending-De,De)),U.gzindex=0}U.status=73}if(U.status===73){if(U.gzhead.name){let De,Te=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),Ie(L),U.pending!==0)return U.last_flush=-1,te;Te=0}De=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,Fe(U,De)}while(De!==0);U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),U.gzindex=0}U.status=91}if(U.status===91){if(U.gzhead.comment){let De,Te=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),Ie(L),U.pending!==0)return U.last_flush=-1,te;Te=0}De=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,Fe(U,De)}while(De!==0);U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te))}U.status=103}if(U.status===103){if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size&&(Ie(L),U.pending!==0))return U.last_flush=-1,te;Fe(U,255&L.adler),Fe(U,L.adler>>8&255),L.adler=0}if(U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(L.avail_in!==0||U.lookahead!==0||oe!==ue&&U.status!==yt){let De=U.level===0?ii(U,oe):U.strategy===pe?((Te,dt)=>{let We;for(;;){if(Te.lookahead===0&&(ei(Te),Te.lookahead===0)){if(dt===ue)return 1;break}if(Te.match_length=0,We=z(Te,0,Te.window[Te.strstart]),Te.lookahead--,Te.strstart++,We&&(le(Te,!1),Te.strm.avail_out===0))return 1}return Te.insert=0,dt===Q?(le(Te,!0),Te.strm.avail_out===0?3:4):Te.sym_next&&(le(Te,!1),Te.strm.avail_out===0)?1:2})(U,oe):U.strategy===Se?((Te,dt)=>{let We,Ut,Xe,ct;const Fi=Te.window;for(;;){if(Te.lookahead<=Je){if(ei(Te),Te.lookahead<=Je&&dt===ue)return 1;if(Te.lookahead===0)break}if(Te.match_length=0,Te.lookahead>=3&&Te.strstart>0&&(Xe=Te.strstart-1,Ut=Fi[Xe],Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe])){ct=Te.strstart+Je;do;while(Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Xe<ct);Te.match_length=Je-(ct-Xe),Te.match_length>Te.lookahead&&(Te.match_length=Te.lookahead)}if(Te.match_length>=3?(We=z(Te,1,Te.match_length-3),Te.lookahead-=Te.match_length,Te.strstart+=Te.match_length,Te.match_length=0):(We=z(Te,0,Te.window[Te.strstart]),Te.lookahead--,Te.strstart++),We&&(le(Te,!1),Te.strm.avail_out===0))return 1}return Te.insert=0,dt===Q?(le(Te,!0),Te.strm.avail_out===0?3:4):Te.sym_next&&(le(Te,!1),Te.strm.avail_out===0)?1:2})(U,oe):Ji[U.level].func(U,oe);if(De!==3&&De!==4||(U.status=yt),De===1||De===3)return L.avail_out===0&&(U.last_flush=-1),te;if(De===2&&(oe===be?se(U):oe!==J&&(Ae(U,0,0,!1),oe===he&&(At(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),Ie(L),L.avail_out===0))return U.last_flush=-1,te}return oe!==Q?te:U.wrap<=0?ne:(U.wrap===2?(Fe(U,255&L.adler),Fe(U,L.adler>>8&255),Fe(U,L.adler>>16&255),Fe(U,L.adler>>24&255),Fe(U,255&L.total_in),Fe(U,L.total_in>>8&255),Fe(U,L.total_in>>16&255),Fe(U,L.total_in>>24&255)):(Qe(U,L.adler>>>16),Qe(U,65535&L.adler)),Ie(L),U.wrap>0&&(U.wrap=-U.wrap),U.pending!==0?te:ne)},deflateEnd:L=>{if(Hd(L))return ae;const oe=L.state.status;return L.state=null,oe===Mt?xt(L,W):te},deflateSetDictionary:(L,oe)=>{let U=oe.length;if(Hd(L))return ae;const Oe=L.state,De=Oe.wrap;if(De===2||De===1&&Oe.status!==Bt||Oe.lookahead)return ae;if(De===1&&(L.adler=ee(L.adler,oe,U,0)),Oe.wrap=0,U>=Oe.w_size){De===0&&(At(Oe.head),Oe.strstart=0,Oe.block_start=0,Oe.insert=0);let Ut=new Uint8Array(Oe.w_size);Ut.set(oe.subarray(U-Oe.w_size,U),0),oe=Ut,U=Oe.w_size}const Te=L.avail_in,dt=L.next_in,We=L.input;for(L.avail_in=U,L.next_in=0,L.input=oe,ei(Oe);Oe.lookahead>=3;){let Ut=Oe.strstart,Xe=Oe.lookahead-2;do Oe.ins_h=st(Oe,Oe.ins_h,Oe.window[Ut+3-1]),Oe.prev[Ut&Oe.w_mask]=Oe.head[Oe.ins_h],Oe.head[Oe.ins_h]=Ut,Ut++;while(--Xe);Oe.strstart=Ut,Oe.lookahead=2,ei(Oe)}return Oe.strstart+=Oe.lookahead,Oe.block_start=Oe.strstart,Oe.insert=Oe.lookahead,Oe.lookahead=0,Oe.match_length=Oe.prev_length=2,Oe.match_available=0,L.next_in=dt,L.input=We,L.avail_in=Te,Oe.wrap=De,te},deflateInfo:"pako deflate (from Nodeca project)"};const dS=(L,oe)=>Object.prototype.hasOwnProperty.call(L,oe);var ow=function(L){const oe=Array.prototype.slice.call(arguments,1);for(;oe.length;){const U=oe.shift();if(U){if(typeof U!="object")throw new TypeError(U+"must be non-object");for(const Oe in U)dS(U,Oe)&&(L[Oe]=U[Oe])}}return L},nw=L=>{let oe=0;for(let Oe=0,De=L.length;Oe<De;Oe++)oe+=L[Oe].length;const U=new Uint8Array(oe);for(let Oe=0,De=0,Te=L.length;Oe<Te;Oe++){let dt=L[Oe];U.set(dt,De),De+=dt.length}return U};let sw=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{sw=!1}const E0=new Uint8Array(256);for(let L=0;L<256;L++)E0[L]=L>=252?6:L>=248?5:L>=240?4:L>=224?3:L>=192?2:1;E0[254]=E0[254]=1;var G6=L=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(L);let oe,U,Oe,De,Te,dt=L.length,We=0;for(De=0;De<dt;De++)U=L.charCodeAt(De),(64512&U)==55296&&De+1<dt&&(Oe=L.charCodeAt(De+1),(64512&Oe)==56320&&(U=65536+(U-55296<<10)+(Oe-56320),De++)),We+=U<128?1:U<2048?2:U<65536?3:4;for(oe=new Uint8Array(We),Te=0,De=0;Te<We;De++)U=L.charCodeAt(De),(64512&U)==55296&&De+1<dt&&(Oe=L.charCodeAt(De+1),(64512&Oe)==56320&&(U=65536+(U-55296<<10)+(Oe-56320),De++)),U<128?oe[Te++]=U:U<2048?(oe[Te++]=192|U>>>6,oe[Te++]=128|63&U):U<65536?(oe[Te++]=224|U>>>12,oe[Te++]=128|U>>>6&63,oe[Te++]=128|63&U):(oe[Te++]=240|U>>>18,oe[Te++]=128|U>>>12&63,oe[Te++]=128|U>>>6&63,oe[Te++]=128|63&U);return oe},Ce=(L,oe)=>{const U=oe||L.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(L.subarray(0,oe));let Oe,De;const Te=new Array(2*U);for(De=0,Oe=0;Oe<U;){let dt=L[Oe++];if(dt<128){Te[De++]=dt;continue}let We=E0[dt];if(We>4)Te[De++]=65533,Oe+=We-1;else{for(dt&=We===2?31:We===3?15:7;We>1&&Oe<U;)dt=dt<<6|63&L[Oe++],We--;We>1?Te[De++]=65533:dt<65536?Te[De++]=dt:(dt-=65536,Te[De++]=55296|dt>>10&1023,Te[De++]=56320|1023&dt)}}return((dt,We)=>{if(We<65534&&dt.subarray&&sw)return String.fromCharCode.apply(null,dt.length===We?dt:dt.subarray(0,We));let Ut="";for(let Xe=0;Xe<We;Xe++)Ut+=String.fromCharCode(dt[Xe]);return Ut})(Te,De)},tt=(L,oe)=>{(oe=oe||L.length)>L.length&&(oe=L.length);let U=oe-1;for(;U>=0&&(192&L[U])==128;)U--;return U<0||U===0?oe:U+E0[L[U]]>oe?U:oe},ft=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 mt=Object.prototype.toString,{Z_NO_FLUSH:$e,Z_SYNC_FLUSH:Ot,Z_FULL_FLUSH:Xt,Z_FINISH:oi,Z_OK:ti,Z_STREAM_END:Bi,Z_DEFAULT_COMPRESSION:Ii,Z_DEFAULT_STRATEGY:Pi,Z_DEFLATED:mr}=fe;function _r(L){this.options=ow({level:Ii,method:mr,chunkSize:16384,windowBits:15,memLevel:8,strategy:Pi},L||{});let oe=this.options;oe.raw&&oe.windowBits>0?oe.windowBits=-oe.windowBits:oe.gzip&&oe.windowBits>0&&oe.windowBits<16&&(oe.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;let U=B1.deflateInit2(this.strm,oe.level,oe.method,oe.windowBits,oe.memLevel,oe.strategy);if(U!==ti)throw new Error(ie[U]);if(oe.header&&B1.deflateSetHeader(this.strm,oe.header),oe.dictionary){let Oe;if(Oe=typeof oe.dictionary=="string"?G6(oe.dictionary):mt.call(oe.dictionary)==="[object ArrayBuffer]"?new Uint8Array(oe.dictionary):oe.dictionary,U=B1.deflateSetDictionary(this.strm,Oe),U!==ti)throw new Error(ie[U]);this._dict_set=!0}}function to(L,oe){const U=new _r(oe);if(U.push(L,!0),U.err)throw U.msg||ie[U.err];return U.result}_r.prototype.push=function(L,oe){const U=this.strm,Oe=this.options.chunkSize;let De,Te;if(this.ended)return!1;for(Te=oe===~~oe?oe:oe===!0?oi:$e,typeof L=="string"?U.input=G6(L):mt.call(L)==="[object ArrayBuffer]"?U.input=new Uint8Array(L):U.input=L,U.next_in=0,U.avail_in=U.input.length;;)if(U.avail_out===0&&(U.output=new Uint8Array(Oe),U.next_out=0,U.avail_out=Oe),(Te===Ot||Te===Xt)&&U.avail_out<=6)this.onData(U.output.subarray(0,U.next_out)),U.avail_out=0;else{if(De=B1.deflate(U,Te),De===Bi)return U.next_out>0&&this.onData(U.output.subarray(0,U.next_out)),De=B1.deflateEnd(this.strm),this.onEnd(De),this.ended=!0,De===ti;if(U.avail_out!==0){if(Te>0&&U.next_out>0)this.onData(U.output.subarray(0,U.next_out)),U.avail_out=0;else if(U.avail_in===0)break}else this.onData(U.output)}return!0},_r.prototype.onData=function(L){this.chunks.push(L)},_r.prototype.onEnd=function(L){L===ti&&(this.result=nw(this.chunks)),this.chunks=[],this.err=L,this.msg=this.strm.msg};var Po={Deflate:_r,deflate:to,deflateRaw:function(L,oe){return(oe=oe||{}).raw=!0,to(L,oe)},gzip:function(L,oe){return(oe=oe||{}).gzip=!0,to(L,oe)}};const jr=16209;var pi=function(L,oe){let U,Oe,De,Te,dt,We,Ut,Xe,ct,Fi,ui,Nt,vn,Er,yi,Lr,_i,Ht,Si,Fr,Gt,vr,Oi,bi;const ir=L.state;U=L.next_in,Oi=L.input,Oe=U+(L.avail_in-5),De=L.next_out,bi=L.output,Te=De-(oe-L.avail_out),dt=De+(L.avail_out-257),We=ir.dmax,Ut=ir.wsize,Xe=ir.whave,ct=ir.wnext,Fi=ir.window,ui=ir.hold,Nt=ir.bits,vn=ir.lencode,Er=ir.distcode,yi=(1<<ir.lenbits)-1,Lr=(1<<ir.distbits)-1;e:do{Nt<15&&(ui+=Oi[U++]<<Nt,Nt+=8,ui+=Oi[U++]<<Nt,Nt+=8),_i=vn[ui&yi];t:for(;;){if(Ht=_i>>>24,ui>>>=Ht,Nt-=Ht,Ht=_i>>>16&255,Ht===0)bi[De++]=65535&_i;else{if(!(16&Ht)){if((64&Ht)==0){_i=vn[(65535&_i)+(ui&(1<<Ht)-1)];continue t}if(32&Ht){ir.mode=16191;break e}L.msg="invalid literal/length code",ir.mode=jr;break e}Si=65535&_i,Ht&=15,Ht&&(Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8),Si+=ui&(1<<Ht)-1,ui>>>=Ht,Nt-=Ht),Nt<15&&(ui+=Oi[U++]<<Nt,Nt+=8,ui+=Oi[U++]<<Nt,Nt+=8),_i=Er[ui&Lr];i:for(;;){if(Ht=_i>>>24,ui>>>=Ht,Nt-=Ht,Ht=_i>>>16&255,!(16&Ht)){if((64&Ht)==0){_i=Er[(65535&_i)+(ui&(1<<Ht)-1)];continue i}L.msg="invalid distance code",ir.mode=jr;break e}if(Fr=65535&_i,Ht&=15,Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8,Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8)),Fr+=ui&(1<<Ht)-1,Fr>We){L.msg="invalid distance too far back",ir.mode=jr;break e}if(ui>>>=Ht,Nt-=Ht,Ht=De-Te,Fr>Ht){if(Ht=Fr-Ht,Ht>Xe&&ir.sane){L.msg="invalid distance too far back",ir.mode=jr;break e}if(Gt=0,vr=Fi,ct===0){if(Gt+=Ut-Ht,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}}else if(ct<Ht){if(Gt+=Ut+ct-Ht,Ht-=ct,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);if(Gt=0,ct<Si){Ht=ct,Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}}}else if(Gt+=ct-Ht,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}for(;Si>2;)bi[De++]=vr[Gt++],bi[De++]=vr[Gt++],bi[De++]=vr[Gt++],Si-=3;Si&&(bi[De++]=vr[Gt++],Si>1&&(bi[De++]=vr[Gt++]))}else{Gt=De-Fr;do bi[De++]=bi[Gt++],bi[De++]=bi[Gt++],bi[De++]=bi[Gt++],Si-=3;while(Si>2);Si&&(bi[De++]=bi[Gt++],Si>1&&(bi[De++]=bi[Gt++]))}break}}break}}while(U<Oe&&De<dt);Si=Nt>>3,U-=Si,Nt-=Si<<3,ui&=(1<<Nt)-1,L.next_in=U,L.next_out=De,L.avail_in=U<Oe?Oe-U+5:5-(U-Oe),L.avail_out=De<dt?dt-De+257:257-(De-dt),ir.hold=ui,ir.bits=Nt};const rn=15,Jc=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]),Pl=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]),P1=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]),Aa=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 Zc=(L,oe,U,Oe,De,Te,dt,We)=>{const Ut=We.bits;let Xe,ct,Fi,ui,Nt,vn,Er=0,yi=0,Lr=0,_i=0,Ht=0,Si=0,Fr=0,Gt=0,vr=0,Oi=0,bi=null;const ir=new Uint16Array(16),ma=new Uint16Array(16);let J6,uw,hw,pw=null;for(Er=0;Er<=rn;Er++)ir[Er]=0;for(yi=0;yi<Oe;yi++)ir[oe[U+yi]]++;for(Ht=Ut,_i=rn;_i>=1&&ir[_i]===0;_i--);if(Ht>_i&&(Ht=_i),_i===0)return De[Te++]=20971520,De[Te++]=20971520,We.bits=1,0;for(Lr=1;Lr<_i&&ir[Lr]===0;Lr++);for(Ht<Lr&&(Ht=Lr),Gt=1,Er=1;Er<=rn;Er++)if(Gt<<=1,Gt-=ir[Er],Gt<0)return-1;if(Gt>0&&(L===0||_i!==1))return-1;for(ma[1]=0,Er=1;Er<rn;Er++)ma[Er+1]=ma[Er]+ir[Er];for(yi=0;yi<Oe;yi++)oe[U+yi]!==0&&(dt[ma[oe[U+yi]]++]=yi);if(L===0?(bi=pw=dt,vn=20):L===1?(bi=Jc,pw=Pl,vn=257):(bi=P1,pw=Aa,vn=0),Oi=0,yi=0,Er=Lr,Nt=Te,Si=Ht,Fr=0,Fi=-1,vr=1<<Ht,ui=vr-1,L===1&&vr>852||L===2&&vr>592)return 1;for(;;){J6=Er-Fr,dt[yi]+1<vn?(uw=0,hw=dt[yi]):dt[yi]>=vn?(uw=pw[dt[yi]-vn],hw=bi[dt[yi]-vn]):(uw=96,hw=0),Xe=1<<Er-Fr,ct=1<<Si,Lr=ct;do ct-=Xe,De[Nt+(Oi>>Fr)+ct]=J6<<24|uw<<16|hw|0;while(ct!==0);for(Xe=1<<Er-1;Oi&Xe;)Xe>>=1;if(Xe!==0?(Oi&=Xe-1,Oi+=Xe):Oi=0,yi++,--ir[Er]==0){if(Er===_i)break;Er=oe[U+dt[yi]]}if(Er>Ht&&(Oi&ui)!==Fi){for(Fr===0&&(Fr=Ht),Nt+=Lr,Si=Er-Fr,Gt=1<<Si;Si+Fr<_i&&(Gt-=ir[Si+Fr],!(Gt<=0));)Si++,Gt<<=1;if(vr+=1<<Si,L===1&&vr>852||L===2&&vr>592)return 1;Fi=Oi&ui,De[Fi]=Ht<<24|Si<<16|Nt-Te|0}}return Oi!==0&&(De[Nt+Oi]=Er-Fr<<24|64<<16|0),We.bits=Ht,0};const{Z_FINISH:Co,Z_BLOCK:tl,Z_TREES:ws,Z_OK:Io,Z_STREAM_END:Il,Z_NEED_DICT:Q6,Z_STREAM_ERROR:Sn,Z_DATA_ERROR:nK,Z_MEM_ERROR:sK,Z_BUF_ERROR:Zxe,Z_DEFLATED:aK}=fe,aw=16180,lw=16190,$u=16191,uS=16192,hS=16194,cw=16199,dw=16200,pS=16206,Oo=16209,lK=L=>(L>>>24&255)+(L>>>8&65280)+((65280&L)<<8)+((255&L)<<24);function Xxe(){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 B0=L=>{if(!L)return 1;const oe=L.state;return!oe||oe.strm!==L||oe.mode<aw||oe.mode>16211?1:0},cK=L=>{if(B0(L))return Sn;const oe=L.state;return L.total_in=L.total_out=oe.total=0,L.msg="",oe.wrap&&(L.adler=1&oe.wrap),oe.mode=aw,oe.last=0,oe.havedict=0,oe.flags=-1,oe.dmax=32768,oe.head=null,oe.hold=0,oe.bits=0,oe.lencode=oe.lendyn=new Int32Array(852),oe.distcode=oe.distdyn=new Int32Array(592),oe.sane=1,oe.back=-1,Io},dK=L=>{if(B0(L))return Sn;const oe=L.state;return oe.wsize=0,oe.whave=0,oe.wnext=0,cK(L)},uK=(L,oe)=>{let U;if(B0(L))return Sn;const Oe=L.state;return oe<0?(U=0,oe=-oe):(U=5+(oe>>4),oe<48&&(oe&=15)),oe&&(oe<8||oe>15)?Sn:(Oe.window!==null&&Oe.wbits!==oe&&(Oe.window=null),Oe.wrap=U,Oe.wbits=oe,dK(L))},hK=(L,oe)=>{if(!L)return Sn;const U=new Xxe;L.state=U,U.strm=L,U.window=null,U.mode=aw;const Oe=uK(L,oe);return Oe!==Io&&(L.state=null),Oe};let fS,gS,pK=!0;const Yxe=L=>{if(pK){fS=new Int32Array(512),gS=new Int32Array(32);let oe=0;for(;oe<144;)L.lens[oe++]=8;for(;oe<256;)L.lens[oe++]=9;for(;oe<280;)L.lens[oe++]=7;for(;oe<288;)L.lens[oe++]=8;for(Zc(1,L.lens,0,288,fS,0,L.work,{bits:9}),oe=0;oe<32;)L.lens[oe++]=5;Zc(2,L.lens,0,32,gS,0,L.work,{bits:5}),pK=!1}L.lencode=fS,L.lenbits=9,L.distcode=gS,L.distbits=5},fK=(L,oe,U,Oe)=>{let De;const Te=L.state;return Te.window===null&&(Te.wsize=1<<Te.wbits,Te.wnext=0,Te.whave=0,Te.window=new Uint8Array(Te.wsize)),Oe>=Te.wsize?(Te.window.set(oe.subarray(U-Te.wsize,U),0),Te.wnext=0,Te.whave=Te.wsize):(De=Te.wsize-Te.wnext,De>Oe&&(De=Oe),Te.window.set(oe.subarray(U-Oe,U-Oe+De),Te.wnext),(Oe-=De)?(Te.window.set(oe.subarray(U-Oe,U),0),Te.wnext=Oe,Te.whave=Te.wsize):(Te.wnext+=De,Te.wnext===Te.wsize&&(Te.wnext=0),Te.whave<Te.wsize&&(Te.whave+=De))),0};var eh={inflateReset:dK,inflateReset2:uK,inflateResetKeep:cK,inflateInit:L=>hK(L,15),inflateInit2:hK,inflate:(L,oe)=>{let U,Oe,De,Te,dt,We,Ut,Xe,ct,Fi,ui,Nt,vn,Er,yi,Lr,_i,Ht,Si,Fr,Gt,vr,Oi=0;const bi=new Uint8Array(4);let ir,ma;const J6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(B0(L)||!L.output||!L.input&&L.avail_in!==0)return Sn;U=L.state,U.mode===$u&&(U.mode=uS),dt=L.next_out,De=L.output,Ut=L.avail_out,Te=L.next_in,Oe=L.input,We=L.avail_in,Xe=U.hold,ct=U.bits,Fi=We,ui=Ut,vr=Io;e:for(;;)switch(U.mode){case aw:if(U.wrap===0){U.mode=uS;break}for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(2&U.wrap&&Xe===35615){U.wbits===0&&(U.wbits=15),U.check=0,bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0),Xe=0,ct=0,U.mode=16181;break}if(U.head&&(U.head.done=!1),!(1&U.wrap)||(((255&Xe)<<8)+(Xe>>8))%31){L.msg="incorrect header check",U.mode=Oo;break}if((15&Xe)!==aK){L.msg="unknown compression method",U.mode=Oo;break}if(Xe>>>=4,ct-=4,Gt=8+(15&Xe),U.wbits===0&&(U.wbits=Gt),Gt>15||Gt>U.wbits){L.msg="invalid window size",U.mode=Oo;break}U.dmax=1<<U.wbits,U.flags=0,L.adler=U.check=1,U.mode=512&Xe?16189:$u,Xe=0,ct=0;break;case 16181:for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(U.flags=Xe,(255&U.flags)!==aK){L.msg="unknown compression method",U.mode=Oo;break}if(57344&U.flags){L.msg="unknown header flags set",U.mode=Oo;break}U.head&&(U.head.text=Xe>>8&1),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0,U.mode=16182;case 16182:for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.head&&(U.head.time=Xe),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,bi[2]=Xe>>>16&255,bi[3]=Xe>>>24&255,U.check=re(U.check,bi,4,0)),Xe=0,ct=0,U.mode=16183;case 16183:for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.head&&(U.head.xflags=255&Xe,U.head.os=Xe>>8),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0,U.mode=16184;case 16184:if(1024&U.flags){for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.length=Xe,U.head&&(U.head.extra_len=Xe),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0}else U.head&&(U.head.extra=null);U.mode=16185;case 16185:if(1024&U.flags&&(Nt=U.length,Nt>We&&(Nt=We),Nt&&(U.head&&(Gt=U.head.extra_len-U.length,U.head.extra||(U.head.extra=new Uint8Array(U.head.extra_len)),U.head.extra.set(Oe.subarray(Te,Te+Nt),Gt)),512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,U.length-=Nt),U.length))break e;U.length=0,U.mode=16186;case 16186:if(2048&U.flags){if(We===0)break e;Nt=0;do Gt=Oe[Te+Nt++],U.head&&Gt&&U.length<65536&&(U.head.name+=String.fromCharCode(Gt));while(Gt&&Nt<We);if(512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,Gt)break e}else U.head&&(U.head.name=null);U.length=0,U.mode=16187;case 16187:if(4096&U.flags){if(We===0)break e;Nt=0;do Gt=Oe[Te+Nt++],U.head&&Gt&&U.length<65536&&(U.head.comment+=String.fromCharCode(Gt));while(Gt&&Nt<We);if(512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,Gt)break e}else U.head&&(U.head.comment=null);U.mode=16188;case 16188:if(512&U.flags){for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(4&U.wrap&&Xe!==(65535&U.check)){L.msg="header crc mismatch",U.mode=Oo;break}Xe=0,ct=0}U.head&&(U.head.hcrc=U.flags>>9&1,U.head.done=!0),L.adler=U.check=0,U.mode=$u;break;case 16189:for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}L.adler=U.check=lK(Xe),Xe=0,ct=0,U.mode=lw;case lw:if(U.havedict===0)return L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,Q6;L.adler=U.check=1,U.mode=$u;case $u:if(oe===tl||oe===ws)break e;case uS:if(U.last){Xe>>>=7&ct,ct-=7&ct,U.mode=pS;break}for(;ct<3;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}switch(U.last=1&Xe,Xe>>>=1,ct-=1,3&Xe){case 0:U.mode=16193;break;case 1:if(Yxe(U),U.mode=cw,oe===ws){Xe>>>=2,ct-=2;break e}break;case 2:U.mode=16196;break;case 3:L.msg="invalid block type",U.mode=Oo}Xe>>>=2,ct-=2;break;case 16193:for(Xe>>>=7&ct,ct-=7&ct;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if((65535&Xe)!=(Xe>>>16^65535)){L.msg="invalid stored block lengths",U.mode=Oo;break}if(U.length=65535&Xe,Xe=0,ct=0,U.mode=hS,oe===ws)break e;case hS:U.mode=16195;case 16195:if(Nt=U.length,Nt){if(Nt>We&&(Nt=We),Nt>Ut&&(Nt=Ut),Nt===0)break e;De.set(Oe.subarray(Te,Te+Nt),dt),We-=Nt,Te+=Nt,Ut-=Nt,dt+=Nt,U.length-=Nt;break}U.mode=$u;break;case 16196:for(;ct<14;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(U.nlen=257+(31&Xe),Xe>>>=5,ct-=5,U.ndist=1+(31&Xe),Xe>>>=5,ct-=5,U.ncode=4+(15&Xe),Xe>>>=4,ct-=4,U.nlen>286||U.ndist>30){L.msg="too many length or distance symbols",U.mode=Oo;break}U.have=0,U.mode=16197;case 16197:for(;U.have<U.ncode;){for(;ct<3;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.lens[J6[U.have++]]=7&Xe,Xe>>>=3,ct-=3}for(;U.have<19;)U.lens[J6[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,ir={bits:U.lenbits},vr=Zc(0,U.lens,0,19,U.lencode,0,U.work,ir),U.lenbits=ir.bits,vr){L.msg="invalid code lengths set",U.mode=Oo;break}U.have=0,U.mode=16198;case 16198:for(;U.have<U.nlen+U.ndist;){for(;Oi=U.lencode[Xe&(1<<U.lenbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(_i<16)Xe>>>=yi,ct-=yi,U.lens[U.have++]=_i;else{if(_i===16){for(ma=yi+2;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(Xe>>>=yi,ct-=yi,U.have===0){L.msg="invalid bit length repeat",U.mode=Oo;break}Gt=U.lens[U.have-1],Nt=3+(3&Xe),Xe>>>=2,ct-=2}else if(_i===17){for(ma=yi+3;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=yi,ct-=yi,Gt=0,Nt=3+(7&Xe),Xe>>>=3,ct-=3}else{for(ma=yi+7;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=yi,ct-=yi,Gt=0,Nt=11+(127&Xe),Xe>>>=7,ct-=7}if(U.have+Nt>U.nlen+U.ndist){L.msg="invalid bit length repeat",U.mode=Oo;break}for(;Nt--;)U.lens[U.have++]=Gt}}if(U.mode===Oo)break;if(U.lens[256]===0){L.msg="invalid code -- missing end-of-block",U.mode=Oo;break}if(U.lenbits=9,ir={bits:U.lenbits},vr=Zc(1,U.lens,0,U.nlen,U.lencode,0,U.work,ir),U.lenbits=ir.bits,vr){L.msg="invalid literal/lengths set",U.mode=Oo;break}if(U.distbits=6,U.distcode=U.distdyn,ir={bits:U.distbits},vr=Zc(2,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,ir),U.distbits=ir.bits,vr){L.msg="invalid distances set",U.mode=Oo;break}if(U.mode=cw,oe===ws)break e;case cw:U.mode=dw;case dw:if(We>=6&&Ut>=258){L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,pi(L,ui),dt=L.next_out,De=L.output,Ut=L.avail_out,Te=L.next_in,Oe=L.input,We=L.avail_in,Xe=U.hold,ct=U.bits,U.mode===$u&&(U.back=-1);break}for(U.back=0;Oi=U.lencode[Xe&(1<<U.lenbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(Lr&&(240&Lr)==0){for(Ht=yi,Si=Lr,Fr=_i;Oi=U.lencode[Fr+((Xe&(1<<Ht+Si)-1)>>Ht)],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(Ht+yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=Ht,ct-=Ht,U.back+=Ht}if(Xe>>>=yi,ct-=yi,U.back+=yi,U.length=_i,Lr===0){U.mode=16205;break}if(32&Lr){U.back=-1,U.mode=$u;break}if(64&Lr){L.msg="invalid literal/length code",U.mode=Oo;break}U.extra=15&Lr,U.mode=16201;case 16201:if(U.extra){for(ma=U.extra;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.length+=Xe&(1<<U.extra)-1,Xe>>>=U.extra,ct-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=16202;case 16202:for(;Oi=U.distcode[Xe&(1<<U.distbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if((240&Lr)==0){for(Ht=yi,Si=Lr,Fr=_i;Oi=U.distcode[Fr+((Xe&(1<<Ht+Si)-1)>>Ht)],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(Ht+yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=Ht,ct-=Ht,U.back+=Ht}if(Xe>>>=yi,ct-=yi,U.back+=yi,64&Lr){L.msg="invalid distance code",U.mode=Oo;break}U.offset=_i,U.extra=15&Lr,U.mode=16203;case 16203:if(U.extra){for(ma=U.extra;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.offset+=Xe&(1<<U.extra)-1,Xe>>>=U.extra,ct-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){L.msg="invalid distance too far back",U.mode=Oo;break}U.mode=16204;case 16204:if(Ut===0)break e;if(Nt=ui-Ut,U.offset>Nt){if(Nt=U.offset-Nt,Nt>U.whave&&U.sane){L.msg="invalid distance too far back",U.mode=Oo;break}Nt>U.wnext?(Nt-=U.wnext,vn=U.wsize-Nt):vn=U.wnext-Nt,Nt>U.length&&(Nt=U.length),Er=U.window}else Er=De,vn=dt-U.offset,Nt=U.length;Nt>Ut&&(Nt=Ut),Ut-=Nt,U.length-=Nt;do De[dt++]=Er[vn++];while(--Nt);U.length===0&&(U.mode=dw);break;case 16205:if(Ut===0)break e;De[dt++]=U.length,Ut--,U.mode=dw;break;case pS:if(U.wrap){for(;ct<32;){if(We===0)break e;We--,Xe|=Oe[Te++]<<ct,ct+=8}if(ui-=Ut,L.total_out+=ui,U.total+=ui,4&U.wrap&&ui&&(L.adler=U.check=U.flags?re(U.check,De,ui,dt-ui):ee(U.check,De,ui,dt-ui)),ui=Ut,4&U.wrap&&(U.flags?Xe:lK(Xe))!==U.check){L.msg="incorrect data check",U.mode=Oo;break}Xe=0,ct=0}U.mode=16207;case 16207:if(U.wrap&&U.flags){for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(4&U.wrap&&Xe!==(4294967295&U.total)){L.msg="incorrect length check",U.mode=Oo;break}Xe=0,ct=0}U.mode=16208;case 16208:vr=Il;break e;case Oo:vr=nK;break e;case 16210:return sK;default:return Sn}return L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,(U.wsize||ui!==L.avail_out&&U.mode<Oo&&(U.mode<pS||oe!==Co))&&fK(L,L.output,L.next_out,ui-L.avail_out),Fi-=L.avail_in,ui-=L.avail_out,L.total_in+=Fi,L.total_out+=ui,U.total+=ui,4&U.wrap&&ui&&(L.adler=U.check=U.flags?re(U.check,De,ui,L.next_out-ui):ee(U.check,De,ui,L.next_out-ui)),L.data_type=U.bits+(U.last?64:0)+(U.mode===$u?128:0)+(U.mode===cw||U.mode===hS?256:0),(Fi===0&&ui===0||oe===Co)&&vr===Io&&(vr=Zxe),vr},inflateEnd:L=>{if(B0(L))return Sn;let oe=L.state;return oe.window&&(oe.window=null),L.state=null,Io},inflateGetHeader:(L,oe)=>{if(B0(L))return Sn;const U=L.state;return(2&U.wrap)==0?Sn:(U.head=oe,oe.done=!1,Io)},inflateSetDictionary:(L,oe)=>{const U=oe.length;let Oe,De,Te;return B0(L)?Sn:(Oe=L.state,Oe.wrap!==0&&Oe.mode!==lw?Sn:Oe.mode===lw&&(De=1,De=ee(De,oe,U,0),De!==Oe.check)?nK:(Te=fK(L,oe,U,U),Te?(Oe.mode=16210,sK):(Oe.havedict=1,Io)))},inflateInfo:"pako inflate (from Nodeca project)"},$xe=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 gK=Object.prototype.toString,{Z_NO_FLUSH:eke,Z_FINISH:tke,Z_OK:K6,Z_STREAM_END:AS,Z_NEED_DICT:mS,Z_STREAM_ERROR:ike,Z_DATA_ERROR:AK,Z_MEM_ERROR:rke}=fe;function W6(L){this.options=ow({chunkSize:65536,windowBits:15,to:""},L||{});const oe=this.options;oe.raw&&oe.windowBits>=0&&oe.windowBits<16&&(oe.windowBits=-oe.windowBits,oe.windowBits===0&&(oe.windowBits=-15)),!(oe.windowBits>=0&&oe.windowBits<16)||L&&L.windowBits||(oe.windowBits+=32),oe.windowBits>15&&oe.windowBits<48&&(15&oe.windowBits)==0&&(oe.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;let U=eh.inflateInit2(this.strm,oe.windowBits);if(U!==K6)throw new Error(ie[U]);if(this.header=new $xe,eh.inflateGetHeader(this.strm,this.header),oe.dictionary&&(typeof oe.dictionary=="string"?oe.dictionary=G6(oe.dictionary):gK.call(oe.dictionary)==="[object ArrayBuffer]"&&(oe.dictionary=new Uint8Array(oe.dictionary)),oe.raw&&(U=eh.inflateSetDictionary(this.strm,oe.dictionary),U!==K6)))throw new Error(ie[U])}function vS(L,oe){const U=new W6(oe);if(U.push(L),U.err)throw U.msg||ie[U.err];return U.result}W6.prototype.push=function(L,oe){const U=this.strm,Oe=this.options.chunkSize,De=this.options.dictionary;let Te,dt,We;if(this.ended)return!1;for(dt=oe===~~oe?oe:oe===!0?tke:eke,gK.call(L)==="[object ArrayBuffer]"?U.input=new Uint8Array(L):U.input=L,U.next_in=0,U.avail_in=U.input.length;;){for(U.avail_out===0&&(U.output=new Uint8Array(Oe),U.next_out=0,U.avail_out=Oe),Te=eh.inflate(U,dt),Te===mS&&De&&(Te=eh.inflateSetDictionary(U,De),Te===K6?Te=eh.inflate(U,dt):Te===AK&&(Te=mS));U.avail_in>0&&Te===AS&&U.state.wrap>0&&L[U.next_in]!==0;)eh.inflateReset(U),Te=eh.inflate(U,dt);switch(Te){case ike:case AK:case mS:case rke:return this.onEnd(Te),this.ended=!0,!1}if(We=U.avail_out,U.next_out&&(U.avail_out===0||Te===AS))if(this.options.to==="string"){let Ut=tt(U.output,U.next_out),Xe=U.next_out-Ut,ct=Ce(U.output,Ut);U.next_out=Xe,U.avail_out=Oe-Xe,Xe&&U.output.set(U.output.subarray(Ut,Ut+Xe),0),this.onData(ct)}else this.onData(U.output.length===U.next_out?U.output:U.output.subarray(0,U.next_out));if(Te!==K6||We!==0){if(Te===AS)return Te=eh.inflateEnd(this.strm),this.onEnd(Te),this.ended=!0,!0;if(U.avail_in===0)break}}return!0},W6.prototype.onData=function(L){this.chunks.push(L)},W6.prototype.onEnd=function(L){L===K6&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nw(this.chunks)),this.chunks=[],this.err=L,this.msg=this.strm.msg};var oke={Inflate:W6,inflate:vS,inflateRaw:function(L,oe){return(oe=oe||{}).raw=!0,vS(L,oe)},ungzip:vS};const{Deflate:nke,deflate:ske,deflateRaw:ake,gzip:lke}=Po,{Inflate:cke,inflate:dke,inflateRaw:uke,ungzip:hke}=oke;var mK=nke,vK=ske,yK=ake,bK=lke,wK=cke,CK=dke,xK=uke,kK=hke,MK=fe,pke={Deflate:mK,deflate:vK,deflateRaw:yK,gzip:bK,Inflate:wK,inflate:CK,inflateRaw:xK,ungzip:kK,constants:MK};i.Deflate=mK,i.Inflate=wK,i.constants=MK,i.default=pke,i.deflate=vK,i.deflateRaw=yK,i.gzip=bK,i.inflate=CK,i.inflateRaw=xK,i.ungzip=kK,Object.defineProperty(i,"__esModule",{value:!0})}))})(HE,HE.exports)),HE.exports}var Hue=SXt();const TXt=_8(Hue),yd=gke({__proto__:null,default:TXt},[Hue]);let _a=window.pako||yd;_a.inflate||(_a=_a.default);const RXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function DXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],positionsDecodeMatrix:t[11]}}function _Xt(t){return{positions:new Uint16Array(_a.inflate(t.positions).buffer),normals:new Int8Array(_a.inflate(t.normals).buffer),indices:new Uint32Array(_a.inflate(t.indices).buffer),edgeIndices:new Uint32Array(_a.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(_a.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(_a.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(_a.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(_a.inflate(t.meshColors).buffer),entityIDs:_a.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(_a.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(_a.inflate(t.entityIsObjects).buffer),positionsDecodeMatrix:new Float32Array(_a.inflate(t.positionsDecodeMatrix).buffer)}}function LXt(t,e,i,r,o,n){n.getNextId(),r.positionsCompression="precompressed",r.normalsCompression="precompressed";const s=i.positions,a=i.normals,l=i.indices,c=i.edgeIndices,d=i.meshPositions,u=i.meshIndices,h=i.meshEdgesIndices,p=i.meshColors,g=JSON.parse(i.entityIDs),f=i.entityMeshes,m=i.entityIsObjects,A=d.length,v=f.length;for(let y=0;y<v;y++){const b=g[y],w=e.globalizeObjectIds?k.globalizeObjectId(r.id,b):b,C=t.metaScene.metaObjects[w],M={},E={};if(C){if(e.excludeTypesMap&&C.type&&e.excludeTypesMap[C.type]||e.includeTypesMap&&C.type&&!e.includeTypesMap[C.type])continue;const I=e.objectDefaults?e.objectDefaults[C.type]||e.objectDefaults.DEFAULT:null;I&&(I.visible===!1&&(M.visible=!1),I.pickable===!1&&(M.pickable=!1),I.colorize&&(E.color=I.colorize),I.opacity!==void 0&&I.opacity!==null&&(E.opacity=I.opacity))}else if(e.excludeUnclassifiedObjects)continue;const B=y===v-1,S=[];for(let I=f[y],T=B?f.length:f[y+1];I<T;I++){const _=I===A-1,O=w+".mesh."+I,j=RXt(p.subarray(I*4,I*4+3)),N=p[I*4+3]/255;r.createMesh(Tt.apply(E,{id:O,primitive:"triangles",positionsCompressed:s.subarray(d[I],_?s.length:d[I+1]),normalsCompressed:a.subarray(d[I],_?s.length:d[I+1]),indices:l.subarray(u[I],_?l.length:u[I+1]),edgeIndices:c.subarray(h[I],_?c.length:h[I+1]),positionsDecodeMatrix:i.positionsDecodeMatrix,color:j,opacity:N})),S.push(O)}r.createEntity(Tt.apply(M,{id:w,isObject:m[y]===1,meshIds:S}))}}const zue={version:1,parse:function(t,e,i,r,o,n){const s=DXt(i),a=_Xt(s);LXt(t,e,a,r,o,n)}};let ns=window.pako||yd;ns.inflate||(ns=ns.default);function FXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],positionsDecodeMatrix:t[11],entityMeshIds:t[12],entityMatrices:t[13],entityUsesInstancing:t[14]}}function OXt(t){return{positions:new Uint16Array(ns.inflate(t.positions).buffer),normals:new Int8Array(ns.inflate(t.normals).buffer),indices:new Uint32Array(ns.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ns.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(ns.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(ns.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(ns.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(ns.inflate(t.meshColors).buffer),entityIDs:ns.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(ns.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(ns.inflate(t.entityIsObjects).buffer),positionsDecodeMatrix:new Float32Array(ns.inflate(t.positionsDecodeMatrix).buffer),entityMeshIds:new Uint32Array(ns.inflate(t.entityMeshIds).buffer),entityMatrices:new Float32Array(ns.inflate(t.entityMatrices).buffer),entityUsesInstancing:new Uint8Array(ns.inflate(t.entityUsesInstancing).buffer)}}const UXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function NXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.meshPositions,h=i.meshIndices,p=i.meshEdgesIndices,g=i.meshColors,f=JSON.parse(i.entityIDs),m=i.entityMeshes,A=i.entityIsObjects,v=i.entityMeshIds,y=i.entityMatrices,b=i.entityUsesInstancing,w=u.length,C=m.length,M={};for(let E=0;E<C;E++){const B=f[E],S=e.globalizeObjectIds?k.globalizeObjectId(r.id,B):B,I=t.metaScene.metaObjects[S],T={},_={},O=y.subarray(E*16,E*16+16);if(I){if(e.excludeTypesMap&&I.type&&e.excludeTypesMap[I.type]||e.includeTypesMap&&I.type&&!e.includeTypesMap[I.type])continue;const G=e.objectDefaults?e.objectDefaults[I.type]||e.objectDefaults.DEFAULT:null;G&&(G.visible===!1&&(T.visible=!1),G.pickable===!1&&(T.pickable=!1),G.colorize&&(_.color=G.colorize),G.opacity!==void 0&&G.opacity!==null&&(_.opacity=G.opacity))}else if(e.excludeUnclassifiedObjects)continue;const j=E===C-1,N=[];for(let G=m[E],q=j?v.length:m[E+1];G<q;G++){const X=v[G],me=X===w-1,ce=n.getNextId(),xe=UXt(g.subarray(X*4,X*4+3)),Re=g[X*4+3]/255,ge=a.subarray(u[X],me?a.length:u[X+1]),ee=l.subarray(u[X],me?a.length:u[X+1]),$=c.subarray(h[X],me?c.length:h[X+1]),re=d.subarray(p[X],me?d.length:p[X+1]);if(b[E]===1){const ie=`${s}.geometry.${ce}.${X}`;ie in M||(r.createGeometry({id:ie,positionsCompressed:ge,normalsCompressed:ee,indices:$,edgeIndices:re,primitive:"triangles",positionsDecodeMatrix:i.positionsDecodeMatrix}),M[ie]=!0),r.createMesh(Tt.apply(_,{id:ce,color:xe,opacity:Re,matrix:O,geometryId:ie})),N.push(ce)}else r.createMesh(Tt.apply(_,{id:ce,primitive:"triangles",positionsCompressed:ge,normalsCompressed:ee,indices:$,edgeIndices:re,positionsDecodeMatrix:i.positionsDecodeMatrix,color:xe,opacity:Re})),N.push(ce)}N.length&&r.createEntity(Tt.apply(T,{id:S,isObject:A[E]===1,meshIds:N}))}}const Vue={version:2,parse:function(t,e,i,r,o,n){const s=FXt(i),a=OXt(s);NXt(t,e,a,r,o,n)}};let Kn=window.pako||yd;Kn.inflate||(Kn=Kn.default);function jXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],instancedPositionsDecodeMatrix:t[11],batchedPositionsDecodeMatrix:t[12],entityMeshIds:t[13],entityMatrices:t[14],entityUsesInstancing:t[15]}}function HXt(t){return{positions:new Uint16Array(Kn.inflate(t.positions).buffer),normals:new Int8Array(Kn.inflate(t.normals).buffer),indices:new Uint32Array(Kn.inflate(t.indices).buffer),edgeIndices:new Uint32Array(Kn.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(Kn.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(Kn.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(Kn.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(Kn.inflate(t.meshColors).buffer),entityIDs:Kn.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(Kn.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(Kn.inflate(t.entityIsObjects).buffer),instancedPositionsDecodeMatrix:new Float32Array(Kn.inflate(t.instancedPositionsDecodeMatrix).buffer),batchedPositionsDecodeMatrix:new Float32Array(Kn.inflate(t.batchedPositionsDecodeMatrix).buffer),entityMeshIds:new Uint32Array(Kn.inflate(t.entityMeshIds).buffer),entityMatrices:new Float32Array(Kn.inflate(t.entityMatrices).buffer),entityUsesInstancing:new Uint8Array(Kn.inflate(t.entityUsesInstancing).buffer)}}const zXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function VXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.meshPositions,h=i.meshIndices,p=i.meshEdgesIndices,g=i.meshColors,f=JSON.parse(i.entityIDs),m=i.entityMeshes,A=i.entityIsObjects,v=i.entityMeshIds,y=i.entityMatrices,b=i.entityUsesInstancing,w=u.length,C=m.length,M={};for(let _=0;_<C;_++){const O=f[_],j=e.globalizeObjectIds?k.globalizeObjectId(r.id,O):O,N=t.metaScene.metaObjects[j],G={},q={},X=y.subarray(_*16,_*16+16);if(N){if(e.excludeTypesMap&&N.type&&e.excludeTypesMap[N.type]||e.includeTypesMap&&N.type&&!e.includeTypesMap[N.type])continue;const xe=e.objectDefaults?e.objectDefaults[N.type]||e.objectDefaults.DEFAULT:null;xe&&(xe.visible===!1&&(G.visible=!1),xe.pickable===!1&&(G.pickable=!1),xe.colorize&&(q.color=xe.colorize),xe.opacity!==void 0&&xe.opacity!==null&&(q.opacity=xe.opacity))}else if(e.excludeUnclassifiedObjects)continue;const me=_===C-1,ce=[];for(let xe=m[_],Re=me?v.length:m[_+1];xe<Re;xe++){var E=v[xe];const ge=E===w-1,ee=`${s}.${j}.mesh.${E}`,$=zXt(g.subarray(E*4,E*4+3)),re=g[E*4+3]/255;var B=a.subarray(u[E],ge?a.length:u[E+1]),S=l.subarray(u[E],ge?a.length:u[E+1]),I=c.subarray(h[E],ge?c.length:h[E+1]),T=d.subarray(p[E],ge?d.length:p[E+1]);if(b[_]===1){const ie=`${s}.geometry.${ee}.${E}`;ie in M||(r.createGeometry({id:ie,positionsCompressed:B,normalsCompressed:S,indices:I,edgeIndices:T,primitive:"triangles",positionsDecodeMatrix:i.instancedPositionsDecodeMatrix}),M[ie]=!0),r.createMesh(Tt.apply(q,{id:ee,color:$,opacity:re,matrix:X,geometryId:ie})),ce.push(ee)}else r.createMesh(Tt.apply(q,{id:ee,primitive:"triangles",positionsCompressed:B,normalsCompressed:S,indices:I,edgeIndices:T,positionsDecodeMatrix:i.batchedPositionsDecodeMatrix,color:$,opacity:re})),ce.push(ee)}ce.length&&r.createEntity(Tt.apply(G,{id:j,isObject:A[_]===1,meshIds:ce}))}}const que={version:3,parse:function(t,e,i,r,o,n){const s=jXt(i),a=HXt(s);VXt(t,e,a,r,o,n)}};let ss=window.pako||yd;ss.inflate||(ss=ss.default);function qXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],decodeMatrices:t[4],matrices:t[5],eachPrimitivePositionsAndNormalsPortion:t[6],eachPrimitiveIndicesPortion:t[7],eachPrimitiveEdgeIndicesPortion:t[8],eachPrimitiveDecodeMatricesPortion:t[9],eachPrimitiveColor:t[10],primitiveInstances:t[11],eachEntityId:t[12],eachEntityPrimitiveInstancesPortion:t[13],eachEntityMatricesPortion:t[14],eachEntityMatrix:t[15]}}function GXt(t){return{positions:new Uint16Array(ss.inflate(t.positions).buffer),normals:new Int8Array(ss.inflate(t.normals).buffer),indices:new Uint32Array(ss.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ss.inflate(t.edgeIndices).buffer),decodeMatrices:new Float32Array(ss.inflate(t.decodeMatrices).buffer),matrices:new Float32Array(ss.inflate(t.matrices).buffer),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(ss.inflate(t.eachPrimitivePositionsAndNormalsPortion).buffer),eachPrimitiveIndicesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveIndicesPortion).buffer),eachPrimitiveEdgeIndicesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveEdgeIndicesPortion).buffer),eachPrimitiveDecodeMatricesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveDecodeMatricesPortion).buffer),eachPrimitiveColor:new Uint8Array(ss.inflate(t.eachPrimitiveColor).buffer),primitiveInstances:new Uint32Array(ss.inflate(t.primitiveInstances).buffer),eachEntityId:ss.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(ss.inflate(t.eachEntityPrimitiveInstancesPortion).buffer),eachEntityMatricesPortion:new Uint32Array(ss.inflate(t.eachEntityMatricesPortion).buffer)}}const QXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function KXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.decodeMatrices,h=i.matrices,p=i.eachPrimitivePositionsAndNormalsPortion,g=i.eachPrimitiveIndicesPortion,f=i.eachPrimitiveEdgeIndicesPortion,m=i.eachPrimitiveDecodeMatricesPortion,A=i.eachPrimitiveColor,v=i.primitiveInstances,y=JSON.parse(i.eachEntityId),b=i.eachEntityPrimitiveInstancesPortion,w=i.eachEntityMatricesPortion,C=p.length,M=v.length,E=new Uint8Array(C),B=new Uint32Array(C),S=y.length;for(let _=0;_<C;_++)B[_]=_;B.sort((_,O)=>m[_]<m[O]?-1:m[_]>m[O]?1:0);for(let _=0;_<M;_++){const O=v[_];E[O]++}const I={};for(let _=0;_<S;_++){const O=S-1,j=_===O,N=b[_],G=j?b[O]:b[_+1];for(let q=N;q<G;q++){const X=v[q];E[X]>1||(I[X]=_)}}for(let _=0;_<C;_++){const O=B[_],j=O===C-1,N=E[O]>1,G=QXt(A.subarray(O*4,O*4+3)),q=A[O*4+3]/255,X=a.subarray(p[O],j?a.length:p[O+1]),me=l.subarray(p[O],j?l.length:p[O+1]),ce=c.subarray(g[O],j?c.length:g[O+1]),xe=d.subarray(f[O],j?d.length:f[O+1]),Re=u.subarray(m[O],m[O]+16);if(N){const ge=`${s}-geometry.${O}`;r.createGeometry({id:ge,primitive:"triangles",positionsCompressed:X,normalsCompressed:me,indices:ce,edgeIndices:xe,positionsDecodeMatrix:Re})}else{const ge=`${s}-${O}`,ee=I[O];y[ee];const $={};r.createMesh(Tt.apply($,{id:ge,primitive:"triangles",positionsCompressed:X,normalsCompressed:me,indices:ce,edgeIndices:xe,positionsDecodeMatrix:Re,color:G,opacity:q}))}}let T=0;for(let _=0;_<S;_++){const O=S-1,j=_===O,N=y[_],G=b[_],q=j?b[O]:b[_+1],X=[];for(let me=G;me<q;me++){const ce=v[me];if(E[ce]>1){const xe={},Re=`${s}-instance.${T++}`,ge=`${s}-geometry.${ce}`,ee=w[_]*16,$=h.subarray(ee,ee+16);r.createMesh(Tt.apply(xe,{id:Re,geometryId:ge,matrix:$})),X.push(Re)}else X.push(ce)}if(X.length>0){const me={};r.createEntity(Tt.apply(me,{id:N,isObject:!0,meshIds:X}))}}}const Gue={version:4,parse:function(t,e,i,r,o,n){const s=qXt(i),a=GXt(s);KXt(t,e,a,r,o,n)}};let ca=window.pako||yd;ca.inflate||(ca=ca.default);function WXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],matrices:t[4],eachPrimitivePositionsAndNormalsPortion:t[5],eachPrimitiveIndicesPortion:t[6],eachPrimitiveEdgeIndicesPortion:t[7],eachPrimitiveColor:t[8],primitiveInstances:t[9],eachEntityId:t[10],eachEntityPrimitiveInstancesPortion:t[11],eachEntityMatricesPortion:t[12]}}function JXt(t){return{positions:new Float32Array(ca.inflate(t.positions).buffer),normals:new Int8Array(ca.inflate(t.normals).buffer),indices:new Uint32Array(ca.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ca.inflate(t.edgeIndices).buffer),matrices:new Float32Array(ca.inflate(t.matrices).buffer),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(ca.inflate(t.eachPrimitivePositionsAndNormalsPortion).buffer),eachPrimitiveIndicesPortion:new Uint32Array(ca.inflate(t.eachPrimitiveIndicesPortion).buffer),eachPrimitiveEdgeIndicesPortion:new Uint32Array(ca.inflate(t.eachPrimitiveEdgeIndicesPortion).buffer),eachPrimitiveColor:new Uint8Array(ca.inflate(t.eachPrimitiveColor).buffer),primitiveInstances:new Uint32Array(ca.inflate(t.primitiveInstances).buffer),eachEntityId:ca.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(ca.inflate(t.eachEntityPrimitiveInstancesPortion).buffer),eachEntityMatricesPortion:new Uint32Array(ca.inflate(t.eachEntityMatricesPortion).buffer)}}const ZXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function XXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="disabled",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.matrices,h=i.eachPrimitivePositionsAndNormalsPortion,p=i.eachPrimitiveIndicesPortion,g=i.eachPrimitiveEdgeIndicesPortion,f=i.eachPrimitiveColor,m=i.primitiveInstances,A=JSON.parse(i.eachEntityId),v=i.eachEntityPrimitiveInstancesPortion,y=i.eachEntityMatricesPortion,b=h.length,w=m.length,C=new Uint8Array(b),M=A.length;for(let S=0;S<w;S++){const I=m[S];C[I]++}const E={};for(let S=0;S<M;S++){const I=M-1,T=S===I,_=v[S],O=T?v[I]:v[S+1];for(let j=_;j<O;j++){const N=m[j];C[N]>1||(E[N]=S)}}for(let S=0;S<b;S++){const I=S===b-1,T=C[S]>1,_=ZXt(f.subarray(S*4,S*4+3)),O=f[S*4+3]/255,j=a.subarray(h[S],I?a.length:h[S+1]),N=l.subarray(h[S],I?l.length:h[S+1]),G=c.subarray(p[S],I?c.length:p[S+1]),q=d.subarray(g[S],I?d.length:g[S+1]);if(T){const X=`${s}-geometry.${S}`;r.createGeometry({id:X,primitive:"triangles",positionsCompressed:j,normalsCompressed:N,indices:G,edgeIndices:q})}else{const X=S,me=E[S];A[me];const ce={};r.createMesh(Tt.apply(ce,{id:X,primitive:"triangles",positionsCompressed:j,normalsCompressed:N,indices:G,edgeIndices:q,color:_,opacity:O}))}}let B=0;for(let S=0;S<M;S++){const I=M-1,T=S===I,_=A[S],O=v[S],j=T?v[I]:v[S+1],N=[];for(let G=O;G<j;G++){const q=m[G];if(C[q]>1){const X={},me="instance."+B++,ce="geometry"+q,xe=y[S]*16,Re=u.subarray(xe,xe+16);r.createMesh(Tt.apply(X,{id:me,geometryId:ce,matrix:Re})),N.push(me)}else N.push(q)}if(N.length>0){const G={};r.createEntity(Tt.apply(G,{id:_,isObject:!0,meshIds:N}))}}}const Que={version:5,parse:function(t,e,i,r,o,n){const s=WXt(i),a=JXt(s);XXt(t,e,a,r,o,n)}};let x7=window.pako||yd;x7.inflate||(x7=x7.default);function YXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],matrices:t[4],reusedPrimitivesDecodeMatrix:t[5],eachPrimitivePositionsAndNormalsPortion:t[6],eachPrimitiveIndicesPortion:t[7],eachPrimitiveEdgeIndicesPortion:t[8],eachPrimitiveColorAndOpacity:t[9],primitiveInstances:t[10],eachEntityId:t[11],eachEntityPrimitiveInstancesPortion:t[12],eachEntityMatricesPortion:t[13],eachTileAABB:t[14],eachTileEntitiesPortion:t[15]}}function $Xt(t){function e(i,r){return i.length===0?[]:x7.inflate(i,r).buffer}return{positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedPrimitivesDecodeMatrix:new Float32Array(e(t.reusedPrimitivesDecodeMatrix)),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(e(t.eachPrimitivePositionsAndNormalsPortion)),eachPrimitiveIndicesPortion:new Uint32Array(e(t.eachPrimitiveIndicesPortion)),eachPrimitiveEdgeIndicesPortion:new Uint32Array(e(t.eachPrimitiveEdgeIndicesPortion)),eachPrimitiveColorAndOpacity:new Uint8Array(e(t.eachPrimitiveColorAndOpacity)),primitiveInstances:new Uint32Array(e(t.primitiveInstances)),eachEntityId:x7.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(e(t.eachEntityPrimitiveInstancesPortion)),eachEntityMatricesPortion:new Uint32Array(e(t.eachEntityMatricesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const eYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function tYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.matrices,h=i.reusedPrimitivesDecodeMatrix,p=i.eachPrimitivePositionsAndNormalsPortion,g=i.eachPrimitiveIndicesPortion,f=i.eachPrimitiveEdgeIndicesPortion,m=i.eachPrimitiveColorAndOpacity,A=i.primitiveInstances,v=JSON.parse(i.eachEntityId),y=i.eachEntityPrimitiveInstancesPortion,b=i.eachEntityMatricesPortion,w=i.eachTileAABB,C=i.eachTileEntitiesPortion,M=p.length,E=A.length,B=v.length,S=C.length,I=new Uint32Array(M);for(let O=0;O<E;O++){const j=A[O];I[j]!==void 0?I[j]++:I[j]=1}const T=k.vec3(),_=k.AABB3();for(let O=0;O<S;O++){const j=S-1,N=O===j,G=C[O],q=N?B:C[O+1],X=O*6,me=w.subarray(X,X+6);k.getAABB3Center(me,T),_[0]=me[0]-T[0],_[1]=me[1]-T[1],_[2]=me[2]-T[2],_[3]=me[3]-T[0],_[4]=me[4]-T[1],_[5]=me[5]-T[2];const ce=xi.createPositionsDecodeMatrix(_),xe={};for(let Re=G;Re<q;Re++){const ge=v[Re],ee=e.globalizeObjectIds?k.globalizeObjectId(r.id,ge):ge,$=b[Re],re=u.slice($,$+16),ie=B-1,fe=Re===ie,de=y[Re],Ae=fe?A.length:y[Re+1],Ue=[],z=t.metaScene.metaObjects[ee],se={},ue={};if(z){if(e.excludeTypesMap&&z.type&&e.excludeTypesMap[z.type]||e.includeTypesMap&&z.type&&!e.includeTypesMap[z.type]||e.includeIdsMap&&z.id&&!e.includeIdsMap[z.id])continue;const be=e.objectDefaults?e.objectDefaults[z.type]||e.objectDefaults.DEFAULT:null;be&&(be.visible===!1&&(se.visible=!1),be.pickable===!1&&(se.pickable=!1),be.colorize&&(ue.color=be.colorize),be.opacity!==void 0&&be.opacity!==null&&(ue.opacity=be.opacity))}else if(e.excludeUnclassifiedObjects)continue;for(let be=de;be<Ae;be++){const he=A[be],Q=I[he]>1,J=he===M-1,te=a.subarray(p[he],J?a.length:p[he+1]),ne=l.subarray(p[he],J?l.length:p[he+1]),ae=c.subarray(g[he],J?c.length:g[he+1]),W=d.subarray(f[he],J?d.length:f[he+1]),K=eYt(m.subarray(he*4,he*4+3)),ve=m[he*4+3]/255,we=n.getNextId();if(Q){const pe=`${s}-geometry.${O}.${he}`;xe[pe]||(r.createGeometry({id:pe,primitive:"triangles",positionsCompressed:te,indices:ae,edgeIndices:W,positionsDecodeMatrix:h}),xe[pe]=!0),r.createMesh(Tt.apply(ue,{id:we,geometryId:pe,origin:T,matrix:re,color:K,opacity:ve})),Ue.push(we)}else r.createMesh(Tt.apply(ue,{id:we,origin:T,primitive:"triangles",positionsCompressed:te,normalsCompressed:ne,indices:ae,edgeIndices:W,positionsDecodeMatrix:ce,color:K,opacity:ve})),Ue.push(we)}Ue.length>0&&r.createEntity(Tt.apply(se,{id:ee,isObject:!0,meshIds:Ue}))}}}const Kue={version:6,parse:function(t,e,i,r,o,n){const s=YXt(i),a=$Xt(s);tYt(t,e,a,r,o,n)}};let k7=window.pako||yd;k7.inflate||(k7=k7.default);function iYt(t){return{positions:t[0],normals:t[1],colors:t[2],indices:t[3],edgeIndices:t[4],matrices:t[5],reusedGeometriesDecodeMatrix:t[6],eachGeometryPrimitiveType:t[7],eachGeometryPositionsPortion:t[8],eachGeometryNormalsPortion:t[9],eachGeometryColorsPortion:t[10],eachGeometryIndicesPortion:t[11],eachGeometryEdgeIndicesPortion:t[12],eachMeshGeometriesPortion:t[13],eachMeshMatricesPortion:t[14],eachMeshMaterial:t[15],eachEntityId:t[16],eachEntityMeshesPortion:t[17],eachTileAABB:t[18],eachTileEntitiesPortion:t[19]}}function rYt(t){function e(i,r){return i.length===0?[]:k7.inflate(i,r).buffer}return{positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityId:k7.inflate(t.eachEntityId,{to:"string"}),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const oYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function Wue(t){const e=[];for(let i=0,r=t.length;i<r;i+=3)e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]),e.push(1);return e}function nYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.positions,l=i.normals,c=i.colors,d=i.indices,u=i.edgeIndices,h=i.matrices,p=i.reusedGeometriesDecodeMatrix,g=i.eachGeometryPrimitiveType,f=i.eachGeometryPositionsPortion,m=i.eachGeometryNormalsPortion,A=i.eachGeometryColorsPortion,v=i.eachGeometryIndicesPortion,y=i.eachGeometryEdgeIndicesPortion,b=i.eachMeshGeometriesPortion,w=i.eachMeshMatricesPortion,C=i.eachMeshMaterial,M=JSON.parse(i.eachEntityId),E=i.eachEntityMeshesPortion,B=i.eachTileAABB,S=i.eachTileEntitiesPortion,I=f.length,T=b.length,_=M.length,O=S.length,j=new Uint32Array(I);for(let q=0;q<T;q++){const X=b[q];j[X]!==void 0?j[X]++:j[X]=1}const N=k.vec3(),G=k.AABB3();for(let q=0;q<O;q++){const X=O-1,me=q===X,ce=S[q],xe=me?_:S[q+1],Re=q*6,ge=B.subarray(Re,Re+6);k.getAABB3Center(ge,N),G[0]=ge[0]-N[0],G[1]=ge[1]-N[1],G[2]=ge[2]-N[2],G[3]=ge[3]-N[0],G[4]=ge[4]-N[1],G[5]=ge[5]-N[2];const ee=xi.createPositionsDecodeMatrix(G),$={};for(let re=ce;re<xe;re++){const ie=M[re],fe=e.globalizeObjectIds?k.globalizeObjectId(r.id,ie):ie,de=_-1,Ae=re===de,Ue=E[re],z=Ae?b.length:E[re+1],se=[],ue=t.metaScene.metaObjects[fe],be={},he={};if(ue){if(e.excludeTypesMap&&ue.type&&e.excludeTypesMap[ue.type]||e.includeTypesMap&&ue.type&&!e.includeTypesMap[ue.type]||e.includeIdsMap&&ue.id&&!e.includeIdsMap[ue.id])continue;const Q=e.objectDefaults?e.objectDefaults[ue.type]||e.objectDefaults.DEFAULT:null;Q&&(Q.visible===!1&&(be.visible=!1),Q.pickable===!1&&(be.pickable=!1),Q.colorize&&(he.color=Q.colorize),Q.opacity!==void 0&&Q.opacity!==null&&(he.opacity=Q.opacity),Q.metallic!==void 0&&Q.metallic!==null&&(he.metallic=Q.metallic),Q.roughness!==void 0&&Q.roughness!==null&&(he.roughness=Q.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Q=Ue;Q<z;Q++){const J=b[Q],te=j[J]>1,ne=J===I-1,ae=oYt(C.subarray(Q*6,Q*6+3)),W=C[Q*6+3]/255,K=C[Q*6+4]/255,ve=C[Q*6+5]/255,we=n.getNextId();if(te){const pe=w[Q],Se=h.slice(pe,pe+16),Ke=`${s}-geometry.${q}.${J}`;if(!$[Ke]){const Pe=g[J];let Ve,Ne,Je,at,Bt,Mt;switch(Pe){case 0:Ve="solid",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Je=l.subarray(m[J],ne?l.length:m[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]),Mt=u.subarray(y[J],ne?u.length:y[J+1]);break;case 1:Ve="surface",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Je=l.subarray(m[J],ne?l.length:m[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]),Mt=u.subarray(y[J],ne?u.length:y[J+1]);break;case 2:Ve="points",Ne=a.subarray(f[J],ne?a.length:f[J+1]),at=Wue(c.subarray(A[J],ne?c.length:A[J+1]));break;case 3:Ve="lines",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]);break;default:continue}r.createGeometry({id:Ke,primitive:Ve,positionsCompressed:Ne,normalsCompressed:Je,colors:at,indices:Bt,edgeIndices:Mt,positionsDecodeMatrix:p}),$[Ke]=!0}r.createMesh(Tt.apply(he,{id:we,geometryId:Ke,origin:N,matrix:Se,color:ae,metallic:K,roughness:ve,opacity:W})),se.push(we)}else{const pe=g[J];let Se,Ke,Pe,Ve,Ne,Je;switch(pe){case 0:Se="solid",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Pe=l.subarray(m[J],ne?l.length:m[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]),Je=u.subarray(y[J],ne?u.length:y[J+1]);break;case 1:Se="surface",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Pe=l.subarray(m[J],ne?l.length:m[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]),Je=u.subarray(y[J],ne?u.length:y[J+1]);break;case 2:Se="points",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Ve=Wue(c.subarray(A[J],ne?c.length:A[J+1]));break;case 3:Se="lines",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]);break;default:continue}r.createMesh(Tt.apply(he,{id:we,origin:N,primitive:Se,positionsCompressed:Ke,normalsCompressed:Pe,colors:Ve,indices:Ne,edgeIndices:Je,positionsDecodeMatrix:ee,color:ae,metallic:K,roughness:ve,opacity:W})),se.push(we)}}se.length>0&&r.createEntity(Tt.apply(be,{id:fe,isObject:!0,meshIds:se}))}}}const Jue={version:7,parse:function(t,e,i,r,o,n){const s=iYt(i),a=rYt(s);nYt(t,e,a,r,o,n)}};let Lf=window.pako||yd;Lf.inflate||(Lf=Lf.default);const Vh=k.vec4(),Zue=k.vec4();function sYt(t){return{types:t[0],eachMetaObjectId:t[1],eachMetaObjectType:t[2],eachMetaObjectName:t[3],eachMetaObjectParent:t[4],positions:t[5],normals:t[6],colors:t[7],indices:t[8],edgeIndices:t[9],matrices:t[10],reusedGeometriesDecodeMatrix:t[11],eachGeometryPrimitiveType:t[12],eachGeometryPositionsPortion:t[13],eachGeometryNormalsPortion:t[14],eachGeometryColorsPortion:t[15],eachGeometryIndicesPortion:t[16],eachGeometryEdgeIndicesPortion:t[17],eachMeshGeometriesPortion:t[18],eachMeshMatricesPortion:t[19],eachMeshMaterial:t[20],eachEntityMetaObject:t[21],eachEntityMeshesPortion:t[22],eachTileAABB:t[23],eachTileEntitiesPortion:t[24]}}function aYt(t){function e(i,r){return i.length===0?[]:Lf.inflate(i,r).buffer}return{types:Lf.inflate(t.types,{to:"string"}),eachMetaObjectId:Lf.inflate(t.eachMetaObjectId,{to:"string"}),eachMetaObjectType:new Uint32Array(e(t.eachMetaObjectType)),eachMetaObjectName:Lf.inflate(t.eachMetaObjectName,{to:"string"}),eachMetaObjectParent:new Uint32Array(e(t.eachMetaObjectParent)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityMetaObject:new Uint32Array(e(t.eachEntityMetaObject)),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const lYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function Xue(t){const e=[];for(let i=0,r=t.length;i<r;i+=3)e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]),e.push(1);return e}function cYt(t,e,i,r,o,n){const s=n.getNextId(),a=JSON.parse(i.types),l=JSON.parse(i.eachMetaObjectId),c=i.eachMetaObjectType,d=JSON.parse(i.eachMetaObjectName),u=i.eachMetaObjectParent,h=i.positions,p=i.normals,g=i.colors,f=i.indices,m=i.edgeIndices,A=i.matrices,v=i.reusedGeometriesDecodeMatrix,y=i.eachGeometryPrimitiveType,b=i.eachGeometryPositionsPortion,w=i.eachGeometryNormalsPortion,C=i.eachGeometryColorsPortion,M=i.eachGeometryIndicesPortion,E=i.eachGeometryEdgeIndicesPortion,B=i.eachMeshGeometriesPortion,S=i.eachMeshMatricesPortion,I=i.eachMeshMaterial,T=i.eachEntityMetaObject,_=i.eachEntityMeshesPortion,O=i.eachTileAABB,j=i.eachTileEntitiesPortion,N=l.length,G=b.length,q=B.length,X=T.length,me=j.length;if(o){const ee={metaObjects:[]};for(let $=0;$<N;$++){const re=l[$],ie=c[$],fe=a[ie]||"default",de=d[$],Ae=u[$],Ue=Ae!==$?l[Ae]:null;ee.metaObjects.push({id:re,type:fe,name:de,parent:Ue})}o.loadData(ee,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds})}const ce=new Uint32Array(G);for(let ee=0;ee<q;ee++){const $=B[ee];ce[$]!==void 0?ce[$]++:ce[$]=1}const xe=k.vec3(),Re=k.AABB3(),ge={};for(let ee=0;ee<me;ee++){const $=me-1,re=ee===$,ie=j[ee],fe=re?X:j[ee+1],de=ee*6,Ae=O.subarray(de,de+6);k.getAABB3Center(Ae,xe),Re[0]=Ae[0]-xe[0],Re[1]=Ae[1]-xe[1],Re[2]=Ae[2]-xe[2],Re[3]=Ae[3]-xe[0],Re[4]=Ae[4]-xe[1],Re[5]=Ae[5]-xe[2];const Ue=xi.createPositionsDecodeMatrix(Re),z={};for(let se=ie;se<fe;se++){const ue=T[se],be=l[ue],he=e.globalizeObjectIds?k.globalizeObjectId(r.id,be):be,Q=X-1,J=se===Q,te=_[se],ne=J?B.length:_[se+1],ae=[],W=t.metaScene.metaObjects[he],K={},ve={};if(W){if(e.excludeTypesMap&&W.type&&e.excludeTypesMap[W.type]||e.includeTypesMap&&W.type&&!e.includeTypesMap[W.type]||e.includeIdsMap&&W.id&&!e.includeIdsMap[W.id])continue;const we=e.objectDefaults?e.objectDefaults[W.type]||e.objectDefaults.DEFAULT:null;we&&(we.visible===!1&&(K.visible=!1),we.pickable===!1&&(K.pickable=!1),we.colorize&&(ve.color=we.colorize),we.opacity!==void 0&&we.opacity!==null&&(ve.opacity=we.opacity),we.metallic!==void 0&&we.metallic!==null&&(ve.metallic=we.metallic),we.roughness!==void 0&&we.roughness!==null&&(ve.roughness=we.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let we=te;we<ne;we++){const pe=B[we],Se=ce[pe]>1,Ke=pe===G-1,Pe=lYt(I.subarray(we*6,we*6+3)),Ve=I[we*6+3]/255,Ne=I[we*6+4]/255,Je=I[we*6+5]/255,at=n.getNextId();if(Se){const Bt=S[we],Mt=A.slice(Bt,Bt+16),yt=`${s}-geometry.${ee}.${pe}`;let xt=ge[yt];if(!xt){xt={batchThisMesh:!e.reuseGeometries};const ze=y[pe];let At=!1;switch(ze){case 0:xt.primitiveName="solid",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryNormals=p.subarray(w[pe],Ke?p.length:w[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),xt.geometryEdgeIndices=m.subarray(E[pe],Ke?m.length:E[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;case 1:xt.primitiveName="surface",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryNormals=p.subarray(w[pe],Ke?p.length:w[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),xt.geometryEdgeIndices=m.subarray(E[pe],Ke?m.length:E[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;case 2:xt.primitiveName="points",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryColors=Xue(g.subarray(C[pe],Ke?g.length:C[pe+1])),At=xt.geometryPositions.length>0;break;case 3:xt.primitiveName="lines",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;default:continue}if(At||(xt=null),xt&&(xt.geometryPositions.length>1e3,xt.batchThisMesh)){xt.decompressedPositions=new Float32Array(xt.geometryPositions.length);const Ct=xt.geometryPositions,st=xt.decompressedPositions;for(let Ie=0,le=Ct.length;Ie<le;Ie+=3)st[Ie+0]=Ct[Ie+0]*v[0]+v[12],st[Ie+1]=Ct[Ie+1]*v[5]+v[13],st[Ie+2]=Ct[Ie+2]*v[10]+v[14];xt.geometryPositions=null,ge[yt]=xt}}if(xt)if(xt.batchThisMesh){const ze=xt.decompressedPositions,At=new Uint16Array(ze.length);for(let Ct=0,st=ze.length;Ct<st;Ct+=3)Vh[0]=ze[Ct+0],Vh[1]=ze[Ct+1],Vh[2]=ze[Ct+2],Vh[3]=1,k.transformVec4(Mt,Vh,Zue),xi.compressPosition(Zue,Re,Vh),At[Ct+0]=Vh[0],At[Ct+1]=Vh[1],At[Ct+2]=Vh[2];r.createMesh(Tt.apply(ve,{id:at,origin:xe,primitive:xt.primitiveName,positionsCompressed:At,normalsCompressed:xt.geometryNormals,colorsCompressed:xt.geometryColors,indices:xt.geometryIndices,edgeIndices:xt.geometryEdgeIndices,positionsDecodeMatrix:Ue,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at)}else z[yt]||(r.createGeometry({id:yt,primitive:xt.primitiveName,positionsCompressed:xt.geometryPositions,normalsCompressed:xt.geometryNormals,colorsCompressed:xt.geometryColors,indices:xt.geometryIndices,edgeIndices:xt.geometryEdgeIndices,positionsDecodeMatrix:v}),z[yt]=!0),r.createMesh(Tt.apply(ve,{id:at,geometryId:yt,origin:xe,matrix:Mt,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at)}else{const Bt=y[pe];let Mt,yt,xt,ze,At,Ct,st=!1;switch(Bt){case 0:Mt="solid",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt=p.subarray(w[pe],Ke?p.length:w[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),Ct=m.subarray(E[pe],Ke?m.length:E[pe+1]),st=yt.length>0&&At.length>0;break;case 1:Mt="surface",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt=p.subarray(w[pe],Ke?p.length:w[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),Ct=m.subarray(E[pe],Ke?m.length:E[pe+1]),st=yt.length>0&&At.length>0;break;case 2:Mt="points",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),ze=Xue(g.subarray(C[pe],Ke?g.length:C[pe+1])),st=yt.length>0;break;case 3:Mt="lines",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),st=yt.length>0&&At.length>0;break;default:continue}st&&(r.createMesh(Tt.apply(ve,{id:at,origin:xe,primitive:Mt,positionsCompressed:yt,normalsCompressed:xt,colorsCompressed:ze,indices:At,edgeIndices:Ct,positionsDecodeMatrix:Ue,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at))}}ae.length>0&&r.createEntity(Tt.apply(K,{id:he,isObject:!0,meshIds:ae}))}}}const Yue={version:8,parse:function(t,e,i,r,o,n){const s=sYt(i),a=aYt(s);cYt(t,e,a,r,o,n)}};let OA=window.pako||yd;OA.inflate||(OA=OA.default);const qh=k.vec4(),$ue=k.vec4();function dYt(t){return{metadata:t[0],positions:t[1],normals:t[2],colors:t[3],indices:t[4],edgeIndices:t[5],matrices:t[6],reusedGeometriesDecodeMatrix:t[7],eachGeometryPrimitiveType:t[8],eachGeometryPositionsPortion:t[9],eachGeometryNormalsPortion:t[10],eachGeometryColorsPortion:t[11],eachGeometryIndicesPortion:t[12],eachGeometryEdgeIndicesPortion:t[13],eachMeshGeometriesPortion:t[14],eachMeshMatricesPortion:t[15],eachMeshMaterial:t[16],eachEntityId:t[17],eachEntityMeshesPortion:t[18],eachTileAABB:t[19],eachTileEntitiesPortion:t[20]}}function uYt(t){function e(i,r){return i.length===0?[]:OA.inflate(i,r).buffer}return{metadata:JSON.parse(OA.inflate(t.metadata,{to:"string"})),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityId:JSON.parse(OA.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const hYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function pYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.positions,c=i.normals,d=i.colors,u=i.indices,h=i.edgeIndices,p=i.matrices,g=i.reusedGeometriesDecodeMatrix,f=i.eachGeometryPrimitiveType,m=i.eachGeometryPositionsPortion,A=i.eachGeometryNormalsPortion,v=i.eachGeometryColorsPortion,y=i.eachGeometryIndicesPortion,b=i.eachGeometryEdgeIndicesPortion,w=i.eachMeshGeometriesPortion,C=i.eachMeshMatricesPortion,M=i.eachMeshMaterial,E=i.eachEntityId,B=i.eachEntityMeshesPortion,S=i.eachTileAABB,I=i.eachTileEntitiesPortion,T=m.length,_=w.length,O=B.length,j=I.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});const N=new Uint32Array(T);for(let me=0;me<_;me++){const ce=w[me];N[ce]!==void 0?N[ce]++:N[ce]=1}const G=k.vec3(),q=k.AABB3(),X={};for(let me=0;me<j;me++){const ce=j-1,xe=me===ce,Re=I[me],ge=xe?O-1:I[me+1]-1,ee=me*6,$=S.subarray(ee,ee+6);k.getAABB3Center($,G),q[0]=$[0]-G[0],q[1]=$[1]-G[1],q[2]=$[2]-G[2],q[3]=$[3]-G[0],q[4]=$[4]-G[1],q[5]=$[5]-G[2];const re=xi.createPositionsDecodeMatrix(q),ie={};for(let fe=Re;fe<=ge;fe++){const de=E[fe],Ae=e.globalizeObjectIds?k.globalizeObjectId(r.id,de):de,Ue=O-1,z=fe===Ue,se=B[fe],ue=z?w.length-1:B[fe+1]-1,be=[],he=t.metaScene.metaObjects[Ae],Q={},J={};if(!(e.includeIdsMap&&de&&!e.includeIdsMap[de])){if(he){if(e.excludeTypesMap&&he.type&&e.excludeTypesMap[he.type]||e.includeTypesMap&&he.type&&!e.includeTypesMap[he.type]||e.includeIdsMap&&he.id&&!e.includeIdsMap[he.id])continue;const te=e.objectDefaults?e.objectDefaults[he.type]||e.objectDefaults.DEFAULT:null;te&&(te.visible===!1&&(Q.visible=!1),te.pickable===!1&&(Q.pickable=!1),te.colorize&&(J.color=te.colorize),te.opacity!==void 0&&te.opacity!==null&&(J.opacity=te.opacity),te.metallic!==void 0&&te.metallic!==null&&(J.metallic=te.metallic),te.roughness!==void 0&&te.roughness!==null&&(J.roughness=te.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let te=se;te<=ue;te++){const ne=w[te],ae=N[ne]>1,W=ne===T-1,K=hYt(M.subarray(te*6,te*6+3)),ve=M[te*6+3]/255,we=M[te*6+4]/255,pe=M[te*6+5]/255,Se=n.getNextId();if(ae){const Ke=C[te],Pe=p.slice(Ke,Ke+16),Ve=`${s}-geometry.${me}.${ne}`;let Ne=X[Ve];if(!Ne){Ne={batchThisMesh:!e.reuseGeometries};const Je=f[ne];let at=!1;switch(Je){case 0:Ne.primitiveName="solid",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryNormals=c.subarray(A[ne],W?c.length:A[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),Ne.geometryEdgeIndices=h.subarray(b[ne],W?h.length:b[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;case 1:Ne.primitiveName="surface",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryNormals=c.subarray(A[ne],W?c.length:A[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),Ne.geometryEdgeIndices=h.subarray(b[ne],W?h.length:b[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;case 2:Ne.primitiveName="points",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryColors=d.subarray(v[ne],W?d.length:v[ne+1]),at=Ne.geometryPositions.length>0;break;case 3:Ne.primitiveName="lines",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;default:continue}if(at||(Ne=null),Ne&&(Ne.geometryPositions.length>1e3,Ne.batchThisMesh)){Ne.decompressedPositions=new Float32Array(Ne.geometryPositions.length),Ne.transformedAndRecompressedPositions=new Uint16Array(Ne.geometryPositions.length);const Bt=Ne.geometryPositions,Mt=Ne.decompressedPositions;for(let yt=0,xt=Bt.length;yt<xt;yt+=3)Mt[yt+0]=Bt[yt+0]*g[0]+g[12],Mt[yt+1]=Bt[yt+1]*g[5]+g[13],Mt[yt+2]=Bt[yt+2]*g[10]+g[14];Ne.geometryPositions=null,X[Ve]=Ne}}if(Ne)if(Ne.batchThisMesh){const Je=Ne.decompressedPositions,at=Ne.transformedAndRecompressedPositions;for(let Bt=0,Mt=Je.length;Bt<Mt;Bt+=3)qh[0]=Je[Bt+0],qh[1]=Je[Bt+1],qh[2]=Je[Bt+2],qh[3]=1,k.transformVec4(Pe,qh,$ue),xi.compressPosition($ue,q,qh),at[Bt+0]=qh[0],at[Bt+1]=qh[1],at[Bt+2]=qh[2];r.createMesh(Tt.apply(J,{id:Se,origin:G,primitive:Ne.primitiveName,positionsCompressed:at,normalsCompressed:Ne.geometryNormals,colorsCompressed:Ne.geometryColors,indices:Ne.geometryIndices,edgeIndices:Ne.geometryEdgeIndices,positionsDecodeMatrix:re,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se)}else ie[Ve]||(r.createGeometry({id:Ve,primitive:Ne.primitiveName,positionsCompressed:Ne.geometryPositions,normalsCompressed:Ne.geometryNormals,colorsCompressed:Ne.geometryColors,indices:Ne.geometryIndices,edgeIndices:Ne.geometryEdgeIndices,positionsDecodeMatrix:g}),ie[Ve]=!0),r.createMesh(Tt.apply(J,{id:Se,geometryId:Ve,origin:G,matrix:Pe,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se)}else{const Ke=f[ne];let Pe,Ve,Ne,Je,at,Bt,Mt=!1;switch(Ke){case 0:Pe="solid",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Ne=c.subarray(A[ne],W?c.length:A[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Bt=h.subarray(b[ne],W?h.length:b[ne+1]),Mt=Ve.length>0&&at.length>0;break;case 1:Pe="surface",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Ne=c.subarray(A[ne],W?c.length:A[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Bt=h.subarray(b[ne],W?h.length:b[ne+1]),Mt=Ve.length>0&&at.length>0;break;case 2:Pe="points",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Je=d.subarray(v[ne],W?d.length:v[ne+1]),Mt=Ve.length>0;break;case 3:Pe="lines",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Mt=Ve.length>0&&at.length>0;break;default:continue}Mt&&(r.createMesh(Tt.apply(J,{id:Se,origin:G,primitive:Pe,positionsCompressed:Ve,normalsCompressed:Ne,colorsCompressed:Je,indices:at,edgeIndices:Bt,positionsDecodeMatrix:re,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se))}}be.length>0&&r.createEntity(Tt.apply(Q,{id:Ae,isObject:!0,meshIds:be}))}}}}const ehe={version:9,parse:function(t,e,i,r,o,n){const s=dYt(i),a=uYt(s);pYt(t,e,a,r,o,n)}};let UA=window.pako||yd;UA.inflate||(UA=UA.default);const Gh=k.vec4(),the=k.vec4(),fYt=9;function gYt(t){let e=0;return{metadata:t[e++],textureData:t[e++],eachTextureDataPortion:t[e++],eachTextureAttributes:t[e++],positions:t[e++],normals:t[e++],colors:t[e++],uvs:t[e++],indices:t[e++],edgeIndices:t[e++],eachTextureSetTextures:t[e++],matrices:t[e++],reusedGeometriesDecodeMatrix:t[e++],eachGeometryPrimitiveType:t[e++],eachGeometryPositionsPortion:t[e++],eachGeometryNormalsPortion:t[e++],eachGeometryColorsPortion:t[e++],eachGeometryUVsPortion:t[e++],eachGeometryIndicesPortion:t[e++],eachGeometryEdgeIndicesPortion:t[e++],eachMeshGeometriesPortion:t[e++],eachMeshMatricesPortion:t[e++],eachMeshTextureSet:t[e++],eachMeshMaterialAttributes:t[e++],eachEntityId:t[e++],eachEntityMeshesPortion:t[e++],eachTileAABB:t[e++],eachTileEntitiesPortion:t[e++]}}function AYt(t){function e(i,r){return i.length===0?[]:UA.inflate(i,r).buffer}return{metadata:JSON.parse(UA.inflate(t.metadata,{to:"string"})),textureData:new Uint8Array(e(t.textureData)),eachTextureDataPortion:new Uint32Array(e(t.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(e(t.eachTextureAttributes)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),uvs:new Float32Array(e(t.uvs)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),eachTextureSetTextures:new Int32Array(e(t.eachTextureSetTextures)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(e(t.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(e(t.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(e(t.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(UA.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const mYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function vYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryPositionsPortion,C=i.eachGeometryNormalsPortion,M=i.eachGeometryColorsPortion,E=i.eachGeometryUVsPortion,B=i.eachGeometryIndicesPortion,S=i.eachGeometryEdgeIndicesPortion,I=i.eachMeshGeometriesPortion,T=i.eachMeshMatricesPortion,_=i.eachMeshTextureSet,O=i.eachMeshMaterialAttributes,j=i.eachEntityId,N=i.eachEntityMeshesPortion,G=i.eachTileAABB,q=i.eachTileEntitiesPortion,X=c.length,me=A.length/5,ce=w.length,xe=I.length,Re=N.length,ge=q.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let fe=0;fe<X;fe++){const de=fe===X-1,Ae=c[fe],Ue=de?l.length:c[fe+1],z=Ue-Ae>0,se=fe*fYt,ue=d[se+0]===1,be=d[se+1];d[se+2],d[se+3];const he=d[se+4],Q=d[se+5],J=d[se+6],te=d[se+7],ne=d[se+8];if(z){const ae=new Uint8Array(l.subarray(Ae,Ue)).buffer,W=`${s}-texture-${fe}`;if(ue)r.createTexture({id:W,buffers:[ae],minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne});else{const K=be===xM?"image/jpeg":be===kM?"image/png":"image/gif",ve=new Blob([ae],{type:K}),we=(window.URL||window.webkitURL).createObjectURL(ve),pe=document.createElement("img");pe.src=we,r.createTexture({id:W,image:pe,minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne})}}}for(let fe=0;fe<me;fe++){const de=fe*5,Ae=`${s}-textureSet-${fe}`,Ue=A[de+0],z=A[de+1],se=A[de+2],ue=A[de+3],be=A[de+4];r.createTextureSet({id:Ae,colorTextureId:Ue>=0?`${s}-texture-${Ue}`:null,normalsTextureId:se>=0?`${s}-texture-${se}`:null,metallicRoughnessTextureId:z>=0?`${s}-texture-${z}`:null,emissiveTextureId:ue>=0?`${s}-texture-${ue}`:null,occlusionTextureId:be>=0?`${s}-texture-${be}`:null})}const ee=new Uint32Array(ce);for(let fe=0;fe<xe;fe++){const de=I[fe];ee[de]!==void 0?ee[de]++:ee[de]=1}const $=k.vec3(),re=k.AABB3(),ie={};for(let fe=0;fe<ge;fe++){const de=ge-1,Ae=fe===de,Ue=q[fe],z=Ae?Re-1:q[fe+1]-1,se=fe*6,ue=G.subarray(se,se+6);k.getAABB3Center(ue,$),re[0]=ue[0]-$[0],re[1]=ue[1]-$[1],re[2]=ue[2]-$[2],re[3]=ue[3]-$[0],re[4]=ue[4]-$[1],re[5]=ue[5]-$[2];const be=xi.createPositionsDecodeMatrix(re),he={};for(let Q=Ue;Q<=z;Q++){const J=j[Q],te=e.globalizeObjectIds?k.globalizeObjectId(r.id,J):J,ne=Re-1,ae=Q===ne,W=N[Q],K=ae?I.length-1:N[Q+1]-1,ve=[],we=t.metaScene.metaObjects[te],pe={},Se={};if(!(e.includeIdsMap&&J&&!e.includeIdsMap[J])){if(we){if(e.excludeTypesMap&&we.type&&e.excludeTypesMap[we.type]||e.includeTypesMap&&we.type&&!e.includeTypesMap[we.type]||e.includeIdsMap&&we.id&&!e.includeIdsMap[we.id])continue;const Ke=e.objectDefaults?e.objectDefaults[we.type]||e.objectDefaults.DEFAULT:null;Ke&&(Ke.visible===!1&&(pe.visible=!1),Ke.pickable===!1&&(pe.pickable=!1),Ke.colorize&&(Se.color=Ke.colorize),Ke.opacity!==void 0&&Ke.opacity!==null&&(Se.opacity=Ke.opacity),Ke.metallic!==void 0&&Ke.metallic!==null&&(Se.metallic=Ke.metallic),Ke.roughness!==void 0&&Ke.roughness!==null&&(Se.roughness=Ke.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Ke=W;Ke<=K;Ke++){const Pe=I[Ke],Ve=ee[Pe]>1,Ne=Pe===ce-1,Je=_[Ke],at=Je>=0?`${s}-textureSet-${Je}`:null,Bt=mYt(O.subarray(Ke*6,Ke*6+3)),Mt=O[Ke*6+3]/255,yt=O[Ke*6+4]/255,xt=O[Ke*6+5]/255,ze=n.getNextId();if(Ve){const At=T[Ke],Ct=v.slice(At,At+16),st=`${s}-geometry.${fe}.${Pe}`;let Ie=ie[st];if(!Ie){Ie={batchThisMesh:!e.reuseGeometries};const le=b[Pe];let Fe=!1;switch(le){case 0:Ie.primitiveName="solid",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 1:Ie.primitiveName="surface",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 2:Ie.primitiveName="points",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryColors=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),Fe=Ie.geometryPositions.length>0;break;case 3:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 4:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=ihe(Ie.geometryPositions,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;default:continue}if(Fe||(Ie=null),Ie&&(Ie.geometryPositions.length>1e3,Ie.batchThisMesh)){Ie.decompressedPositions=new Float32Array(Ie.geometryPositions.length),Ie.transformedAndRecompressedPositions=new Uint16Array(Ie.geometryPositions.length);const Qe=Ie.geometryPositions,Pt=Ie.decompressedPositions;for(let bt=0,ei=Qe.length;bt<ei;bt+=3)Pt[bt+0]=Qe[bt+0]*y[0]+y[12],Pt[bt+1]=Qe[bt+1]*y[5]+y[13],Pt[bt+2]=Qe[bt+2]*y[10]+y[14];Ie.geometryPositions=null,ie[st]=Ie}}if(Ie)if(Ie.batchThisMesh){const le=Ie.decompressedPositions,Fe=Ie.transformedAndRecompressedPositions;for(let Qe=0,Pt=le.length;Qe<Pt;Qe+=3)Gh[0]=le[Qe+0],Gh[1]=le[Qe+1],Gh[2]=le[Qe+2],Gh[3]=1,k.transformVec4(Ct,Gh,the),xi.compressPosition(the,re,Gh),Fe[Qe+0]=Gh[0],Fe[Qe+1]=Gh[1],Fe[Qe+2]=Gh[2];r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ie.primitiveName,positionsCompressed:Fe,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze)}else he[st]||(r.createGeometry({id:st,primitive:Ie.primitiveName,positionsCompressed:Ie.geometryPositions,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:y}),he[st]=!0),r.createMesh(Tt.apply(Se,{id:ze,geometryId:st,textureSetId:at,matrix:Ct,color:Bt,metallic:yt,roughness:xt,opacity:Mt,origin:$})),ve.push(ze)}else{const At=b[Pe];let Ct,st,Ie,le,Fe,Qe,Pt,bt=!1;switch(At){case 0:Ct="solid",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 1:Ct="surface",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 2:Ct="points",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Fe=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),bt=st.length>0;break;case 3:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 4:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=ihe(st,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),bt=st.length>0&&Qe.length>0;break;default:continue}bt&&(r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ct,positionsCompressed:st,normalsCompressed:Ie,uv:le&&le.length>0?le:null,colorsCompressed:Fe,indices:Qe,edgeIndices:Pt,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze))}}ve.length>0&&r.createEntity(Tt.apply(pe,{id:te,isObject:!0,meshIds:ve}))}}}}function ihe(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const rhe={version:10,parse:function(t,e,i,r,o,n){const s=gYt(i),a=AYt(s);vYt(t,e,a,r,o,n)}},Qh=k.vec4(),ohe=k.vec4(),yYt=9;function bYt(t){const e=(function(){const o=new ArrayBuffer(2);return new Uint16Array(o)[0]=1,new Uint8Array(o)[0]!==1})(),i=(function(){let o=0;const n=new DataView(t);return function(s){const a=1+2*o++,l=n.getUint32(a*4,!0),c=n.getUint32((a+1)*4,!0),d=s.BYTES_PER_ELEMENT;if(e&&d>1){const u=new Uint8Array(t,l,c),h=d/2,p=u.length/d;for(let g=0;g<p;g++){const f=g*d;for(let m=0;m<h;m++){const A=f+m,v=f-m+d-1,y=u[A];u[A]=u[v],u[v]=y}}}return new s(t,l,c/d)}})(),r=(function(){const o=new TextDecoder;return()=>JSON.parse(o.decode(i(Uint8Array)))})();return{metadata:r(),textureData:i(Uint8Array),eachTextureDataPortion:i(Uint32Array),eachTextureAttributes:i(Uint16Array),positions:i(Uint16Array),normals:i(Int8Array),colors:i(Uint8Array),uvs:i(Float32Array),indices:i(Uint32Array),edgeIndices:i(Uint32Array),eachTextureSetTextures:i(Int32Array),matrices:i(Float32Array),reusedGeometriesDecodeMatrix:i(Float32Array),eachGeometryPrimitiveType:i(Uint8Array),eachGeometryPositionsPortion:i(Uint32Array),eachGeometryNormalsPortion:i(Uint32Array),eachGeometryColorsPortion:i(Uint32Array),eachGeometryUVsPortion:i(Uint32Array),eachGeometryIndicesPortion:i(Uint32Array),eachGeometryEdgeIndicesPortion:i(Uint32Array),eachMeshGeometriesPortion:i(Uint32Array),eachMeshMatricesPortion:i(Uint32Array),eachMeshTextureSet:i(Int32Array),eachMeshMaterialAttributes:i(Uint8Array),eachEntityId:r(),eachEntityMeshesPortion:i(Uint32Array),eachTileAABB:i(Float64Array),eachTileEntitiesPortion:i(Uint32Array)}}const wYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function CYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryPositionsPortion,C=i.eachGeometryNormalsPortion,M=i.eachGeometryColorsPortion,E=i.eachGeometryUVsPortion,B=i.eachGeometryIndicesPortion,S=i.eachGeometryEdgeIndicesPortion,I=i.eachMeshGeometriesPortion,T=i.eachMeshMatricesPortion,_=i.eachMeshTextureSet,O=i.eachMeshMaterialAttributes,j=i.eachEntityId,N=i.eachEntityMeshesPortion,G=i.eachTileAABB,q=i.eachTileEntitiesPortion,X=c.length,me=A.length/5,ce=w.length,xe=I.length,Re=N.length,ge=q.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let fe=0;fe<X;fe++){const de=fe===X-1,Ae=c[fe],Ue=de?l.length:c[fe+1],z=Ue-Ae>0,se=fe*yYt,ue=d[se+0]===1,be=d[se+1];d[se+2],d[se+3];const he=d[se+4],Q=d[se+5],J=d[se+6],te=d[se+7],ne=d[se+8];if(z){const ae=new Uint8Array(l.subarray(Ae,Ue)).buffer,W=`${s}-texture-${fe}`;if(ue)r.createTexture({id:W,buffers:[ae],minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne});else{const K=be===xM?"image/jpeg":be===kM?"image/png":"image/gif",ve=new Blob([ae],{type:K}),we=(window.URL||window.webkitURL).createObjectURL(ve),pe=document.createElement("img");pe.src=we,r.createTexture({id:W,image:pe,minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne})}}}for(let fe=0;fe<me;fe++){const de=fe*5,Ae=`${s}-textureSet-${fe}`,Ue=A[de+0],z=A[de+1],se=A[de+2],ue=A[de+3],be=A[de+4];r.createTextureSet({id:Ae,colorTextureId:Ue>=0?`${s}-texture-${Ue}`:null,normalsTextureId:se>=0?`${s}-texture-${se}`:null,metallicRoughnessTextureId:z>=0?`${s}-texture-${z}`:null,emissiveTextureId:ue>=0?`${s}-texture-${ue}`:null,occlusionTextureId:be>=0?`${s}-texture-${be}`:null})}const ee=new Uint32Array(ce);for(let fe=0;fe<xe;fe++){const de=I[fe];ee[de]!==void 0?ee[de]++:ee[de]=1}const $=k.vec3(),re=k.AABB3(),ie={};for(let fe=0;fe<ge;fe++){const de=ge-1,Ae=fe===de,Ue=q[fe],z=Ae?Re-1:q[fe+1]-1,se=fe*6,ue=G.subarray(se,se+6);k.getAABB3Center(ue,$),re[0]=ue[0]-$[0],re[1]=ue[1]-$[1],re[2]=ue[2]-$[2],re[3]=ue[3]-$[0],re[4]=ue[4]-$[1],re[5]=ue[5]-$[2];const be=xi.createPositionsDecodeMatrix(re),he={};for(let Q=Ue;Q<=z;Q++){const J=j[Q],te=e.globalizeObjectIds?k.globalizeObjectId(r.id,J):J,ne=Re-1,ae=Q===ne,W=N[Q],K=ae?I.length-1:N[Q+1]-1,ve=[],we=t.metaScene.metaObjects[te],pe={},Se={};if(!(e.includeIdsMap&&J&&!e.includeIdsMap[J])){if(we){if(e.excludeTypesMap&&we.type&&e.excludeTypesMap[we.type]||e.includeTypesMap&&we.type&&!e.includeTypesMap[we.type]||e.includeIdsMap&&we.id&&!e.includeIdsMap[we.id])continue;const Ke=e.objectDefaults?e.objectDefaults[we.type]||e.objectDefaults.DEFAULT:null;Ke&&(Ke.visible===!1&&(pe.visible=!1),Ke.pickable===!1&&(pe.pickable=!1),Ke.colorize&&(Se.color=Ke.colorize),Ke.opacity!==void 0&&Ke.opacity!==null&&(Se.opacity=Ke.opacity),Ke.metallic!==void 0&&Ke.metallic!==null&&(Se.metallic=Ke.metallic),Ke.roughness!==void 0&&Ke.roughness!==null&&(Se.roughness=Ke.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Ke=W;Ke<=K;Ke++){const Pe=I[Ke],Ve=ee[Pe]>1,Ne=Pe===ce-1,Je=_[Ke],at=Je>=0?`${s}-textureSet-${Je}`:null,Bt=wYt(O.subarray(Ke*6,Ke*6+3)),Mt=O[Ke*6+3]/255,yt=O[Ke*6+4]/255,xt=O[Ke*6+5]/255,ze=n.getNextId();if(Ve){const At=T[Ke],Ct=v.slice(At,At+16),st=`${s}-geometry.${fe}.${Pe}`;let Ie=ie[st];if(!Ie){Ie={batchThisMesh:!e.reuseGeometries};const le=b[Pe];let Fe=!1;switch(le){case 0:Ie.primitiveName="solid",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 1:Ie.primitiveName="surface",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 2:Ie.primitiveName="points",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryColors=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),Fe=Ie.geometryPositions.length>0;break;case 3:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 4:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=nhe(Ie.geometryPositions,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;default:continue}if(Fe||(Ie=null),Ie&&(Ie.geometryPositions.length>1e3,Ie.batchThisMesh)){Ie.decompressedPositions=new Float32Array(Ie.geometryPositions.length),Ie.transformedAndRecompressedPositions=new Uint16Array(Ie.geometryPositions.length);const Qe=Ie.geometryPositions,Pt=Ie.decompressedPositions;for(let bt=0,ei=Qe.length;bt<ei;bt+=3)Pt[bt+0]=Qe[bt+0]*y[0]+y[12],Pt[bt+1]=Qe[bt+1]*y[5]+y[13],Pt[bt+2]=Qe[bt+2]*y[10]+y[14];Ie.geometryPositions=null,ie[st]=Ie}}if(Ie)if(Ie.batchThisMesh){const le=Ie.decompressedPositions,Fe=Ie.transformedAndRecompressedPositions;for(let Qe=0,Pt=le.length;Qe<Pt;Qe+=3)Qh[0]=le[Qe+0],Qh[1]=le[Qe+1],Qh[2]=le[Qe+2],Qh[3]=1,k.transformVec4(Ct,Qh,ohe),xi.compressPosition(ohe,re,Qh),Fe[Qe+0]=Qh[0],Fe[Qe+1]=Qh[1],Fe[Qe+2]=Qh[2];r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ie.primitiveName,positionsCompressed:Fe,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze)}else he[st]||(r.createGeometry({id:st,primitive:Ie.primitiveName,positionsCompressed:Ie.geometryPositions,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:y}),he[st]=!0),r.createMesh(Tt.apply(Se,{id:ze,geometryId:st,textureSetId:at,matrix:Ct,color:Bt,metallic:yt,roughness:xt,opacity:Mt,origin:$})),ve.push(ze)}else{const At=b[Pe];let Ct,st,Ie,le,Fe,Qe,Pt,bt=!1;switch(At){case 0:Ct="solid",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 1:Ct="surface",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 2:Ct="points",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Fe=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),bt=st.length>0;break;case 3:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 4:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=nhe(st,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),bt=st.length>0&&Qe.length>0;break;default:continue}bt&&(r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ct,positionsCompressed:st,normalsCompressed:Ie,uv:le&&le.length>0?le:null,colorsCompressed:Fe,indices:Qe,edgeIndices:Pt,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze))}}ve.length>0&&r.createEntity(Tt.apply(pe,{id:te,isObject:!0,meshIds:ve}))}}}}function nhe(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const she={version:11,parseArrayBuffer:function(t,e,i,r,o,n){const s=bYt(i);CYt(t,e,s,r,o,n)}};let Ff=window.pako||yd;Ff.inflate||(Ff=Ff.default);const Kh=k.vec4(),ahe=k.vec4(),xYt=9;function kYt(t){const e=(function(){const o=new ArrayBuffer(2);return new Uint16Array(o)[0]=1,new Uint8Array(o)[0]!==1})(),i=(function(){let o=0;const n=new DataView(t);return function(s){const a=1+2*o++,l=n.getUint32(a*4,!0),c=n.getUint32((a+1)*4,!0),d=s.BYTES_PER_ELEMENT;if(e&&d>1){const u=new Uint8Array(t,l,c),h=d/2,p=u.length/d;for(let g=0;g<p;g++){const f=g*d;for(let m=0;m<h;m++){const A=f+m,v=f-m+d-1,y=u[A];u[A]=u[v],u[v]=y}}}return new s(t,l,c/d)}})(),r=(function(){const o=new TextDecoder;return()=>JSON.parse(o.decode(i(Uint8Array)))})();return{metadata:r(),textureData:i(Uint8Array),eachTextureDataPortion:i(Uint32Array),eachTextureAttributes:i(Uint16Array),positions:i(Uint16Array),normals:i(Int8Array),colors:i(Uint8Array),uvs:i(Float32Array),indices:i(Uint32Array),edgeIndices:i(Uint32Array),eachTextureSetTextures:i(Int32Array),matrices:i(Float32Array),reusedGeometriesDecodeMatrix:i(Float32Array),eachGeometryPrimitiveType:i(Uint8Array),eachGeometryAxisLabel:r(),eachGeometryPositionsPortion:i(Uint32Array),eachGeometryNormalsPortion:i(Uint32Array),eachGeometryColorsPortion:i(Uint32Array),eachGeometryUVsPortion:i(Uint32Array),eachGeometryIndicesPortion:i(Uint32Array),eachGeometryEdgeIndicesPortion:i(Uint32Array),eachMeshGeometriesPortion:i(Uint32Array),eachMeshMatricesPortion:i(Uint32Array),eachMeshTextureSet:i(Int32Array),eachMeshMaterialAttributes:i(Uint8Array),eachEntityId:r(),eachEntityMeshesPortion:i(Uint32Array),eachTileAABB:i(Float64Array),eachTileEntitiesPortion:i(Uint32Array)}}function MYt(t){let e=0;return{metadata:t[e++],textureData:t[e++],eachTextureDataPortion:t[e++],eachTextureAttributes:t[e++],positions:t[e++],normals:t[e++],colors:t[e++],uvs:t[e++],indices:t[e++],edgeIndices:t[e++],eachTextureSetTextures:t[e++],matrices:t[e++],reusedGeometriesDecodeMatrix:t[e++],eachGeometryPrimitiveType:t[e++],eachGeometryAxisLabel:t[e++],eachGeometryPositionsPortion:t[e++],eachGeometryNormalsPortion:t[e++],eachGeometryColorsPortion:t[e++],eachGeometryUVsPortion:t[e++],eachGeometryIndicesPortion:t[e++],eachGeometryEdgeIndicesPortion:t[e++],eachMeshGeometriesPortion:t[e++],eachMeshMatricesPortion:t[e++],eachMeshTextureSet:t[e++],eachMeshMaterialAttributes:t[e++],eachEntityId:t[e++],eachEntityMeshesPortion:t[e++],eachTileAABB:t[e++],eachTileEntitiesPortion:t[e++]}}function EYt(t){function e(i,r){return i.length===0?[]:Ff.inflate(i,r).buffer}return{metadata:JSON.parse(Ff.inflate(t.metadata,{to:"string"})),textureData:new Uint8Array(e(t.textureData)),eachTextureDataPortion:new Uint32Array(e(t.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(e(t.eachTextureAttributes)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),uvs:new Float32Array(e(t.uvs)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),eachTextureSetTextures:new Int32Array(e(t.eachTextureSetTextures)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryAxisLabel:JSON.parse(Ff.inflate(t.eachGeometryAxisLabel,{to:"string"})),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(e(t.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(e(t.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(e(t.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(Ff.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const BYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function lhe(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryAxisLabel,C=i.eachGeometryPositionsPortion,M=i.eachGeometryNormalsPortion,E=i.eachGeometryColorsPortion,B=i.eachGeometryUVsPortion,S=i.eachGeometryIndicesPortion,I=i.eachGeometryEdgeIndicesPortion,T=i.eachMeshGeometriesPortion,_=i.eachMeshMatricesPortion,O=i.eachMeshTextureSet,j=i.eachMeshMaterialAttributes,N=i.eachEntityId,G=i.eachEntityMeshesPortion,q=i.eachTileAABB,X=i.eachTileEntitiesPortion,me=c.length,ce=A.length/5,xe=C.length,Re=T.length,ge=G.length,ee=X.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let de=0;de<me;de++){const Ae=de===me-1,Ue=c[de],z=Ae?l.length:c[de+1],se=z-Ue>0,ue=de*xYt,be=d[ue+0]===1,he=d[ue+1];d[ue+2],d[ue+3];const Q=d[ue+4],J=d[ue+5],te=d[ue+6],ne=d[ue+7],ae=d[ue+8];if(se){const W=new Uint8Array(l.subarray(Ue,z)).buffer,K=`${s}-texture-${de}`;if(be)r.createTexture({id:K,buffers:[W],minFilter:Q,magFilter:J,wrapS:te,wrapT:ne,wrapR:ae});else{const ve=he===xM?"image/jpeg":he===kM?"image/png":"image/gif",we=new Blob([W],{type:ve}),pe=(window.URL||window.webkitURL).createObjectURL(we),Se=document.createElement("img");Se.src=pe,r.createTexture({id:K,image:Se,minFilter:Q,magFilter:J,wrapS:te,wrapT:ne,wrapR:ae})}}}for(let de=0;de<ce;de++){const Ae=de*5,Ue=`${s}-textureSet-${de}`,z=A[Ae+0],se=A[Ae+1],ue=A[Ae+2],be=A[Ae+3],he=A[Ae+4];r.createTextureSet({id:Ue,colorTextureId:z>=0?`${s}-texture-${z}`:null,normalsTextureId:ue>=0?`${s}-texture-${ue}`:null,metallicRoughnessTextureId:se>=0?`${s}-texture-${se}`:null,emissiveTextureId:be>=0?`${s}-texture-${be}`:null,occlusionTextureId:he>=0?`${s}-texture-${he}`:null})}const $=new Uint32Array(xe);for(let de=0;de<Re;de++){const Ae=T[de];$[Ae]!==void 0?$[Ae]++:$[Ae]=1}const re=k.vec3(),ie=k.AABB3(),fe={};for(let de=0;de<ee;de++){const Ae=ee-1,Ue=de===Ae,z=X[de],se=Ue?ge-1:X[de+1]-1,ue=de*6,be=q.subarray(ue,ue+6);k.getAABB3Center(be,re),ie[0]=be[0]-re[0],ie[1]=be[1]-re[1],ie[2]=be[2]-re[2],ie[3]=be[3]-re[0],ie[4]=be[4]-re[1],ie[5]=be[5]-re[2];const he=xi.createPositionsDecodeMatrix(ie),Q={};for(let J=z;J<=se;J++){const te=N[J],ne=e.globalizeObjectIds?k.globalizeObjectId(r.id,te):te,ae=ge-1,W=J===ae,K=G[J],ve=W?T.length-1:G[J+1]-1,we=[],pe=t.metaScene.metaObjects[ne],Se={},Ke={};if(!(e.includeIdsMap&&te&&!e.includeIdsMap[te])){if(pe){if(e.excludeTypesMap&&pe.type&&e.excludeTypesMap[pe.type]||e.includeTypesMap&&pe.type&&!e.includeTypesMap[pe.type]||e.includeIdsMap&&pe.id&&!e.includeIdsMap[pe.id])continue;const Pe=e.objectDefaults?e.objectDefaults[pe.type]||e.objectDefaults.DEFAULT:null;Pe&&(Pe.visible===!1&&(Se.visible=!1),Pe.pickable===!1&&(Se.pickable=!1),Pe.colorize&&(Ke.color=Pe.colorize),Pe.opacity!==void 0&&Pe.opacity!==null&&(Ke.opacity=Pe.opacity),Pe.metallic!==void 0&&Pe.metallic!==null&&(Ke.metallic=Pe.metallic),Pe.roughness!==void 0&&Pe.roughness!==null&&(Ke.roughness=Pe.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Pe=K;Pe<=ve;Pe++){const Ve=T[Pe],Ne=$[Ve]>1,Je=Ve===xe-1,at=O[Pe],Bt=at>=0?`${s}-textureSet-${at}`:null,Mt=BYt(j.subarray(Pe*6,Pe*6+3)),yt=j[Pe*6+3]/255,xt=j[Pe*6+4]/255,ze=j[Pe*6+5]/255,At=n.getNextId();if(Ne){const Ct=_[Pe],st=v.slice(Ct,Ct+16),Ie=`${s}-geometry.${de}.${Ve}`;let le=fe[Ie];if(!le){le={batchThisMesh:!e.reuseGeometries};const Fe=b[Ve],Qe=w[Ve];let Pt=!1,bt;switch(Fe){case 0:le.primitiveName="solid",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryNormals=h.subarray(M[Ve],Je?h.length:M[Ve+1]),le.geometryUVs=g.subarray(B[Ve],Je?g.length:B[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),le.geometryEdgeIndices=m.subarray(I[Ve],Je?m.length:I[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 1:le.primitiveName="surface",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryNormals=h.subarray(M[Ve],Je?h.length:M[Ve+1]),le.geometryUVs=g.subarray(B[Ve],Je?g.length:B[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),le.geometryEdgeIndices=m.subarray(I[Ve],Je?m.length:I[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 2:le.primitiveName="points",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryColors=p.subarray(E[Ve],Je?p.length:E[Ve+1]),Pt=le.geometryPositions.length>0;break;case 3:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 4:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryIndices=che(le.geometryPositions,f.subarray(S[Ve],Je?f.length:S[Ve+1])),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 7:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.decompressedPositions=xi.decompressPositions(le.geometryPositions,y),bt=sA({origin:le.decompressedPositions,text:Qe,size:2}),le.decompressedPositions=bt.positions,le.geometryIndices=bt.indices,le.geometryPositions=null,Pt=le.decompressedPositions.length>0&&le.geometryIndices.length>0;break;default:continue}if(Pt||(le=null),le&&(le.geometryPositions&&le.geometryPositions.length>1e3,le.batchThisMesh)){if(Fe===7)le.transformedAndRecompressedPositions=new Uint16Array(le.decompressedPositions.length);else{le.decompressedPositions=new Float32Array(le.geometryPositions.length),le.transformedAndRecompressedPositions=new Uint16Array(le.geometryPositions.length);const ei=le.geometryPositions,ii=le.decompressedPositions;for(let wi=0,Ai=ei.length;wi<Ai;wi+=3)ii[wi+0]=ei[wi+0]*y[0]+y[12],ii[wi+1]=ei[wi+1]*y[5]+y[13],ii[wi+2]=ei[wi+2]*y[10]+y[14];le.geometryPositions=null}fe[Ie]=le}}if(le)if(le.batchThisMesh){const Fe=le.decompressedPositions,Qe=le.transformedAndRecompressedPositions;for(let Pt=0,bt=Fe.length;Pt<bt;Pt+=3)Kh[0]=Fe[Pt+0],Kh[1]=Fe[Pt+1],Kh[2]=Fe[Pt+2],Kh[3]=1,k.transformVec4(st,Kh,ahe),xi.compressPosition(ahe,ie,Kh),Qe[Pt+0]=Kh[0],Qe[Pt+1]=Kh[1],Qe[Pt+2]=Kh[2];r.createMesh(Tt.apply(Ke,{id:At,textureSetId:Bt,origin:re,primitive:le.primitiveName,positionsCompressed:Qe,normalsCompressed:le.geometryNormals,uv:le.geometryUVs,colorsCompressed:le.geometryColors,indices:le.geometryIndices,edgeIndices:le.geometryEdgeIndices,positionsDecodeMatrix:he,color:Mt,metallic:xt,roughness:ze,opacity:yt})),we.push(At)}else{if(!Q[Ie]){let Fe={id:Ie,primitive:le.primitiveName,normalsCompressed:le.geometryNormals,uv:le.geometryUVs,colorsCompressed:le.geometryColors,indices:le.geometryIndices,edgeIndices:le.geometryEdgeIndices};le.geometryPositions?Fe={...Fe,positionsCompressed:le.geometryPositions,positionsDecodeMatrix:y}:Fe={...Fe,positions:le.decompressedPositions},r.createGeometry(Fe),Q[Ie]=!0}r.createMesh(Tt.apply(Ke,{id:At,geometryId:Ie,textureSetId:Bt,matrix:st,color:Mt,metallic:xt,roughness:ze,opacity:yt,origin:re})),we.push(At)}}else{const Ct=b[Ve],st=w[Ve];let Ie,le,Fe,Qe,Pt,bt,ei,ii=!1,wi;switch(Ct){case 0:Ie="solid",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Fe=h.subarray(M[Ve],Je?h.length:M[Ve+1]),Qe=g.subarray(B[Ve],Je?g.length:B[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ei=m.subarray(I[Ve],Je?m.length:I[Ve+1]),ii=le.length>0&&bt.length>0;break;case 1:Ie="surface",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Fe=h.subarray(M[Ve],Je?h.length:M[Ve+1]),Qe=g.subarray(B[Ve],Je?g.length:B[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ei=m.subarray(I[Ve],Je?m.length:I[Ve+1]),ii=le.length>0&&bt.length>0;break;case 2:Ie="points",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Pt=p.subarray(E[Ve],Je?p.length:E[Ve+1]),ii=le.length>0;break;case 3:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ii=le.length>0&&bt.length>0;break;case 4:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),bt=che(le,f.subarray(S[Ve],Je?f.length:S[Ve+1])),ii=le.length>0&&bt.length>0;break;case 7:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le=xi.decompressPositions(le,he),wi=sA({origin:le,text:st,size:2}),le=wi.positions,bt=wi.indices,ii=le.length>0&&bt.length>0;break;default:continue}if(ii){let Ai=Tt.apply(Ke,{id:At,textureSetId:Bt,origin:re,primitive:Ie,normalsCompressed:Fe,uv:Qe&&Qe.length>0?Qe:null,colorsCompressed:Pt,indices:bt,edgeIndices:ei,color:Mt,metallic:xt,roughness:ze,opacity:yt});Ct!==7?Ai={...Ai,positionsCompressed:le,positionsDecodeMatrix:he}:Ai={...Ai,positions:le},r.createMesh(Ai),we.push(At)}}}we.length>0&&r.createEntity(Tt.apply(Se,{id:ne,isObject:!0,meshIds:we}))}}}}function che(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const dhe={version:12,parseArrayBuffer:function(t,e,i,r,o,n){const s=kYt(i);lhe(t,e,s,r,o,n)},parse:function(t,e,i,r,o,n){const s=MYt(i),a=EYt(s);lhe(t,e,a,r,o,n)}},La={};La[zue.version]=zue,La[Vue.version]=Vue,La[que.version]=que,La[Gue.version]=Gue,La[Que.version]=Que,La[Kue.version]=Kue,La[Jue.version]=Jue,La[Yue.version]=Yue,La[ehe.version]=ehe,La[rhe.version]=rhe,La[she.version]=she,La[dhe.version]=dhe;class zE extends kc{constructor(e,i={}){super("XKTLoader",e,i),this._maxGeometryBatchSize=i.maxGeometryBatchSize,this.textureTranscoder=i.textureTranscoder,this.dataSource=i.dataSource,this.objectDefaults=i.objectDefaults,this.includeTypes=i.includeTypes,this.excludeTypes=i.excludeTypes,this.excludeUnclassifiedObjects=i.excludeUnclassifiedObjects,this.reuseGeometries=i.reuseGeometries}get supportedVersions(){return Object.keys(La)}get textureTranscoder(){return this._textureTranscoder}set textureTranscoder(e){this._textureTranscoder=e}get dataSource(){return this._dataSource}set dataSource(e){this._dataSource=e||new Nue}get objectDefaults(){return this._objectDefaults}set objectDefaults(e){this._objectDefaults=e||Fue}get includeTypes(){return this._includeTypes}set includeTypes(e){this._includeTypes=e}get excludeTypes(){return this._excludeTypes}set excludeTypes(e){this._excludeTypes=e}get includeIds(){return this._includeIds}set includeIds(e){this._includeIds=e}get excludeUnclassifiedObjects(){return this._excludeUnclassifiedObjects}set excludeUnclassifiedObjects(e){this._excludeUnclassifiedObjects=!!e}get globalizeObjectIds(){return this._globalizeObjectIds}set globalizeObjectIds(e){this._globalizeObjectIds=!!e}get reuseGeometries(){return this._reuseGeometries}set reuseGeometries(e){this._reuseGeometries=e!==!1}load(e={}){if(e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id),!e.src&&!e.xkt&&!e.manifestSrc&&!e.manifest)throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");const i={},r=e.includeTypes||this._includeTypes,o=e.excludeTypes||this._excludeTypes,n=e.includeIds||this._includeIds,s=e.objectDefaults||this._objectDefaults;if(i.reuseGeometries=e.reuseGeometries!==null&&e.reuseGeometries!==void 0?e.reuseGeometries:this._reuseGeometries!==!1,r){i.includeTypesMap={};for(let g=0,f=r.length;g<f;g++)i.includeTypesMap[r[g]]=!0}if(o){i.excludeTypesMap={};for(let g=0,f=o.length;g<f;g++)i.excludeTypesMap[o[g]]=!0}if(n){i.includeIdsMap={};for(let g=0,f=n.length;g<f;g++)i.includeIdsMap[n[g]]=!0}s&&(i.objectDefaults=s),i.excludeUnclassifiedObjects=e.excludeUnclassifiedObjects!==void 0?!!e.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=e.globalizeObjectIds!==void 0&&e.globalizeObjectIds!==null?!!e.globalizeObjectIds:this._globalizeObjectIds;const a=new i7(this.viewer.scene,Tt.apply(e,{isModel:!0,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:e.origin,disableVertexWelding:e.disableVertexWelding||!1,disableIndexRebucketing:e.disableIndexRebucketing||!1,dtxEnabled:e.dtxEnabled,renderOrder:e.renderOrder})),l=a.id,c=new Nce({metaScene:this.viewer.metaScene,id:l});this.viewer.scene.canvas.spinner.processes++;const d=()=>{a.destroyed||(a.finalize(),c.finalize(),this.viewer.scene.canvas.spinner.processes--,a.once("destroyed",()=>{this.viewer.metaScene.destroyMetaModel(c.id)}),this.scheduleTask(()=>{a.destroyed||(a.scene.fire("modelLoaded",a.id),a.fire("loaded",!0,!1))}))},u=g=>{this.viewer.scene.canvas.spinner.processes--,this.error(g),a.fire("error",g)};let h=0;const p={getNextId:()=>`${l}.${h++}`};if(e.metaModelSrc||e.metaModelData)if(e.metaModelSrc){const g=e.metaModelSrc;this._dataSource.getMetaModel(g,f=>{a.destroyed||(c.loadData(f,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),e.src?this._loadModel(e.src,i,a,null,p,d,u):(this._parseModel(e.xkt,i,a,null,p),d()))},f=>{u(`load(): Failed to load model metadata for model '${l} from '${g}' - ${f}`)})}else e.metaModelData&&(c.loadData(e.metaModelData,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),e.src?this._loadModel(e.src,i,a,null,p,d,u):(this._parseModel(e.xkt,i,a,null,p),d()));else if(e.src)this._loadModel(e.src,i,a,c,p,d,u);else if(e.xkt)this._parseModel(e.xkt,i,a,c,p),d();else if(e.manifestSrc||e.manifest){const g=e.manifestSrc?PYt(e.manifestSrc):"",f=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getMetaModel(`${g}${v[w]}`,M=>{c.loadData(M,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),w++,this.scheduleTask(C,200)},b)};C()},m=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getXKT(`${g}${v[w]}`,M=>{this._parseModel(M,i,a,null,p),a.preFinalize(),w++,this.scheduleTask(C,200)},b)};C()},A=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getXKT(`${g}${v[w]}`,M=>{this._parseModel(M,i,a,c,p),a.preFinalize(),w++,this.scheduleTask(C,200)},b)};C()};if(e.manifest){const v=e.manifest,y=v.xktFiles;if(!y||y.length===0){u("load(): Failed to load model manifest - manifest not valid");return}const b=v.metaModelFiles;b?f(b,()=>{m(y,d,u)},u):A(y,d,u)}else this._dataSource.getManifest(e.manifestSrc,v=>{if(a.destroyed)return;const y=v.xktFiles;if(!y||y.length===0){u("load(): Failed to load model manifest - manifest not valid");return}const b=v.metaModelFiles;b?f(b,()=>{m(y,d,u)},u):A(y,d,u)},u)}return a}_loadModel(e,i,r,o,n,s,a){this._dataSource.getXKT(e,l=>{this._parseModel(l,i,r,o,n),r.preFinalize(),s()},a)}async _parseModel(e,i,r,o,n){if(r.destroyed)return;const s=new DataView(e),a=new Uint8Array(e),l=s.getUint32(0,!0),c=l&2147483647,d=c<11||c>=12&&l>>>31,u=La[c];if(!u){this.error("Unsupported .XKT file version: "+c+" - this XKTLoaderPlugin supports versions "+Object.keys(La));return}if(!d){u.parseArrayBuffer(this.viewer,i,e,r,o,n);return}const h=s.getUint32(4,!0),p=[];let g=(h+2)*4;for(let f=0;f<h;f++){const m=s.getUint32((f+2)*4,!0);p.push(a.subarray(g,g+m)),g+=m}u.parse(this.viewer,i,p,r,o,n)}}function PYt(t){t.indexOf("?")>-1&&(t=t.split("?")[0]);const e=t.split("/");return e.pop(),e.join("/")+"/"}let IYt=1;class KQ{constructor(e,i,r=null){this.tileset=e,this.computePriority=e.plugin.computePriority,this.distanceFactorToFreeData=e.plugin.distanceFactorToFreeData,this.src=i.content?.uri??null;const o=this.src?new URL(this.src).pathname:null;this.name=`${e.name}_${o?o.substring(o.lastIndexOf("/")+1):`tileWithNoContent_${IYt++}`}`,this.parent=r,this.refine=i.refine,this.data=null,this.fetching=null,this.depth=r?r.depth+1:1,this.model=null,this.loadProcess=null,this.loading=!1,this.currentDistanceFromCamera=null,this._visible=!r,this.priority=1,this.geometricError=i.geometricError;const[n,s,a,l,c,d,u,h,p,g,f,m]=i.boundingVolume.box,A=[n,a,-s];e.rootTransform&&(A[0]+=e.rootTransform[12],A[1]+=e.rootTransform[14],A[2]+=e.rootTransform[13]),this.center=Object.freeze(A);const v=[l,c,d],y=[-u,-h,-p],b=[g,f,m];this.xSize=k.lenVec3(v),this.ySize=k.lenVec3(b),this.zSize=k.lenVec3(y),this.volume=this.xSize*2*this.ySize*2*this.zSize*2,this.children=i.children?.map(w=>new KQ(e,w,this))??[],e.tiles.add(this)}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,e?this.tileset.visibleTiles.add(this):this.tileset.visibleTiles.delete(this))}get loaded(){return!!this.model}get viewDistance(){return this.tileset.sensitivity*this.geometricError}get isWithinCameraVisibleRange(){return this.currentDistanceFromCamera<=this.viewDistance}updateVisibility(e){this.currentDistanceFromCamera=k.distVec3(this.center,e),this.parent&&(this.visible=this.isWithinCameraVisibleRange,this.currentDistanceFromCamera>this.viewDistance*this.distanceFactorToFreeData&&(this.data=null)),this.visible&&this.children.forEach(i=>i.updateVisibility(e)),this.priority=this.computePriority(this)}fetchData(){return this.data?this.data:this.src?(this.fetching||(this.fetching=new Promise((e,i)=>{fetch(this.src).then(r=>{r.ok?r.arrayBuffer().then(o=>{this.data=o,this.fetching=null,e(this.data)}):i(r)})})),this.fetching):null}showBoundingBox(){const{viewer:e}=this.tileset.plugin,{xSize:i,ySize:r,zSize:o,center:n}=this,s=1/this.depth;this.boxLines=new nr(e.scene,{geometry:new mo(e.scene,NF({center:n,xSize:i,ySize:r,zSize:o})),material:new vo(e.scene,{emissive:[1-s,s,(1-s)/2]})})}async load(){if(this.loading)return this.loadProcess;if(this.loaded)return this.model;if(this.loading=!0,!this.data)try{await this.fetchData()}catch(e){return console.warn(`[Xeokit - TilesetLoaderPlugin] Impossible to fetch data of tile "${this.name}".`,e),this.loading=!1,null}if(!this.visible)return this.loading=!1,null;this.tileset.plugin.debugMode&&this.showBoundingBox();try{const e=new Promise(i=>{const r=this.tileset.plugin.loader.load({id:this.name,xkt:this.data,metaModelData:{metaObjects:[{id:"metaModelRoot"}]}});r.once("loaded",()=>{this.loading=!1,this.loadProcess=null,this.model=r,this.tileset.destroyed||!this.visible?(this.unload(),i(null)):(this.tileset.loadedTiles.add(this),i(r))}),r.once("destroyed",()=>{this.loading=!1,this.loadProcess=null,i(null)})});return this.loadProcess=e,this.loadProcess}catch(e){return console.warn(`[Xeokit - TilesetLoaderPlugin] Impossible to load tile "${this.name}".`,e),null}}unload(){this.boxLines&&(this.boxLines.destroy(),this.boxLines=null),this.model&&(this.model.destroy(),this.model=null),this.tileset.loadedTiles.delete(this),this.children.forEach(e=>{e.loaded&&e.unload()})}}function SYt(t,e,i){const r=Array.from(t),o=r.splice(0,e),n=async s=>{if(await i(s),r.length>0){const a=r.shift();n(a)}};o.forEach(n)}function TYt(t){let e=!1;return{cancel(){e=!0},async run(i){for(let r of t){if(e)break;await new Promise(o=>setTimeout(()=>(i(r)||Promise.resolve()).then(o)))}}}}let RYt=0;class DYt{constructor(e,i){this.plugin=e,this.name=i.name||`tileset-${RYt++}`,this.tiles=new Set,this.visibleTiles=new Set,this.loadedTiles=new Set,this.queue=null,this.renderNeeded=!0,this.destroyed=!1,this._sensitivity=e.sensitivity,i.root.transform&&(this.rootTransform=i.root.transform),this.root=new KQ(this,i.root),this.root.load().then(r=>e.viewer.cameraFlight.flyTo(r))}get sensitivity(){return this._sensitivity}set sensitivity(e){this._sensitivity=e,this.updateVisibility()}updateVisibility(){this.tiles.forEach(e=>{e!==this.root&&(e.visible=!1)}),this.root.updateVisibility(this.plugin.viewer.camera.eye),this.renderNeeded=!0}render(){if(!this.renderNeeded)return;this.queue&&this.queue.cancel(),this.loadedTiles.forEach(i=>{i.visible||i.unload()});const e=Array.from(this.visibleTiles).filter(i=>!i.loaded).sort((i,r)=>i.priority-r.priority);SYt(e,40,i=>i.fetchData()),this.queue=TYt(e),this.queue.run(i=>i.load()),this.renderNeeded=!1}destroy(){this.queue&&this.queue.cancel(),this.loadedTiles.forEach(e=>e.unload()),this.destroyed=!0,this.plugin.tilesets.delete(this)}}function _Yt(t){return t.depth}class uhe extends kc{constructor(e,i={}){super("TilesetLoader",e);const{computePriority:r=_Yt,sensitivity:o=50,distanceFactorToFreeData:n=3,debugMode:s=!1}=i;this._sensitivity=o,this.distanceFactorToFreeData=n,this.computePriority=r,this.debugMode=s,this.tilesets=new Set,e.camera.on("matrix",this.updateTilesetsVisibilityCallback=()=>this.updateTilesetsVisibility()),e.scene.on("tick",this.renderTilesetsCallback=()=>this.renderTilesets()),this.loader=new zE(e)}load(e){const i=new DYt(this,e);return this.tilesets.add(i),i}updateTilesetsVisibility(){this.tilesets.forEach(e=>e.updateVisibility())}renderTilesets(){this.tilesets.forEach(e=>e.render())}get sensitivity(){return this._sensitivity}set sensitivity(e){this._sensitivity=e,this.tilesets.forEach(i=>i.sensitivity=this._sensitivity)}destroy(){this.viewer.camera.off(this.updateTilesetsVisibilityCallback),this.viewer.scene.off(this.renderTilesetsCallback),this.tilesets.forEach(e=>e.destroy()),super.destroy()}}const LYt="2.6.90";typeof window<"u"&&(window.__XEOKIT__?console.warn("WARNING: Multiple instances of xeokit-sdk being imported."):window.__XEOKIT__=LYt);const Wh=Object.freeze(Object.defineProperty({__proto__:null,AlphaFormat:Qse,AmbientLight:VO,AngleMeasurementEditMouseControl:cqt,AngleMeasurementEditTouchControl:dqt,AngleMeasurementsControl:mU,AngleMeasurementsMouseControl:Jce,AngleMeasurementsPlugin:uE,AngleMeasurementsTouchControl:lqt,AnnotationsPlugin:yU,AxisGizmoPlugin:gqt,BCFViewpointsPlugin:mE,Bitmap:Bae,ByteType:Fse,CameraMemento:ezt,CameraPath:EFt,CameraPathAnimation:bs,ClampToEdgeWrapping:sa,Component:Hi,CompressedMediaType:ZFt,Configs:RM,ContextMenu:VLt,CubicBezierCurve:rzt,Curve:S9,DefaultLoadingManager:Dle,DepthFormat:Zse,DepthStencilFormat:Xse,DirLight:Ad,DistanceMeasurementEditControl:wU,DistanceMeasurementEditMouseControl:xqt,DistanceMeasurementEditTouchControl:kqt,DistanceMeasurementsControl:bU,DistanceMeasurementsMouseControl:ede,DistanceMeasurementsPlugin:tde,DistanceMeasurementsTouchControl:Cqt,EdgeMaterial:gO,EmphasisMaterial:Lh,FastNavPlugin:nde,FloatType:Hse,Fresnel:VOt,Frustum:zl,FrustumPlane:yf,GIFMediaType:JFt,GLTFDefaultDataSource:sde,GLTFLoaderPlugin:lN,HalfFloatType:zse,ImagePlane:LOt,IntType:Nse,JPEGMediaType:xM,KTX2TextureTranscoder:Nd,LOD:$le,LambertMaterial:FOt,LightMap:YHt,LineSet:Kle,LinearEncoding:dl,LinearFilter:aa,LinearMipMapLinearFilter:lA,LinearMipMapNearestFilter:_9,LinearMipmapLinearFilter:kf,LinearMipmapNearestFilter:WFt,Loader:_le,LoadingManager:Rle,LocaleService:Ase,LuminanceAlphaFormat:Jse,LuminanceFormat:Wse,Map:xc,Marker:o7,MarqueePicker:Yu,MarqueePickerMouseControl:MFt,Mesh:nr,MeshSurfaceArea:Rae,MeshVolume:Iae,MetallicMaterial:NOt,MirroredRepeatWrapping:Th,ModelMemento:tzt,NavCubePlugin:cN,NearestFilter:xf,NearestMipMapLinearFilter:aA,NearestMipMapNearestFilter:D9,NearestMipmapLinearFilter:Lse,NearestMipmapNearestFilter:_se,Node:R9,ObjectsKdTree3:KLt,ObjectsMemento:izt,PNGMediaType:kM,Path:ozt,PerformanceModel:szt,PhongMaterial:vo,PickResult:JM,Plugin:kc,PointLight:JHt,PointerCircle:RF,PointerLens:qLt,QuadraticBezierCurve:nzt,Queue:sse,RGBAFormat:L9,RGBAIntegerFormat:iae,RGBA_ASTC_10x10_Format:iO,RGBA_ASTC_10x5_Format:$F,RGBA_ASTC_10x6_Format:eO,RGBA_ASTC_10x8_Format:tO,RGBA_ASTC_12x10_Format:rO,RGBA_ASTC_12x12_Format:oO,RGBA_ASTC_4x4_Format:wM,RGBA_ASTC_5x4_Format:QF,RGBA_ASTC_5x5_Format:KF,RGBA_ASTC_6x5_Format:WF,RGBA_ASTC_6x6_Format:JF,RGBA_ASTC_8x5_Format:ZF,RGBA_ASTC_8x6_Format:XF,RGBA_ASTC_8x8_Format:YF,RGBA_BPTC_Format:CM,RGBA_ETC2_EAC_Format:bM,RGBA_PVRTC_2BPPV1_Format:qF,RGBA_PVRTC_4BPPV1_Format:vM,RGBA_S3TC_DXT1_Format:gM,RGBA_S3TC_DXT3_Format:AM,RGBA_S3TC_DXT5_Format:O9,RGBFormat:Kse,RGB_ETC1_Format:GF,RGB_ETC2_Format:yM,RGB_PVRTC_2BPPV1_Format:VF,RGB_PVRTC_4BPPV1_Format:mM,RGB_S3TC_DXT1_Format:F9,RGFormat:eae,RGIntegerFormat:tae,ReadableGeometry:mo,RedFormat:Yse,RedIntegerFormat:$se,ReflectionMap:XHt,RepeatWrapping:Eo,SceneModel:i7,SceneModelMesh:_ae,SceneModelTransform:jle,SectionPlane:KO,SectionPlanesPlugin:PXt,ShortType:Ose,SpecularMaterial:zOt,SplineCurve:cM,SpriteMarker:$Ht,Texture:cA,TextureTranscoder:czt,TilesetLoaderPlugin:uhe,UnsignedByteType:zF,UnsignedInt248Type:Gse,UnsignedIntType:jse,UnsignedShort4444Type:Vse,UnsignedShort5551Type:qse,UnsignedShortType:Use,VBOGeometry:xse,VFC:hce,Viewer:Wce,WorkerPool:Fle,XKTDefaultDataSource:Nue,XKTLoaderPlugin:zE,buildBoxGeometry:UF,buildBoxLinesGeometry:NF,buildBoxLinesGeometryFromAABB:VFt,buildCylinderGeometry:oA,buildGridGeometry:kse,buildLineGeometry:Ese,buildPlaneGeometry:jF,buildPolylineGeometry:Mse,buildPolylineGeometryFromCurve:GFt,buildSphereGeometry:nA,buildTorusGeometry:HF,buildVectorTextGeometry:sA,createCombinedTexture:oqt,createRTCViewMat:Or,createSkyboxMesh:nqt,createSphereMapMesh:sqt,frustumIntersectsAABB3:lM,getKTX2TextureTranscoder:Ole,getPlaneRTCPos:un,isTriangleMeshSolid:Pae,load3DSGeometry:HFt,loadOBJGeometry:zFt,math:k,meshSurfaceArea:H9,meshVolume:uA,os:YO,rtcToWorldPos:KFt,sRGBEncoding:ho,setFrustum:gse,stats:br,utils:Tt,worldToRTCPos:Cf,worldToRTCPositions:fM},Symbol.toStringTag,{value:"Module"}));function NA(t){let e=t.substring(1);const i=[];let r=null;for(;e.length>0;)r=e.substring(0,2),e=e.substring(2),i.push(parseInt(r,16)/255);return i}function hhe(t){let e="";return e+=Math.round(t[0]*255).toString(16).padStart(2,"0"),e+=Math.round(t[1]*255).toString(16).padStart(2,"0"),e+=Math.round(t[2]*255).toString(16).padStart(2,"0"),`#${e}`}const FYt={class:"annotations-3d"},OYt={__name:"Annotations3D",setup(t){const e=kt("$viewer"),{localContext:i}=e,{xeokit:r}=i.viewer,o=r.scene.canvas.canvas,n=PF(),s=$n(new WeakSet),a=qe(()=>n.value.filter(u=>s.has(u))),l=new Map;Et(n,()=>{n.value.forEach(u=>{if(!l.has(u.id)){const{x:h,y:p,z:g}=u,f=new o7(r.scene,{worldPos:[h,g,p]});l.set(u.id,f);const[m,A]=f.canvasPos;f.style=ke(`left: ${m}px; top: ${A}px;`),f.on("canvasPos",([b,w])=>{f.style.value=`left: ${b}px; top: ${w}px;`}),f.on("visible",b=>b?s.add(u):s.delete(u)),f.on("destroyed",()=>{e.state.hub.off(y),e.state.hub.off(v)});const v=e.state.hub.on("annotation-updated",({annotation:b})=>{if(b.id===u.id){const{x:w,y:C,z:M}=b;f.worldPos=[w,M,C],f._update(),r.scene._renderer._occlusionTester._occlusionTestListDirty=!0}}),y=e.state.hub.on("annotation-removed",({annotation:b})=>{b.id===u.id&&(l.delete(u.id),f.destroy())})}})},{flush:"sync"});const c=(u,h)=>{const{clientX:p,clientY:g}=h,{x:f,y:m}=o.getBoundingClientRect(),A=r.scene.pick({pickSurface:!0,canvasPos:[p-f,g-m]});if(A){const[v,y,b]=A.worldPos;Object.assign(u,{x:v,y:b,z:y})}},d=u=>l.get(u.id).style.value;return(u,h)=>(P(),F("div",FYt,[(P(!0),F(lt,null,Vt(a.value,p=>(P(),Y(IF,{key:p.instanceId,annotation:p,canvas:pt(o),style:Ee(d(p)),onAnnotationDrag:g=>c(p,g)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},phe=V(OYt,[["__scopeId","data-v-10ceb001"]]),UYt={setup(){const t=kt("$viewer"),e=t.localContext.pluginComponentInstances.get("viewer3d"),{math:i}=e.xeokitSdk,r=()=>{const n=e.xeokit,s=[0,0,-1],a=n.scene.aabb,l=i.getAABB3Diag(a),c=i.vec3();i.getAABB3Center(a,c);const d=45,u=Math.abs(l/Math.tan(d*i.DEGTORAD));n.cameraControl.pivotPos=c,n.cameraFlight.jumpTo({look:c,eye:[c[0]-u*s[0],c[1]-u*s[1],c[2]-u*s[2]],up:[0,1,0],orthoScale:l*1.1,fitFOV:d})},o=()=>{const n=t.localContext.loadedModels.flatMap(s=>s.objects.filter(a=>a.visible===!1).map(a=>a.id));t.state.showObjects(n)};return{onClick:()=>{r(),o(),e.reintegrateObjects()}}}};function NYt(t,e,i,r,o,n){const s=R("BIMDataIconHome"),a=R("BIMDataButton");return P(),Y(a,{color:"default",ghost:"",rounded:"",icon:"",onClick:r.onClick},{default:H(()=>[D(s,{size:"xs"})]),_:1},8,["onClick"])}const jYt=V(UYt,[["render",NYt]]),HYt={computed:{active(){return this.$viewer.localContext.pluginComponentInstances.has("navigationVersionsModel")?this.$viewer.localContext.pluginComponentInstances.get("navigationVersionsModel").isOpen.value:!1}},methods:{onClick(){this.$viewer.localContext.pluginComponentInstances.get("navigationVersionsModel").toggle()}}};function zYt(t,e,i,r,o,n){const s=R("BIMDataIcon"),a=R("BIMDataButton"),l=R("BIMDataTooltip");return P(),Y(l,{text:t.$t("navigationVersionsModel.tooltip")},{default:H(()=>[D(a,{class:Me(["bimdata-navigation-versions-model",{active:n.active}]),color:"primary",ghost:"",rounded:"",icon:"",onClick:n.onClick},{default:H(()=>[D(s,{name:"versioning",fill:"",color:"primary",size:"xxs"})]),_:1},8,["class","onClick"])]),_:1},8,["text"])}const VYt=V(HYt,[["render",zYt],["__scopeId","data-v-ced27a96"]]),qYt={key:0,width:"159",height:"116",viewBox:"0 0 159 116",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GYt={key:1,width:"159",height:"116",viewBox:"0 0 159 116",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QYt={__name:"KeyboardNavigate",setup(t){const e=kt("$viewer").i18n.locale==="fr";return(i,r)=>e?(P(),F("svg",qYt,[...r[0]||(r[0]=[Ys('<path d="M79 0L87 11H71L79 0Z" fill="#2F374A"></path><path d="M159 79.1111L148 87.1111L148 71.1111L159 79.1111Z" fill="#2F374A"></path><path d="M9.5399e-08 79.1111L11 71.1111L11 87.1111L9.5399e-08 79.1111Z" fill="#2F374A"></path><path d="M79 115.222L71 104.222L87 104.222L79 115.222Z" fill="#2F374A"></path><rect x="61.3333" y="18" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M82.5998 38.834V40H76.6759V38.834H82.5998ZM82.465 32.377L77.2209 40H76.2365V39.0684L81.4982 31.4688H82.465V32.377ZM81.9201 31.4688V32.6406H76.2716V31.4688H81.9201Z" fill="#6B6B6B"></path><rect x="104.667" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M122.148 83.1111H120.326L120.338 81.9451H122.148C122.676 81.9451 123.117 81.8298 123.473 81.5994C123.832 81.3689 124.101 81.0388 124.281 80.6091C124.465 80.1794 124.557 79.6677 124.557 79.074V78.6111C124.557 78.1501 124.504 77.7419 124.398 77.3865C124.297 77.031 124.144 76.7322 123.941 76.49C123.742 76.2478 123.496 76.0642 123.203 75.9392C122.914 75.8142 122.58 75.7517 122.201 75.7517H120.291V74.5798H122.201C122.767 74.5798 123.285 74.6755 123.754 74.8669C124.223 75.0544 124.627 75.3259 124.967 75.6814C125.31 76.0369 125.574 76.4626 125.758 76.9587C125.941 77.4548 126.033 78.0095 126.033 78.6228V79.074C126.033 79.6873 125.941 80.2419 125.758 80.738C125.574 81.2341 125.31 81.6599 124.967 82.0154C124.623 82.3669 124.213 82.6384 123.736 82.8298C123.264 83.0173 122.734 83.1111 122.148 83.1111ZM121.141 74.5798V83.1111H119.67V74.5798H121.141Z" fill="#6B6B6B"></path><rect x="18" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M37.3036 81.9744L39.5478 83.7556L38.5927 84.5935L36.3896 82.8298L37.3036 81.9744ZM39.5653 78.6111V79.0798C39.5653 79.7244 39.4814 80.3025 39.3134 80.8142C39.1454 81.3259 38.9052 81.7615 38.5927 82.1208C38.2802 82.4802 37.9071 82.7556 37.4735 82.947C37.04 83.1345 36.5595 83.2283 36.0321 83.2283C35.5087 83.2283 35.0302 83.1345 34.5966 82.947C34.1669 82.7556 33.7939 82.4802 33.4775 82.1208C33.161 81.7615 32.915 81.3259 32.7392 80.8142C32.5673 80.3025 32.4814 79.7244 32.4814 79.0798V78.6111C32.4814 77.9666 32.5673 77.3904 32.7392 76.8826C32.911 76.3708 33.1532 75.9353 33.4657 75.5759C33.7821 75.2126 34.1552 74.9373 34.5849 74.7498C35.0185 74.5583 35.497 74.4626 36.0204 74.4626C36.5478 74.4626 37.0282 74.5583 37.4618 74.7498C37.8993 74.9373 38.2743 75.2126 38.5868 75.5759C38.8993 75.9353 39.1396 76.3708 39.3075 76.8826C39.4794 77.3904 39.5653 77.9666 39.5653 78.6111ZM38.0888 79.0798V78.5994C38.0888 78.1228 38.0419 77.7029 37.9482 77.3396C37.8583 76.9724 37.7235 76.6658 37.5439 76.4197C37.3681 76.1697 37.1513 75.9822 36.8935 75.8572C36.6396 75.7283 36.3485 75.6638 36.0204 75.6638C35.7001 75.6638 35.413 75.7283 35.1591 75.8572C34.9052 75.9822 34.6884 76.1697 34.5087 76.4197C34.329 76.6658 34.1923 76.9724 34.0985 77.3396C34.0048 77.7029 33.9579 78.1228 33.9579 78.5994V79.0798C33.9579 79.5564 34.0048 79.9783 34.0985 80.3455C34.1923 80.7126 34.329 81.0232 34.5087 81.2771C34.6923 81.5271 34.911 81.7166 35.165 81.8455C35.4228 81.9705 35.7118 82.033 36.0321 82.033C36.3603 82.033 36.6513 81.9705 36.9052 81.8455C37.1591 81.7166 37.3739 81.5271 37.5497 81.2771C37.7255 81.0232 37.8583 80.7126 37.9482 80.3455C38.0419 79.9783 38.0888 79.5564 38.0888 79.0798Z" fill="#6B6B6B"></path><rect x="61.3333" y="61.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M81.1115 81.025C81.1115 80.8492 81.0841 80.693 81.0295 80.5563C80.9787 80.4196 80.8869 80.2946 80.7541 80.1813C80.6213 80.068 80.4338 79.9586 80.1916 79.8531C79.9533 79.7438 79.6486 79.6324 79.2775 79.5192C78.8713 79.3942 78.4963 79.2555 78.1525 79.1031C77.8127 78.9469 77.5158 78.7672 77.2619 78.5641C77.008 78.3571 76.8107 78.1207 76.6701 77.8551C76.5295 77.5856 76.4591 77.275 76.4591 76.9235C76.4591 76.5758 76.5314 76.2594 76.6759 75.9742C76.8244 75.6891 77.0334 75.443 77.3029 75.236C77.5763 75.025 77.8986 74.8629 78.2697 74.7496C78.6408 74.6324 79.0509 74.5739 79.5002 74.5739C80.133 74.5739 80.6779 74.691 81.1349 74.9254C81.5959 75.1598 81.9494 75.4742 82.1955 75.8688C82.4455 76.2633 82.5705 76.6989 82.5705 77.1754H81.1115C81.1115 76.8942 81.0509 76.6461 80.9298 76.4313C80.8127 76.2125 80.633 76.0406 80.3908 75.9156C80.1525 75.7906 79.8498 75.7281 79.4826 75.7281C79.1349 75.7281 78.8459 75.7809 78.6154 75.8864C78.3849 75.9918 78.213 76.1344 78.0998 76.3141C77.9865 76.4938 77.9298 76.6969 77.9298 76.9235C77.9298 77.0836 77.967 77.2301 78.0412 77.3629C78.1154 77.4918 78.2287 77.6129 78.381 77.7262C78.5334 77.8356 78.7248 77.9391 78.9552 78.0367C79.1857 78.1344 79.4572 78.2281 79.7697 78.318C80.2423 78.4586 80.6545 78.6149 81.006 78.7867C81.3576 78.9547 81.6505 79.1461 81.8849 79.361C82.1193 79.5758 82.2951 79.8199 82.4123 80.0934C82.5295 80.3629 82.588 80.6696 82.588 81.0133C82.588 81.3727 82.5158 81.6969 82.3713 81.986C82.2267 82.2711 82.0197 82.5153 81.7502 82.7184C81.4845 82.9176 81.1642 83.0719 80.7892 83.1813C80.4181 83.2867 80.0041 83.3395 79.547 83.3395C79.1369 83.3395 78.7326 83.2848 78.3341 83.1754C77.9396 83.066 77.5802 82.9 77.256 82.6774C76.9318 82.4508 76.674 82.1696 76.4826 81.8336C76.2912 81.4938 76.1955 81.0973 76.1955 80.6442H77.6662C77.6662 80.9215 77.713 81.1578 77.8068 81.3531C77.9045 81.5485 78.0392 81.7086 78.2111 81.8336C78.383 81.9547 78.5822 82.0446 78.8088 82.1031C79.0392 82.1617 79.2853 82.191 79.547 82.191C79.8908 82.191 80.1779 82.1422 80.4084 82.0446C80.6427 81.9469 80.8185 81.8102 80.9357 81.6344C81.0529 81.4586 81.1115 81.2555 81.1115 81.025Z" fill="#6B6B6B"></path>',12)])])):(P(),F("svg",GYt,[...r[1]||(r[1]=[Ys('<path d="M79 0L87 11H71L79 0Z" fill="#2F374A"></path><path d="M159 79.1111L148 87.1111L148 71.1111L159 79.1111Z" fill="#2F374A"></path><path d="M9.5399e-08 79.1111L11 71.1111L11 87.1111L9.5399e-08 79.1111Z" fill="#2F374A"></path><path d="M79 115.222L71 104.222L87 104.222L79 115.222Z" fill="#2F374A"></path><rect x="61.3333" y="18" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M77.1095 38.084L78.8088 31.4688H79.6994L79.5998 33.1738L77.7834 40H76.8576L77.1095 38.084ZM75.838 31.4688L77.215 38.0312L77.338 40H76.3537L74.3791 31.4688H75.838ZM81.6271 38.0137L82.9865 31.4688H84.4513L82.4767 40H81.4923L81.6271 38.0137ZM80.0451 31.4688L81.7267 38.1016L81.9728 40H81.047L79.2599 33.1738L79.1662 31.4688H80.0451Z" fill="#6B6B6B"></path><rect x="104.667" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M122.148 83.1111H120.326L120.338 81.9451H122.148C122.676 81.9451 123.117 81.8298 123.473 81.5994C123.832 81.3689 124.101 81.0388 124.281 80.6091C124.465 80.1794 124.557 79.6677 124.557 79.074V78.6111C124.557 78.1501 124.504 77.7419 124.398 77.3865C124.297 77.031 124.144 76.7322 123.941 76.49C123.742 76.2478 123.496 76.0642 123.203 75.9392C122.914 75.8142 122.58 75.7517 122.201 75.7517H120.291V74.5798H122.201C122.767 74.5798 123.285 74.6755 123.754 74.8669C124.223 75.0544 124.627 75.3259 124.967 75.6814C125.31 76.0369 125.574 76.4626 125.758 76.9587C125.941 77.4548 126.033 78.0095 126.033 78.6228V79.074C126.033 79.6873 125.941 80.2419 125.758 80.738C125.574 81.2341 125.31 81.6599 124.967 82.0154C124.623 82.3669 124.213 82.6384 123.736 82.8298C123.264 83.0173 122.734 83.1111 122.148 83.1111ZM121.141 74.5798V83.1111H119.67V74.5798H121.141Z" fill="#6B6B6B"></path><rect x="18" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M36.2665 75.7166L33.7177 83.1111H32.1767L35.3876 74.5798H36.372L36.2665 75.7166ZM38.3993 83.1111L35.8446 75.7166L35.7333 74.5798H36.7235L39.9462 83.1111H38.3993ZM38.2763 79.947V81.113H33.6357V79.947H38.2763Z" fill="#6B6B6B"></path><rect x="61.3333" y="61.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M81.1115 81.025C81.1115 80.8492 81.0841 80.693 81.0295 80.5563C80.9787 80.4196 80.8869 80.2946 80.7541 80.1813C80.6213 80.068 80.4338 79.9586 80.1916 79.8531C79.9533 79.7438 79.6486 79.6324 79.2775 79.5192C78.8713 79.3942 78.4963 79.2555 78.1525 79.1031C77.8127 78.9469 77.5158 78.7672 77.2619 78.5641C77.008 78.3571 76.8107 78.1207 76.6701 77.8551C76.5295 77.5856 76.4591 77.275 76.4591 76.9235C76.4591 76.5758 76.5314 76.2594 76.6759 75.9742C76.8244 75.6891 77.0334 75.443 77.3029 75.236C77.5763 75.025 77.8986 74.8629 78.2697 74.7496C78.6408 74.6324 79.0509 74.5739 79.5002 74.5739C80.133 74.5739 80.6779 74.691 81.1349 74.9254C81.5959 75.1598 81.9494 75.4742 82.1955 75.8688C82.4455 76.2633 82.5705 76.6989 82.5705 77.1754H81.1115C81.1115 76.8942 81.0509 76.6461 80.9298 76.4313C80.8127 76.2125 80.633 76.0406 80.3908 75.9156C80.1525 75.7906 79.8498 75.7281 79.4826 75.7281C79.1349 75.7281 78.8459 75.7809 78.6154 75.8864C78.3849 75.9918 78.213 76.1344 78.0998 76.3141C77.9865 76.4938 77.9298 76.6969 77.9298 76.9235C77.9298 77.0836 77.967 77.2301 78.0412 77.3629C78.1154 77.4918 78.2287 77.6129 78.381 77.7262C78.5334 77.8356 78.7248 77.9391 78.9552 78.0367C79.1857 78.1344 79.4572 78.2281 79.7697 78.318C80.2423 78.4586 80.6545 78.6149 81.006 78.7867C81.3576 78.9547 81.6505 79.1461 81.8849 79.361C82.1193 79.5758 82.2951 79.8199 82.4123 80.0934C82.5295 80.3629 82.588 80.6696 82.588 81.0133C82.588 81.3727 82.5158 81.6969 82.3713 81.986C82.2267 82.2711 82.0197 82.5153 81.7502 82.7184C81.4845 82.9176 81.1642 83.0719 80.7892 83.1813C80.4181 83.2867 80.0041 83.3395 79.547 83.3395C79.1369 83.3395 78.7326 83.2848 78.3341 83.1754C77.9396 83.066 77.5802 82.9 77.256 82.6774C76.9318 82.4508 76.674 82.1696 76.4826 81.8336C76.2912 81.4938 76.1955 81.0973 76.1955 80.6442H77.6662C77.6662 80.9215 77.713 81.1578 77.8068 81.3531C77.9045 81.5485 78.0392 81.7086 78.2111 81.8336C78.383 81.9547 78.5822 82.0446 78.8088 82.1031C79.0392 82.1617 79.2853 82.191 79.547 82.191C79.8908 82.191 80.1779 82.1422 80.4084 82.0446C80.6427 81.9469 80.8185 81.8102 80.9357 81.6344C81.0529 81.4586 81.1115 81.2555 81.1115 81.025Z" fill="#6B6B6B"></path>',12)])]))}},KYt={key:0,width:"37",height:"129",viewBox:"0 0 37 129",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WYt={key:1,width:"37",height:"129",viewBox:"0 0 37 129",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JYt={__name:"KeyboardStorey",setup(t){const e=kt("$viewer"),i=qe(()=>e.i18n.locale==="fr");return(r,o)=>i.value?(P(),F("svg",KYt,[...o[0]||(o[0]=[Ys('<rect y="25" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M16.2509 38.4688L18.0614 41.5801L19.872 38.4688H21.5653L18.9872 42.6934L21.6298 47H19.9189L18.0614 43.8301L16.204 47H14.4872L17.1357 42.6934L14.5517 38.4688H16.2509Z" fill="#6B6B6B"></path><rect y="68.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M15.7763 88.3063L17.4755 81.691H18.3661L18.2665 83.3961L16.4501 90.2223H15.5243L15.7763 88.3063ZM14.5048 81.691L15.8817 88.2535L16.0048 90.2223H15.0204L13.0458 81.691H14.5048ZM20.2939 88.236L21.6532 81.691H23.1181L21.1435 90.2223H20.1591L20.2939 88.236ZM18.7118 81.691L20.3935 88.3239L20.6396 90.2223H19.7138L17.9267 83.3961L17.8329 81.691H18.7118Z" fill="#6B6B6B"></path><path d="M18 0L26 11H10L18 0Z" fill="#2F374A"></path><rect x="14" y="13" width="8" height="2" fill="#2F374A"></rect><rect x="14" y="17" width="8" height="4" fill="#2F374A"></rect><path d="M18 129L10 118L26 118L18 129Z" fill="#2F374A"></path><rect x="22" y="116" width="8" height="2" transform="rotate(-180 22 116)" fill="#2F374A"></rect><rect x="22" y="112" width="8" height="4" transform="rotate(-180 22 112)" fill="#2F374A"></rect>',10)])])):(P(),F("svg",WYt,[...o[1]||(o[1]=[Ys('<rect y="25" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M16.2509 38.4688L18.0614 41.5801L19.872 38.4688H21.5653L18.9872 42.6934L21.6298 47H19.9189L18.0614 43.8301L16.204 47H14.4872L17.1357 42.6934L14.5517 38.4688H16.2509Z" fill="#6B6B6B"></path><rect y="68.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M21.2665 89.0563V90.2223H15.3427V89.0563H21.2665ZM21.1317 82.5992L15.8876 90.2223H14.9032V89.2906L20.165 81.691H21.1317V82.5992ZM20.5868 81.691V82.8629H14.9384V81.691H20.5868Z" fill="#6B6B6B"></path><path d="M18 0L26 11H10L18 0Z" fill="#2F374A"></path><rect x="14" y="13" width="8" height="2" fill="#2F374A"></rect><rect x="14" y="17" width="8" height="4" fill="#2F374A"></rect><path d="M18 129L10 118L26 118L18 129Z" fill="#2F374A"></path><rect x="22" y="116" width="8" height="2" transform="rotate(-180 22 116)" fill="#2F374A"></rect><rect x="22" y="112" width="8" height="4" transform="rotate(-180 22 112)" fill="#2F374A"></rect>',10)])]))}},ZYt={},XYt={width:"174",height:"130",viewBox:"0 0 174 130",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YYt(t,e){return P(),F("svg",XYt,[...e[0]||(e[0]=[Ys('<path d="M33.1118 0.382324H131.606L141.853 99.4882H23.4L33.1118 0.382324Z" fill="#F2F2F2"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M22.9412 99.8706H142.235L131.988 0.305882V0H32.8059L23.0176 99.4882L22.9412 99.8706ZM141.394 99.1059H23.7823L33.4941 0.764706H131.3L141.394 99.1059Z" fill="#9E9E9E"></path><path d="M62.1705 9.86475L60.7941 46.953H103.771V9.86475H62.1705Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M60.4117 47.3354H104.153H104.229V9.48242H61.8647L60.4117 47.3354ZM103.388 46.5707H61.1764L62.5529 10.2471H103.388V46.5707Z" fill="#9E9E9E"></path><path d="M60.7942 46.9529L64.5412 61.7882H100.1L103.771 46.9529H60.7942Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M64.2353 62.1706H100.406L104.306 46.5706H60.3353L64.2353 62.1706ZM99.7942 61.4059H64.8471L61.3294 47.3353H103.312L99.7942 61.4059Z" fill="#9E9E9E"></path><path d="M85.2648 34.7939L85.0354 53.8351L90.0825 49.0175L97.806 49.5528L85.2648 34.7939Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M83.8118 57.5823L83.7354 31.5823L100.406 51.4646L90.3883 49.9352L83.8118 57.5823ZM85.8765 37.3176L85.953 51.9235L89.6236 47.6411L95.2824 48.4823L85.8765 37.3176Z" fill="black"></path><path d="M26.3059 128.241H25.9236C17.5883 128.241 10.7059 121.359 10.7059 113.024V100.253C10.7059 91.9178 17.5883 85.0354 25.9236 85.0354H26.3059C34.6412 85.0354 41.5236 91.9178 41.5236 100.253V113.024C41.5236 121.359 34.6412 128.241 26.3059 128.241Z" fill="white"></path><path d="M137.188 128.241H136.806C128.471 128.241 121.588 121.359 121.588 113.024V100.253C121.588 91.9178 128.471 85.0354 136.806 85.0354H137.188C145.524 85.0354 152.406 91.9178 152.406 100.253V113.024C152.406 121.359 145.524 128.241 137.188 128.241Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M25.4647 129.159H26.9942C35.6353 129.159 42.6706 122.2 42.5942 113.559V99.6413C42.5942 91.0766 35.6353 84.0413 26.9942 84.0413H25.4647C16.9 84.0413 9.86475 91.0001 9.86475 99.6413V113.559C9.86475 122.124 16.8236 129.159 25.4647 129.159ZM12.1589 99.5648C12.1589 92.2236 18.1236 86.2589 25.4647 86.2589H26.9942C34.3353 86.2589 40.3 92.2236 40.3 99.5648V113.482C40.3 120.824 34.3353 126.788 26.9942 126.788H25.4647C18.1236 126.788 12.1589 120.824 12.1589 113.482V99.5648Z" fill="#30374B"></path><path d="M26.3823 104.459C25.5411 104.459 24.8529 103.771 24.8529 102.929V98.4176C24.8529 97.5764 25.5411 96.8882 26.3823 96.8882C27.2235 96.8882 27.9117 97.5764 27.9117 98.4176V102.929C27.9117 103.771 27.2235 104.459 26.3823 104.459Z" fill="#30374B"></path><path d="M15.3706 84.1177C14.8353 84.1177 14.3765 83.6589 14.3765 83.1236V75.4765C14.3765 74.9412 14.8353 74.4824 15.3706 74.4824C15.9059 74.4824 16.3647 74.9412 16.3647 75.4765V83.1236C16.3647 83.6589 15.9059 84.1177 15.3706 84.1177Z" fill="#F8C62C"></path><path d="M9.63529 90.3884C9.63529 90.9237 9.17647 91.3825 8.64118 91.3825H0.994118C0.458824 91.3825 0 90.9237 0 90.3884C0 89.8531 0.458824 89.3943 0.994118 89.3943H8.64118C9.17647 89.3943 9.63529 89.8531 9.63529 90.3884Z" fill="#F8C62C"></path><path d="M11.9294 86.4117C11.5471 86.7941 10.8589 86.7941 10.4765 86.4117L3.74709 79.6823C3.36474 79.3 3.36474 78.6117 3.74709 78.2294C4.12944 77.847 4.81768 77.847 5.20003 78.2294L11.9294 84.9588C12.3118 85.3412 12.3118 86.0294 11.9294 86.4117Z" fill="#F8C62C"></path><path d="M87.7117 105.682H82.9706V100.941H80.8294V105.682H76.1647V107.747H80.8294V112.488H82.9706V107.747H87.7117V105.682Z" fill="#F8C62C"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M136.194 129.159H137.724C146.365 129.159 153.4 122.2 153.324 113.559V99.6413C153.324 91.0766 146.365 84.0413 137.724 84.0413H136.194C127.629 84.0413 120.594 91.0001 120.594 99.6413V113.559C120.594 122.124 127.553 129.159 136.194 129.159ZM122.888 99.5648C122.888 92.2236 128.853 86.2589 136.194 86.2589H137.724C145.065 86.2589 151.029 92.2236 151.029 99.5648V113.482C151.029 120.824 145.065 126.788 137.724 126.788H136.194C128.853 126.788 122.888 120.824 122.888 113.482V99.5648Z" fill="#30374B"></path><path d="M137.112 104.459C136.271 104.459 135.582 103.771 135.582 102.929V98.4176C135.582 97.5764 136.271 96.8882 137.112 96.8882C137.953 96.8882 138.641 97.5764 138.641 98.4176V102.929C138.641 103.771 137.953 104.459 137.112 104.459Z" fill="#30374B"></path><path d="M102.776 106.753L108.129 101.4C108.588 100.941 108.588 100.253 108.129 99.7941C107.671 99.3352 106.982 99.3352 106.524 99.7941L100.406 105.912C100.176 106.141 100.1 106.447 100.1 106.753C100.1 107.059 100.176 107.365 100.406 107.594L106.524 113.712C106.982 114.171 107.671 114.171 108.129 113.712C108.588 113.253 108.588 112.565 108.129 112.106L102.776 106.753Z" fill="#F8C62C"></path><path d="M171.218 106.753L165.865 101.4C165.406 100.941 165.406 100.253 165.865 99.7941C166.324 99.3352 167.012 99.3352 167.471 99.7941L173.588 105.912C173.818 106.141 173.894 106.447 173.894 106.753C173.894 107.059 173.818 107.365 173.588 107.594L167.471 113.712C167.012 114.171 166.324 114.171 165.865 113.712C165.406 113.253 165.406 112.565 165.865 112.106L171.218 106.753Z" fill="#F8C62C"></path>',20)])])}const $Yt=V(ZYt,[["render",YYt]]),e$t={},t$t={width:"42",height:"55",viewBox:"0 0 42 55",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function i$t(t,e){return P(),F("svg",t$t,[...e[0]||(e[0]=[Ys('<path d="M1.7192 47.4914L0.501465 10.6013H40.8298L40.3284 47.4914H1.7192Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.36104 47.8495H40.6866L41.188 10.2432H0.143311L1.36104 47.8495ZM39.9703 47.1332H2.07735L0.859623 10.9595H40.4717L39.9703 47.1332Z" fill="#9E9E9E"></path><path d="M4.29792 0.429688L0.501465 10.6013H40.8298L37.5348 0.429688H4.29792Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M0 10.9596H41.3312L37.7496 0H4.01135L0 10.9596ZM40.3284 10.2433H1.00284L4.51277 0.716312H37.2482L40.3284 10.2433Z" fill="#9E9E9E"></path><path d="M18.9312 23.0255C19.4326 23.0255 19.8624 22.5957 19.8624 22.0943V14.9312C19.8624 14.4298 19.4326 14 18.9312 14C18.4298 14 18 14.4298 18 14.9312V22.0943C18 22.5957 18.4298 23.0255 18.9312 23.0255Z" fill="#F8C62C"></path><path d="M24.3035 28.9708C24.3035 29.4722 24.7333 29.902 25.2347 29.902H32.3978C32.8992 29.902 33.329 29.4722 33.329 28.9708C33.329 28.4693 32.8992 28.0395 32.3978 28.0395H25.2347C24.7333 27.9679 24.3035 28.3977 24.3035 28.9708Z" fill="#F8C62C"></path><path d="M22.1546 25.2461C22.5128 25.6043 23.1575 25.6043 23.5156 25.2461L29.8192 18.9426C30.1773 18.5844 30.1773 17.9398 29.8192 17.5816C29.461 17.2234 28.8163 17.2234 28.4582 17.5816L22.1546 23.8852C21.7248 24.2433 21.7248 24.8164 22.1546 25.2461Z" fill="#F8C62C"></path><path d="M21.5855 31.4087L21.3477 51.0688L26.5798 46.0745L34.5865 46.6294L21.5855 31.4087Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M20.0793 54.9534L20 28L37.2819 48.6114L26.8969 47.0259L20.0793 54.9534ZM22.2197 33.9456L22.299 49.087L26.1041 44.6477L31.9705 45.5197L22.2197 33.9456Z" fill="black"></path>',9)])])}const r$t=V(e$t,[["render",i$t]]),o$t={},n$t={width:"124",height:"152",viewBox:"0 0 124 152",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function s$t(t,e){return P(),F("svg",n$t,[...e[0]||(e[0]=[Ys('<path d="M10.5436 0.396484H112.649L123.272 103.216H0.475708L10.5436 0.396484Z" fill="#F2F2F2"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M0 103.612H123.668L113.046 0.317098V0H10.2264L0.0792746 103.216L0 103.612ZM122.876 102.819H0.951324L10.9399 0.792766H112.332L122.876 102.819Z" fill="#9E9E9E"></path><path d="M40.7472 10.2266L39.241 48.6747H83.7933V10.2266H40.7472Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M38.8446 49.071H84.1897H84.269V9.83008H40.3508L38.8446 49.071ZM83.4762 48.2783H39.7166L41.0643 10.6228H83.4762V48.2783Z" fill="#9E9E9E"></path><path d="M39.2408 48.6748L43.1253 64.0541H79.988L83.7932 48.6748H39.2408Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M42.8083 64.4503H80.3052L84.3482 48.2783H38.7653L42.8083 64.4503ZM79.671 63.6576H43.4425L39.7958 49.0711H83.3176L79.671 63.6576Z" fill="#9E9E9E"></path><path d="M64.6088 36.1494L64.371 55.8095L69.6031 50.8152L77.6098 51.3701L64.6088 36.1494Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M63.1026 59.6938L63.0233 32.7405L80.3052 53.3519L69.9202 51.7664L63.1026 59.6938ZM65.243 38.6861L65.3223 53.8275L69.1275 49.3881L74.9938 50.2602L65.243 38.6861Z" fill="black"></path><path d="M61.7549 130.724H61.3585C52.7176 130.724 45.5829 123.589 45.5829 114.948V101.709C45.5829 93.0686 52.7176 85.9338 61.3585 85.9338H61.7549C70.3958 85.9338 77.5306 93.0686 77.5306 101.709V114.948C77.5306 123.589 70.4751 130.724 61.7549 130.724Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M44.7902 114.79C44.7902 124.144 52.4005 131.754 61.7549 131.754C71.1093 131.754 78.7197 124.065 78.7197 114.79V101.947C78.7197 92.5928 71.1093 84.9824 61.7549 84.9824C52.4005 84.9824 44.7902 92.5928 44.7902 101.947V114.79ZM47.1684 101.868C47.1684 93.8612 53.6689 87.2814 61.7549 87.2814C69.7617 87.2814 76.3415 93.7819 76.3415 101.868V114.71C76.3415 122.717 69.8409 129.297 61.7549 129.297C53.7482 129.297 47.1684 122.796 47.1684 114.71V101.868Z" fill="#30374B"></path><path d="M61.8341 106.069C60.9621 106.069 60.2487 105.356 60.2487 104.484V100.996C60.2487 100.124 60.9621 99.4104 61.8341 99.4104C62.7062 99.4104 63.4196 100.124 63.4196 100.996V104.484C63.4196 105.356 62.7062 106.069 61.8341 106.069Z" fill="#30374B"></path><path d="M61.8341 97.7457C60.9621 97.7457 60.2487 97.0322 60.2487 96.1602C60.2487 95.2882 60.9621 94.5747 61.8341 94.5747C62.7062 94.5747 63.4196 95.2882 63.4196 96.1602C63.4196 97.0322 62.7062 97.7457 61.8341 97.7457Z" fill="#30374B"></path><path d="M61.8341 110.826C60.9621 110.826 60.2487 110.113 60.2487 109.241C60.2487 108.369 60.9621 107.655 61.8341 107.655C62.7062 107.655 63.4196 108.369 63.4196 109.241C63.4196 110.113 62.7062 110.826 61.8341 110.826Z" fill="#30374B"></path><path d="M61.8342 142.298L67.3834 136.749C67.859 136.273 68.5725 136.273 69.0481 136.749C69.5238 137.224 69.5238 137.938 69.0481 138.414L62.7062 144.756C62.4684 144.993 62.1513 145.073 61.8342 145.073C61.5171 145.073 61.2 144.993 60.9621 144.756L54.6202 138.414C54.1445 137.938 54.1445 137.224 54.6202 136.749C55.0958 136.273 55.8093 136.273 56.2849 136.749L61.8342 142.298Z" fill="#F8C62C"></path><path d="M61.8342 149.195L67.3834 143.646C67.859 143.17 68.5725 143.17 69.0481 143.646C69.5238 144.121 69.5238 144.835 69.0481 145.311L62.7062 151.653C62.4684 151.89 62.1513 151.97 61.8342 151.97C61.5171 151.97 61.2 151.89 60.9621 151.653L54.6202 145.311C54.1445 144.835 54.1445 144.121 54.6202 143.646C55.0958 143.17 55.8093 143.17 56.2849 143.646L61.8342 149.195Z" fill="#F8C62C"></path>',15)])])}const a$t=V(o$t,[["render",s$t]]),l$t={name:"FirstPersonViewHelper",components:{KeyboardNavigate:QYt,KeyboardStorey:JYt,MouseMove:$Yt,MouseStorey:r$t,MouseZoom:a$t},emits:["close"],methods:{close(){this.$emit("close")},clear(){localStorage.setItem("firstPersonViewHelper","false"),this.close()}}},c$t={class:"bimdata-first-person-view-helper"},d$t={class:"bimdata-first-person-view-helper__header"},u$t={class:"bimdata-first-person-view-helper__content"},h$t={class:"bimdata-first-person-view-helper__content__main"},p$t={class:"bimdata-first-person-view-helper__content__main__left"},f$t={class:"bimdata-first-person-view-helper__content__main__left__element"},g$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},A$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},m$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},v$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},y$t={class:"bimdata-first-person-view-helper__content__main__left__element"},b$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},w$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},C$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},x$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},k$t={class:"bimdata-first-person-view-helper__content__main__left__element"},M$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},E$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},B$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},P$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},I$t={class:"bimdata-first-person-view-helper__content__main__right"},S$t={class:"bimdata-first-person-view-helper__content__main__right__title"},T$t={class:"bimdata-first-person-view-helper__content__main__right__content"},R$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture"},D$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture__element"},_$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture__element"},L$t={class:"bimdata-first-person-view-helper__content__main__right__content__text"},F$t={class:"bimdata-first-person-view-helper__content__footer"},O$t={class:"bimdata-first-person-view-helper__footer-buttons"};function U$t(t,e,i,r,o,n){const s=R("KeyboardNavigate"),a=R("MouseMove"),l=R("MouseZoom"),c=R("MouseStorey"),d=R("KeyboardStorey"),u=R("BIMDataButton");return P(),F("div",c$t,[x("h1",d$t,Z(t.$t("viewer3d.firstPersonViewHelper.title")),1),x("div",u$t,[x("div",h$t,[x("div",p$t,[x("div",f$t,[x("div",g$t,[D(s)]),x("div",A$t,[x("h4",m$t,Z(t.$t("viewer3d.firstPersonViewHelper.keyboardUsage")),1),x("ul",v$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.forward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.backward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.left")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.right")),1)])])]),x("div",y$t,[x("div",b$t,[D(a)]),x("div",w$t,[x("h4",C$t,Z(t.$t("viewer3d.firstPersonViewHelper.mouseOrientation")),1),x("ul",x$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.pressLeft")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseMove")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseVertical")),1)])])]),x("div",k$t,[x("div",M$t,[D(l)]),x("div",E$t,[x("h4",B$t,Z(t.$t("viewer3d.firstPersonViewHelper.mouseZoom")),1),x("ul",P$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseWheelForward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseWheelBackward")),1)])])])]),x("div",I$t,[x("h4",S$t,Z(t.$t("viewer3d.firstPersonViewHelper.changeStorey")),1),x("div",T$t,[x("div",R$t,[x("div",D$t,[D(c)]),x("div",_$t,[D(d)])]),x("div",L$t,[x("ul",null,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.storeyClick")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.moveCameraToObject")),1)]),x("ul",null,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.keyboardStoreyChange")),1)])])])])]),x("div",F$t,Z(t.$t("viewer3d.firstPersonViewHelper.contentFooter")),1)]),x("div",O$t,[D(u,{color:"primary",fill:"",radius:"",width:"200px",onClick:n.close},{default:H(()=>[rt(Z(t.$t("viewer3d.firstPersonViewHelper.understand")),1)]),_:1},8,["onClick"]),D(u,{color:"primary",outline:"",radius:"",width:"200px",onClick:n.clear},{default:H(()=>[rt(Z(t.$t("viewer3d.firstPersonViewHelper.noRecall")),1)]),_:1},8,["onClick"])])])}const fhe=V(l$t,[["render",U$t],["__scopeId","data-v-77cce9d5"]]),N$t={components:{ShortcutsModal:eM,FirstPersonViewHelper:fhe},data(){const t=this.$t;return{tabs:[{id:0,get label(){return t("viewer3d.modals.3d")}},{id:1,get label(){return t("viewer3d.modals.firstPerson")}}],activeTab:0,elements:[{image:"shortcutRotate",title:this.$t("shortcuts-helper.title_rotate"),text:this.$t("shortcuts-helper.text_rotate")},{image:"shortcutZoom",title:this.$t("shortcuts-helper.title_zoom"),text:this.$t("shortcuts-helper.text_zoom")},{image:"shortcutOpen",title:this.$t("shortcuts-helper.title_open"),text:this.$t("shortcuts-helper.text_open")}],shortcuts:[{letter:"F",text:this.$t("context_menu.fit_view")},{letter:"C",text:this.$t("context_menu.select_all")},{letter:"V",text:this.$t("context_menu.deselect_all")},{letter:"H",text:this.$t("context_menu.hide")},{letter:"Y",text:this.$t("context_menu.select_similar")},{letter:"I",text:this.$t("context_menu.isolate")},{letter:"U",text:this.$t("context_menu.reintegrate")},{letter:"R",text:this.$t("context_menu.show_all")},{letter:"1",text:this.$t("shortcuts-helper.shortcut_1")},{letter:"2",text:this.$t("shortcuts-helper.shortcut_2")},{letter:"3",text:this.$t("shortcuts-helper.shortcut_3")},{letter:"4",text:this.$t("shortcuts-helper.shortcut_4")},{letter:"5",text:this.$t("shortcuts-helper.shortcut_5")},{letter:"6",text:this.$t("shortcuts-helper.shortcut_6")},{maj:!0,text:this.$t("shortcuts-helper.shortcut_pan"),illustration:"click"},{alt:!0,text:this.$t("shortcuts-helper.shortcut_open"),illustration:"click"},{shift:!0,text:this.$t("shortcuts-helper.shortcut_multiselect"),illustration:"click"}]}}},j$t={class:"bimdata-shortcuts-helper__header"};function H$t(t,e,i,r,o,n){const s=R("BIMDataTabs"),a=R("ShortcutsModal"),l=R("FirstPersonViewHelper");return P(),F("div",null,[x("div",j$t,[D(s,{tabs:o.tabs,width:"490px",height:"44px",tabSize:"245",onTabSelected:e[0]||(e[0]=c=>o.activeTab=o.tabs.indexOf(c)),selected:o.activeTab},null,8,["tabs","selected"])]),o.activeTab===0?(P(),Y(a,{key:0,elements:o.elements,shortcuts:o.shortcuts,onClose:e[1]||(e[1]=c=>t.$emit("close"))},{title:H(()=>[rt(Z(t.$t("shortcuts-helper.title_modal")),1)]),_:1},8,["elements","shortcuts"])):(P(),Y(l,{key:1,onClose:e[2]||(e[2]=c=>t.$emit("close"))}))])}const z$t=V(N$t,[["render",H$t],["__scopeId","data-v-a26872a0"]]),V$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M1.20102%2023.5V24.5H2.20102H10.261C11.4116%2029.9278%2016.2295%2034%2022%2034C27.7705%2034%2032.5884%2029.9278%2033.739%2024.5H41.799H42.799V23.5V20.5V19.5H41.799H33.739C32.5884%2014.0722%2027.7705%2010%2022%2010C16.2295%2010%2011.4116%2014.0722%2010.261%2019.5H2.20102H1.20102V20.5V23.5ZM14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C26.0764%2014.619%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",q$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M6.23222%2034.2322L5.52512%2034.9393L6.23222%2035.6464L8.35354%2037.7678L9.06065%2038.4749L9.76776%2037.7678L15.4677%2032.0678C17.3477%2033.2898%2019.592%2034%2022%2034C24.408%2034%2026.6523%2033.2898%2028.5323%2032.0678L34.2322%2037.7678L34.9393%2038.4749L35.6464%2037.7678L37.7678%2035.6465L38.4749%2034.9393L37.7678%2034.2322L32.0678%2028.5323C33.2898%2026.6523%2034%2024.408%2034%2022C34%2019.592%2033.2898%2017.3477%2032.0678%2015.4677L37.7678%209.76776L38.4749%209.06065L37.7678%208.35354L35.6464%206.23222L34.9393%205.52512L34.2322%206.23222L28.5322%2011.9322C26.6523%2010.7102%2024.408%2010%2022%2010C19.592%2010%2017.3477%2010.7102%2015.4677%2011.9322L9.76776%206.23224L9.06065%205.52513L8.35354%206.23224L6.23222%208.35356L5.52512%209.06066L6.23222%209.76777L11.9322%2015.4678C10.7102%2017.3477%2010%2019.592%2010%2022C10%2024.408%2010.7102%2026.6523%2011.9322%2028.5323L6.23222%2034.2322ZM14.619%2022C14.619%2017.9236%2017.9236%2014.6191%2022%2014.6191C26.0764%2014.6191%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",G$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C26.0764%2014.619%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022ZM22%2010C15.3726%2010%2010%2015.3726%2010%2022C10%2028.6274%2015.3726%2034%2022%2034C28.6274%2034%2034%2028.6274%2034%2022C34%2015.3726%2028.6274%2010%2022%2010Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",Q$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C23.8642%2014.619%2025.5667%2015.3094%2026.8665%2016.4504L14.7593%2023.4405C14.6673%2022.9751%2014.619%2022.4935%2014.619%2022ZM29.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C20.0879%2029.381%2018.3459%2028.6547%2017.0341%2027.4608L29.2136%2020.4289C29.3232%2020.9347%2029.381%2021.4602%2029.381%2022ZM22%2010C15.3726%2010%2010%2015.3726%2010%2022C10%2028.6274%2015.3726%2034%2022%2034C28.6274%2034%2034%2028.6274%2034%2022C34%2015.3726%2028.6274%2010%2022%2010Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",K$t="data:image/svg+xml,%3csvg%20width='33'%20height='33'%20viewBox='0%200%2033%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.70001%2016.8667V17.3667H2.20001H7.33335H7.83335V16.8667V16.1333V15.6333H7.33335L2.20001%2015.6333H1.70001V16.1333L1.70001%2016.8667ZM30.8%2017.3667H31.3V16.8667V16.1333V15.6333H30.8L25.6667%2015.6333H25.1667V16.1333V16.8667V17.3667H25.6667H30.8Z'%20fill='%232F374A'%20stroke='white'/%3e%3cpath%20d='M16.1333%201.70001L15.6333%201.70001L15.6333%202.20001L15.6333%207.33335L15.6333%207.83335L16.1333%207.83335L16.8667%207.83335L17.3667%207.83335L17.3667%207.33335L17.3667%202.20001L17.3667%201.70001L16.8667%201.70001L16.1333%201.70001ZM15.6333%2030.8L15.6333%2031.3L16.1333%2031.3L16.8667%2031.3L17.3667%2031.3L17.3667%2030.8L17.3667%2025.6667L17.3667%2025.1667L16.8667%2025.1667L16.1333%2025.1667L15.6333%2025.1667L15.6333%2025.6667L15.6333%2030.8Z'%20fill='%232F374A'%20stroke='white'/%3e%3c/svg%3e",W$t={0:{positions:[36.5625,31.640625,36.5625,19.51171875,36.42067337036133,16.11605453491211,35.99519348144531,13.020120620727539,35.28605651855469,10.223917961120605,34.293270111083984,7.727446556091309,33.01683044433594,5.530706882476807,30.959993362426758,3.3593661785125732,28.725576400756836,1.6479235887527466,26.31357765197754,.39637935161590576,23.723995208740234,-.39526674151420593,20.956830978393555,-.7270146012306213,20.3203125,-.73828125,17.307449340820312,-.5108020901679993,14.569392204284668,.17163534462451935,12.106142044067383,1.3090311288833618,9.917699813842773,2.9013850688934326,8.174575805664062,5.153988838195801,6.733142375946045,7.555612087249756,5.593398094177246,10.106253623962402,4.755343437194824,12.805914878845215,4.218978404998779,15.654594421386719,3.9843032360076904,18.652292251586914,3.97265625,19.51171875,3.97265625,31.640625,4.115384578704834,35.0230827331543,4.543569564819336,38.11090850830078,5.257210731506348,40.904109954833984,6.256308555603027,43.40268325805664,7.540863037109375,45.606624603271484,9.608292579650879,47.79111099243164,11.846480369567871,49.51402282714844,14.255425453186035,50.775352478027344,16.835128784179688,51.57510757446289,19.585588455200195,51.91328811645508,20.25,51.92578125,23.26165771484375,51.697608947753906,25.997068405151367,51.013092041015625,28.456228256225586,49.872230529785156,30.639141082763672,48.2750244140625,32.375572204589844,46.0158576965332,33.81153869628906,43.60895538330078,34.947044372558594,41.0543212890625,35.78208923339844,38.35194778442383,36.31666946411133,35.5018424987793,36.55078887939453,32.50400161743164,36.5625,31.640625,29.63671875,18.10546875,29.63671875,33.1171875,29.450082778930664,36.561954498291016,28.89017677307129,39.497215270996094,27.956998825073242,41.92298126220703,25.967069625854492,44.22639083862305,23.724157333374023,45.72625732421875,21.228260040283203,46.422576904296875,20.25,46.4765625,17.354780197143555,46.07659912109375,14.97888469696045,44.876708984375,13.33356761932373,42.470394134521484,12.110569953918457,39.9057731628418,11.309891700744629,37.1828498840332,10.931534767150879,34.30161666870117,10.8984375,33.1171875,10.8984375,18.10546875,11.085087776184082,14.669450759887695,11.645040512084961,11.733874320983887,12.578293800354004,9.298736572265625,14.569818496704102,6.974865436553955,16.804428100585938,5.454482555389404,19.282119750976562,4.737586975097656,20.3203125,4.67578125,23.212167739868164,5.077450752258301,25.581016540527344,6.282459735870361,27.21183204650879,8.69408893585205,28.425546646118164,11.263723373413086,29.2221622467041,13.991360664367676,29.6016788482666,16.877002716064453],indices:[0,2,1,2,4,3,4,6,5,6,8,7,8,10,9,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,63,62,61,24,62,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,0,45,0,4,2,4,8,6,8,12,10,12,16,14,16,20,18,20,24,22,24,64,63,60,24,61,24,28,26,28,32,30,32,36,34,36,40,38,40,44,42,44,4,0,4,12,8,12,20,16,20,64,24,59,24,60,24,32,28,32,40,36,40,4,44,20,65,64,58,24,59,20,66,65,57,24,58,12,66,20,57,32,24,12,67,66,56,32,57,12,68,67,55,32,56,12,69,68,54,32,55,12,70,69,53,32,54,12,71,70,53,40,32,4,71,12,52,40,53,4,72,71,51,40,52,4,73,72,50,40,51,4,74,73,49,40,50,4,75,74,48,40,49,4,76,75,47,40,48,40,76,4,76,40,47],width:32.58984375},1:{positions:[23.94140625,51.1875,23.94140625,0,17.015625,0,17.015625,44.4375,6.5390625,44.296875,6.5390625,49.2890625],indices:[0,2,1,3,5,4,0,3,2,3,0,5],width:17.40234375},2:{positions:[37.3359375,5.4140625,37.3359375,0,4.1484375,0,4.1484375,4.74609375,20.91796875,23.37890625,23.33412742614746,26.180971145629883,25.239078521728516,28.61744499206543,26.632823944091797,30.68832778930664,27.938528060913086,33.606327056884766,28.560094833374023,36.34145736694336,28.6171875,37.40625,28.23740577697754,40.36100769042969,27.09806251525879,42.90309143066406,24.87748908996582,45.0150146484375,22.4631290435791,46.19827651977539,20.4609375,46.4765625,17.237478256225586,46.17487716674805,14.632962226867676,45.26981735229492,12.647390365600586,43.76138687133789,11.200069427490234,41.599464416503906,10.360716819763184,38.91020965576172,10.125,36.10546875,3.48046875,36.10546875,3.41015625,36.31640625,3.580944538116455,39.24900436401367,4.255249977111816,41.95781326293945,5.433072566986084,44.442840576171875,7.114412784576416,46.704078674316406,9.256887435913086,48.52997589111328,11.61109447479248,49.96455383300781,14.177034378051758,51.007816314697266,16.954708099365234,51.659759521484375,19.944114685058594,51.920387268066406,20.4609375,51.92578125,23.575925827026367,51.698787689208984,26.37569808959961,51.01780319213867,28.86025619506836,49.88283157348633,31.029598236083984,48.29386901855469,32.93091583251953,46.07616424560547,34.31552505493164,43.65195846557617,35.18342971801758,41.0212516784668,35.53462600708008,38.18403625488281,35.54296875,37.65234375,35.271297454833984,34.8802490234375,34.45627975463867,32.10430145263672,33.097923278808594,29.324501037597656,31.655981063842773,27.067161560058594,29.948768615722656,24.73398208618164,27.976285934448242,22.324962615966797,26.12109375,20.25,12.65625,5.58984375,12.7265625,5.4140625],indices:[51,1,0,1,3,2,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,46,45,46,48,47,48,50,49,51,3,1,19,22,20,22,26,24,26,30,28,30,34,32,34,38,36,38,42,40,42,46,44,46,50,48,50,3,51,18,22,19,22,30,26,30,38,34,38,46,42,46,3,50,18,30,22,46,4,3,17,30,18,46,5,4,16,30,17,46,6,5,15,30,16,46,7,6,14,30,15,46,8,7,13,30,14,38,8,46,13,38,30,38,9,8,12,38,13,38,10,9,11,38,12,38,11,10],width:33.92578125},3:{positions:[13.640625,23.37890625,13.640625,28.79296875,19.6875,28.79296875,22.903934478759766,29.15167236328125,25.282482147216797,30.227783203125,26.954715728759766,32.621280670166016,27.896883010864258,35.25688171386719,28.125,37.51171875,27.781084060668945,40.67007064819336,26.749338150024414,43.162776947021484,24.544097900390625,45.051876068115234,22.03769302368164,46.1552734375,19.51171875,46.4765625,16.51466941833496,46.0916633605957,14.03652286529541,44.93696212768555,12.056009292602539,42.62509536743164,10.906388282775879,40.13740539550781,10.58203125,37.79296875,3.9375,37.79296875,3.8671875,38.00390625,4.073190689086914,40.847023010253906,4.870357036590576,43.464176177978516,6.258687496185303,45.85536193847656,8.649903297424316,47.949581146240234,11.105090141296387,49.6024169921875,13.624245643615723,50.81385803222656,16.207372665405273,51.58391189575195,18.854469299316406,51.912574768066406,19.51171875,51.92578125,22.69034194946289,51.71705627441406,25.550539016723633,51.090885162353516,28.09231185913086,50.04726028442383,30.315656661987305,48.58618927001953,32.206153869628906,46.54783248901367,33.6175651550293,44.22849655151367,34.54988479614258,41.62818145751953,35.00312423706055,38.74688720703125,35.05078125,37.37109375,34.68306350708008,34.60222244262695,33.579917907714844,31.84009552001953,31.788928985595703,29.416330337524414,29.652488708496094,27.526569366455078,27.38671875,26.26171875,30.2706241607666,24.998523712158203,32.5009765625,23.31671142578125,34.190120697021484,20.399517059326172,35.28596115112305,17.665790557861328,35.78849792480469,15.115530967712402,35.82421875,14.2734375,35.583168029785156,11.223187446594238,34.860015869140625,8.486950874328613,33.65475845336914,6.064727306365967,31.9674015045166,3.9565165042877197,29.64410972595215,2.185784339904785,27.159265518188477,.8323085308074951,24.512863159179688,-.10391119122505188,21.704906463623047,-.6228747963905334,19.51171875,-.73828125,16.397254943847656,-.535150945186615,13.541664123535156,.07424008101224899,10.9449462890625,1.089891791343689,8.607102394104004,2.5118041038513184,6.504549980163574,4.569301605224609,4.957869052886963,6.847413539886475,3.9670591354370117,9.34614086151123,3.5321204662323,12.065483093261719,3.515625,13.2890625,3.62109375,13.5,10.23046875,13.5,10.628458976745605,10.52513313293457,11.822431564331055,8.080921173095703,14.14232063293457,6.207763671875,16.670166015625,5.072887420654297,19.405969619750977,4.6762919425964355,19.51171875,4.67578125,22.593053817749023,5.02486515045166,25.119962692260742,6.072116374969482,27.08766746520996,8.277663230895996,28.33972930908203,10.727699279785156,28.876150131225586,13.422224998474121,28.8984375,14.1328125,28.579307556152344,17.37627601623535,27.621917724609375,19.90043067932129,25.462261199951172,21.754257202148438,22.976253509521484,22.91082000732422,20.163896560668945,23.3701229095459,19.6875,23.37890625],indices:[86,1,0,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,46,45,46,48,47,48,50,49,50,52,51,52,54,53,54,56,55,56,58,57,58,60,59,60,62,61,62,64,63,64,66,65,66,68,67,85,1,86,15,18,16,18,22,20,22,26,24,26,30,28,30,34,32,34,38,36,38,42,40,42,46,44,46,50,48,50,54,52,54,58,56,58,62,60,62,66,64,66,69,68,84,1,85,14,18,15,18,26,22,26,34,30,34,42,38,42,50,46,50,58,54,58,66,62,66,70,69,83,1,84,14,26,18,58,70,66,83,2,1,13,26,14,58,71,70,82,2,83,12,26,13,58,72,71,82,3,2,11,26,12,58,73,72,82,4,3,10,26,11,58,74,73,81,4,82,10,34,26,58,75,74,9,34,10,50,75,58,8,34,9,50,76,75,7,34,8,50,77,76,6,34,7,50,78,77,5,34,6,50,79,78,5,42,34,50,80,79,4,42,5,50,81,80,81,42,4,42,81,50],width:32.30859375},4:{positions:[31.81640625,51.1875,31.81640625,17.2265625,38.8828125,17.2265625,38.8828125,11.8125,31.81640625,11.8125,31.81640625,0,24.92578125,0,24.92578125,11.8125,1.93359375,11.8125,1.93359375,15.71484375,24.50390625,51.1875,31.81640625,51.1875,24.046875,39.515625,9.31640625,17.2265625,24.92578125,17.2265625,24.92578125,41.23828125,24.71484375,41.2734375],indices:[1,3,2,4,6,5,7,9,8,9,14,13,16,13,12,13,10,9,10,1,0,1,4,3,4,7,6,7,14,9,16,10,13,10,4,1,4,14,7,15,10,16,4,15,14,15,4,10],width:36.94921875},5:{positions:[11.91796875,22.5,6.15234375,23.09765625,9.10546875,51.1875,34.734375,51.1875,34.734375,45.03515625,14.9765625,45.03515625,13.2890625,30.65625,14.99853515625,31.75048828125,16.892578125,32.642578125,19.03271484375,33.25341796875,21.48046875,33.50390625,21.48046875,33.50390625,24.524171829223633,33.29277038574219,27.260135650634766,32.595733642578125,29.6883602142334,31.412792205810547,31.808847427368164,29.743946075439453,33.53106689453125,27.481525421142578,34.8779411315918,25.034576416015625,35.84947204589844,22.40309715270996,36.44565963745117,19.58709144592285,36.66650390625,16.586557388305664,36.66796875,16.3125,36.47660446166992,13.1383056640625,35.90251541137695,10.244234085083008,34.94569778442383,7.630287170410156,33.60615158081055,5.296463966369629,31.54420280456543,3.2312631607055664,29.28870391845703,1.597025990486145,26.839656829833984,.3937528729438782,24.197057723999023,-.3785564601421356,21.360912322998047,-.7199019193649292,20.49609375,-.73828125,17.404800415039062,-.5199803113937378,14.58151912689209,.13492262363433838,12.026251792907715,1.226427435874939,9.738997459411621,2.7545342445373535,7.902623653411865,4.662389278411865,6.586172580718994,6.943535327911377,5.78964376449585,9.59797191619873,5.513038158416748,12.625699043273926,5.51953125,13.25390625,5.58984375,13.46484375,11.84765625,13.46484375,12.231374740600586,10.424592018127441,13.382529258728027,7.983725547790527,15.769926071166992,6.059262275695801,18.29474449157715,4.960567474365234,20.49609375,4.67578125,23.407373428344727,5.077446937561035,25.80744171142578,6.282444000244141,27.603513717651367,8.744783401489258,28.85628890991211,11.317317962646484,29.565767288208008,14.000046730041504,29.7421875,16.2421875,29.464466094970703,19.35067367553711,28.631298065185547,22.06241226196289,26.50613021850586,24.628503799438477,24.30402374267578,26.380647659301758,22.024982452392578,27.31884002685547,20.49609375,27.4921875,17.11406707763672,27.2115478515625,14.758378028869629,26.369632720947266,13.049945831298828,24.7330322265625],indices:[2,4,3,6,8,7,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,2,5,4,6,9,8,12,16,14,16,20,18,20,24,22,24,28,26,28,32,30,32,36,34,36,40,38,40,43,42,1,5,2,12,20,16,20,28,24,28,36,32,36,43,40,1,6,5,36,44,43,1,9,6,36,45,44,28,45,36,28,46,45,28,47,46,28,48,47,28,49,48,20,49,28,20,50,49,20,51,50,20,52,51,20,53,52,20,54,53,20,55,54,12,55,20,12,56,55,12,57,56,12,58,57,12,59,58,12,60,59,12,61,60,1,11,9,11,61,12,62,1,0,1,61,11,61,1,62],width:31.154930591583252},6:{positions:[23.73046875,51.92578125,23.73046875,51.92578125,26.35400390625,51.7763671875,28.951171875,51.328125,31.31103515625,50.6513671875,33.22265625,49.81640625,33.22265625,49.81640625,31.74609375,44.5078125,29.98388671875,45.30322265625,28.142578125,45.931640625,26.09912109375,46.34033203125,23.73046875,46.4765625,23.73046875,46.4765625,20.900758743286133,46.15056610107422,18.386611938476562,45.17258071899414,16.18802833557129,43.5426025390625,14.465424537658691,41.076210021972656,13.138894081115723,38.50679397583008,12.208439826965332,35.8343505859375,11.67405891418457,33.05888366699219,11.53125,30.62109375,11.53125,29.8125,13.904020309448242,31.542055130004883,16.591995239257812,32.85417938232422,19.408527374267578,33.66147994995117,22.372249603271484,33.98829650878906,22.921875,33.99609375,25.913307189941406,33.7476806640625,28.614002227783203,33.002437591552734,31.023962020874023,31.7603702545166,33.143184661865234,30.021472930908203,34.91127014160156,27.67707633972168,36.273963928222656,25.183759689331055,37.23126983642578,22.541519165039062,37.783180236816406,19.750356674194336,37.93359375,17.2265625,37.749637603759766,14.08007526397705,37.19777297973633,11.182336807250977,36.27799606323242,8.533347129821777,34.99031066894531,6.1331071853637695,32.81218719482422,3.8232548236846924,30.5310001373291,1.9849358797073364,28.146751403808594,.6181499361991882,25.65943717956543,-.2771027684211731,23.069063186645508,-.7008222937583923,22.0078125,-.73828125,19.07733154296875,-.5163767337799072,16.358732223510742,.14933684468269348,13.852017402648926,1.2588595151901245,11.557185173034668,2.8121912479400635,9.638298988342285,5.0737128257751465,8.030496597290039,7.450648784637451,6.733777046203613,9.942998886108398,5.748140335083008,12.550763130187988,5.073586463928223,15.273941993713379,4.710115432739258,18.112533569335938,4.640625,20.07421875,4.640625,29.84765625,4.791966915130615,33.015262603759766,5.245992183685303,35.97719955444336,6.0027008056640625,38.73346710205078,7.062093257904053,41.28406524658203,8.424168586730957,43.62899398803711,10.08892822265625,45.768253326416016,12.196839332580566,47.81597900390625,14.478988647460938,49.4511604309082,16.93537712097168,50.673797607421875,19.56600570678711,51.483890533447266,22.370872497558594,51.881439208984375,21.375,28.828125,21.375,28.828125,18.29266357421875,28.514667510986328,15.669046401977539,27.57429313659668,13.216089248657227,25.754901885986328,11.53125,23.5546875,11.53125,23.5546875,11.53125,19.40625,11.72034740447998,16.05575180053711,12.287637710571289,13.114592552185059,13.233122825622559,10.582772254943848,15.422850608825684,7.959404945373535,17.641748428344727,6.1007585525512695,19.889812469482422,5.006833076477051,22.0078125,4.67578125,24.755970001220703,5.117502212524414,27.043012619018555,6.4426655769348145,28.768321990966797,9.139809608459473,30.00419807434082,11.825053215026855,30.75064468383789,14.498397827148438,31.007658004760742,17.15984344482422,31.0078125,17.2265625,30.737268447875977,20.334959030151367,29.925634384155273,23.062726974487305,28.57291030883789,25.409866333007812,26.557069778442383,27.331403732299805,24.112672805786133,28.470571517944336],indices:[2,4,3,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,61,60,61,63,62,63,65,64,65,67,66,21,25,23,25,29,27,29,33,31,33,37,35,37,41,39,41,45,43,45,49,47,49,53,51,53,57,55,57,61,59,61,65,63,65,68,67,21,29,25,29,37,33,37,45,41,45,53,49,57,65,61,57,68,65,73,57,74,68,2,1,2,6,4,6,8,7,53,75,57,72,57,73,68,6,2,6,9,8,53,76,75,71,57,72,68,9,6,53,77,76,70,57,71,68,10,9,53,78,77,68,12,10,53,79,78,68,13,12,45,79,53,68,14,13,45,80,79,68,15,14,45,81,80,57,15,68,45,82,81,57,16,15,45,83,82,57,17,16,45,84,83,57,18,17,37,84,45,57,19,18,37,85,84,57,20,19,37,86,85,57,21,20,37,87,86,70,21,57,37,88,87,70,29,21,37,89,88,95,29,70,37,90,89,94,29,95,29,90,37,93,29,94,29,91,90,92,29,93,29,92,91],width:33.29296875},7:{positions:[37.3359375,51.1875,37.3359375,45.73828125,35.06884002685547,42.96620559692383,32.99747848510742,40.27573776245117,31.121856689453125,37.666873931884766,29.441970825195312,35.13961410522461,27.957822799682617,32.6939582824707,26.669410705566406,30.329906463623047,25.576738357543945,28.047460556030273,24.585519790649414,25.34857940673828,23.679515838623047,22.592660903930664,22.85872459411621,19.779708862304688,22.123149871826172,16.909719467163086,21.47278594970703,13.982696533203125,20.907638549804688,10.998638153076172,20.427703857421875,7.957544803619385,20.109375,5.51953125,19.546875,0,12.62109375,0,13.18359375,5.51953125,13.624162673950195,8.682632446289062,14.162458419799805,11.7554292678833,14.798481941223145,14.737921714782715,15.532232284545898,17.630107879638672,16.363710403442383,20.431991577148438,17.29291534423828,23.14356803894043,18.319847106933594,25.764841079711914,19.59184455871582,28.50404167175293,20.94556999206543,31.184146881103516,22.381019592285156,33.80515670776367,23.898197174072266,36.367069244384766,25.497098922729492,38.86988830566406,27.17772674560547,41.31361389160156,28.940080642700195,43.6982421875,30.55078125,45.73828125,2.70703125,45.73828125,2.70703125,51.1875],indices:[36,1,0,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,15,18,16,18,22,20,22,26,24,26,30,28,30,34,32,34,1,36,14,18,15,18,26,22,26,34,30,34,2,1,13,18,14,18,34,26,34,3,2,12,18,13,34,4,3,11,18,12,34,5,4,10,18,11,34,6,5,9,18,10,34,7,6,8,18,9,34,8,7,8,34,18],width:34.62890625},8:{positions:[35.5078125,37.828125,35.5078125,37.828125,35.171749114990234,34.87995147705078,34.16355895996094,32.23108673095703,32.111854553222656,29.74087905883789,29.926387786865234,27.833354949951172,27.60715675354004,26.50851058959961,27.17578125,26.33203125,29.95149040222168,25.094419479370117,32.32651901245117,23.460092544555664,34.43555450439453,20.72713279724121,35.900413513183594,18.128986358642578,36.721099853515625,15.665656089782715,36.9140625,13.8515625,36.669769287109375,10.764041900634766,35.936893463134766,8.031349182128906,34.71543502807617,5.653482913970947,33.00539016723633,3.630444288253784,30.672534942626953,1.9876797199249268,28.159135818481445,.7305349111557007,25.465194702148438,-.14099019765853882,22.590709686279297,-.6268956065177917,20.28515625,-.73828125,17.073928833007812,-.5518752932548523,14.154998779296875,.007342617027461529,11.52836799621582,.9393724799156189,9.194035530090332,2.2442142963409424,7.087226867675781,4.249664306640625,5.474374294281006,6.483748912811279,4.355478763580322,8.946466445922852,3.730539560317993,11.637818336486816,3.5859375,13.8515625,3.9077277183532715,16.76708984375,4.873098373413086,19.430402755737305,6.983664512634277,21.999971389770508,9.1663179397583,24.03520965576172,11.421058654785156,25.536113739013672,13.21875,26.33203125,10.521642684936523,27.690086364746094,8.310940742492676,29.498327255249023,6.554880142211914,32.2148551940918,5.462681293487549,34.86786651611328,5.034343719482422,37.45735549926758,5.02734375,37.828125,5.274991512298584,40.936737060546875,6.0179338455200195,43.679622650146484,7.256171703338623,46.056785583496094,8.989704132080078,48.0682258605957,11.195730209350586,49.67716598510742,13.679861068725586,50.85453796386719,16.442096710205078,51.60033416748047,19.482437133789062,51.914554595947266,20.21484375,51.92578125,23.33972930908203,51.71018600463867,26.17371940612793,51.06340789794922,28.716812133789062,49.98543930053711,30.96900749206543,48.476287841796875,32.855812072753906,46.481101989746094,34.23870849609375,44.16929626464844,35.11769485473633,41.54087829589844,35.49277114868164,38.5958366394043,30.0234375,13.9921875,30.0234375,13.9921875,29.64218521118164,16.91078758239746,28.498428344726562,19.414352416992188,26.08045768737793,21.54735565185547,23.622779846191406,22.934738159179688,21.125396728515625,23.576496124267578,20.21484375,23.625,17.24955177307129,23.25731658935547,14.728343963623047,22.15427017211914,12.576437950134277,19.76153564453125,11.184748649597168,17.31914710998535,10.553275108337402,14.827102661132812,10.51171875,13.9921875,10.887092590332031,10.988458633422852,12.013215065002441,8.51321792602539,14.405669212341309,6.533318519592285,16.906885147094727,5.263905048370361,19.516860961914062,4.704977512359619,20.28515625,4.67578125,23.29867172241211,5.026233196258545,25.858081817626953,6.077588081359863,28.013742446899414,8.338984489440918,29.392438888549805,10.737264633178711,29.994173049926758,13.27242660522461,28.58203125,37.6875,28.58203125,37.6875,28.174694061279297,40.610374450683594,26.952680587768555,43.08668899536133,24.61227035522461,45.108375549316406,22.137697219848633,46.228328704833984,20.21484375,46.4765625,17.313322067260742,46.03565979003906,14.926724433898926,44.71294403076172,13.154691696166992,42.36640930175781,12.172061920166016,39.77567672729492,11.953125,37.6875,12.353304862976074,34.70274353027344,13.553845405578613,32.25563430786133,15.877814292907715,30.335918426513672,18.399682998657227,29.288454055786133,20.28515625,29.07421875,23.187891006469727,29.511512756347656,25.59459114074707,30.82339859008789,27.39614486694336,33.1435661315918,28.379940032958984,35.7212028503418],indices:[96,43,97,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,1,60,1,3,2,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,75,74,73,31,74,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,98,97,95,43,96,43,47,45,47,51,49,51,55,53,55,59,57,59,3,1,3,7,5,7,11,9,11,15,13,15,19,17,19,23,21,23,27,25,27,31,29,31,76,75,72,31,73,31,35,33,37,41,39,41,98,43,94,43,95,43,51,47,51,59,55,59,7,3,7,15,11,15,23,19,23,31,27,31,77,76,71,31,72,31,37,35,37,98,41,94,51,43,23,77,31,70,31,71,37,99,98,93,51,94,23,78,77,70,37,31,37,100,99,92,51,93,23,79,78,69,37,70,37,101,100,91,51,92,23,80,79,68,37,69,37,102,101,90,51,91,23,81,80,67,37,68,37,103,102,89,51,90,15,81,23,66,37,67,89,59,51,15,82,81,66,103,37,88,59,89,15,83,82,65,103,66,87,59,88,15,84,83,64,103,65,106,59,87,15,85,84,64,104,103,105,59,106,15,62,85,63,104,64,104,59,105,15,63,62,104,7,59,7,63,15,63,7,104],width:33.328125},9:{positions:[17.96484375,4.67578125,17.96484375,4.67578125,20.832611083984375,5.023819923400879,23.333181381225586,6.067935943603516,25.466554641723633,7.80812931060791,26.91764259338379,9.993691444396973,28.0020751953125,12.483912467956543,28.7198543548584,15.278792381286621,29.070980072021484,18.378332138061523,29.109375,19.8984375,29.109375,22.21875,27.17138671875,20.02587890625,24.802734375,18.439453125,22.097061157226562,17.482282638549805,19.10603904724121,17.156333923339844,19.0546875,17.15625,15.962648391723633,17.374753952026367,13.161947250366211,18.030263900756836,10.65258502960205,19.12278175354004,8.43455982208252,20.652305603027344,6.556478023529053,22.870075225830078,5.067807197570801,25.25521469116211,3.968548536300659,27.80772590637207,3.2587015628814697,30.527606964111328,2.9382660388946533,33.414859771728516,2.91796875,34.3828125,3.1171858310699463,37.45964050292969,3.7148373126983643,40.29710006713867,4.710922718048096,42.89520263671875,6.105442523956299,45.253936767578125,8.45276927947998,47.5704231262207,10.840720176696777,49.39479446411133,13.269293785095215,50.72705078125,15.738492012023926,51.56719207763672,18.248313903808594,51.915218353271484,18.7734375,51.92578125,21.87710189819336,51.72084045410156,24.703197479248047,51.10601806640625,27.25172233581543,50.0813102722168,29.52267837524414,48.646724700927734,31.40683364868164,46.456634521484375,32.97002410888672,44.11880111694336,34.212249755859375,41.63322067260742,35.133514404296875,38.99989700317383,35.73381423950195,36.21882629394531,36.01314926147461,33.29001235961914,36.03515625,32.16796875,36.03515625,19.96875,35.885276794433594,16.642547607421875,35.435638427734375,13.59611988067627,34.686241149902344,10.8294677734375,33.6370849609375,8.34259033203125,32.28816604614258,6.135488033294678,30.066654205322266,3.964623212814331,27.738887786865234,2.2044835090637207,25.30486488342285,.8550683259963989,22.764589309692383,-.08362190425395966,20.118059158325195,-.6115872859954834,17.96484375,-.73828125,15.23583984375,-.61083984375,12.462890625,-.228515625,9.81298828125,.41748046875,7.453125,1.3359375,7.453125,1.3359375,8.5078125,6.64453125,10.62158203125,5.71728515625,12.814453125,5.115234375,15.21826171875,4.78564453125,17.96484375,4.67578125,19.0546875,22.5703125,19.0546875,22.5703125,22.15691566467285,22.88543701171875,24.769695281982422,23.830808639526367,27.256725311279297,25.793380737304688,28.883312225341797,27.970977783203125,29.109375,28.44140625,29.109375,32.87109375,28.917926788330078,36.28435516357422,28.34358024597168,39.213134765625,27.386337280273438,41.657432556152344,25.37175941467285,43.94849395751953,23.127288818359375,45.50687026977539,20.652921676635742,46.33256530761719,18.984375,46.4765625,16.33090591430664,46.012935638427734,13.984920501708984,44.62206268310547,12.139910697937012,42.07911682128906,10.835031509399414,39.48687744140625,10.070281982421875,36.84534454345703,9.84375,34.3828125,10.09748363494873,31.21339988708496,10.858684539794922,28.454280853271484,12.127352714538574,26.105453491210938,14.162574768066406,24.085222244262695,16.57485580444336,22.90838050842285],indices:[60,63,61,63,65,64,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,89,25,88,25,89,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,63,60,63,66,65,10,14,12,14,18,16,18,22,20,22,89,24,87,25,88,25,29,27,29,33,31,33,37,35,37,41,39,41,45,43,45,49,47,49,53,51,53,57,55,57,63,59,63,67,66,10,18,14,18,89,22,86,25,87,25,33,29,33,41,37,41,49,45,49,57,53,57,67,63,18,90,89,85,25,86,57,1,67,18,91,90,85,33,25,57,2,1,18,92,91,84,33,85,57,3,2,18,93,92,83,33,84,49,3,57,18,94,93,82,33,83,49,4,3,18,70,94,81,33,82,49,5,4,10,70,18,80,33,81,49,6,5,10,71,70,80,41,33,49,7,6,10,72,71,79,41,80,41,7,49,10,73,72,78,41,79,41,8,7,10,74,73,77,41,78,41,9,8,10,75,74,76,41,77,41,10,9,75,41,76,41,75,10],width:33.1171875},".":{positions:[12.5859375,7.1015625,12.5859375,0,5.66015625,0,5.66015625,7.1015625],indices:[3,1,0,1,3,2],width:6.92578125},m:{positions:[5.02734375,38.0390625,11.21484375,38.0390625,11.70703125,33.046875,13.634581565856934,35.28191375732422,15.986680030822754,37.00302505493164,18.700471878051758,38.111698150634766,21.567134857177734,38.6696662902832,23.09765625,38.7421875,26.139192581176758,38.42292022705078,28.791221618652344,37.465118408203125,31.15591812133789,35.599586486816406,32.90284729003906,33.37240219116211,33.71484375,31.7109375,35.408084869384766,34.171592712402344,37.503177642822266,36.16951370239258,40.22900390625,37.6488037109375,42.961280822753906,38.50468063354492,45.3515625,38.7421875,48.32835006713867,38.446842193603516,50.9460334777832,37.5608024597168,53.204620361328125,36.084068298339844,54.8843879699707,33.86517333984375,56.19401931762695,31.434070587158203,57.133506774902344,28.79076385498047,57.70286178588867,25.93524932861328,57.90207290649414,22.867528915405273,57.90234375,22.74609375,57.90234375,0,50.9765625,0,50.9765625,22.81640625,50.74445724487305,26.319555282592773,50.04814529418945,29.033550262451172,47.956382751464844,31.33014678955078,45.659942626953125,32.691036224365234,43.27734375,33.1171875,40.4267463684082,32.6451530456543,38.09538650512695,31.229045867919922,36.33670425415039,28.815231323242188,35.26606750488281,26.190664291381836,34.9453125,24.43359375,34.9453125,24.15234375,34.9453125,0,27.984375,0,27.984375,22.81640625,27.73810386657715,26.2243709564209,26.99928855895996,28.921852111816406,24.89556121826172,31.278352737426758,22.623031616210938,32.67652893066406,20.28515625,33.1171875,17.40234375,32.7919921875,15.08203125,31.81640625,13.2802734375,30.251953125,11.953125,28.16015625,11.953125,28.16015625,11.953125,0,5.02734375,0],indices:[55,1,0,2,4,3,4,6,5,6,8,7,8,10,9,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,40,42,41,54,1,55,2,6,4,6,10,8,12,16,14,16,20,18,20,24,22,24,28,26,39,42,40,54,2,1,2,10,6,12,20,16,20,28,24,38,42,39,20,29,28,38,43,42,20,30,29,37,43,38,20,31,30,36,43,37,20,32,31,36,44,43,20,33,32,35,44,36,20,34,33,35,45,44,12,34,20,12,35,34,12,45,35,10,45,12,10,46,45,10,47,46,10,48,47,2,48,10,2,49,48,2,50,49,2,51,50,2,53,51,53,2,54],width:52.875},c:{positions:[20.49609375,4.67578125,20.49609375,4.67578125,23.36757469177246,5.087423801422119,25.919267654418945,6.322350978851318,28.055252075195312,8.557517051696777,29.08038330078125,10.95840835571289,29.1796875,12.0234375,35.40234375,12.0234375,35.47265625,11.8125,35.209197998046875,9.178794860839844,34.224666595458984,6.713964939117432,32.519065856933594,4.418010711669922,29.943574905395508,2.4374680519104004,27.361528396606445,.9345490336418152,24.772926330566406,-.0907462015748024,22.177766799926758,-.6384177803993225,20.49609375,-.73828125,17.386640548706055,-.5293084979057312,14.578433990478516,.09760986268520355,12.071474075317383,1.142473816871643,9.86575984954834,2.605283260345459,7.9612932205200195,4.4860382080078125,6.3618083000183105,6.765913009643555,5.107275009155273,9.241913795471191,4.197693824768066,11.914040565490723,3.633063793182373,14.782294273376465,3.4133858680725098,17.8466739654541,3.41015625,18.28125,3.41015625,19.7578125,3.5838754177093506,22.87480926513672,4.105032920837402,25.780019760131836,4.973628997802734,28.473445892333984,6.189663410186768,30.95508575439453,7.753136157989502,33.22494125366211,9.646564483642578,35.16857147216797,11.828062057495117,36.69178771972656,14.297628402709961,37.79460144042969,17.05526351928711,38.47700500488281,20.100967407226562,38.73899841308594,20.49609375,38.7421875,23.570213317871094,38.5140495300293,26.36119842529297,37.82963943481445,28.869049072265625,36.6889533996582,31.093765258789062,35.09199523925781,33.085479736328125,32.87481689453125,34.484825134277344,30.467679977416992,35.29180145263672,27.87058448791504,35.5078125,25.13671875,35.4375,24.92578125,29.1796875,24.92578125,28.72093391418457,27.737882614135742,27.34467315673828,30.163320541381836,24.98297119140625,32.04195022583008,22.43872833251953,33.074039459228516,20.49609375,33.29296875,17.510202407836914,32.94111633300781,15.082853317260742,31.88556480407715,13.214049339294434,30.12630844116211,11.89155101776123,27.541250228881836,10.979540824890137,24.808610916137695,10.478017807006836,21.928388595581055,10.37109375,19.7578125,10.37109375,18.28125,10.565627098083496,15.065240859985352,11.149227142333984,12.176401138305664,12.121894836425781,9.614731788635254,13.855029106140137,7.324370861053467,15.960027694702148,5.741883754730225,18.4368896484375,4.867271423339844],indices:[5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,4,7,5,7,11,9,11,15,13,15,19,17,19,23,21,23,27,25,27,31,29,31,35,33,35,39,37,39,43,41,43,47,45,47,50,49,3,7,4,7,15,11,15,23,19,23,31,27,31,39,35,39,47,43,47,51,50,3,15,7,39,51,47,2,15,3,39,52,51,39,53,52,39,54,53,39,55,54,31,55,39,31,56,55,31,57,56,31,58,57,23,58,31,23,59,58,23,60,59,23,61,60,23,62,61,23,63,62,23,64,63,23,65,64,23,66,65,15,66,23,15,67,66,15,68,67,15,1,68,1,15,2],width:32.09765625},k:{positions:[28.828125,0,16.48828125,17.54296875,11.98828125,17.54296875,11.98828125,0,5.0625,0,5.0625,54.84375,11.98828125,54.84375,11.98828125,23.0625,16.41796875,23.0625,26.82421875,38.0390625,35.12109375,38.0390625,22.11328125,20.7421875,36.984375,0],indices:[12,1,0,2,4,3,4,6,5,8,10,9,11,1,12,4,7,6,8,11,10,11,2,1,2,7,4,7,11,8,11,7,2],width:31.921875},t:{positions:[0,0,30,0],indices:[0,2,1],width:30}," ":{width:16,positions:[],indices:[]}};function J$t({text:t,size:e=1,zOffset:i=0}){const r=[],o=[];let n=0,s=0;const a=10;e/=100;for(const l of t){const c=W$t[l];if(!c)throw new Error("Unknown character: "+l);const d=s;for(let h=0;h<c.positions.length;h+=2)r.push(c.positions[h]*e+d,c.positions[h+1]*e,i);const u=n===0?0:n+1;for(const h of c.indices)o.push(h+u),n=Math.max(n,h+u);s+=(c.width+a)*e}return{positions:r,indices:o,primitive:"triangles"}}function ghe(t,{content:e,size:i,matrix:r,offset:o=0}){const{material:n,origin:s,plugin:a}=t,{textSizeRatio:l,textBottomMarginRatio:c,xeokitSdk:d,viewer:u}=a,{Mesh:h,VBOGeometry:p,math:g}=d,{scene:f}=u,{primitive:m,positions:A,indices:v}=J$t({text:e,size:i*l,zOffset:o});let y=A[0],b=A[0];for(let B=0;B<A.length;B+=3){const S=A[B];S<y&&(y=S),S>b&&(b=S)}const w=-(b-y)/2,C=g.mat4(),M=g.translationMat4v([w,i*c,0]);g.mulMat4(r,g.rotationMat4v(Math.PI,[0,1,0],g.mat4()),C),g.mulMat4(r,M),g.mulMat4(C,M);const E=new p(f,{primitive:m,positions:A,indices:v});return[new h(f,{geometry:E,material:n,pickable:!1,origin:s,matrix:r}),new h(f,{geometry:E,material:n,pickable:!1,origin:s,matrix:C})]}class Z$t{constructor(e,i,r){this.plugin=e;const{viewer:o}=e;this.line=null,this.texts=null,this.length=0;const{math:n,worldToRTCPos:s,Node:a,PhongMaterial:l}=e.xeokitSdk,c=n.vec3(),d=n.vec3();s(i,d,c),this.material=new l(o.scene,{emissive:NA(e.defaultColor)}),this.node=new a(o.scene,{pickable:!1,origin:d,children:[]}),this.origin=d,this.p1=c,this.normal=r}move(e,i){const{arrowSizeRatio:r,offsetRatio:o,xeokitSdk:n,viewer:s}=this.plugin,{math:a,Mesh:l,VBOGeometry:c}=n,{scene:d}=s,u=this.p1;this.p2=a.subVec3(e,this.origin),this.node.removeChildren(),this.line?.destroy();const h=a.subVec3(e,u,a.vec3());if(h.every(ee=>ee===0))return;const p=a.normalizeVec3(h,a.vec3()),g=a.mulVec3Scalar(p,-1,a.vec3()),f=a.lenVec3(h);this.length=f;const m=o*f;let A=0;const v=a.mulVec3Scalar(h,.5,a.vec3()),y=a.addVec3(u,v,a.vec3());let b=a.normalizeVec3(a.cross3Vec3(i,a.normalizeVec3(h,a.vec3()),a.vec3()));const w=a.dotVec3(i,this.normal)>.999,C=a.vec3([0,1,0]),M=a.dotVec3(p,C);if(w){const ee=Math.abs(M)<.01;A=m;let $=null;if(ee){const{look:re,up:ie,eye:fe}=d.camera,de=a.normalizeVec3(a.subVec3(re,fe,a.vec3())),Ae=a.cross3Vec3(de,ie);$=a.dotVec3(p,Ae)}else{const re=a.cross3Vec3(C,i,a.vec3());$=a.dotVec3(p,re)}$<0&&(b=a.negateVec3(b),A=-A)}else if(Math.abs(M)>.99){const{look:ee,eye:$}=d.camera,re=a.normalizeVec3(a.subVec3(ee,$,a.vec3()));b=a.normalizeVec3(a.cross3Vec3(p,re,a.vec3())),i=a.normalizeVec3(a.cross3Vec3(b,p,a.vec3()))}else i=a.normalizeVec3(a.cross3Vec3(C,p,a.vec3())),b=a.normalizeVec3(a.cross3Vec3(p,i,a.vec3())),a.dotVec3(b,C)<0&&(b=a.negateVec3(b));const E=a.negateVec3(b,a.vec3()),B=a.mulVec3Scalar(b,f*r,a.vec3()),S=a.mulVec3Scalar(E,f*r,a.vec3()),I=a.addVec3(u,B,a.vec3()),T=a.addVec3(u,S,a.vec3()),_=a.addVec3(e,B,a.vec3()),O=a.addVec3(e,S,a.vec3()),j=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(b,p,a.vec3())),f*r*Math.SQRT2),N=a.addVec3(u,j,a.vec3()),G=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(E,p,a.vec3())),f*r*Math.SQRT2),q=a.addVec3(u,G,a.vec3()),X=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(b,g,a.vec3())),f*r*Math.SQRT2),me=a.addVec3(e,X,a.vec3()),ce=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(E,g,a.vec3())),f*r*Math.SQRT2),xe=a.addVec3(e,ce,a.vec3()),Re=a.translationMat4v(a.mulVec3Scalar(i,m,a.vec3()));this.line=new l(s.scene,{geometry:new c(s.scene,{primitive:"lines",positions:[...u,...e,...I,...T,..._,...O,...N,...q,...me,...xe],indices:[0,1,0,2,0,3,0,6,0,7,1,4,1,5,1,8,1,9]}),material:this.material,matrix:Re,pickable:!1,origin:this.origin}),this.node.addChild(this.line),this.texts?.forEach(ee=>ee.destroy());const ge=a.mat4([...p,0,...b,0,...i,0,...y,1]);this.texts=this._makeTexts(f.toFixed(2)+" m",f,ge,A),this.texts.forEach(ee=>this.node.addChild(ee))}_makeTexts(e,i,r,o=0){return ghe(this,{content:e,size:i,matrix:r,offset:o})}destroy(){this.node.destroy(),this.line?.destroy(),this.texts?.forEach(e=>e.destroy()),this.plugin.measurements=this.plugin.measurements.filter(e=>e!==this)}get visible(){return this.node.visible}set visible(e){this.node.visible=e}get color(){return hhe(this.material.emissive)}set color(e=this.plugin.defaultColor){this.material.emissive=NA(e)}}class Ahe{constructor(e,i,r={}){this.viewer=e,this.xeokitSdk=i,this.arrowSizeRatio=r.arrowSizeRatio??.04,this.textSizeRatio=r.textSizeRatio??.1,this.textBottomMarginRatio=r.textBottomMarginRatio??.02,this.offsetRatio=r.offsetRatio??.003,this.snapPickRadius=r.snapPickRadius??15,this.defaultColor=r.defaultColor??"#ffffff";const o=document.createElement("img"),n=e.scene.canvas.canvas;n.parentNode.insertBefore(o,n),o.style.width="28px",o.style.height="28px",o.style.position="absolute",o.style.pointerEvents="none",o.style.transform="translate(-50%, -50%)",o.style.display="none",this.imgElement=o,this.measurements=[],this.measurementEndCallbackId=0,this.measurementEndCallbacks={},this.control=new X$t(this)}on(e,i){if(e==="measurementEnd")return this.measurementEndCallbacks[this.measurementEndCallbackId++]=i,this.measurementEndCallbackId}off(e){this.measurementEndCallbacks[e]=null}}class X$t{constructor(e){this.plugin=e,this.currentMeasurement=null,this.lastPosition=null,this.mouseDown=!1,this.dragging=!1,this.activated=!1}_updateCursor(e){const{imgElement:i,viewer:r}=this.plugin,{scene:o}=r;o.canvas.canvas.style.cursor=`url("${K$t}") 16 16, auto`;const n=o.pick({canvasPos:e,snapRadius:this.plugin.snapPickRadius,snapToEdge:!0,snapToVertex:!0});if(n?.snappedWorldPos||n?.worldPos){if(n.snappedCanvasPos)i.style.left=`${n.snappedCanvasPos[0]}px`,i.style.top=`${n.snappedCanvasPos[1]}px`,i.src=n.snapType==="vertex"?q$t:V$t;else{const s=n.canvasPos;i.style.left=`${s[0]}px`,i.style.top=`${s[1]}px`,i.src=G$t}this.lastPosition=n.snappedWorldPos??n.worldPos,this.lastPosition.worldNormal=n.snappedWorldNormal??n.worldNormal}else i.style.left=`${e[0]}px`,i.style.top=`${e[1]}px`,i.src=Q$t,this.lastPosition=null}_onMouseMove(e){this.mouseDown&&(this.dragging=!0),e.preventDefault(),this._updateCursor([e.offsetX,e.offsetY]),this.lastPosition&&this.currentMeasurement?.move(this.lastPosition,this.lastPosition.worldNormal)}_onMouseDown(){this.mouseDown=!0}_onMouseUp(){this.mouseDown=!1;const e=this.dragging;this.dragging=!1,!e&&this.lastPosition&&(this.currentMeasurement?(this.plugin.measurements.push(this.currentMeasurement),Object.values(this.plugin.measurementEndCallbacks).forEach(i=>i?.(this.currentMeasurement)),this.currentMeasurement=null):this.currentMeasurement=new Z$t(this.plugin,this.lastPosition,this.lastPosition.worldNormal))}activate(){if(this.activated)return;const{canvas:e}=this.plugin.viewer.scene.canvas;this.plugin.imgElement.style.display="block";const i=this._onMouseMove.bind(this),r=this._onMouseDown.bind(this),o=this._onMouseUp.bind(this);e.addEventListener("mousemove",i),e.addEventListener("mousedown",r),document.addEventListener("mouseup",o),this._unsubscribe=()=>{e.removeEventListener("mousemove",i),e.removeEventListener("mousedown",r),document.removeEventListener("mouseup",o)},this.activated=!0}deactivate(){this.activated&&(this._unsubscribe?.(),this.currentMeasurement?.destroy(),this.currentMeasurement=null,this.lastPosition=null,this.plugin.imgElement.style.display="none",this.activated=!1)}}class Y$t{constructor(e,i){this.plugin=e;const{xeokitSdk:r,viewer:o}=e,{Mesh:n,ReadableGeometry:s,buildSphereGeometry:a,PhongMaterial:l,Node:c,math:d,worldToRTCPos:u}=r,h=d.vec3(),p=d.vec3();this._length=0;const{entity:g,worldPos:f}=i;u(f,p,h);const m=new l(o.scene,{emissive:NA(e.defaultColor),diffuse:[0,0,0]}),A=(C=!0)=>new n(o.scene,{geometry:new s(o.scene,a({radius:.03})),material:m,pickable:!1,visible:C,origin:p}),v=A(),y=A(!1),b=new n(o.scene,{geometry:new s(o.scene,{primitive:"lines",positions:[0,0,0,0,0,0],indices:[0,1]}),material:m,pickable:!1,visible:!1,origin:p}),w=new c(o.scene,{pickable:!1,visible:!0,position:h,origin:p,children:[v,b,y]});this.origin=p,this.modelId=g.model.id,this.node=w,this.toSphere=y,this.fromSphere=v,this.line=b,this.material=m}show(e){const{node:i,fromSphere:r,toSphere:o,line:n,texts:s,plugin:a}=this,{math:l}=a.xeokitSdk;i.position=l.subVec3(e.worldPos,i.origin,l.vec3()),i.visible=!0;const{viewer:c}=a,d=c.scene.pick({pickSurface:!0,origin:e.worldPos,direction:e.worldNormal});if(s&&(s.forEach(u=>u.destroy()),this.texts=null),d){o.visible=!0,n.visible=!0,o.position=l.subVec3(d.worldPos,o.origin,l.vec3()),o.position=l.subVec3(o.position,i.position,l.vec3()),n.position=l.vec3().set(i.position),n.geometry.positions=[0,0,0,...o.position];const u=l.lenVec3(o.position);this._length=u;const h=r.position,p=o.position,g=l.subVec3(p,h,l.vec3()),f=l.normalizeVec3(g,l.vec3()),m=l.mulVec3Scalar(g,.5,l.vec3()),A=l.addVec3(h,m,l.vec3()),v=[0,1,0],y=l.dotVec3(f,v),b=Math.abs(y)>.9;let w;if(b){const C=l.normalizeVec3(l.subVec3(c.scene.camera.eye,c.scene.camera.look,l.vec3()),l.vec3()),M=l.normalizeVec3(l.cross3Vec3(C,f,l.vec3()),l.vec3()),E=l.normalizeVec3(l.cross3Vec3(M,f,l.vec3()),l.vec3());w=l.mat4([...f,0,...M,0,...E,0,...A,1])}else{const C=l.normalizeVec3(l.cross3Vec3(v,f,l.vec3()),l.vec3()),M=l.normalizeVec3(l.cross3Vec3(f,C,l.vec3()),l.vec3());w=l.mat4([...f,0,...M,0,...C,0,...A,1])}this.texts=this._makeTexts(u.toFixed(2)+" m",u,w),this.texts.forEach(C=>i.addChild(C))}else o.visible=!1,n.visible=!1,this._length=0}hide(){this.node.visible=!1}destroy(){this.node.destroy(),this.line.destroy(),this.fromSphere.destroy(),this.toSphere.destroy(),this.texts?.forEach(e=>e.destroy())}set length(e){this._length=e}get length(){return this.visible?this._length:0}get visible(){return this.node.visible===!0}set visible(e){this.node.visible=!!e}get color(){return hhe(this.material.emissive)}set color(e=this.plugin.defaultColor){this.material.emissive=NA(e)}_makeTexts(e,i,r){return ghe(this,{content:e,size:i,matrix:r})}}class mhe{constructor(e,i,r={}){this.viewer=e,this.xeokitSdk=i,this.textSizeRatio=r.textSizeRatio??.1,this.textBottomMarginRatio=r.textBottomMarginRatio??.01,this.defaultColor=r.defaultColor??"#ffffff",this.measurements=[],this.measurementEndCallbackId=0,this.measurementEndCallbacks={},this.control=new $$t(this)}on(e,i){if(e==="measurementEnd")return this.measurementEndCallbacks[this.measurementEndCallbackId++]=i,this.measurementEndCallbackId}off(e){this.measurementEndCallbacks[e]=null}}class $$t{constructor(e){this.plugin=e,this.currentMeasure=null,this.pickedSpaceMeasureSubscription=null,this.hitHelperMouseMoveSubscription=null}activate(){const{plugin:e}=this,{viewer:i}=e;this.pickedSpaceMeasureSubscription=i.scene.input.on("mouseclicked",()=>{if(!this.currentMeasure?.length)return;const r=this.currentMeasure;this.currentMeasure=null,Object.values(this.plugin.measurementEndCallbacks).forEach(o=>o(r))}),this.hitHelperMouseMoveSubscription=i.scene.input.on("mousemove",r=>{const o=i.scene.pick({canvasPos:r,pickSurface:!0});o?.entity?.model&&(o?((!this.currentMeasure||this.currentMeasure.modelId!==o.entity.model.id)&&(this.currentMeasure?.destroy(),this.currentMeasure=new Y$t(this.plugin,o)),this.currentMeasure.show(o)):this.currentMeasure?.hide())})}deactivate(){const{viewer:e}=this.plugin;this.currentMeasure?.destroy(),this.currentMeasure=null,e.scene.input.off(this.pickedSpaceMeasureSubscription),e.scene.input.off(this.hitHelperMouseMoveSubscription)}}const eei=`onmessage = async event => {
1384
+ }`}function wde(t,e=!0,i){const r=i||new Set;if(t){if(Cde(t))r.add(t);else if(Cde(t.buffer))r.add(t.buffer);else if(!ArrayBuffer.isView(t)&&e&&typeof t=="object")for(const o in t)wde(t[o],e,r)}return i===void 0?Array.from(r):[]}function Cde(t){return t?t instanceof ArrayBuffer||typeof MessagePort<"u"&&t instanceof MessagePort||typeof ImageBitmap<"u"&&t instanceof ImageBitmap||typeof OffscreenCanvas<"u"&&t instanceof OffscreenCanvas:!1}const IU=()=>{};class SU{name;source;url;terminated=!1;worker;onMessage;onError;_loadableURL="";static isSupported(){return typeof Worker<"u"&&Ec||typeof BU<"u"&&!Ec}constructor(e){const{name:i,source:r,url:o}=e;Hh(r||o),this.name=i,this.source=r,this.url=o,this.onMessage=IU,this.onError=n=>console.log(n),this.worker=Ec?this._createBrowserWorker():this._createNodeWorker()}destroy(){this.onMessage=IU,this.onError=IU,this.worker.terminate(),this.terminated=!0}get isRunning(){return!!this.onMessage}postMessage(e,i){i=i||wde(e),this.worker.postMessage(e,i)}_getErrorFromErrorEvent(e){let i="Failed to load ";return i+=`worker ${this.name} from ${this.url}. `,e.message&&(i+=`${e.message} in `),e.lineno&&(i+=`:${e.lineno}:${e.colno}`),new Error(i)}_createBrowserWorker(){this._loadableURL=Wqt({source:this.source,url:this.url});const e=new Worker(this._loadableURL,{name:this.name});return e.onmessage=i=>{i.data?this.onMessage(i.data):this.onError(new Error("No data received"))},e.onerror=i=>{this.onError(this._getErrorFromErrorEvent(i)),this.terminated=!0},e.onmessageerror=i=>console.error(i),e}_createNodeWorker(){let e;if(this.url){const i=this.url.includes(":/")||this.url.startsWith("/")?this.url:`./${this.url}`;e=new BU(i,{eval:!1})}else if(this.source)e=new BU(this.source,{eval:!0});else throw new Error("no worker");return e.on("message",i=>{this.onMessage(i)}),e.on("error",i=>{this.onError(i)}),e.on("exit",i=>{}),e}}class Xqt{name="unnamed";source;url;maxConcurrency=1;maxMobileConcurrency=1;onDebug=()=>{};reuseWorkers=!0;props={};jobQueue=[];idleQueue=[];count=0;isDestroyed=!1;static isSupported(){return SU.isSupported()}constructor(e){this.source=e.source,this.url=e.url,this.setProps(e)}destroy(){this.idleQueue.forEach(e=>e.destroy()),this.isDestroyed=!0}setProps(e){this.props={...this.props,...e},e.name!==void 0&&(this.name=e.name),e.maxConcurrency!==void 0&&(this.maxConcurrency=e.maxConcurrency),e.maxMobileConcurrency!==void 0&&(this.maxMobileConcurrency=e.maxMobileConcurrency),e.reuseWorkers!==void 0&&(this.reuseWorkers=e.reuseWorkers),e.onDebug!==void 0&&(this.onDebug=e.onDebug)}async startJob(e,i=(o,n,s)=>o.done(s),r=(o,n)=>o.error(n)){const o=new Promise(n=>(this.jobQueue.push({name:e,onMessage:i,onError:r,onStart:n}),this));return this._startQueuedJob(),await o}async _startQueuedJob(){if(!this.jobQueue.length)return;const e=this._getAvailableWorker();if(!e)return;const i=this.jobQueue.shift();if(i){this.onDebug({message:"Starting job",name:i.name,workerThread:e,backlog:this.jobQueue.length});const r=new Kqt(i.name,e);e.onMessage=o=>i.onMessage(r,o.type,o.payload),e.onError=o=>i.onError(r,o),i.onStart(r);try{await r.result}catch(o){console.error(`Worker exception: ${o}`)}finally{this.returnWorkerToQueue(e)}}}returnWorkerToQueue(e){!Ec||this.isDestroyed||!this.reuseWorkers||this.count>this._getMaxConcurrency()?(e.destroy(),this.count--):this.idleQueue.push(e),this.isDestroyed||this._startQueuedJob()}_getAvailableWorker(){if(this.idleQueue.length>0)return this.idleQueue.shift()||null;if(this.count<this._getMaxConcurrency()){this.count++;const e=`${this.name.toLowerCase()} (#${this.count} of ${this.maxConcurrency})`;return new SU({name:e,source:this.source,url:this.url})}return null}_getMaxConcurrency(){return Qqt?this.maxMobileConcurrency:this.maxConcurrency}}const Yqt={maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:!0,onDebug:()=>{}};class b0{props;workerPools=new Map;static _workerFarm;static isSupported(){return SU.isSupported()}static getWorkerFarm(e={}){return b0._workerFarm=b0._workerFarm||new b0({}),b0._workerFarm.setProps(e),b0._workerFarm}constructor(e){this.props={...Yqt},this.setProps(e),this.workerPools=new Map}destroy(){for(const e of this.workerPools.values())e.destroy();this.workerPools=new Map}setProps(e){this.props={...this.props,...e};for(const i of this.workerPools.values())i.setProps(this._getWorkerPoolProps())}getWorkerPool(e){const{name:i,source:r,url:o}=e;let n=this.workerPools.get(i);return n||(n=new Xqt({name:i,source:r,url:o}),n.setProps(this._getWorkerPoolProps()),this.workerPools.set(i,n)),n}_getWorkerPoolProps(){return{maxConcurrency:this.props.maxConcurrency,maxMobileConcurrency:this.props.maxMobileConcurrency,reuseWorkers:this.props.reuseWorkers,onDebug:this.props.onDebug}}}function $qt(t,e={}){const i=e[t.id]||{},r=Ec?`${t.id}-worker.js`:`${t.id}-worker-node.js`;let o=i.workerUrl;if(!o&&t.id==="compression"&&(o=e.workerUrl),e._workerType==="test"&&(Ec?o=`modules/${t.module}/dist/${r}`:o=`modules/${t.module}/src/workers/${t.id}-worker-node.ts`),!o){let n=t.version;n==="latest"&&(n=qqt);const s=n?`@${n}`:"";o=`https://unpkg.com/@loaders.gl/${t.module}${s}/dist/${r}`}return Hh(o),o}function eGt(t,e=vde){Hh(t,"no worker provided");const i=t.version;return!(!e||!i)}const TU={};async function Tf(t,e=null,i={},r=null){return e&&(t=tGt(t,e,i,r)),TU[t]=TU[t]||iGt(t),await TU[t]}function tGt(t,e,i={},r=null){if(!i.useLocalLibraries&&t.startsWith("http"))return t;r=r||t;const o=i.modules||{};return o[r]?o[r]:Ec?i.CDN?(Hh(i.CDN.startsWith("http")),`${i.CDN}/${e}@${vde}/dist/libs/${r}`):EU?`../src/libs/${r}`:`modules/${e}/src/libs/${r}`:`modules/${e}/dist/libs/${r}`}async function iGt(t){if(t.endsWith("wasm"))return await oGt(t);if(!Ec)try{const{requireFromFile:i}=globalThis.loaders||{};return await i?.(t)}catch(i){return console.error(i),null}if(EU)return importScripts(t);const e=await nGt(t);return rGt(e,t)}function rGt(t,e){if(!Ec){const{requireFromString:r}=globalThis.loaders||{};return r?.(t,e)}if(EU)return eval.call(globalThis,t),null;const i=document.createElement("script");i.id=e;try{i.appendChild(document.createTextNode(t))}catch{i.text=t}return document.body.appendChild(i),null}async function oGt(t){const{readFileAsArrayBuffer:e}=globalThis.loaders||{};return Ec||!e||t.startsWith("http")?await(await fetch(t)).arrayBuffer():await e(t)}async function nGt(t){const{readFileAsText:e}=globalThis.loaders||{};return Ec||!e||t.startsWith("http")?await(await fetch(t)).text():await e(t)}function sGt(t,e){return!b0.isSupported()||!Ec&&!e?._nodeWorkers?!1:t.worker&&e?.worker}async function aGt(t,e,i,r,o){const n=t.id,s=$qt(t,i),a=b0.getWorkerFarm(i).getWorkerPool({name:n,url:s});i=JSON.parse(JSON.stringify(i)),r=JSON.parse(JSON.stringify(r||{}));const l=await a.startJob("process-on-worker",lGt.bind(null,o));return l.postMessage("process",{input:e,options:i,context:r}),await(await l.result).result}async function lGt(t,e,i,r){switch(i){case"done":e.done(r);break;case"error":e.error(new Error(r.error));break;case"process":const{id:o,input:n,options:s}=r;try{const a=await t(n,s);e.postMessage("done",{id:o,result:a})}catch(a){const l=a instanceof Error?a.message:"unknown error";e.postMessage("error",{id:o,error:l})}break;default:console.warn(`parse-with-worker unknown message ${i}`)}}function cGt(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?xde(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?xde(t,0,e):""}function xde(t,e,i){if(t.byteLength<=e+i)return"";const r=new DataView(t);let o="";for(let n=0;n<i;n++)o+=String.fromCharCode(r.getUint8(e+n));return o}function dGt(t){try{return JSON.parse(t)}catch{throw new Error(`Failed to parse JSON from data starting with "${cGt(t)}"`)}}function uGt(t,e,i){if(i=i||t.byteLength,t.byteLength<i||e.byteLength<i)return!1;const r=new Uint8Array(t),o=new Uint8Array(e);for(let n=0;n<r.length;++n)if(r[n]!==o[n])return!1;return!0}function hGt(...t){return pGt(t)}function pGt(t){const e=t.map(n=>n instanceof ArrayBuffer?new Uint8Array(n):n),i=e.reduce((n,s)=>n+s.byteLength,0),r=new Uint8Array(i);let o=0;for(const n of e)r.set(n,o),o+=n.byteLength;return r.buffer}function kde(t,e,i){const r=i!==void 0?new Uint8Array(t).subarray(e,e+i):new Uint8Array(t).subarray(e);return new Uint8Array(r).buffer}function g7(t,e){return jh(t>=0),jh(e>0),t+(e-1)&-4}function fGt(t,e,i){let r;if(t instanceof ArrayBuffer)r=new Uint8Array(t);else{const o=t.byteOffset,n=t.byteLength;r=new Uint8Array(t.buffer||t.arrayBuffer,o,n)}return e.set(r,i),i+g7(r.byteLength,4)}async function gGt(t){const e=[];for await(const i of t)e.push(i);return hGt(...e)}let AGt="";const Mde={};function mGt(t){for(const e in Mde)if(t.startsWith(e)){const i=Mde[e];t=t.replace(e,i)}return!t.startsWith("http://")&&!t.startsWith("https://")&&(t=`${AGt}${t}`),t}function vGt(t){return t&&typeof t=="object"&&t.isBuffer}function Ede(t){if(vGt(t)||t instanceof ArrayBuffer)return t;if(ArrayBuffer.isView(t))return t.byteOffset===0&&t.byteLength===t.buffer.byteLength?t.buffer:t.buffer.slice(t.byteOffset,t.byteOffset+t.byteLength);if(typeof t=="string"){const e=t;return new TextEncoder().encode(e).buffer}if(t&&typeof t=="object"&&t._toArrayBuffer)return t._toArrayBuffer();throw new Error("toArrayBuffer")}function Bde(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(e+1):""}function yGt(t){const e=t?t.lastIndexOf("/"):-1;return e>=0?t.substr(0,e):""}const bGt=t=>typeof t=="boolean",A7=t=>typeof t=="function",m7=t=>t!==null&&typeof t=="object",Pde=t=>m7(t)&&t.constructor==={}.constructor,wGt=t=>!!t&&typeof t[Symbol.iterator]=="function",CGt=t=>t&&typeof t[Symbol.asyncIterator]=="function",Rf=t=>typeof Response<"u"&&t instanceof Response||t&&t.arrayBuffer&&t.text&&t.json,TA=t=>typeof Blob<"u"&&t instanceof Blob,xGt=t=>t&&typeof t=="object"&&t.isBuffer,kGt=t=>typeof ReadableStream<"u"&&t instanceof ReadableStream||m7(t)&&A7(t.tee)&&A7(t.cancel)&&A7(t.getReader),MGt=t=>m7(t)&&A7(t.read)&&A7(t.pipe)&&bGt(t.readable),Ide=t=>kGt(t)||MGt(t);class EGt extends Error{constructor(e,i){super(e),this.reason=i.reason,this.url=i.url,this.response=i.response}reason;url;response}const BGt=/^data:([-\w.]+\/[-\w.+]+)(;|,)/,PGt=/^([-\w.]+\/[-\w.+]+)/;function Sde(t,e){return t.toLowerCase()===e.toLowerCase()}function IGt(t){const e=PGt.exec(t);return e?e[1]:t}function Tde(t){const e=BGt.exec(t);return e?e[1]:""}const Rde=/\?.*/;function SGt(t){const e=t.match(Rde);return e&&e[0]}function RU(t){return t.replace(Rde,"")}function TGt(t){if(t.length<50)return t;const e=t.slice(t.length-15);return`${t.substr(0,32)}...${e}`}function ME(t){return Rf(t)?t.url:TA(t)?t.name||"":typeof t=="string"?t:""}function DU(t){if(Rf(t)){const e=t,i=e.headers.get("content-type")||"",r=RU(e.url);return IGt(i)||Tde(r)}return TA(t)?t.type||"":typeof t=="string"?Tde(t):""}function RGt(t){return Rf(t)?t.headers["content-length"]||-1:TA(t)?t.size:typeof t=="string"?t.length:t instanceof ArrayBuffer||ArrayBuffer.isView(t)?t.byteLength:-1}async function Dde(t){if(Rf(t))return t;const e={},i=RGt(t);i>=0&&(e["content-length"]=String(i));const r=ME(t),o=DU(t);o&&(e["content-type"]=o);const n=await LGt(t);n&&(e["x-first-bytes"]=n),typeof t=="string"&&(t=new TextEncoder().encode(t));const s=new Response(t,{headers:e});return Object.defineProperty(s,"url",{value:r}),s}async function DGt(t){if(!t.ok)throw await _Gt(t)}async function _Gt(t){const e=TGt(t.url);let i=`Failed to fetch resource (${t.status}) ${t.statusText}: ${e}`;i=i.length>100?`${i.slice(0,100)}...`:i;const r={reason:t.statusText,url:t.url,response:t};try{const o=t.headers.get("Content-Type");r.reason=!t.bodyUsed&&o?.includes("application/json")?await t.json():await t.text()}catch{}return new EGt(i,r)}async function LGt(t){if(typeof t=="string")return`data:,${t.slice(0,5)}`;if(t instanceof Blob){const e=t.slice(0,5);return await new Promise(i=>{const r=new FileReader;r.onload=o=>i(o?.target?.result),r.readAsDataURL(e)})}if(t instanceof ArrayBuffer){const e=t.slice(0,5);return`data:base64,${FGt(e)}`}return null}function FGt(t){let e="";const i=new Uint8Array(t);for(let r=0;r<i.byteLength;r++)e+=String.fromCharCode(i[r]);return btoa(e)}function OGt(t){return!UGt(t)&&!NGt(t)}function UGt(t){return t.startsWith("http:")||t.startsWith("https:")}function NGt(t){return t.startsWith("data:")}async function _de(t,e){if(typeof t=="string"){const i=mGt(t);return OGt(i)&&globalThis.loaders?.fetchNode?globalThis.loaders?.fetchNode(i,e):await fetch(i,e)}return await Dde(t)}const Lde=new kU({id:"loaders.gl"});class jGt{log(){return()=>{}}info(){return()=>{}}warn(){return()=>{}}error(){return()=>{}}}class HGt{console;constructor(){this.console=console}log(...e){return this.console.log.bind(this.console,...e)}info(...e){return this.console.info.bind(this.console,...e)}warn(...e){return this.console.warn.bind(this.console,...e)}error(...e){return this.console.error.bind(this.console,...e)}}const Fde={fetch:null,mimeType:void 0,nothrow:!1,log:new HGt,useLocalLibraries:!1,CDN:"https://unpkg.com/@loaders.gl",worker:!0,maxConcurrency:3,maxMobileConcurrency:1,reuseWorkers:xE,_nodeWorkers:!1,_workerType:"",limit:0,_limitMB:0,batchSize:"auto",batchDebounceMs:0,metadata:!1,transforms:[]},zGt={throws:"nothrow",dataType:"(no longer used)",uri:"baseUri",method:"fetch.method",headers:"fetch.headers",body:"fetch.body",mode:"fetch.mode",credentials:"fetch.credentials",cache:"fetch.cache",redirect:"fetch.redirect",referrer:"fetch.referrer",referrerPolicy:"fetch.referrerPolicy",integrity:"fetch.integrity",keepalive:"fetch.keepalive",signal:"fetch.signal"};function Ode(){globalThis.loaders=globalThis.loaders||{};const{loaders:t}=globalThis;return t._state||(t._state={}),t._state}function Ude(){const t=Ode();return t.globalOptions=t.globalOptions||{...Fde},t.globalOptions}function VGt(t,e,i,r){return i=i||[],i=Array.isArray(i)?i:[i],qGt(t,i),QGt(e,t,r)}function qGt(t,e){Nde(t,null,Fde,zGt,e);for(const i of e){const r=t&&t[i.id]||{},o=i.options&&i.options[i.id]||{},n=i.deprecatedOptions&&i.deprecatedOptions[i.id]||{};Nde(r,i.id,o,n,e)}}function Nde(t,e,i,r,o){const n=e||"Top level",s=e?`${e}.`:"";for(const a in t){const l=!e&&m7(t[a]),c=a==="baseUri"&&!e,d=a==="workerUrl"&&e;if(!(a in i)&&!c&&!d){if(a in r)Lde.warn(`${n} loader option '${s}${a}' no longer supported, use '${r[a]}'`)();else if(!l){const u=GGt(a,o);Lde.warn(`${n} loader option '${s}${a}' not recognized. ${u}`)()}}}}function GGt(t,e){const i=t.toLowerCase();let r="";for(const o of e)for(const n in o.options){if(t===n)return`Did you mean '${o.id}.${n}'?`;const s=n.toLowerCase();(i.startsWith(s)||s.startsWith(i))&&(r=r||`Did you mean '${o.id}.${n}'?`)}return r}function QGt(t,e,i){const r={...t.options||{}};return KGt(r,i),r.log===null&&(r.log=new jGt),jde(r,Ude()),jde(r,e),r}function jde(t,e){for(const i in e)if(i in e){const r=e[i];Pde(r)&&Pde(t[i])?t[i]={...t[i],...e[i]}:t[i]=e[i]}}function KGt(t,e){e&&!("baseUri"in t)&&(t.baseUri=e)}function Hde(t){return t?(Array.isArray(t)&&(t=t[0]),Array.isArray(t?.extensions)):!1}function zde(t){jh(t,"null loader"),jh(Hde(t),"invalid loader");let e;return Array.isArray(t)&&(e=t[1],t=t[0],t={...t,options:{...t.options,...e}}),(t?.parseTextSync||t?.parseText)&&(t.text=!0),t.text||(t.binary=!0),t}const WGt=()=>{const t=Ode();return t.loaderRegistry=t.loaderRegistry||[],t.loaderRegistry};function JGt(){return WGt()}const ZGt=/\.([^.]+)$/;async function XGt(t,e=[],i,r){if(!qde(t))return null;let o=Vde(t,e,{...i,nothrow:!0},r);if(o)return o;if(TA(t)&&(t=await t.slice(0,10).arrayBuffer(),o=Vde(t,e,i,r)),!o&&!i?.nothrow)throw new Error(Gde(t));return o}function Vde(t,e=[],i,r){if(!qde(t))return null;if(e&&!Array.isArray(e))return zde(e);let o=[];e&&(o=o.concat(e)),i?.ignoreRegisteredLoaders||o.push(...JGt()),$Gt(o);const n=YGt(t,o,i,r);if(!n&&!i?.nothrow)throw new Error(Gde(t));return n}function YGt(t,e,i,r){const o=ME(t),n=DU(t),s=RU(o)||r?.url;let a=null,l="";return i?.mimeType&&(a=_U(e,i?.mimeType),l=`match forced by supplied MIME type ${i?.mimeType}`),a=a||eQt(e,s),l=l||(a?`matched url ${s}`:""),a=a||_U(e,n),l=l||(a?`matched MIME type ${n}`:""),a=a||iQt(e,t),l=l||(a?`matched initial data ${Kde(t)}`:""),i?.fallbackMimeType&&(a=a||_U(e,i?.fallbackMimeType),l=l||(a?`matched fallback MIME type ${n}`:"")),l&&jqt.log(1,`selectLoader selected ${a?.name}: ${l}.`),a}function qde(t){return!(t instanceof Response&&t.status===204)}function Gde(t){const e=ME(t),i=DU(t);let r="No valid loader found (";r+=e?`${Bde(e)}, `:"no url provided, ",r+=`MIME type: ${i?`"${i}"`:"not provided"}, `;const o=t?Kde(t):"";return r+=o?` first bytes: "${o}"`:"first bytes: not available",r+=")",r}function $Gt(t){for(const e of t)zde(e)}function eQt(t,e){const i=e&&ZGt.exec(e),r=i&&i[1];return r?tQt(t,r):null}function tQt(t,e){e=e.toLowerCase();for(const i of t)for(const r of i.extensions)if(r.toLowerCase()===e)return i;return null}function _U(t,e){for(const i of t)if(i.mimeTypes?.some(r=>Sde(e,r))||Sde(e,`application/x.${i.id}`))return i;return null}function iQt(t,e){if(!e)return null;for(const i of t)if(typeof e=="string"){if(rQt(e,i))return i}else if(ArrayBuffer.isView(e)){if(Qde(e.buffer,e.byteOffset,i))return i}else if(e instanceof ArrayBuffer&&Qde(e,0,i))return i;return null}function rQt(t,e){return e.testText?e.testText(t):(Array.isArray(e.tests)?e.tests:[e.tests]).some(i=>t.startsWith(i))}function Qde(t,e,i){return(Array.isArray(i.tests)?i.tests:[i.tests]).some(r=>oQt(t,e,i,r))}function oQt(t,e,i,r){if(r instanceof ArrayBuffer)return uGt(r,t,r.byteLength);switch(typeof r){case"function":return r(t);case"string":const o=LU(t,e,r.length);return r===o;default:return!1}}function Kde(t,e=5){return typeof t=="string"?t.slice(0,e):ArrayBuffer.isView(t)?LU(t.buffer,t.byteOffset,e):t instanceof ArrayBuffer?LU(t,0,e):""}function LU(t,e,i){if(t.byteLength<e+i)return"";const r=new DataView(t);let o="";for(let n=0;n<i;n++)o+=String.fromCharCode(r.getUint8(e+n));return o}const nQt=256*1024;function*sQt(t,e){const i=e?.chunkSize||nQt;let r=0;const o=new TextEncoder;for(;r<t.length;){const n=Math.min(t.length-r,i),s=t.slice(r,r+n);r+=n,yield o.encode(s)}}const aQt=256*1024;function*lQt(t,e={}){const{chunkSize:i=aQt}=e;let r=0;for(;r<t.byteLength;){const o=Math.min(t.byteLength-r,i),n=new ArrayBuffer(o),s=new Uint8Array(t,r,o);new Uint8Array(n).set(s),r+=o,yield n}}const cQt=1024*1024;async function*dQt(t,e){const i=e?.chunkSize||cQt;let r=0;for(;r<t.size;){const o=r+i,n=await t.slice(r,o).arrayBuffer();r=o,yield n}}function Wde(t,e){return xE?uQt(t,e):hQt(t)}async function*uQt(t,e){const i=t.getReader();let r;try{for(;;){const o=r||i.read();e?._streamReadAhead&&(r=i.read());const{done:n,value:s}=await o;if(n)return;yield Ede(s)}}catch{i.releaseLock()}}async function*hQt(t,e){for await(const i of t)yield Ede(i)}function pQt(t,e){if(typeof t=="string")return sQt(t,e);if(t instanceof ArrayBuffer)return lQt(t,e);if(TA(t))return dQt(t,e);if(Ide(t))return Wde(t,e);if(Rf(t))return Wde(t.body,e);throw new Error("makeIterator")}const Jde="Cannot convert supplied data type";function fQt(t,e,i){if(e.text&&typeof t=="string")return t;if(xGt(t)&&(t=t.buffer),t instanceof ArrayBuffer){const r=t;return e.text&&!e.binary?new TextDecoder("utf8").decode(r):r}if(ArrayBuffer.isView(t)){if(e.text&&!e.binary)return new TextDecoder("utf8").decode(t);let r=t.buffer;const o=t.byteLength||t.length;return(t.byteOffset!==0||o!==r.byteLength)&&(r=r.slice(t.byteOffset,t.byteOffset+o)),r}throw new Error(Jde)}async function gQt(t,e,i){const r=t instanceof ArrayBuffer||ArrayBuffer.isView(t);if(typeof t=="string"||r)return fQt(t,e);if(TA(t)&&(t=await Dde(t)),Rf(t)){const o=t;return await DGt(o),e.binary?await o.arrayBuffer():await o.text()}if(Ide(t)&&(t=pQt(t,i)),wGt(t)||CGt(t))return gGt(t);throw new Error(Jde)}function AQt(t,e){const i=Ude(),r=t||i;return typeof r.fetch=="function"?r.fetch:m7(r.fetch)?o=>_de(o,r.fetch):e?.fetch?e?.fetch:_de}function mQt(t,e,i){if(i)return i;const r={fetch:AQt(e,t),...t};if(r.url){const o=RU(r.url);r.baseUrl=o,r.queryString=SGt(r.url),r.filename=Bde(o),r.baseUrl=yGt(o)}return Array.isArray(r.loaders)||(r.loaders=null),r}function vQt(t,e){if(t&&!Array.isArray(t))return t;let i;if(t&&(i=Array.isArray(t)?t:[t]),e&&e.loaders){const r=Array.isArray(e.loaders)?e.loaders:[e.loaders];i=i?[...i,...r]:r}return i&&i.length?i:void 0}async function FU(t,e,i,r){e&&!Array.isArray(e)&&!Hde(e)&&(r=void 0,i=e,e=void 0),t=await t,i=i||{};const o=ME(t),n=vQt(e,r),s=await XGt(t,n,i);return s?(i=VGt(i,s,n,o),r=mQt({url:o,_parse:FU,loaders:n},i,r||null),await yQt(s,t,i,r)):null}async function yQt(t,e,i,r){if(eGt(t),i=Hqt(t.options,i),Rf(e)){const n=e,{ok:s,redirected:a,status:l,statusText:c,type:d,url:u}=n,h=Object.fromEntries(n.headers.entries());r.response={headers:h,ok:s,redirected:a,status:l,statusText:c,type:d,url:u}}e=await gQt(e,t,i);const o=t;if(o.parseTextSync&&typeof e=="string")return o.parseTextSync(e,i,r);if(sGt(t,i))return await aGt(t,e,i,r,FU);if(o.parseText&&typeof e=="string")return await o.parseText(e,i,r);if(o.parse)return await o.parse(e,i,r);throw Hh(!o.parseSync),new Error(`${t.id} loader - no parser found and worker is disabled`)}function bQt(t){switch(t.constructor){case Int8Array:return"int8";case Uint8Array:case Uint8ClampedArray:return"uint8";case Int16Array:return"int16";case Uint16Array:return"uint16";case Int32Array:return"int32";case Uint32Array:return"uint32";case Float32Array:return"float32";case Float64Array:return"float64";default:return"null"}}function wQt(t){let e=1/0,i=1/0,r=1/0,o=-1/0,n=-1/0,s=-1/0;const a=t.POSITION?t.POSITION.value:[],l=a&&a.length;for(let c=0;c<l;c+=3){const d=a[c],u=a[c+1],h=a[c+2];e=d<e?d:e,i=u<i?u:i,r=h<r?h:r,o=d>o?d:o,n=u>n?u:n,s=h>s?h:s}return[[e,i,r],[o,n,s]]}function CQt(t,e,i){const r=bQt(e.value),o=i||xQt(e);return{name:t,type:{type:"fixed-size-list",listSize:e.size,children:[{name:"value",type:r}]},nullable:!1,metadata:o}}function xQt(t){const e={};return"byteOffset"in t&&(e.byteOffset=t.byteOffset.toString(10)),"byteStride"in t&&(e.byteStride=t.byteStride.toString(10)),"normalized"in t&&(e.normalized=t.normalized.toString()),e}const kQt="4.3.3",MQt=globalThis.loaders?.parseImageNode,OU=typeof Image<"u",UU=typeof ImageBitmap<"u",EQt=!!MQt,NU=xE?!0:EQt;function BQt(t){switch(t){case"auto":return UU||OU||NU;case"imagebitmap":return UU;case"image":return OU;case"data":return NU;default:throw new Error(`@loaders.gl/images: image ${t} not supported in this environment`)}}function PQt(){if(UU)return"imagebitmap";if(OU)return"image";if(NU)return"data";throw new Error("Install '@loaders.gl/polyfills' to parse images under Node.js")}function IQt(t){const e=SQt(t);if(!e)throw new Error("Not an image");return e}function Zde(t){switch(IQt(t)){case"data":return t;case"image":case"imagebitmap":const e=document.createElement("canvas"),i=e.getContext("2d");if(!i)throw new Error("getImageData");return e.width=t.width,e.height=t.height,i.drawImage(t,0,0),i.getImageData(0,0,t.width,t.height);default:throw new Error("getImageData")}}function SQt(t){return typeof ImageBitmap<"u"&&t instanceof ImageBitmap?"imagebitmap":typeof Image<"u"&&t instanceof Image?"image":t&&typeof t=="object"&&t.data&&t.width&&t.height?"data":null}const TQt=/^data:image\/svg\+xml/,RQt=/\.svg((\?|#).*)?$/;function jU(t){return t&&(TQt.test(t)||RQt.test(t))}function DQt(t,e){if(jU(e)){let i=new TextDecoder().decode(t);try{typeof unescape=="function"&&typeof encodeURIComponent=="function"&&(i=unescape(encodeURIComponent(i)))}catch(r){throw new Error(r.message)}return`data:image/svg+xml;base64,${btoa(i)}`}return Xde(t,e)}function Xde(t,e){if(jU(e))throw new Error("SVG cannot be parsed directly to imagebitmap");return new Blob([new Uint8Array(t)])}async function Yde(t,e,i){const r=DQt(t,i),o=self.URL||self.webkitURL,n=typeof r!="string"&&o.createObjectURL(r);try{return await _Qt(n||r,e)}finally{n&&o.revokeObjectURL(n)}}async function _Qt(t,e){const i=new Image;return i.src=t,e.image&&e.image.decode&&i.decode?(await i.decode(),i):await new Promise((r,o)=>{try{i.onload=()=>r(i),i.onerror=n=>{const s=n instanceof Error?n.message:"error";o(new Error(s))}}catch(n){o(n)}})}const LQt={};let $de=!0;async function FQt(t,e,i){let r;jU(i)?r=await Yde(t,e,i):r=Xde(t,i);const o=e&&e.imagebitmap;return await OQt(r,o)}async function OQt(t,e=null){if((UQt(e)||!$de)&&(e=null),e)try{return await createImageBitmap(t,e)}catch(i){console.warn(i),$de=!1}return await createImageBitmap(t)}function UQt(t){for(const e in t||LQt)return!1;return!0}function NQt(t){return!VQt(t,"ftyp",4)||(t[8]&96)===0?null:jQt(t)}function jQt(t){switch(HQt(t,8,12).replace("\0"," ").trim()){case"avif":case"avis":return{extension:"avif",mimeType:"image/avif"};default:return null}}function HQt(t,e,i){return String.fromCharCode(...t.slice(e,i))}function zQt(t){return[...t].map(e=>e.charCodeAt(0))}function VQt(t,e,i=0){const r=zQt(e);for(let o=0;o<r.length;++o)if(r[o]!==t[o+i])return!1;return!0}const wu=!1,v7=!0;function HU(t){const e=y7(t);return GQt(e)||WQt(e)||QQt(e)||KQt(e)||qQt(e)}function qQt(t){const e=new Uint8Array(t instanceof DataView?t.buffer:t),i=NQt(e);return i?{mimeType:i.mimeType,width:0,height:0}:null}function GQt(t){const e=y7(t);return e.byteLength>=24&&e.getUint32(0,wu)===2303741511?{mimeType:"image/png",width:e.getUint32(16,wu),height:e.getUint32(20,wu)}:null}function QQt(t){const e=y7(t);return e.byteLength>=10&&e.getUint32(0,wu)===1195984440?{mimeType:"image/gif",width:e.getUint16(6,v7),height:e.getUint16(8,v7)}:null}function KQt(t){const e=y7(t);return e.byteLength>=14&&e.getUint16(0,wu)===16973&&e.getUint32(2,v7)===e.byteLength?{mimeType:"image/bmp",width:e.getUint32(18,v7),height:e.getUint32(22,v7)}:null}function WQt(t){const e=y7(t);if(!(e.byteLength>=3&&e.getUint16(0,wu)===65496&&e.getUint8(2)===255))return null;const{tableMarkers:i,sofMarkers:r}=JQt();let o=2;for(;o+9<e.byteLength;){const n=e.getUint16(o,wu);if(r.has(n))return{mimeType:"image/jpeg",height:e.getUint16(o+5,wu),width:e.getUint16(o+7,wu)};if(!i.has(n))return null;o+=2,o+=e.getUint16(o,wu)}return null}function JQt(){const t=new Set([65499,65476,65484,65501,65534]);for(let e=65504;e<65520;++e)t.add(e);return{tableMarkers:t,sofMarkers:new Set([65472,65473,65474,65475,65477,65478,65479,65481,65482,65483,65485,65486,65487,65502])}}function y7(t){if(t instanceof DataView)return t;if(ArrayBuffer.isView(t))return new DataView(t.buffer);if(t instanceof ArrayBuffer)return new DataView(t);throw new Error("toDataView")}async function ZQt(t,e){const{mimeType:i}=HU(t)||{},r=globalThis.loaders?.parseImageNode;return jh(r),await r(t,i)}async function XQt(t,e,i){e=e||{};const r=(e.image||{}).type||"auto",{url:o}=i||{},n=YQt(r);let s;switch(n){case"imagebitmap":s=await FQt(t,e,o);break;case"image":s=await Yde(t,e,o);break;case"data":s=await ZQt(t);break;default:jh(!1)}return r==="data"&&(s=Zde(s)),s}function YQt(t){switch(t){case"auto":case"data":return PQt();default:return BQt(t),t}}const $Qt=["png","jpg","jpeg","gif","webp","bmp","ico","svg","avif"],eKt=["image/png","image/jpeg","image/gif","image/webp","image/avif","image/bmp","image/vnd.microsoft.icon","image/svg+xml"],tKt={image:{type:"auto",decode:!0}},iKt={dataType:null,batchType:null,id:"image",module:"images",name:"Images",version:kQt,mimeTypes:eKt,extensions:$Qt,parse:XQt,tests:[t=>!!HU(new DataView(t))],options:tKt},zU={};function rKt(t){if(zU[t]===void 0){const e=xE?nKt(t):oKt(t);zU[t]=e}return zU[t]}function oKt(t){const e=["image/png","image/jpeg","image/gif"],i=globalThis.loaders?.imageFormatsNode||e;return!!globalThis.loaders?.parseImageNode&&i.includes(t)}function nKt(t){switch(t){case"image/avif":case"image/webp":return sKt(t);default:return!0}}function sKt(t){try{return document.createElement("canvas").toDataURL(t).indexOf(`data:${t}`)===0}catch{return!1}}function Gl(t,e){if(!t)throw new Error(e||"assert failed: gltf")}const eue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},tue={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},iue=["SCALAR","VEC2","VEC3","VEC4"],aKt=[[Int8Array,5120],[Uint8Array,5121],[Int16Array,5122],[Uint16Array,5123],[Uint32Array,5125],[Float32Array,5126],[Float64Array,5130]],lKt=new Map(aKt),cKt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},dKt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},uKt={5120:Int8Array,5121:Uint8Array,5122:Int16Array,5123:Uint16Array,5125:Uint32Array,5126:Float32Array};function rue(t){return iue[t-1]||iue[0]}function EE(t){const e=lKt.get(t.constructor);if(!e)throw new Error("Illegal typed array");return e}function VU(t,e){const i=uKt[t.componentType],r=cKt[t.type],o=dKt[t.componentType],n=t.count*r,s=t.count*r*o;Gl(s>=0&&s<=e.byteLength);const a=tue[t.componentType],l=eue[t.type];return{ArrayType:i,length:n,byteLength:s,componentByteSize:a,numberOfComponentsInElement:l}}function hKt(t,e,i){const r=t.bufferViews[i];Gl(r);const o=r.buffer,n=e[o];Gl(n);const s=(r.byteOffset||0)+n.byteOffset;return new Uint8Array(n.arrayBuffer,s,r.byteLength)}function pKt(t,e,i){const r=typeof i=="number"?t.accessors?.[i]:i;if(!r)throw new Error(`No gltf accessor ${JSON.stringify(i)}`);const o=t.bufferViews?.[r.bufferView||0];if(!o)throw new Error(`No gltf buffer view for accessor ${o}`);const{arrayBuffer:n,byteOffset:s}=e[o.buffer],a=(s||0)+(r.byteOffset||0)+(o.byteOffset||0),{ArrayType:l,length:c,componentByteSize:d,numberOfComponentsInElement:u}=VU(r,o),h=d*u,p=o.byteStride||h;if(typeof o.byteStride>"u"||o.byteStride===h)return new l(n,a,c);const g=new l(c);for(let f=0;f<r.count;f++){const m=new l(n,a+f*p,u);g.set(m,f*u)}return g}function fKt(){return{asset:{version:"2.0",generator:"loaders.gl"},buffers:[],extensions:{},extensionsRequired:[],extensionsUsed:[]}}class os{gltf;sourceBuffers;byteLength;constructor(e){this.gltf={json:e?.json||fKt(),buffers:e?.buffers||[],images:e?.images||[]},this.sourceBuffers=[],this.byteLength=0,this.gltf.buffers&&this.gltf.buffers[0]&&(this.byteLength=this.gltf.buffers[0].byteLength,this.sourceBuffers=[this.gltf.buffers[0]])}get json(){return this.gltf.json}getApplicationData(e){return this.json[e]}getExtraData(e){return(this.json.extras||{})[e]}hasExtension(e){const i=this.getUsedExtensions().find(o=>o===e),r=this.getRequiredExtensions().find(o=>o===e);return typeof i=="string"||typeof r=="string"}getExtension(e){const i=this.getUsedExtensions().find(o=>o===e),r=this.json.extensions||{};return i?r[e]:null}getRequiredExtension(e){return this.getRequiredExtensions().find(i=>i===e)?this.getExtension(e):null}getRequiredExtensions(){return this.json.extensionsRequired||[]}getUsedExtensions(){return this.json.extensionsUsed||[]}getRemovedExtensions(){return this.json.extensionsRemoved||[]}getObjectExtension(e,i){return(e.extensions||{})[i]}getScene(e){return this.getObject("scenes",e)}getNode(e){return this.getObject("nodes",e)}getSkin(e){return this.getObject("skins",e)}getMesh(e){return this.getObject("meshes",e)}getMaterial(e){return this.getObject("materials",e)}getAccessor(e){return this.getObject("accessors",e)}getTexture(e){return this.getObject("textures",e)}getSampler(e){return this.getObject("samplers",e)}getImage(e){return this.getObject("images",e)}getBufferView(e){return this.getObject("bufferViews",e)}getBuffer(e){return this.getObject("buffers",e)}getObject(e,i){if(typeof i=="object")return i;const r=this.json[e]&&this.json[e][i];if(!r)throw new Error(`glTF file error: Could not find ${e}[${i}]`);return r}getTypedArrayForBufferView(e){e=this.getBufferView(e);const i=e.buffer,r=this.gltf.buffers[i];Gl(r);const o=(e.byteOffset||0)+r.byteOffset;return new Uint8Array(r.arrayBuffer,o,e.byteLength)}getTypedArrayForAccessor(e){const i=this.getAccessor(e);return pKt(this.gltf.json,this.gltf.buffers,i)}getTypedArrayForImageData(e){e=this.getAccessor(e);const i=this.getBufferView(e.bufferView),r=this.getBuffer(i.buffer).data,o=i.byteOffset||0;return new Uint8Array(r,o,i.byteLength)}addApplicationData(e,i){return this.json[e]=i,this}addExtraData(e,i){return this.json.extras=this.json.extras||{},this.json.extras[e]=i,this}addObjectExtension(e,i,r){return e.extensions=e.extensions||{},e.extensions[i]=r,this.registerUsedExtension(i),this}setObjectExtension(e,i,r){const o=e.extensions||{};o[i]=r}removeObjectExtension(e,i){const r=e?.extensions||{};if(r[i]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const o=this.json.extensionsRemoved;o.includes(i)||o.push(i)}delete r[i]}addExtension(e,i={}){return Gl(i),this.json.extensions=this.json.extensions||{},this.json.extensions[e]=i,this.registerUsedExtension(e),i}addRequiredExtension(e,i={}){return Gl(i),this.addExtension(e,i),this.registerRequiredExtension(e),i}registerUsedExtension(e){this.json.extensionsUsed=this.json.extensionsUsed||[],this.json.extensionsUsed.find(i=>i===e)||this.json.extensionsUsed.push(e)}registerRequiredExtension(e){this.registerUsedExtension(e),this.json.extensionsRequired=this.json.extensionsRequired||[],this.json.extensionsRequired.find(i=>i===e)||this.json.extensionsRequired.push(e)}removeExtension(e){if(this.json.extensions?.[e]){this.json.extensionsRemoved=this.json.extensionsRemoved||[];const i=this.json.extensionsRemoved;i.includes(e)||i.push(e)}this.json.extensions&&delete this.json.extensions[e],this.json.extensionsRequired&&this._removeStringFromArray(this.json.extensionsRequired,e),this.json.extensionsUsed&&this._removeStringFromArray(this.json.extensionsUsed,e)}setDefaultScene(e){this.json.scene=e}addScene(e){const{nodeIndices:i}=e;return this.json.scenes=this.json.scenes||[],this.json.scenes.push({nodes:i}),this.json.scenes.length-1}addNode(e){const{meshIndex:i,matrix:r}=e;this.json.nodes=this.json.nodes||[];const o={mesh:i};return r&&(o.matrix=r),this.json.nodes.push(o),this.json.nodes.length-1}addMesh(e){const{attributes:i,indices:r,material:o,mode:n=4}=e,s={primitives:[{attributes:this._addAttributes(i),mode:n}]};if(r){const a=this._addIndices(r);s.primitives[0].indices=a}return Number.isFinite(o)&&(s.primitives[0].material=o),this.json.meshes=this.json.meshes||[],this.json.meshes.push(s),this.json.meshes.length-1}addPointCloud(e){const i={primitives:[{attributes:this._addAttributes(e),mode:0}]};return this.json.meshes=this.json.meshes||[],this.json.meshes.push(i),this.json.meshes.length-1}addImage(e,i){const r=HU(e),o=i||r?.mimeType,n={bufferView:this.addBufferView(e),mimeType:o};return this.json.images=this.json.images||[],this.json.images.push(n),this.json.images.length-1}addBufferView(e,i=0,r=this.byteLength){const o=e.byteLength;Gl(Number.isFinite(o)),this.sourceBuffers=this.sourceBuffers||[],this.sourceBuffers.push(e);const n={buffer:i,byteOffset:r,byteLength:o};return this.byteLength+=g7(o,4),this.json.bufferViews=this.json.bufferViews||[],this.json.bufferViews.push(n),this.json.bufferViews.length-1}addAccessor(e,i){const r={bufferView:e,type:rue(i.size),componentType:i.componentType,count:i.count,max:i.max,min:i.min};return this.json.accessors=this.json.accessors||[],this.json.accessors.push(r),this.json.accessors.length-1}addBinaryBuffer(e,i={size:3}){const r=this.addBufferView(e);let o={min:i.min,max:i.max};(!o.min||!o.max)&&(o=this._getAccessorMinMax(e,i.size));const n={size:i.size,componentType:EE(e),count:Math.round(e.length/i.size),min:o.min,max:o.max};return this.addAccessor(r,Object.assign(n,i))}addTexture(e){const{imageIndex:i}=e,r={source:i};return this.json.textures=this.json.textures||[],this.json.textures.push(r),this.json.textures.length-1}addMaterial(e){return this.json.materials=this.json.materials||[],this.json.materials.push(e),this.json.materials.length-1}createBinaryChunk(){const e=this.byteLength,i=new ArrayBuffer(e),r=new Uint8Array(i);let o=0;for(const n of this.sourceBuffers||[])o=fGt(n,r,o);this.json?.buffers?.[0]?this.json.buffers[0].byteLength=e:this.json.buffers=[{byteLength:e}],this.gltf.binary=i,this.sourceBuffers=[i],this.gltf.buffers=[{arrayBuffer:i,byteOffset:0,byteLength:i.byteLength}]}_removeStringFromArray(e,i){let r=!0;for(;r;){const o=e.indexOf(i);o>-1?e.splice(o,1):r=!1}}_addAttributes(e={}){const i={};for(const r in e){const o=e[r],n=this._getGltfAttributeName(r),s=this.addBinaryBuffer(o.value,o);i[n]=s}return i}_addIndices(e){return this.addBinaryBuffer(e,{size:1})}_getGltfAttributeName(e){switch(e.toLowerCase()){case"position":case"positions":case"vertices":return"POSITION";case"normal":case"normals":return"NORMAL";case"color":case"colors":return"COLOR_0";case"texcoord":case"texcoords":return"TEXCOORD_0";default:return e}}_getAccessorMinMax(e,i){const r={min:null,max:null};if(e.length<i)return r;r.min=[],r.max=[];const o=e.subarray(0,i);for(const n of o)r.min.push(n),r.max.push(n);for(let n=i;n<e.length;n+=i)for(let s=0;s<i;s++)r.min[0+s]=Math.min(r.min[0+s],e[n+s]),r.max[0+s]=Math.max(r.max[0+s],e[n+s]);return r}}function oue(t){return(t%1+1)%1}const nue={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16,BOOLEAN:1,STRING:1,ENUM:1},gKt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:BigInt64Array,UINT64:BigUint64Array,FLOAT32:Float32Array,FLOAT64:Float64Array},sue={INT8:1,UINT8:1,INT16:2,UINT16:2,INT32:4,UINT32:4,INT64:8,UINT64:8,FLOAT32:4,FLOAT64:8};function qU(t,e){return sue[e]*nue[t]}function BE(t,e,i,r){if(i!=="UINT8"&&i!=="UINT16"&&i!=="UINT32"&&i!=="UINT64")return null;const o=t.getTypedArrayForBufferView(e),n=PE(o,"SCALAR",i,r+1);return n instanceof BigInt64Array||n instanceof BigUint64Array?null:n}function PE(t,e,i,r=1){const o=nue[e],n=gKt[i],s=sue[i],a=r*o,l=a*s;let c=t.buffer,d=t.byteOffset;return d%s!==0&&(c=new Uint8Array(c).slice(d,d+l).buffer,d=0),new n(c,d,a)}function GU(t,e,i){const r=`TEXCOORD_${e.texCoord||0}`,o=i.attributes[r],n=t.getTypedArrayForAccessor(o),s=t.gltf.json,a=e.index,l=s.textures?.[a]?.source;if(typeof l<"u"){const c=s.images?.[l]?.mimeType,d=t.gltf.images?.[l];if(d&&typeof d.width<"u"){const u=[];for(let h=0;h<n.length;h+=2){const p=AKt(d,c,n,h,e.channels);u.push(p)}return u}}return[]}function aue(t,e,i,r,o){if(!i?.length)return;const n=[];for(const d of i){let u=r.findIndex(h=>h===d);u===-1&&(u=r.push(d)-1),n.push(u)}const s=new Uint32Array(n),a=t.gltf.buffers.push({arrayBuffer:s.buffer,byteOffset:s.byteOffset,byteLength:s.byteLength})-1,l=t.addBufferView(s,a,0),c=t.addAccessor(l,{size:1,componentType:EE(s),count:s.length});o.attributes[e]=c}function AKt(t,e,i,r,o=[0]){const n={r:{offset:0,shift:0},g:{offset:1,shift:8},b:{offset:2,shift:16},a:{offset:3,shift:24}},s=i[r],a=i[r+1];let l=1;e&&(e.indexOf("image/jpeg")!==-1||e.indexOf("image/png")!==-1)&&(l=4);const c=mKt(s,a,t,l);let d=0;for(const u of o){const h=typeof u=="number"?Object.values(n)[u]:n[u],p=c+h.offset,g=Zde(t);if(g.data.length<=p)throw new Error(`${g.data.length} <= ${p}`);const f=g.data[p];d|=f<<h.shift}return d}function mKt(t,e,i,r=1){const o=i.width,n=oue(t)*(o-1),s=Math.round(n),a=i.height,l=oue(e)*(a-1),c=Math.round(l),d=i.components?i.components:r;return(c*o+s)*d}function lue(t,e,i,r,o){const n=[];for(let s=0;s<e;s++){const a=i[s],l=i[s+1]-i[s];if(l+a>r)break;const c=a/o,d=l/o;n.push(t.slice(c,c+d))}return n}function cue(t,e,i){const r=[];for(let o=0;o<e;o++){const n=o*i;r.push(t.slice(n,n+i))}return r}function due(t,e,i,r){if(i)throw new Error("Not implemented - arrayOffsets for strings is specified");if(r){const o=[],n=new TextDecoder("utf8");let s=0;for(let a=0;a<t;a++){const l=r[a+1]-r[a];if(l+s<=e.length){const c=e.subarray(s,l+s),d=n.decode(c);o.push(d),s+=l}}return o}return[]}const RA="EXT_mesh_features",vKt=RA;async function yKt(t,e){const i=new os(t);wKt(i,e)}function bKt(t,e){const i=new os(t);return xKt(i),i.createBinaryChunk(),i.gltf}function wKt(t,e){const i=t.gltf.json;if(i.meshes)for(const r of i.meshes)for(const o of r.primitives)CKt(t,o,e)}function CKt(t,e,i){if(!i?.gltf?.loadBuffers)return;const r=e.extensions?.[RA]?.featureIds;if(r)for(const o of r){let n;if(typeof o.attribute<"u"){const s=`_FEATURE_ID_${o.attribute}`,a=e.attributes[s];n=t.getTypedArrayForAccessor(a)}else typeof o.texture<"u"&&i?.gltf?.loadImages?n=GU(t,o.texture,e):n=[];o.data=n}}function xKt(t,e){const i=t.gltf.json.meshes;if(i)for(const r of i)for(const o of r.primitives)MKt(t,o)}function kKt(t,e,i,r){e.extensions||(e.extensions={});let o=e.extensions[RA];o||(o={featureIds:[]},e.extensions[RA]=o);const{featureIds:n}=o,s={featureCount:i.length,propertyTable:r,data:i};n.push(s),t.addObjectExtension(e,RA,o)}function MKt(t,e){const i=e.extensions?.[RA];if(!i)return;const r=i.featureIds;r.forEach((o,n)=>{if(o.data){const{accessorKey:s,index:a}=EKt(e.attributes),l=new Uint32Array(o.data);r[n]={featureCount:l.length,propertyTable:o.propertyTable,attribute:a},t.gltf.buffers.push({arrayBuffer:l.buffer,byteOffset:l.byteOffset,byteLength:l.byteLength});const c=t.addBufferView(l),d=t.addAccessor(c,{size:1,componentType:EE(l),count:l.length});e.attributes[s]=d}})}function EKt(t){const e="_FEATURE_ID_",i=Object.keys(t).filter(o=>o.indexOf(e)===0);let r=-1;for(const o of i){const n=Number(o.substring(e.length));n>r&&(r=n)}return r++,{accessorKey:`${e}${r}`,index:r}}const BKt=Object.freeze(Object.defineProperty({__proto__:null,createExtMeshFeatures:kKt,decode:yKt,encode:bKt,name:vKt},Symbol.toStringTag,{value:"Module"})),DA="EXT_structural_metadata",PKt=DA;async function IKt(t,e){const i=new os(t);TKt(i,e)}function SKt(t,e){const i=new os(t);return KKt(i),i.createBinaryChunk(),i.gltf}function TKt(t,e){if(!e.gltf?.loadBuffers)return;const i=t.getExtension(DA);i&&(e.gltf?.loadImages&&RKt(t,i),DKt(t,i))}function RKt(t,e){const i=e.propertyTextures,r=t.gltf.json;if(i&&r.meshes)for(const o of r.meshes)for(const n of o.primitives)LKt(t,i,n,e)}function DKt(t,e){const i=e.schema;if(!i)return;const r=i.classes,o=e.propertyTables;if(r&&o)for(const n in r){const s=_Kt(o,n);s&&OKt(t,i,s)}}function _Kt(t,e){for(const i of t)if(i.class===e)return i;return null}function LKt(t,e,i,r){if(!e)return;const o=i.extensions?.[DA]?.propertyTextures;if(o)for(const n of o){const s=e[n];FKt(t,s,i,r)}}function FKt(t,e,i,r){if(!e.properties)return;r.dataAttributeNames||(r.dataAttributeNames=[]);const o=e.class;for(const n in e.properties){const s=`${o}_${n}`,a=e.properties?.[n];if(!a)continue;a.data||(a.data=[]);const l=a.data,c=GU(t,a,i);c!==null&&(aue(t,s,c,l,i),a.data=l,r.dataAttributeNames.push(s))}}function OKt(t,e,i){const r=e.classes?.[i.class];if(!r)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${i.class}`);const o=i.count;for(const n in r.properties){const s=r.properties[n],a=i.properties?.[n];if(a){const l=UKt(t,e,s,o,a);a.data=l}}}function UKt(t,e,i,r,o){let n=[];const s=o.values,a=t.getTypedArrayForBufferView(s),l=NKt(t,i,o,r),c=jKt(t,o,r);switch(i.type){case"SCALAR":case"VEC2":case"VEC3":case"VEC4":case"MAT2":case"MAT3":case"MAT4":{n=HKt(i,r,a,l);break}case"BOOLEAN":throw new Error(`Not implemented - classProperty.type=${i.type}`);case"STRING":{n=due(r,a,l,c);break}case"ENUM":{n=zKt(e,i,r,a,l);break}default:throw new Error(`Unknown classProperty type ${i.type}`)}return n}function NKt(t,e,i,r){return e.array&&typeof e.count>"u"&&typeof i.arrayOffsets<"u"?BE(t,i.arrayOffsets,i.arrayOffsetType||"UINT32",r):null}function jKt(t,e,i){return typeof e.stringOffsets<"u"?BE(t,e.stringOffsets,e.stringOffsetType||"UINT32",i):null}function HKt(t,e,i,r){const o=t.array,n=t.count,s=qU(t.type,t.componentType),a=i.byteLength/s;let l;return t.componentType?l=PE(i,t.type,t.componentType,a):l=i,o?r?lue(l,e,r,i.length,s):n?cue(l,e,n):[]:l}function zKt(t,e,i,r,o){const n=e.enumType;if(!n)throw new Error("Incorrect data in the EXT_structural_metadata extension: classProperty.enumType is not set for type ENUM");const s=t.enums?.[n];if(!s)throw new Error(`Incorrect data in the EXT_structural_metadata extension: schema.enums does't contain ${n}`);const a=s.valueType||"UINT16",l=qU(e.type,a),c=r.byteLength/l;let d=PE(r,e.type,a,c);if(d||(d=r),e.array){if(o)return VKt({valuesData:d,numberOfElements:i,arrayOffsets:o,valuesDataBytesLength:r.length,elementSize:l,enumEntry:s});const u=e.count;return u?qKt(d,i,u,s):[]}return QU(d,0,i,s)}function VKt(t){const{valuesData:e,numberOfElements:i,arrayOffsets:r,valuesDataBytesLength:o,elementSize:n,enumEntry:s}=t,a=[];for(let l=0;l<i;l++){const c=r[l],d=r[l+1]-r[l];if(d+c>o)break;const u=c/n,h=d/n,p=QU(e,u,h,s);a.push(p)}return a}function qKt(t,e,i,r){const o=[];for(let n=0;n<e;n++){const s=i*n,a=QU(t,s,i,r);o.push(a)}return o}function QU(t,e,i,r){const o=[];for(let n=0;n<i;n++)if(t instanceof BigInt64Array||t instanceof BigUint64Array)o.push("");else{const s=t[e+n],a=GKt(r,s);a?o.push(a.name):o.push("")}return o}function GKt(t,e){for(const i of t.values)if(i.value===e)return i;return null}const QKt="schemaClassId";function KKt(t,e){const i=t.getExtension(DA);if(i&&i.propertyTables)for(const r of i.propertyTables){const o=r.class,n=i.schema?.classes?.[o];r.properties&&n&&WKt(r,n,t)}}function WKt(t,e,i){for(const r in t.properties){const o=t.properties[r].data;if(o){const n=e.properties[r];if(n){const s=YKt(o,n,i);t.properties[r]=s}}}}function JKt(t,e,i=QKt){let r=t.getExtension(DA);r||(r=t.addExtension(DA)),r.schema=ZKt(e,i,r.schema);const o=XKt(e,i,r.schema);return r.propertyTables||(r.propertyTables=[]),r.propertyTables.push(o)-1}function ZKt(t,e,i){const r=i??{id:"schema_id"},o={properties:{}};for(const n of t){const s={type:n.elementType,componentType:n.componentType};o.properties[n.name]=s}return r.classes={},r.classes[e]=o,r}function XKt(t,e,i){const r={class:e,count:0};let o=0;const n=i.classes?.[e];for(const s of t){if(o===0&&(o=s.values.length),o!==s.values.length&&s.values.length)throw new Error("Illegal values in attributes");n?.properties[s.name]&&(r.properties||(r.properties={}),r.properties[s.name]={values:0,data:s.values})}return r.count=o,r}function YKt(t,e,i){const r={values:0};if(e.type==="STRING"){const{stringData:o,stringOffsets:n}=tWt(t);r.stringOffsets=KU(n,i),r.values=KU(o,i)}else if(e.type==="SCALAR"&&e.componentType){const o=eWt(t,e.componentType);r.values=KU(o,i)}return r}const $Kt={INT8:Int8Array,UINT8:Uint8Array,INT16:Int16Array,UINT16:Uint16Array,INT32:Int32Array,UINT32:Uint32Array,INT64:Int32Array,UINT64:Uint32Array,FLOAT32:Float32Array,FLOAT64:Float64Array};function eWt(t,e){const i=[];for(const o of t)i.push(Number(o));const r=$Kt[e];if(!r)throw new Error("Illegal component type");return new r(i)}function tWt(t){const e=new TextEncoder,i=[];let r=0;for(const l of t){const c=e.encode(l);r+=c.length,i.push(c)}const o=new Uint8Array(r),n=[];let s=0;for(const l of i)o.set(l,s),n.push(s),s+=l.length;n.push(s);const a=new Uint32Array(n);return{stringData:o,stringOffsets:a}}function KU(t,e){return e.gltf.buffers.push({arrayBuffer:t.buffer,byteOffset:t.byteOffset,byteLength:t.byteLength}),e.addBufferView(t)}const iWt=Object.freeze(Object.defineProperty({__proto__:null,createExtStructuralMetadata:JKt,decode:IKt,encode:SKt,name:PKt},Symbol.toStringTag,{value:"Module"})),uue="EXT_feature_metadata",rWt=uue;async function oWt(t,e){const i=new os(t);nWt(i,e)}function nWt(t,e){if(!e.gltf?.loadBuffers)return;const i=t.getExtension(uue);i&&(e.gltf?.loadImages&&sWt(t,i),aWt(t,i))}function sWt(t,e){const i=e.schema;if(!i)return;const r=i.classes,{featureTextures:o}=e;if(r&&o)for(const n in r){const s=r[n],a=cWt(o,n);a&&uWt(t,a,s)}}function aWt(t,e){const i=e.schema;if(!i)return;const r=i.classes,o=e.featureTables;if(r&&o)for(const n in r){const s=lWt(o,n);s&&dWt(t,i,s)}}function lWt(t,e){for(const i in t){const r=t[i];if(r.class===e)return r}return null}function cWt(t,e){for(const i in t){const r=t[i];if(r.class===e)return r}return null}function dWt(t,e,i){if(!i.class)return;const r=e.classes?.[i.class];if(!r)throw new Error(`Incorrect data in the EXT_structural_metadata extension: no schema class with name ${i.class}`);const o=i.count;for(const n in r.properties){const s=r.properties[n],a=i.properties?.[n];if(a){const l=hWt(t,e,s,o,a);a.data=l}}}function uWt(t,e,i){const r=e.class;for(const o in i.properties){const n=e?.properties?.[o];if(n){const s=mWt(t,n,r);n.data=s}}}function hWt(t,e,i,r,o){let n=[];const s=o.bufferView,a=t.getTypedArrayForBufferView(s),l=pWt(t,i,o,r),c=fWt(t,i,o,r);return i.type==="STRING"||i.componentType==="STRING"?n=due(r,a,l,c):gWt(i)&&(n=AWt(i,r,a,l)),n}function pWt(t,e,i,r){return e.type==="ARRAY"&&typeof e.componentCount>"u"&&typeof i.arrayOffsetBufferView<"u"?BE(t,i.arrayOffsetBufferView,i.offsetType||"UINT32",r):null}function fWt(t,e,i,r){return typeof i.stringOffsetBufferView<"u"?BE(t,i.stringOffsetBufferView,i.offsetType||"UINT32",r):null}function gWt(t){const e=["UINT8","INT16","UINT16","INT32","UINT32","INT64","UINT64","FLOAT32","FLOAT64"];return e.includes(t.type)||typeof t.componentType<"u"&&e.includes(t.componentType)}function AWt(t,e,i,r){const o=t.type==="ARRAY",n=t.componentCount,s="SCALAR",a=t.componentType||t.type,l=qU(s,a),c=i.byteLength/l,d=PE(i,s,a,c);return o?r?lue(d,e,r,i.length,l):n?cue(d,e,n):[]:d}function mWt(t,e,i){const r=t.gltf.json;if(!r.meshes)return[];const o=[];for(const n of r.meshes)for(const s of n.primitives)vWt(t,i,e,o,s);return o}function vWt(t,e,i,r,o){const n={channels:i.channels,...i.texture},s=GU(t,n,o);s&&aue(t,e,s,r,o)}const yWt=Object.freeze(Object.defineProperty({__proto__:null,decode:oWt,name:rWt},Symbol.toStringTag,{value:"Module"})),bWt="4.3.3",wWt="4.3.3",IE={TRANSCODER:"basis_transcoder.js",TRANSCODER_WASM:"basis_transcoder.wasm",ENCODER:"basis_encoder.js",ENCODER_WASM:"basis_encoder.wasm"};let hue;async function pue(t){return zqt(t.modules),Vqt("basis")||(hue||=CWt(t),await hue)}async function CWt(t){let e=null,i=null;return[e,i]=await Promise.all([await Tf(IE.TRANSCODER,"textures",t),await Tf(IE.TRANSCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await xWt(e,i)}function xWt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t(i).then(o=>{const{BasisFile:n,initializeBasis:s}=o;s(),r({BasisFile:n})})})}let WU;async function fue(t){const e=t.modules||{};return e.basisEncoder?e.basisEncoder:(WU=WU||kWt(t),await WU)}async function kWt(t){let e=null,i=null;return[e,i]=await Promise.all([await Tf(IE.ENCODER,"textures",t),await Tf(IE.ENCODER_WASM,"textures",t)]),e=e||globalThis.BASIS,await MWt(e,i)}function MWt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t(i).then(o=>{const{BasisFile:n,KTX2File:s,initializeBasis:a,BasisEncoder:l}=o;a(),r({BasisFile:n,KTX2File:s,BasisEncoder:l})})})}const _A={COMPRESSED_RGB_S3TC_DXT1_EXT:33776,COMPRESSED_RGBA_S3TC_DXT5_EXT:33779,COMPRESSED_RGB_PVRTC_4BPPV1_IMG:35840,COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:35842,COMPRESSED_RGB_ETC1_WEBGL:36196,COMPRESSED_RGBA_ASTC_4X4_KHR:37808},EWt=["","WEBKIT_","MOZ_"],gue={WEBGL_compressed_texture_s3tc:"dxt",WEBGL_compressed_texture_s3tc_srgb:"dxt-srgb",WEBGL_compressed_texture_etc1:"etc1",WEBGL_compressed_texture_etc:"etc2",WEBGL_compressed_texture_pvrtc:"pvrtc",WEBGL_compressed_texture_atc:"atc",WEBGL_compressed_texture_astc:"astc",EXT_texture_compression_rgtc:"rgtc"};let SE=null;function BWt(t){if(!SE){t=t||PWt()||void 0,SE=new Set;for(const e of EWt)for(const i in gue)if(t&&t.getExtension(`${e}${i}`)){const r=gue[i];SE.add(r)}}return SE}function PWt(){try{return document.createElement("canvas").getContext("webgl")}catch{return null}}const Ql=[171,75,84,88,32,50,48,187,13,10,26,10];function IWt(t){const e=new Uint8Array(t);return!(e.byteLength<Ql.length||e[0]!==Ql[0]||e[1]!==Ql[1]||e[2]!==Ql[2]||e[3]!==Ql[3]||e[4]!==Ql[4]||e[5]!==Ql[5]||e[6]!==Ql[6]||e[7]!==Ql[7]||e[8]!==Ql[8]||e[9]!==Ql[9]||e[10]!==Ql[10]||e[11]!==Ql[11])}const SWt={etc1:{basisFormat:0,compressed:!0,format:_A.COMPRESSED_RGB_ETC1_WEBGL},etc2:{basisFormat:1,compressed:!0},bc1:{basisFormat:2,compressed:!0,format:_A.COMPRESSED_RGB_S3TC_DXT1_EXT},bc3:{basisFormat:3,compressed:!0,format:_A.COMPRESSED_RGBA_S3TC_DXT5_EXT},bc4:{basisFormat:4,compressed:!0},bc5:{basisFormat:5,compressed:!0},"bc7-m6-opaque-only":{basisFormat:6,compressed:!0},"bc7-m5":{basisFormat:7,compressed:!0},"pvrtc1-4-rgb":{basisFormat:8,compressed:!0,format:_A.COMPRESSED_RGB_PVRTC_4BPPV1_IMG},"pvrtc1-4-rgba":{basisFormat:9,compressed:!0,format:_A.COMPRESSED_RGBA_PVRTC_4BPPV1_IMG},"astc-4x4":{basisFormat:10,compressed:!0,format:_A.COMPRESSED_RGBA_ASTC_4X4_KHR},"atc-rgb":{basisFormat:11,compressed:!0},"atc-rgba-interpolated-alpha":{basisFormat:12,compressed:!0},rgba32:{basisFormat:13,compressed:!1},rgb565:{basisFormat:14,compressed:!1},bgr565:{basisFormat:15,compressed:!1},rgba4444:{basisFormat:16,compressed:!1}};async function TWt(t,e){if(e.basis.containerFormat==="auto"){if(IWt(t)){const r=await fue(e);return Aue(r.KTX2File,t,e)}const{BasisFile:i}=await pue(e);return JU(i,t,e)}switch(e.basis.module){case"encoder":const i=await fue(e);switch(e.basis.containerFormat){case"ktx2":return Aue(i.KTX2File,t,e);case"basis":default:return JU(i.BasisFile,t,e)}case"transcoder":default:const{BasisFile:r}=await pue(e);return JU(r,t,e)}}function JU(t,e,i){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("Failed to start basis transcoding");const o=r.getNumImages(),n=[];for(let s=0;s<o;s++){const a=r.getNumLevels(s),l=[];for(let c=0;c<a;c++)l.push(RWt(r,s,c,i));n.push(l)}return n}finally{r.close(),r.delete()}}function RWt(t,e,i,r){const o=t.getImageWidth(e,i),n=t.getImageHeight(e,i),s=t.getHasAlpha(),{compressed:a,format:l,basisFormat:c}=mue(r,s),d=t.getImageTranscodedSizeInBytes(e,i,c),u=new Uint8Array(d);if(!t.transcodeImage(u,e,i,c,0,0))throw new Error("failed to start Basis transcoding");return{width:o,height:n,data:u,compressed:a,format:l,hasAlpha:s}}function Aue(t,e,i){const r=new t(new Uint8Array(e));try{if(!r.startTranscoding())throw new Error("failed to start KTX2 transcoding");const o=r.getLevels(),n=[];for(let s=0;s<o;s++)n.push(DWt(r,s,i));return[n]}finally{r.close(),r.delete()}}function DWt(t,e,i){const{alphaFlag:r,height:o,width:n}=t.getImageLevelInfo(e,0,0),{compressed:s,format:a,basisFormat:l}=mue(i,r),c=t.getImageTranscodedSizeInBytes(e,0,0,l),d=new Uint8Array(c);if(!t.transcodeImage(d,e,0,0,l,0,-1,-1))throw new Error("Failed to transcode KTX2 image");return{width:n,height:o,data:d,compressed:s,levelSize:c,hasAlpha:r,format:a}}function mue(t,e){let i=t&&t.basis&&t.basis.format;return i==="auto"&&(i=vue()),typeof i=="object"&&(i=e?i.alpha:i.noAlpha),i=i.toLowerCase(),SWt[i]}function vue(){const t=BWt();return t.has("astc")?"astc-4x4":t.has("dxt")?{alpha:"bc3",noAlpha:"bc1"}:t.has("pvrtc")?{alpha:"pvrtc1-4-rgba",noAlpha:"pvrtc1-4-rgb"}:t.has("etc1")?"etc1":t.has("etc2")?"etc2":"rgb565"}const _Wt={dataType:null,batchType:null,name:"Basis",id:"basis",module:"textures",version:wWt,worker:!0,extensions:["basis","ktx2"],mimeTypes:["application/octet-stream","image/ktx2"],tests:["sB"],binary:!0,options:{basis:{format:"auto",libraryPath:"libs/",containerFormat:"auto",module:"transcoder"}}},LWt={..._Wt,parse:TWt},LA=!0,yue=1735152710,ZU=12,TE=8,FWt=1313821514,OWt=5130562,UWt=0,NWt=0,jWt=1;function HWt(t,e=0){return`${String.fromCharCode(t.getUint8(e+0))}${String.fromCharCode(t.getUint8(e+1))}${String.fromCharCode(t.getUint8(e+2))}${String.fromCharCode(t.getUint8(e+3))}`}function zWt(t,e=0,i={}){const r=new DataView(t),{magic:o=yue}=i,n=r.getUint32(e,!1);return n===o||n===yue}function VWt(t,e,i=0,r={}){const o=new DataView(e),n=HWt(o,i+0),s=o.getUint32(i+4,LA),a=o.getUint32(i+8,LA);switch(Object.assign(t,{header:{byteOffset:i,byteLength:a,hasBinChunk:!1},type:n,version:s,json:{},binChunks:[]}),i+=ZU,t.version){case 1:return qWt(t,o,i);case 2:return GWt(t,o,i,r={});default:throw new Error(`Invalid GLB version ${t.version}. Only supports version 1 and 2.`)}}function qWt(t,e,i){jh(t.header.byteLength>ZU+TE);const r=e.getUint32(i+0,LA),o=e.getUint32(i+4,LA);return i+=TE,jh(o===UWt),XU(t,e,i,r),i+=r,i+=YU(t,e,i,t.header.byteLength),i}function GWt(t,e,i,r){return jh(t.header.byteLength>ZU+TE),QWt(t,e,i,r),i+t.header.byteLength}function QWt(t,e,i,r){for(;i+8<=t.header.byteLength;){const o=e.getUint32(i+0,LA),n=e.getUint32(i+4,LA);switch(i+=TE,n){case FWt:XU(t,e,i,o);break;case OWt:YU(t,e,i,o);break;case NWt:r.strict||XU(t,e,i,o);break;case jWt:r.strict||YU(t,e,i,o);break}i+=g7(o,4)}return i}function XU(t,e,i,r){const o=new Uint8Array(e.buffer,i,r),n=new TextDecoder("utf8").decode(o);return t.json=JSON.parse(n),g7(r,4)}function YU(t,e,i,r){return t.header.hasBinChunk=!0,t.binChunks.push({byteOffset:i,byteLength:r,arrayBuffer:e.buffer}),g7(r,4)}function bue(t,e){if(t.startsWith("data:")||t.startsWith("http:")||t.startsWith("https:"))return t;const i=e.baseUri||e.uri;if(!i)throw new Error(`'baseUri' must be provided to resolve relative url ${t}`);return i.substr(0,i.lastIndexOf("/")+1)+t}const KWt="B9h9z9tFBBBF8fL9gBB9gLaaaaaFa9gEaaaB9gFaFa9gEaaaFaEMcBFFFGGGEIIILF9wFFFLEFBFKNFaFCx/IFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBF8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBGy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBEn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBIi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBKI9z9iqlBOc+x8ycGBM/qQFTa8jUUUUBCU/EBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAGTkUUUBRNCUoBAG9uC/wgBZHKCUGAKCUG9JyRVAECFJRICBRcGXEXAcAF9PQFAVAFAclAcAVJAF9JyRMGXGXAG9FQBAMCbJHKC9wZRSAKCIrCEJCGrRQANCUGJRfCBRbAIRTEXGXAOATlAQ9PQBCBRISEMATAQJRIGXAS9FQBCBRtCBREEXGXAOAIlCi9PQBCBRISLMANCU/CBJAEJRKGXGXGXGXGXATAECKrJ2BBAtCKZrCEZfIBFGEBMAKhB83EBAKCNJhB83EBSEMAKAI2BIAI2BBHmCKrHYAYCE6HYy86BBAKCFJAICIJAYJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCGJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCEJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCIJAYAmJHY2BBAI2BFHmCKrHPAPCE6HPy86BBAKCLJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCKJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCOJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCNJAYAmJHY2BBAI2BGHmCKrHPAPCE6HPy86BBAKCVJAYAPJHY2BBAmCIrCEZHPAPCE6HPy86BBAKCcJAYAPJHY2BBAmCGrCEZHPAPCE6HPy86BBAKCMJAYAPJHY2BBAmCEZHmAmCE6Hmy86BBAKCSJAYAmJHm2BBAI2BEHICKrHYAYCE6HYy86BBAKCQJAmAYJHm2BBAICIrCEZHYAYCE6HYy86BBAKCfJAmAYJHm2BBAICGrCEZHYAYCE6HYy86BBAKCbJAmAYJHK2BBAICEZHIAICE6HIy86BBAKAIJRISGMAKAI2BNAI2BBHmCIrHYAYCb6HYy86BBAKCFJAICNJAYJHY2BBAmCbZHmAmCb6Hmy86BBAKCGJAYAmJHm2BBAI2BFHYCIrHPAPCb6HPy86BBAKCEJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCIJAmAYJHm2BBAI2BGHYCIrHPAPCb6HPy86BBAKCLJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCKJAmAYJHm2BBAI2BEHYCIrHPAPCb6HPy86BBAKCOJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCNJAmAYJHm2BBAI2BIHYCIrHPAPCb6HPy86BBAKCVJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCcJAmAYJHm2BBAI2BLHYCIrHPAPCb6HPy86BBAKCMJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCSJAmAYJHm2BBAI2BKHYCIrHPAPCb6HPy86BBAKCQJAmAPJHm2BBAYCbZHYAYCb6HYy86BBAKCfJAmAYJHm2BBAI2BOHICIrHYAYCb6HYy86BBAKCbJAmAYJHK2BBAICbZHIAICb6HIy86BBAKAIJRISFMAKAI8pBB83BBAKCNJAICNJ8pBB83BBAICTJRIMAtCGJRtAECTJHEAS9JQBMMGXAIQBCBRISEMGXAM9FQBANAbJ2BBRtCBRKAfREEXAEANCU/CBJAKJ2BBHTCFrCBATCFZl9zAtJHt86BBAEAGJREAKCFJHKAM9HQBMMAfCFJRfAIRTAbCFJHbAG9HQBMMABAcAG9sJANCUGJAMAG9sTkUUUBpANANCUGJAMCaJAG9sJAGTkUUUBpMAMCBAIyAcJRcAIQBMC9+RKSFMCBC99AOAIlAGCAAGCA9Ly6yRKMALCU/EBJ8kUUUUBAKM+OmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUFT+JUUUBpALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM+lLKFaF99GaG99FaG99GXGXAGCI9HQBAF9FQFEXGXGX9DBBB8/9DBBB+/ABCGJHG1BB+yAB1BBHE+yHI+L+TABCFJHL1BBHK+yHO+L+THN9DBBBB9gHVyAN9DBB/+hANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE86BBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG86BBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG86BBABCIJRBAFCaJHFQBSGMMAF9FQBEXGXGX9DBBB8/9DBBB+/ABCIJHG8uFB+yAB8uFBHE+yHI+L+TABCGJHL8uFBHK+yHO+L+THN9DBBBB9gHVyAN9DB/+g6ANAN+U9DBBBBANAVyHcAc+MHMAECa3yAI+SHIAI+UAcAMAKCa3yAO+SHcAc+U+S+S+R+VHO+U+SHN+L9DBBB9P9d9FQBAN+oRESFMCUUUU94REMAGAE87FBGXGX9DBBB8/9DBBB+/Ac9DBBBB9gyAcAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMALAG87FBGXGX9DBBB8/9DBBB+/AI9DBBBB9gyAIAO+U+SHN+L9DBBB9P9d9FQBAN+oRGSFMCUUUU94RGMABAG87FBABCNJRBAFCaJHFQBMMM/SEIEaE99EaF99GXAF9FQBCBREABRIEXGXGX9D/zI818/AICKJ8uFBHLCEq+y+VHKAI8uFB+y+UHO9DB/+g6+U9DBBB8/9DBBB+/AO9DBBBB9gy+SHN+L9DBBB9P9d9FQBAN+oRVSFMCUUUU94RVMAICIJ8uFBRcAICGJ8uFBRMABALCFJCEZAEqCFWJAV87FBGXGXAKAM+y+UHN9DB/+g6+U9DBBB8/9DBBB+/AN9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRMSFMCUUUU94RMMABALCGJCEZAEqCFWJAM87FBGXGXAKAc+y+UHK9DB/+g6+U9DBBB8/9DBBB+/AK9DBBBB9gy+SHS+L9DBBB9P9d9FQBAS+oRcSFMCUUUU94RcMABALCaJCEZAEqCFWJAc87FBGXGX9DBBU8/AOAO+U+TANAN+U+TAKAK+U+THO9DBBBBAO9DBBBB9gy+R9DB/+g6+U9DBBB8/+SHO+L9DBBB9P9d9FQBAO+oRcSFMCUUUU94RcMABALCEZAEqCFWJAc87FBAICNJRIAECIJREAFCaJHFQBMMM9JBGXAGCGrAF9sHF9FQBEXABAB8oGBHGCNWCN91+yAGCi91CnWCUUU/8EJ+++U84GBABCIJRBAFCaJHFQBMMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEM/lFFFaGXGXAFABqCEZ9FQBABRESFMGXGXAGCT9PQBABRESFMABREEXAEAF8oGBjGBAECIJAFCIJ8oGBjGBAECNJAFCNJ8oGBjGBAECSJAFCSJ8oGBjGBAECTJREAFCTJRFAGC9wJHGCb9LQBMMAGCI9JQBEXAEAF8oGBjGBAFCIJRFAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF2BB86BBAECFJREAFCFJRFAGCaJHGQBMMABMoFFGaGXGXABCEZ9FQBABRESFMAFCgFZC+BwsN9sRIGXGXAGCT9PQBABRESFMABREEXAEAIjGBAECSJAIjGBAECNJAIjGBAECIJAIjGBAECTJREAGC9wJHGCb9LQBMMAGCI9JQBEXAEAIjGBAECIJREAGC98JHGCE9LQBMMGXAG9FQBEXAEAF86BBAECFJREAGCaJHGQBMMABMMMFBCUNMIT9kBB",WWt="B9h9z9tFBBBF8dL9gBB9gLaaaaaFa9gEaaaB9gGaaB9gFaFaEQSBBFBFFGEGEGIILF9wFFFLEFBFKNFaFCx/aFMO/LFVK9tv9t9vq95GBt9f9f939h9z9t9f9j9h9s9s9f9jW9vq9zBBp9tv9z9o9v9wW9f9kv9j9v9kv9WvqWv94h919m9mvqBG8Z9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv94h919m9mvqBIy9tv9z9o9v9wW9f9kv9j9v9kv9J9u9kv949TvZ91v9u9jvBLn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9P9jWBKi9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9R919hWBNn9tv9z9o9v9wW9f9kv9j9v9kv69p9sWvq9F949wBcI9z9iqlBMc/j9JSIBTEM9+FLa8jUUUUBCTlRBCBRFEXCBRGCBREEXABCNJAGJAECUaAFAGrCFZHIy86BBAEAIJREAGCFJHGCN9HQBMAFCx+YUUBJAE86BBAFCEWCxkUUBJAB8pEN83EBAFCFJHFCUG9HQBMMkRIbaG97FaK978jUUUUBCU/KBlHL8kUUUUBC9+RKGXAGCFJAI9LQBCaRKAE2BBC+gF9HQBALAEAIJHOAGlAG/8cBBCUoBAG9uC/wgBZHKCUGAKCUG9JyRNAECFJRKCBRVGXEXAVAF9PQFANAFAVlAVANJAF9JyRcGXGXAG9FQBAcCbJHIC9wZHMCE9sRSAMCFWRQAICIrCEJCGrRfCBRbEXAKRTCBRtGXEXGXAOATlAf9PQBCBRKSLMALCU/CBJAtAM9sJRmATAfJRKCBREGXAMCoB9JQBAOAKlC/gB9JQBCBRIEXAmAIJREGXGXGXGXGXATAICKrJ2BBHYCEZfIBFGEBMAECBDtDMIBSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIBAKCTJRKMGXGXGXGXGXAYCGrCEZfIBFGEBMAECBDtDMITSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMITAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMITAKCTJRKMGXGXGXGXGXAYCIrCEZfIBFGEBMAECBDtDMIASEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIAAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAEAKDBBBDMIAAKCTJRKMGXGXGXGXGXAYCKrfIBFGEBMAECBDtDMI8wSEMAEAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCIJAnDeBJAYCx+YUUBJ2BBJRKSGMAEAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBAYCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HYCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMI8wAKCNJAnDeBJAYCx+YUUBJ2BBJRKSFMAEAKDBBBDMI8wAKCTJRKMAICoBJREAICUFJAM9LQFAERIAOAKlC/fB9LQBMMGXAEAM9PQBAECErRIEXGXAOAKlCi9PQBCBRKSOMAmAEJRYGXGXGXGXGXATAECKrJ2BBAICKZrCEZfIBFGEBMAYCBDtDMIBSEMAYAKDBBIAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnHPCGD+MFAPDQBTFtGmEYIPLdKeOnC0+G+MiDtD9OHdCEDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCIJAnDeBJAeCx+YUUBJ2BBJRKSGMAYAKDBBNAKDBBBHPCID+MFAPDQBTFtGmEYIPLdKeOnC+P+e+8/4BDtD9OHdCbDbD8jHPD8dBhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBAeCx+YUUBJDBBBHnAnDQBBBBBBBBBBBBBBBBAPD8dFhUg/8/4/w/goB9+h84k7HeCEWCxkUUBJDBEBD9uDQBFGEILKOTtmYPdenDfAdAPD9SDMIBAKCNJAnDeBJAeCx+YUUBJ2BBJRKSFMAYAKDBBBDMIBAKCTJRKMAICGJRIAECTJHEAM9JQBMMGXAK9FQBAKRTAtCFJHtCI6QGSFMMCBRKSEMGXAM9FQBALCUGJAbJREALAbJDBGBRnCBRYEXAEALCU/CBJAYJHIDBIBHdCFD9tAdCFDbHPD9OD9hD9RHdAIAMJDBIBHiCFD9tAiAPD9OD9hD9RHiDQBTFtGmEYIPLdKeOnH8ZAIAQJDBIBHpCFD9tApAPD9OD9hD9RHpAIASJDBIBHyCFD9tAyAPD9OD9hD9RHyDQBTFtGmEYIPLdKeOnH8cDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGEAnD9uHnDyBjGBAEAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnA8ZA8cDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNiV8ZcpMyS8cQ8df8eb8fHdApAyDQNiV8ZcpMyS8cQ8df8eb8fHiDQBFTtGEmYILPdKOenHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJHIAnAdAiDQNVi8ZcMpySQ8c8dfb8e8fHPAPDQBFGEBFGEBFGEBFGED9uHnDyBjGBAIAGJHIAnAPAPDQILKOILKOILKOILKOD9uHnDyBjGBAIAGJHIAnAPAPDQNVcMNVcMNVcMNVcMD9uHnDyBjGBAIAGJHIAnAPAPDQSQfbSQfbSQfbSQfbD9uHnDyBjGBAIAGJREAYCTJHYAM9JQBMMAbCIJHbAG9JQBMMABAVAG9sJALCUGJAcAG9s/8cBBALALCUGJAcCaJAG9sJAG/8cBBMAcCBAKyAVJRVAKQBMC9+RKSFMCBC99AOAKlAGCAAGCA9Ly6yRKMALCU/KBJ8kUUUUBAKMNBT+BUUUBM+KmFTa8jUUUUBCoFlHL8kUUUUBC9+RKGXAFCE9uHOCtJAI9LQBCaRKAE2BBHNC/wFZC/gF9HQBANCbZHVCF9LQBALCoBJCgFCUF/8MBALC84Jha83EBALC8wJha83EBALC8oJha83EBALCAJha83EBALCiJha83EBALCTJha83EBALha83ENALha83EBAEAIJC9wJRcAECFJHNAOJRMGXAF9FQBCQCbAVCF6yRSABRECBRVCBRQCBRfCBRICBRKEXGXAMAcuQBC9+RKSEMGXGXAN2BBHOC/vF9LQBALCoBJAOCIrCa9zAKJCbZCEWJHb8oGIRTAb8oGBRtGXAOCbZHbAS9PQBALAOCa9zAIJCbZCGWJ8oGBAVAbyROAb9FRbGXGXAGCG9HQBABAt87FBABCIJAO87FBABCGJAT87FBSFMAEAtjGBAECNJAOjGBAECIJATjGBMAVAbJRVALCoBJAKCEWJHmAOjGBAmATjGIALAICGWJAOjGBALCoBJAKCFJCbZHKCEWJHTAtjGBATAOjGIAIAbJRIAKCFJRKSGMGXGXAbCb6QBAQAbJAbC989zJCFJRQSFMAM1BBHbCgFZROGXGXAbCa9MQBAMCFJRMSFMAM1BFHbCgBZCOWAOCgBZqROGXAbCa9MQBAMCGJRMSFMAM1BGHbCgBZCfWAOqROGXAbCa9MQBAMCEJRMSFMAM1BEHbCgBZCdWAOqROGXAbCa9MQBAMCIJRMSFMAM2BIC8cWAOqROAMCLJRMMAOCFrCBAOCFZl9zAQJRQMGXGXAGCG9HQBABAt87FBABCIJAQ87FBABCGJAT87FBSFMAEAtjGBAECNJAQjGBAECIJATjGBMALCoBJAKCEWJHOAQjGBAOATjGIALAICGWJAQjGBALCoBJAKCFJCbZHKCEWJHOAtjGBAOAQjGIAICFJRIAKCFJRKSFMGXAOCDF9LQBALAIAcAOCbZJ2BBHbCIrHTlCbZCGWJ8oGBAVCFJHtATyROALAIAblCbZCGWJ8oGBAtAT9FHmJHtAbCbZHTyRbAT9FRTGXGXAGCG9HQBABAV87FBABCIJAb87FBABCGJAO87FBSFMAEAVjGBAECNJAbjGBAECIJAOjGBMALAICGWJAVjGBALCoBJAKCEWJHYAOjGBAYAVjGIALAICFJHICbZCGWJAOjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAIAmJCbZHICGWJAbjGBALCoBJAKCGJCbZHKCEWJHOAVjGBAOAbjGIAKCFJRKAIATJRIAtATJRVSFMAVCBAM2BBHYyHTAOC/+F6HPJROAYCbZRtGXGXAYCIrHmQBAOCFJRbSFMAORbALAIAmlCbZCGWJ8oGBROMGXGXAtQBAbCFJRVSFMAbRVALAIAYlCbZCGWJ8oGBRbMGXGXAP9FQBAMCFJRYSFMAM1BFHYCgFZRTGXGXAYCa9MQBAMCGJRYSFMAM1BGHYCgBZCOWATCgBZqRTGXAYCa9MQBAMCEJRYSFMAM1BEHYCgBZCfWATqRTGXAYCa9MQBAMCIJRYSFMAM1BIHYCgBZCdWATqRTGXAYCa9MQBAMCLJRYSFMAMCKJRYAM2BLC8cWATqRTMATCFrCBATCFZl9zAQJHQRTMGXGXAmCb6QBAYRPSFMAY1BBHMCgFZROGXGXAMCa9MQBAYCFJRPSFMAY1BFHMCgBZCOWAOCgBZqROGXAMCa9MQBAYCGJRPSFMAY1BGHMCgBZCfWAOqROGXAMCa9MQBAYCEJRPSFMAY1BEHMCgBZCdWAOqROGXAMCa9MQBAYCIJRPSFMAYCLJRPAY2BIC8cWAOqROMAOCFrCBAOCFZl9zAQJHQROMGXGXAtCb6QBAPRMSFMAP1BBHMCgFZRbGXGXAMCa9MQBAPCFJRMSFMAP1BFHMCgBZCOWAbCgBZqRbGXAMCa9MQBAPCGJRMSFMAP1BGHMCgBZCfWAbqRbGXAMCa9MQBAPCEJRMSFMAP1BEHMCgBZCdWAbqRbGXAMCa9MQBAPCIJRMSFMAPCLJRMAP2BIC8cWAbqRbMAbCFrCBAbCFZl9zAQJHQRbMGXGXAGCG9HQBABAT87FBABCIJAb87FBABCGJAO87FBSFMAEATjGBAECNJAbjGBAECIJAOjGBMALCoBJAKCEWJHYAOjGBAYATjGIALAICGWJATjGBALCoBJAKCFJCbZCEWJHYAbjGBAYAOjGIALAICFJHICbZCGWJAOjGBALCoBJAKCGJCbZCEWJHOATjGBAOAbjGIALAIAm9FAmCb6qJHICbZCGWJAbjGBAIAt9FAtCb6qJRIAKCEJRKMANCFJRNABCKJRBAECSJREAKCbZRKAICbZRIAfCEJHfAF9JQBMMCBC99AMAc6yRKMALCoFJ8kUUUUBAKM/tIFGa8jUUUUBCTlRLC9+RKGXAFCLJAI9LQBCaRKAE2BBC/+FZC/QF9HQBALhB83ENAECFJRKAEAIJC98JREGXAF9FQBGXAGCG6QBEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMALCNJAICFZCGWqHGAICGrCBAICFrCFZl9zAG8oGBJHIjGBABAIjGBABCIJRBAFCaJHFQBSGMMEXGXAKAE9JQBC9+bMAK1BBHGCgFZRIGXGXAGCa9MQBAKCFJRKSFMAK1BFHGCgBZCOWAICgBZqRIGXAGCa9MQBAKCGJRKSFMAK1BGHGCgBZCfWAIqRIGXAGCa9MQBAKCEJRKSFMAK1BEHGCgBZCdWAIqRIGXAGCa9MQBAKCIJRKSFMAK2BIC8cWAIqRIAKCLJRKMABAICGrCBAICFrCFZl9zALCNJAICFZCGWqHI8oGBJHG87FBAIAGjGBABCGJRBAFCaJHFQBMMCBC99AKAE6yRKMAKM/xLGEaK978jUUUUBCAlHE8kUUUUBGXGXAGCI9HQBGXAFC98ZHI9FQBABRGCBRLEXAGAGDBBBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMBBAGCTJRGALCIJHLAI9JQBMMAIAF9PQFAEAFCEZHLCGWHGqCBCTAGl/8MBAEABAICGWJHIAG/8cBBGXAL9FQBAEAEDBIBHKCiD+rFCiD+sFD/6FHOAKCND+rFCiD+sFD/6FAOD/gFAKCTD+rFCiD+sFD/6FHND/gFD/kFD/lFHVCBDtD+2FHcAOCUUUU94DtHMD9OD9RD/kFHO9DBB/+hDYAOAOD/mFAVAVD/mFANAcANAMD9OD9RD/kFHOAOD/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHcD/kFCgFDtD9OAKCUUU94DtD9OD9QAOAND/mFAcD/kFCND+rFCU/+EDtD9OD9QAVAND/mFAcD/kFCTD+rFCUU/8ODtD9OD9QDMIBMAIAEAG/8cBBSFMABAFC98ZHGT+HUUUBAGAF9PQBAEAFCEZHICEWHLJCBCAALl/8MBAEABAGCEWJHGAL/8cBBAEAIT+HUUUBAGAEAL/8cBBMAECAJ8kUUUUBM+yEGGaO97GXAF9FQBCBRGEXABCTJHEAEDBBBHICBDtHLCUU98D8cFCUU98D8cEHKD9OABDBBBHOAIDQILKOSQfbPden8c8d8e8fCggFDtD9OD/6FAOAIDQBFGENVcMTtmYi8ZpyHICTD+sFD/6FHND/gFAICTD+rFCTD+sFD/6FHVD/gFD/kFD/lFHI9DB/+g6DYAVAIALD+2FHLAVCUUUU94DtHcD9OD9RD/kFHVAVD/mFAIAID/mFANALANAcD9OD9RD/kFHIAID/mFD/kFD/kFD/jFD/nFHND/mF9DBBX9LDYHLD/kFCTD+rFAVAND/mFALD/kFCggEDtD9OD9QHVAIAND/mFALD/kFCaDbCBDnGCBDnECBDnKCBDnOCBDncCBDnMCBDnfCBDnbD9OHIDQNVi8ZcMpySQ8c8dfb8e8fD9QDMBBABAOAKD9OAVAIDQBFTtGEmYILPdKOenD9QDMBBABCAJRBAGCIJHGAF9JQBMMM94FEa8jUUUUBCAlHE8kUUUUBABAFC98ZHIT+JUUUBGXAIAF9PQBAEAFCEZHLCEWHFJCBCAAFl/8MBAEABAICEWJHBAF/8cBBAEALT+JUUUBABAEAF/8cBBMAECAJ8kUUUUBM/hEIGaF97FaL978jUUUUBCTlRGGXAF9FQBCBREEXAGABDBBBHIABCTJHLDBBBHKDQILKOSQfbPden8c8d8e8fHOCTD+sFHNCID+rFDMIBAB9DBBU8/DY9D/zI818/DYANCEDtD9QD/6FD/nFHNAIAKDQBFGENVcMTtmYi8ZpyHICTD+rFCTD+sFD/6FD/mFHKAKD/mFANAICTD+sFD/6FD/mFHVAVD/mFANAOCTD+rFCTD+sFD/6FD/mFHOAOD/mFD/kFD/kFD/lFCBDtD+4FD/jF9DB/+g6DYHND/mF9DBBX9LDYHID/kFCggEDtHcD9OAVAND/mFAID/kFCTD+rFD9QHVAOAND/mFAID/kFCTD+rFAKAND/mFAID/kFAcD9OD9QHNDQBFTtGEmYILPdKOenHID8dBAGDBIBDyB+t+J83EBABCNJAID8dFAGDBIBDyF+t+J83EBALAVANDQNVi8ZcMpySQ8c8dfb8e8fHND8dBAGDBIBDyG+t+J83EBABCiJAND8dFAGDBIBDyE+t+J83EBABCAJRBAECIJHEAF9JQBMMM/3FGEaF978jUUUUBCoBlREGXAGCGrAF9sHIC98ZHL9FQBCBRGABRFEXAFAFDBBBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMBBAFCTJRFAGCIJHGAL9JQBMMGXALAI9PQBAEAICEZHGCGWHFqCBCoBAFl/8MBAEABALCGWJHLAF/8cBBGXAG9FQBAEAEDBIBHKCND+rFCND+sFD/6FAKCiD+sFCnD+rFCUUU/8EDtD+uFD/mFDMIBMALAEAF/8cBBMM9TFEaCBCB8oGUkUUBHFABCEJC98ZJHBjGUkUUBGXGXAB8/BCTWHGuQBCaREABAGlCggEJCTrXBCa6QFMAFREMAEMMMFBCUNMIT9tBB",JWt=new Uint8Array([0,97,115,109,1,0,0,0,1,4,1,96,0,0,3,3,2,0,0,5,3,1,0,1,12,1,0,10,22,2,12,0,65,0,65,0,65,0,252,10,0,0,11,7,0,65,0,253,15,26,11]),ZWt=new Uint8Array([32,0,65,253,3,1,2,34,4,106,6,5,11,8,7,20,13,33,12,16,128,9,116,64,19,113,127,15,10,21,22,14,255,66,24,54,136,107,18,23,192,26,114,118,132,17,77,101,130,144,27,87,131,44,45,74,156,154,70,167]),XWt={0:"",1:"meshopt_decodeFilterOct",2:"meshopt_decodeFilterQuat",3:"meshopt_decodeFilterExp",NONE:"",OCTAHEDRAL:"meshopt_decodeFilterOct",QUATERNION:"meshopt_decodeFilterQuat",EXPONENTIAL:"meshopt_decodeFilterExp"},YWt={0:"meshopt_decodeVertexBuffer",1:"meshopt_decodeIndexBuffer",2:"meshopt_decodeIndexSequence",ATTRIBUTES:"meshopt_decodeVertexBuffer",TRIANGLES:"meshopt_decodeIndexBuffer",INDICES:"meshopt_decodeIndexSequence"};async function $Wt(t,e,i,r,o,n="NONE"){const s=await eJt();rJt(s,s.exports[YWt[o]],t,e,i,r,s.exports[XWt[n||"NONE"]])}let $U;async function eJt(){return $U||($U=tJt()),$U}async function tJt(){let t=KWt;WebAssembly.validate(JWt)&&(t=WWt,console.log("Warning: meshopt_decoder is using experimental SIMD support"));const e=await WebAssembly.instantiate(iJt(t),{});return await e.instance.exports.__wasm_call_ctors(),e.instance}function iJt(t){const e=new Uint8Array(t.length);for(let r=0;r<t.length;++r){const o=t.charCodeAt(r);e[r]=o>96?o-71:o>64?o-65:o>47?o+4:o>46?63:62}let i=0;for(let r=0;r<t.length;++r)e[i++]=e[r]<60?ZWt[e[r]]:(e[r]-60)*64+e[++r];return e.buffer.slice(0,i)}function rJt(t,e,i,r,o,n,s){const a=t.exports.sbrk,l=r+3&-4,c=a(l*o),d=a(n.length),u=new Uint8Array(t.exports.memory.buffer);u.set(n,d);const h=e(c,r,o,d,n.length);if(h===0&&s&&s(c,l,o),i.set(u.subarray(c,c+r*o)),a(c-a(0)),h!==0)throw new Error(`Malformed buffer data: ${h}`)}const RE="EXT_meshopt_compression",oJt=RE;async function nJt(t,e){const i=new os(t);if(!e?.gltf?.decompressMeshes||!e.gltf?.loadBuffers)return;const r=[];for(const o of t.json.bufferViews||[])r.push(sJt(i,o));await Promise.all(r),i.removeExtension(RE)}async function sJt(t,e){const i=t.getObjectExtension(e,RE);if(i){const{byteOffset:r=0,byteLength:o=0,byteStride:n,count:s,mode:a,filter:l="NONE",buffer:c}=i,d=t.gltf.buffers[c],u=new Uint8Array(d.arrayBuffer,d.byteOffset+r,o),h=new Uint8Array(t.gltf.buffers[e.buffer].arrayBuffer,e.byteOffset,e.byteLength);await $Wt(h,s,n,u,a,l),t.removeObjectExtension(e,RE)}}const aJt=Object.freeze(Object.defineProperty({__proto__:null,decode:nJt,name:oJt},Symbol.toStringTag,{value:"Module"})),FA="EXT_texture_webp",lJt=FA;function cJt(t,e){const i=new os(t);if(!rKt("image/webp")){if(i.getRequiredExtensions().includes(FA))throw new Error(`gltf: Required extension ${FA} not supported by browser`);return}const{json:r}=i;for(const o of r.textures||[]){const n=i.getObjectExtension(o,FA);n&&(o.source=n.source),i.removeObjectExtension(o,FA)}i.removeExtension(FA)}const dJt=Object.freeze(Object.defineProperty({__proto__:null,name:lJt,preprocess:cJt},Symbol.toStringTag,{value:"Module"})),DE="KHR_texture_basisu",uJt=DE;function hJt(t,e){const i=new os(t),{json:r}=i;for(const o of r.textures||[]){const n=i.getObjectExtension(o,DE);n&&(o.source=n.source,i.removeObjectExtension(o,DE))}i.removeExtension(DE)}const pJt=Object.freeze(Object.defineProperty({__proto__:null,name:uJt,preprocess:hJt},Symbol.toStringTag,{value:"Module"})),fJt="4.3.3",gJt={dataType:null,batchType:null,name:"Draco",id:"draco",module:"draco",version:fJt,worker:!0,extensions:["drc"],mimeTypes:["application/octet-stream"],binary:!0,tests:["DRACO"],options:{draco:{decoderType:typeof WebAssembly=="object"?"wasm":"js",libraryPath:"libs/",extraAttributes:{},attributeNameEntry:void 0}}};function AJt(t,e,i){const r=Cue(e.metadata),o=[],n=mJt(e.attributes);for(const s in t){const a=t[s],l=wue(s,a,n[s]);o.push(l)}if(i){const s=wue("indices",i);o.push(s)}return{fields:o,metadata:r}}function mJt(t){const e={};for(const i in t){const r=t[i];e[r.name||"undefined"]=r}return e}function wue(t,e,i){const r=i?Cue(i.metadata):void 0;return CQt(t,e,r)}function Cue(t){Object.entries(t);const e={};for(const i in t)e[`${i}.string`]=JSON.stringify(t[i]);return e}const xue={POSITION:"POSITION",NORMAL:"NORMAL",COLOR:"COLOR_0",TEX_COORD:"TEXCOORD_0"},vJt={1:Int8Array,2:Uint8Array,3:Int16Array,4:Uint16Array,5:Int32Array,6:Uint32Array,9:Float32Array},yJt=4;class bJt{draco;decoder;metadataQuerier;constructor(e){this.draco=e,this.decoder=new this.draco.Decoder,this.metadataQuerier=new this.draco.MetadataQuerier}destroy(){this.draco.destroy(this.decoder),this.draco.destroy(this.metadataQuerier)}parseSync(e,i={}){const r=new this.draco.DecoderBuffer;r.Init(new Int8Array(e),e.byteLength),this._disableAttributeTransforms(i);const o=this.decoder.GetEncodedGeometryType(r),n=o===this.draco.TRIANGULAR_MESH?new this.draco.Mesh:new this.draco.PointCloud;try{let s;switch(o){case this.draco.TRIANGULAR_MESH:s=this.decoder.DecodeBufferToMesh(r,n);break;case this.draco.POINT_CLOUD:s=this.decoder.DecodeBufferToPointCloud(r,n);break;default:throw new Error("DRACO: Unknown geometry type.")}if(!s.ok()||!n.ptr){const u=`DRACO decompression failed: ${s.error_msg()}`;throw new Error(u)}const a=this._getDracoLoaderData(n,o,i),l=this._getMeshData(n,a,i),c=wQt(l.attributes),d=AJt(l.attributes,a,l.indices);return{loader:"draco",loaderData:a,header:{vertexCount:n.num_points(),boundingBox:c},...l,schema:d}}finally{this.draco.destroy(r),n&&this.draco.destroy(n)}}_getDracoLoaderData(e,i,r){const o=this._getTopLevelMetadata(e),n=this._getDracoAttributes(e,r);return{geometry_type:i,num_attributes:e.num_attributes(),num_points:e.num_points(),num_faces:e instanceof this.draco.Mesh?e.num_faces():0,metadata:o,attributes:n}}_getDracoAttributes(e,i){const r={};for(let o=0;o<e.num_attributes();o++){const n=this.decoder.GetAttribute(e,o),s=this._getAttributeMetadata(e,o);r[n.unique_id()]={unique_id:n.unique_id(),attribute_type:n.attribute_type(),data_type:n.data_type(),num_components:n.num_components(),byte_offset:n.byte_offset(),byte_stride:n.byte_stride(),normalized:n.normalized(),attribute_index:o,metadata:s};const a=this._getQuantizationTransform(n,i);a&&(r[n.unique_id()].quantization_transform=a);const l=this._getOctahedronTransform(n,i);l&&(r[n.unique_id()].octahedron_transform=l)}return r}_getMeshData(e,i,r){const o=this._getMeshAttributes(i,e,r);if(!o.POSITION)throw new Error("DRACO: No position attribute found.");if(e instanceof this.draco.Mesh)switch(r.topology){case"triangle-strip":return{topology:"triangle-strip",mode:4,attributes:o,indices:{value:this._getTriangleStripIndices(e),size:1}};case"triangle-list":default:return{topology:"triangle-list",mode:5,attributes:o,indices:{value:this._getTriangleListIndices(e),size:1}}}return{topology:"point-list",mode:0,attributes:o}}_getMeshAttributes(e,i,r){const o={};for(const n of Object.values(e.attributes)){const s=this._deduceAttributeName(n,r);n.name=s;const a=this._getAttributeValues(i,n);if(a){const{value:l,size:c}=a;o[s]={value:l,size:c,byteOffset:n.byte_offset,byteStride:n.byte_stride,normalized:n.normalized}}}return o}_getTriangleListIndices(e){const i=e.num_faces()*3,r=i*yJt,o=this.draco._malloc(r);try{return this.decoder.GetTrianglesUInt32Array(e,r,o),new Uint32Array(this.draco.HEAPF32.buffer,o,i).slice()}finally{this.draco._free(o)}}_getTriangleStripIndices(e){const i=new this.draco.DracoInt32Array;try{return this.decoder.GetTriangleStripsFromMesh(e,i),xJt(i)}finally{this.draco.destroy(i)}}_getAttributeValues(e,i){const r=vJt[i.data_type];if(!r)return console.warn(`DRACO: Unsupported attribute type ${i.data_type}`),null;const o=i.num_components,n=e.num_points()*o,s=n*r.BYTES_PER_ELEMENT,a=wJt(this.draco,r);let l;const c=this.draco._malloc(s);try{const d=this.decoder.GetAttribute(e,i.attribute_index);this.decoder.GetAttributeDataArrayForAllPoints(e,d,a,s,c),l=new r(this.draco.HEAPF32.buffer,c,n).slice()}finally{this.draco._free(c)}return{value:l,size:o}}_deduceAttributeName(e,i){const r=e.unique_id;for(const[s,a]of Object.entries(i.extraAttributes||{}))if(a===r)return s;const o=e.attribute_type;for(const s in xue)if(this.draco[s]===o)return xue[s];const n=i.attributeNameEntry||"name";return e.metadata[n]?e.metadata[n].string:`CUSTOM_ATTRIBUTE_${r}`}_getTopLevelMetadata(e){const i=this.decoder.GetMetadata(e);return this._getDracoMetadata(i)}_getAttributeMetadata(e,i){const r=this.decoder.GetAttributeMetadata(e,i);return this._getDracoMetadata(r)}_getDracoMetadata(e){if(!e||!e.ptr)return{};const i={},r=this.metadataQuerier.NumEntries(e);for(let o=0;o<r;o++){const n=this.metadataQuerier.GetEntryName(e,o);i[n]=this._getDracoMetadataField(e,n)}return i}_getDracoMetadataField(e,i){const r=new this.draco.DracoInt32Array;try{this.metadataQuerier.GetIntEntryArray(e,i,r);const o=CJt(r);return{int:this.metadataQuerier.GetIntEntry(e,i),string:this.metadataQuerier.GetStringEntry(e,i),double:this.metadataQuerier.GetDoubleEntry(e,i),intArray:o}}finally{this.draco.destroy(r)}}_disableAttributeTransforms(e){const{quantizedAttributes:i=[],octahedronAttributes:r=[]}=e,o=[...i,...r];for(const n of o)this.decoder.SkipAttributeTransform(this.draco[n])}_getQuantizationTransform(e,i){const{quantizedAttributes:r=[]}=i,o=e.attribute_type();if(r.map(n=>this.decoder[n]).includes(o)){const n=new this.draco.AttributeQuantizationTransform;try{if(n.InitFromAttribute(e))return{quantization_bits:n.quantization_bits(),range:n.range(),min_values:new Float32Array([1,2,3]).map(s=>n.min_value(s))}}finally{this.draco.destroy(n)}}return null}_getOctahedronTransform(e,i){const{octahedronAttributes:r=[]}=i,o=e.attribute_type();if(r.map(n=>this.decoder[n]).includes(o)){const n=new this.draco.AttributeQuantizationTransform;try{if(n.InitFromAttribute(e))return{quantization_bits:n.quantization_bits()}}finally{this.draco.destroy(n)}}return null}}function wJt(t,e){switch(e){case Float32Array:return t.DT_FLOAT32;case Int8Array:return t.DT_INT8;case Int16Array:return t.DT_INT16;case Int32Array:return t.DT_INT32;case Uint8Array:return t.DT_UINT8;case Uint16Array:return t.DT_UINT16;case Uint32Array:return t.DT_UINT32;default:return t.DT_INVALID}}function CJt(t){const e=t.size(),i=new Int32Array(e);for(let r=0;r<e;r++)i[r]=t.GetValue(r);return i}function xJt(t){const e=t.size(),i=new Int32Array(e);for(let r=0;r<e;r++)i[r]=t.GetValue(r);return i}const kJt="1.5.6",MJt="1.4.1",eN=`https://www.gstatic.com/draco/versioned/decoders/${kJt}`,gl={DECODER:"draco_wasm_wrapper.js",DECODER_WASM:"draco_decoder.wasm",FALLBACK_DECODER:"draco_decoder.js",ENCODER:"draco_encoder.js"},tN={[gl.DECODER]:`${eN}/${gl.DECODER}`,[gl.DECODER_WASM]:`${eN}/${gl.DECODER_WASM}`,[gl.FALLBACK_DECODER]:`${eN}/${gl.FALLBACK_DECODER}`,[gl.ENCODER]:`https://raw.githubusercontent.com/google/draco/${MJt}/javascript/${gl.ENCODER}`};let iN;async function EJt(t){const e=t.modules||{};return e.draco3d?iN||=e.draco3d.createDecoderModule({}).then(i=>({draco:i})):iN||=BJt(t),await iN}async function BJt(t){let e,i;switch(t.draco&&t.draco.decoderType){case"js":e=await Tf(tN[gl.FALLBACK_DECODER],"draco",t,gl.FALLBACK_DECODER);break;case"wasm":default:[e,i]=await Promise.all([await Tf(tN[gl.DECODER],"draco",t,gl.DECODER),await Tf(tN[gl.DECODER_WASM],"draco",t,gl.DECODER_WASM)])}return e=e||globalThis.DracoDecoderModule,await PJt(e,i)}function PJt(t,e){const i={};return e&&(i.wasmBinary=e),new Promise(r=>{t({...i,onModuleLoaded:o=>r({draco:o})})})}const IJt={...gJt,parse:SJt};async function SJt(t,e){const{draco:i}=await EJt(e),r=new bJt(i);try{return r.parseSync(t,e?.draco)}finally{r.destroy()}}function TJt(t){const e={};for(const i in t){const r=t[i];if(i!=="indices"){const o=kue(r);e[i]=o}}return e}function kue(t){const{buffer:e,size:i,count:r}=RJt(t);return{value:e,size:i,byteOffset:0,count:r,type:rue(i),componentType:EE(e)}}function RJt(t){let e=t,i=1,r=0;return t&&t.value&&(e=t.value,i=t.size||1),e&&(ArrayBuffer.isView(e)||(e=DJt(e,Float32Array)),r=e.length/i),{buffer:e,size:i,count:r}}function DJt(t,e,i=!1){return t?Array.isArray(t)?new e(t):i&&!(t instanceof e)?new e(t):t:null}const Mp="KHR_draco_mesh_compression",_Jt=Mp;function LJt(t,e,i){const r=new os(t);for(const o of Mue(r))r.getObjectExtension(o,Mp)}async function FJt(t,e,i){if(!e?.gltf?.decompressMeshes)return;const r=new os(t),o=[];for(const n of Mue(r))r.getObjectExtension(n,Mp)&&o.push(UJt(r,n,e,i));await Promise.all(o),r.removeExtension(Mp)}function OJt(t,e={}){const i=new os(t);for(const r of i.json.meshes||[])NJt(r),i.addRequiredExtension(Mp)}async function UJt(t,e,i,r){const o=t.getObjectExtension(e,Mp);if(!o)return;const n=t.getTypedArrayForBufferView(o.bufferView),s=kde(n.buffer,n.byteOffset),a={...i};delete a["3d-tiles"];const l=await ade(s,IJt,a,r),c=TJt(l.attributes);for(const[d,u]of Object.entries(c))if(d in e.attributes){const h=e.attributes[d],p=t.getAccessor(h);p?.min&&p?.max&&(u.min=p.min,u.max=p.max)}e.attributes=c,l.indices&&(e.indices=kue(l.indices)),t.removeObjectExtension(e,Mp),jJt(e)}function NJt(t,e,i=4,r,o){if(!r.DracoWriter)throw new Error("options.gltf.DracoWriter not provided");const n=r.DracoWriter.encodeSync({attributes:t}),s=o?.parseSync?.({attributes:t}),a=r._addFauxAttributes(s.attributes),l=r.addBufferView(n);return{primitives:[{attributes:a,mode:i,extensions:{[Mp]:{bufferView:l,attributes:a}}}]}}function jJt(t){if(!t.attributes&&Object.keys(t.attributes).length>0)throw new Error("glTF: Empty primitive detected: Draco decompression failure?")}function*Mue(t){for(const e of t.json.meshes||[])for(const i of e.primitives)yield i}const HJt=Object.freeze(Object.defineProperty({__proto__:null,decode:FJt,encode:OJt,name:_Jt,preprocess:LJt},Symbol.toStringTag,{value:"Module"})),zJt={EPSILON:1e-12,debug:!1,precision:4,printTypes:!1,printDegrees:!1,printRowMajor:!0,_cartographicRadians:!1};globalThis.mathgl=globalThis.mathgl||{config:{...zJt}};const Bc=globalThis.mathgl.config;function VJt(t,{precision:e=Bc.precision}={}){return t=qJt(t),`${parseFloat(t.toPrecision(e))}`}function _E(t){return Array.isArray(t)||ArrayBuffer.isView(t)&&!(t instanceof DataView)}function Eue(t,e,i){const r=Bc.EPSILON;try{if(t===e)return!0;if(_E(t)&&_E(e)){if(t.length!==e.length)return!1;for(let o=0;o<t.length;++o)if(!Eue(t[o],e[o]))return!1;return!0}return t&&t.equals?t.equals(e):e&&e.equals?e.equals(t):typeof t=="number"&&typeof e=="number"?Math.abs(t-e)<=Bc.EPSILON*Math.max(1,Math.abs(t),Math.abs(e)):!1}finally{Bc.EPSILON=r}}function qJt(t){return Math.round(t/Bc.EPSILON)*Bc.EPSILON}class Bue extends Array{clone(){return new this.constructor().copy(this)}fromArray(e,i=0){for(let r=0;r<this.ELEMENTS;++r)this[r]=e[r+i];return this.check()}toArray(e=[],i=0){for(let r=0;r<this.ELEMENTS;++r)e[i+r]=this[r];return e}toObject(e){return e}from(e){return Array.isArray(e)?this.copy(e):this.fromObject(e)}to(e){return e===this?this:_E(e)?this.toArray(e):this.toObject(e)}toTarget(e){return e?this.to(e):this}toFloat32Array(){return new Float32Array(this)}toString(){return this.formatString(Bc)}formatString(e){let i="";for(let r=0;r<this.ELEMENTS;++r)i+=(r>0?", ":"")+VJt(this[r],e);return`${e.printTypes?this.constructor.name:""}[${i}]`}equals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i<this.ELEMENTS;++i)if(!Eue(this[i],e[i]))return!1;return!0}exactEquals(e){if(!e||this.length!==e.length)return!1;for(let i=0;i<this.ELEMENTS;++i)if(this[i]!==e[i])return!1;return!0}negate(){for(let e=0;e<this.ELEMENTS;++e)this[e]=-this[e];return this.check()}lerp(e,i,r){if(r===void 0)return this.lerp(this,e,i);for(let o=0;o<this.ELEMENTS;++o){const n=e[o],s=typeof i=="number"?i:i[o];this[o]=n+r*(s-n)}return this.check()}min(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.min(e[i],this[i]);return this.check()}max(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=Math.max(e[i],this[i]);return this.check()}clamp(e,i){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e[r]),i[r]);return this.check()}add(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]+=i[r];return this.check()}subtract(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]-=i[r];return this.check()}scale(e){if(typeof e=="number")for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;else for(let i=0;i<this.ELEMENTS&&i<e.length;++i)this[i]*=e[i];return this.check()}multiplyByScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;return this.check()}check(){if(Bc.debug&&!this.validate())throw new Error(`math.gl: ${this.constructor.name} some fields set to invalid numbers'`);return this}validate(){let e=this.length===this.ELEMENTS;for(let i=0;i<this.ELEMENTS;++i)e=e&&Number.isFinite(this[i]);return e}sub(e){return this.subtract(e)}setScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]=e;return this.check()}addScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]+=e;return this.check()}subScalar(e){return this.addScalar(-e)}multiplyScalar(e){for(let i=0;i<this.ELEMENTS;++i)this[i]*=e;return this.check()}divideScalar(e){return this.multiplyByScalar(1/e)}clampScalar(e,i){for(let r=0;r<this.ELEMENTS;++r)this[r]=Math.min(Math.max(this[r],e),i);return this.check()}get elements(){return this}}function GJt(t,e){if(t.length!==e)return!1;for(let i=0;i<t.length;++i)if(!Number.isFinite(t[i]))return!1;return!0}function Kl(t){if(!Number.isFinite(t))throw new Error(`Invalid number ${JSON.stringify(t)}`);return t}function QJt(t,e,i=""){if(Bc.debug&&!GJt(t,e))throw new Error(`math.gl: ${i} some fields set to invalid numbers'`);return t}function Pue(t,e){if(!t)throw new Error(`math.gl assertion ${e}`)}class KJt extends Bue{get x(){return this[0]}set x(e){this[0]=Kl(e)}get y(){return this[1]}set y(e){this[1]=Kl(e)}len(){return Math.sqrt(this.lengthSquared())}magnitude(){return this.len()}lengthSquared(){let e=0;for(let i=0;i<this.ELEMENTS;++i)e+=this[i]*this[i];return e}magnitudeSquared(){return this.lengthSquared()}distance(e){return Math.sqrt(this.distanceSquared(e))}distanceSquared(e){let i=0;for(let r=0;r<this.ELEMENTS;++r){const o=this[r]-e[r];i+=o*o}return Kl(i)}dot(e){let i=0;for(let r=0;r<this.ELEMENTS;++r)i+=this[r]*e[r];return Kl(i)}normalize(){const e=this.magnitude();if(e!==0)for(let i=0;i<this.ELEMENTS;++i)this[i]/=e;return this.check()}multiply(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]*=i[r];return this.check()}divide(...e){for(const i of e)for(let r=0;r<this.ELEMENTS;++r)this[r]/=i[r];return this.check()}lengthSq(){return this.lengthSquared()}distanceTo(e){return this.distance(e)}distanceToSquared(e){return this.distanceSquared(e)}getComponent(e){return Pue(e>=0&&e<this.ELEMENTS,"index is out of range"),Kl(this[e])}setComponent(e,i){return Pue(e>=0&&e<this.ELEMENTS,"index is out of range"),this[e]=i,this.check()}addVectors(e,i){return this.copy(e).add(i)}subVectors(e,i){return this.copy(e).subtract(i)}multiplyVectors(e,i){return this.copy(e).multiply(i)}addScaledVector(e,i){return this.add(new this.constructor(e).multiplyScalar(i))}}let LE=typeof Float32Array<"u"?Float32Array:Array;function WJt(){const t=new LE(2);return LE!=Float32Array&&(t[0]=0,t[1]=0),t}function JJt(t,e,i){const r=e[0],o=e[1];return t[0]=i[0]*r+i[3]*o+i[6],t[1]=i[1]*r+i[4]*o+i[7],t}(function(){const t=WJt();return function(e,i,r,o,n,s){let a,l;for(i||(i=2),r||(r=0),o?l=Math.min(o*i+r,e.length):l=e.length,a=r;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],n(t,t,s),e[a]=t[0],e[a+1]=t[1];return e}})();function ZJt(t,e,i){const r=e[0],o=e[1],n=e[2],s=i[3]*r+i[7]*o+i[11]*n||1;return t[0]=(i[0]*r+i[4]*o+i[8]*n)/s,t[1]=(i[1]*r+i[5]*o+i[9]*n)/s,t[2]=(i[2]*r+i[6]*o+i[10]*n)/s,t}function XJt(t,e,i){const r=e[0],o=e[1];return t[0]=i[0]*r+i[2]*o,t[1]=i[1]*r+i[3]*o,t[2]=e[2],t}function YJt(t,e,i){const r=e[0],o=e[1],n=e[2];return t[0]=i[0]*r+i[3]*o+i[6]*n,t[1]=i[1]*r+i[4]*o+i[7]*n,t[2]=i[2]*r+i[5]*o+i[8]*n,t[3]=e[3],t}function $Jt(){const t=new LE(3);return LE!=Float32Array&&(t[0]=0,t[1]=0,t[2]=0),t}function eZt(t,e){return t[0]*e[0]+t[1]*e[1]+t[2]*e[2]}function tZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=i[0],a=i[1],l=i[2];return t[0]=o*l-n*a,t[1]=n*s-r*l,t[2]=r*a-o*s,t}function iZt(t,e,i){const r=e[0],o=e[1],n=e[2];let s=i[3]*r+i[7]*o+i[11]*n+i[15];return s=s||1,t[0]=(i[0]*r+i[4]*o+i[8]*n+i[12])/s,t[1]=(i[1]*r+i[5]*o+i[9]*n+i[13])/s,t[2]=(i[2]*r+i[6]*o+i[10]*n+i[14])/s,t}function Iue(t,e,i){const r=e[0],o=e[1],n=e[2];return t[0]=r*i[0]+o*i[3]+n*i[6],t[1]=r*i[1]+o*i[4]+n*i[7],t[2]=r*i[2]+o*i[5]+n*i[8],t}function rZt(t,e,i){const r=i[0],o=i[1],n=i[2],s=i[3],a=e[0],l=e[1],c=e[2];let d=o*c-n*l,u=n*a-r*c,h=r*l-o*a,p=o*h-n*u,g=n*d-r*h,f=r*u-o*d;const m=s*2;return d*=m,u*=m,h*=m,p*=2,g*=2,f*=2,t[0]=a+d+p,t[1]=l+u+g,t[2]=c+h+f,t}function oZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[0],n[1]=o[1]*Math.cos(r)-o[2]*Math.sin(r),n[2]=o[1]*Math.sin(r)+o[2]*Math.cos(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function nZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[2]*Math.sin(r)+o[0]*Math.cos(r),n[1]=o[1],n[2]=o[2]*Math.cos(r)-o[0]*Math.sin(r),t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function sZt(t,e,i,r){const o=[],n=[];return o[0]=e[0]-i[0],o[1]=e[1]-i[1],o[2]=e[2]-i[2],n[0]=o[0]*Math.cos(r)-o[1]*Math.sin(r),n[1]=o[0]*Math.sin(r)+o[1]*Math.cos(r),n[2]=o[2],t[0]=n[0]+i[0],t[1]=n[1]+i[1],t[2]=n[2]+i[2],t}function aZt(t,e){const i=t[0],r=t[1],o=t[2],n=e[0],s=e[1],a=e[2],l=Math.sqrt((i*i+r*r+o*o)*(n*n+s*s+a*a)),c=l&&eZt(t,e)/l;return Math.acos(Math.min(Math.max(c,-1),1))}(function(){const t=$Jt();return function(e,i,r,o,n,s){let a,l;for(i||(i=3),r||(r=0),o?l=Math.min(o*i+r,e.length):l=e.length,a=r;a<l;a+=i)t[0]=e[a],t[1]=e[a+1],t[2]=e[a+2],n(t,t,s),e[a]=t[0],e[a+1]=t[1],e[a+2]=t[2];return e}})();const rN=[0,0,0];let FE,lZt=class pxe extends KJt{static get ZERO(){return FE||(FE=new pxe(0,0,0),Object.freeze(FE)),FE}constructor(e=0,i=0,r=0){super(-0,-0,-0),arguments.length===1&&_E(e)?this.copy(e):(Bc.debug&&(Kl(e),Kl(i),Kl(r)),this[0]=e,this[1]=i,this[2]=r)}set(e,i,r){return this[0]=e,this[1]=i,this[2]=r,this.check()}copy(e){return this[0]=e[0],this[1]=e[1],this[2]=e[2],this.check()}fromObject(e){return Bc.debug&&(Kl(e.x),Kl(e.y),Kl(e.z)),this[0]=e.x,this[1]=e.y,this[2]=e.z,this.check()}toObject(e){return e.x=this[0],e.y=this[1],e.z=this[2],e}get ELEMENTS(){return 3}get z(){return this[2]}set z(e){this[2]=Kl(e)}angle(e){return aZt(this,e)}cross(e){return tZt(this,this,e),this.check()}rotateX({radians:e,origin:i=rN}){return oZt(this,this,i,e),this.check()}rotateY({radians:e,origin:i=rN}){return nZt(this,this,i,e),this.check()}rotateZ({radians:e,origin:i=rN}){return sZt(this,this,i,e),this.check()}transform(e){return this.transformAsPoint(e)}transformAsPoint(e){return iZt(this,this,e),this.check()}transformAsVector(e){return ZJt(this,this,e),this.check()}transformByMatrix3(e){return Iue(this,this,e),this.check()}transformByMatrix2(e){return XJt(this,this,e),this.check()}transformByQuaternion(e){return rZt(this,this,e),this.check()}};class cZt extends Bue{toString(){let e="[";if(Bc.printRowMajor){e+="row-major:";for(let i=0;i<this.RANK;++i)for(let r=0;r<this.RANK;++r)e+=` ${this[r*this.RANK+i]}`}else{e+="column-major:";for(let i=0;i<this.ELEMENTS;++i)e+=` ${this[i]}`}return e+="]",e}getElementIndex(e,i){return i*this.RANK+e}getElement(e,i){return this[i*this.RANK+e]}setElement(e,i,r){return this[i*this.RANK+e]=Kl(r),this}getColumn(e,i=new Array(this.RANK).fill(-0)){const r=e*this.RANK;for(let o=0;o<this.RANK;++o)i[o]=this[r+o];return i}setColumn(e,i){const r=e*this.RANK;for(let o=0;o<this.RANK;++o)this[r+o]=i[o];return this}}function dZt(t,e){if(t===e){const i=e[1],r=e[2],o=e[5];t[1]=e[3],t[2]=e[6],t[3]=i,t[5]=e[7],t[6]=r,t[7]=o}else t[0]=e[0],t[1]=e[3],t[2]=e[6],t[3]=e[1],t[4]=e[4],t[5]=e[7],t[6]=e[2],t[7]=e[5],t[8]=e[8];return t}function uZt(t,e){const i=e[0],r=e[1],o=e[2],n=e[3],s=e[4],a=e[5],l=e[6],c=e[7],d=e[8],u=d*s-a*c,h=-d*n+a*l,p=c*n-s*l;let g=i*u+r*h+o*p;return g?(g=1/g,t[0]=u*g,t[1]=(-d*r+o*c)*g,t[2]=(a*r-o*s)*g,t[3]=h*g,t[4]=(d*i-o*l)*g,t[5]=(-a*i+o*n)*g,t[6]=p*g,t[7]=(-c*i+r*l)*g,t[8]=(s*i-r*n)*g,t):null}function hZt(t){const e=t[0],i=t[1],r=t[2],o=t[3],n=t[4],s=t[5],a=t[6],l=t[7],c=t[8];return e*(c*n-s*l)+i*(-c*o+s*a)+r*(l*o-n*a)}function Sue(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=i[0],p=i[1],g=i[2],f=i[3],m=i[4],A=i[5],v=i[6],y=i[7],b=i[8];return t[0]=h*r+p*s+g*c,t[1]=h*o+p*a+g*d,t[2]=h*n+p*l+g*u,t[3]=f*r+m*s+A*c,t[4]=f*o+m*a+A*d,t[5]=f*n+m*l+A*u,t[6]=v*r+y*s+b*c,t[7]=v*o+y*a+b*d,t[8]=v*n+y*l+b*u,t}function pZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=i[0],p=i[1];return t[0]=r,t[1]=o,t[2]=n,t[3]=s,t[4]=a,t[5]=l,t[6]=h*r+p*s+c,t[7]=h*o+p*a+d,t[8]=h*n+p*l+u,t}function fZt(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=e[6],d=e[7],u=e[8],h=Math.sin(i),p=Math.cos(i);return t[0]=p*r+h*s,t[1]=p*o+h*a,t[2]=p*n+h*l,t[3]=p*s-h*r,t[4]=p*a-h*o,t[5]=p*l-h*n,t[6]=c,t[7]=d,t[8]=u,t}function Tue(t,e,i){const r=i[0],o=i[1];return t[0]=r*e[0],t[1]=r*e[1],t[2]=r*e[2],t[3]=o*e[3],t[4]=o*e[4],t[5]=o*e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t}function gZt(t,e){const i=e[0],r=e[1],o=e[2],n=e[3],s=i+i,a=r+r,l=o+o,c=i*s,d=r*s,u=r*a,h=o*s,p=o*a,g=o*l,f=n*s,m=n*a,A=n*l;return t[0]=1-u-g,t[3]=d-A,t[6]=h+m,t[1]=d+A,t[4]=1-c-g,t[7]=p-f,t[2]=h-m,t[5]=p+f,t[8]=1-c-u,t}var oN;(function(t){t[t.COL0ROW0=0]="COL0ROW0",t[t.COL0ROW1=1]="COL0ROW1",t[t.COL0ROW2=2]="COL0ROW2",t[t.COL1ROW0=3]="COL1ROW0",t[t.COL1ROW1=4]="COL1ROW1",t[t.COL1ROW2=5]="COL1ROW2",t[t.COL2ROW0=6]="COL2ROW0",t[t.COL2ROW1=7]="COL2ROW1",t[t.COL2ROW2=8]="COL2ROW2"})(oN||(oN={}));const AZt=Object.freeze([1,0,0,0,1,0,0,0,1]);let b7=class extends cZt{static get IDENTITY(){return vZt()}static get ZERO(){return mZt()}get ELEMENTS(){return 9}get RANK(){return 3}get INDICES(){return oN}constructor(t,...e){super(-0,-0,-0,-0,-0,-0,-0,-0,-0),arguments.length===1&&Array.isArray(t)?this.copy(t):e.length>0?this.copy([t,...e]):this.identity()}copy(t){return this[0]=t[0],this[1]=t[1],this[2]=t[2],this[3]=t[3],this[4]=t[4],this[5]=t[5],this[6]=t[6],this[7]=t[7],this[8]=t[8],this.check()}identity(){return this.copy(AZt)}fromObject(t){return this.check()}fromQuaternion(t){return gZt(this,t),this.check()}set(t,e,i,r,o,n,s,a,l){return this[0]=t,this[1]=e,this[2]=i,this[3]=r,this[4]=o,this[5]=n,this[6]=s,this[7]=a,this[8]=l,this.check()}setRowMajor(t,e,i,r,o,n,s,a,l){return this[0]=t,this[1]=r,this[2]=s,this[3]=e,this[4]=o,this[5]=a,this[6]=i,this[7]=n,this[8]=l,this.check()}determinant(){return hZt(this)}transpose(){return dZt(this,this),this.check()}invert(){return uZt(this,this),this.check()}multiplyLeft(t){return Sue(this,t,this),this.check()}multiplyRight(t){return Sue(this,this,t),this.check()}rotate(t){return fZt(this,this,t),this.check()}scale(t){return Array.isArray(t)?Tue(this,this,t):Tue(this,this,[t,t]),this.check()}translate(t){return pZt(this,this,t),this.check()}transform(t,e){let i;switch(t.length){case 2:i=JJt(e||[-0,-0],t,this);break;case 3:i=Iue(e||[-0,-0,-0],t,this);break;case 4:i=YJt(e||[-0,-0,-0,-0],t,this);break;default:throw new Error("Illegal vector")}return QJt(i,t.length),i}transformVector(t,e){return this.transform(t,e)}transformVector2(t,e){return this.transform(t,e)}transformVector3(t,e){return this.transform(t,e)}},OE,UE=null;function mZt(){return OE||(OE=new b7([0,0,0,0,0,0,0,0,0]),Object.freeze(OE)),OE}function vZt(){return UE||(UE=new b7,Object.freeze(UE)),UE}const NE="KHR_texture_transform",yZt=NE,jE=new lZt,bZt=new b7,wZt=new b7;async function CZt(t,e){if(!new os(t).hasExtension(NE)||!e.gltf?.loadBuffers)return;const i=t.json.materials||[];for(let r=0;r<i.length;r++)xZt(r,t)}function xZt(t,e){const i=e.json.materials?.[t],r=[i?.pbrMetallicRoughness?.baseColorTexture,i?.emissiveTexture,i?.normalTexture,i?.occlusionTexture,i?.pbrMetallicRoughness?.metallicRoughnessTexture],o=[];for(const n of r)n&&n?.extensions?.[NE]&&kZt(e,t,n,o)}function kZt(t,e,i,r){const o=MZt(i,r);if(!o)return;const n=t.json.meshes||[];for(const s of n)for(const a of s.primitives){const l=a.material;Number.isFinite(l)&&e===l&&EZt(t,a,o)}}function MZt(t,e){const i=t.extensions?.[NE],{texCoord:r=0}=t,{texCoord:o=r}=i;if(e.findIndex(([n,s])=>n===r&&s===o)===-1){const n=IZt(i);return r!==o&&(t.texCoord=o),e.push([r,o]),{originalTexCoord:r,texCoord:o,matrix:n}}return null}function EZt(t,e,i){const{originalTexCoord:r,texCoord:o,matrix:n}=i,s=e.attributes[`TEXCOORD_${r}`];if(Number.isFinite(s)){const a=t.json.accessors?.[s];if(a&&a.bufferView){const l=t.json.bufferViews?.[a.bufferView];if(l){const{arrayBuffer:c,byteOffset:d}=t.buffers[l.buffer],u=(d||0)+(a.byteOffset||0)+(l.byteOffset||0),{ArrayType:h,length:p}=VU(a,l),g=tue[a.componentType],f=eue[a.type],m=l.byteStride||g*f,A=new Float32Array(p);for(let v=0;v<a.count;v++){const y=new h(c,u+v*m,2);jE.set(y[0],y[1],1),jE.transformByMatrix3(n),A.set([jE[0],jE[1]],v*f)}r===o?BZt(a,l,t.buffers,A):PZt(o,a,e,t,A)}}}}function BZt(t,e,i,r){t.componentType=5126,i.push({arrayBuffer:r.buffer,byteOffset:0,byteLength:r.buffer.byteLength}),e.buffer=i.length-1,e.byteLength=r.buffer.byteLength,e.byteOffset=0,delete e.byteStride}function PZt(t,e,i,r,o){r.buffers.push({arrayBuffer:o.buffer,byteOffset:0,byteLength:o.buffer.byteLength});const n=r.json.bufferViews;if(!n)return;n.push({buffer:r.buffers.length-1,byteLength:o.buffer.byteLength,byteOffset:0});const s=r.json.accessors;s&&(s.push({bufferView:n?.length-1,byteOffset:0,componentType:5126,count:e.count,type:"VEC2"}),i.attributes[`TEXCOORD_${t}`]=s.length-1)}function IZt(t){const{offset:e=[0,0],rotation:i=0,scale:r=[1,1]}=t,o=new b7().set(1,0,0,0,1,0,e[0],e[1],1),n=bZt.set(Math.cos(i),Math.sin(i),0,-Math.sin(i),Math.cos(i),0,0,0,1),s=wZt.set(r[0],0,0,0,r[1],0,0,0,1);return o.multiplyRight(n).multiplyRight(s)}const SZt=Object.freeze(Object.defineProperty({__proto__:null,decode:CZt,name:yZt},Symbol.toStringTag,{value:"Module"})),Df="KHR_lights_punctual",TZt=Df;async function RZt(t){const e=new os(t),{json:i}=e,r=e.getExtension(Df);r&&(e.json.lights=r.lights,e.removeExtension(Df));for(const o of i.nodes||[]){const n=e.getObjectExtension(o,Df);n&&(o.light=n.light),e.removeObjectExtension(o,Df)}}async function DZt(t){const e=new os(t),{json:i}=e;if(i.lights){const r=e.addExtension(Df);Gl(!r.lights),r.lights=i.lights,delete i.lights}if(e.json.lights){for(const r of e.json.lights){const o=r.node;e.addObjectExtension(o,Df,r)}delete e.json.lights}}const _Zt=Object.freeze(Object.defineProperty({__proto__:null,decode:RZt,encode:DZt,name:TZt},Symbol.toStringTag,{value:"Module"})),w7="KHR_materials_unlit",LZt=w7;async function FZt(t){const e=new os(t),{json:i}=e;for(const r of i.materials||[])r.extensions&&r.extensions.KHR_materials_unlit&&(r.unlit=!0),e.removeObjectExtension(r,w7);e.removeExtension(w7)}function OZt(t){const e=new os(t),{json:i}=e;if(e.materials)for(const r of i.materials||[])r.unlit&&(delete r.unlit,e.addObjectExtension(r,w7,{}),e.addExtension(w7))}const UZt=Object.freeze(Object.defineProperty({__proto__:null,decode:FZt,encode:OZt,name:LZt},Symbol.toStringTag,{value:"Module"})),C7="KHR_techniques_webgl",NZt=C7;async function jZt(t){const e=new os(t),{json:i}=e,r=e.getExtension(C7);if(r){const o=zZt(r,e);for(const n of i.materials||[]){const s=e.getObjectExtension(n,C7);s&&(n.technique=Object.assign({},s,o[s.technique]),n.technique.values=VZt(n.technique,e)),e.removeObjectExtension(n,C7)}e.removeExtension(C7)}}async function HZt(t,e){}function zZt(t,e){const{programs:i=[],shaders:r=[],techniques:o=[]}=t,n=new TextDecoder;return r.forEach(s=>{if(Number.isFinite(s.bufferView))s.code=n.decode(e.getTypedArrayForBufferView(s.bufferView));else throw new Error("KHR_techniques_webgl: no shader code")}),i.forEach(s=>{s.fragmentShader=r[s.fragmentShader],s.vertexShader=r[s.vertexShader]}),o.forEach(s=>{s.program=i[s.program]}),o}function VZt(t,e){const i=Object.assign({},t.values);return Object.keys(t.uniforms||{}).forEach(r=>{t.uniforms[r].value&&!(r in i)&&(i[r]=t.uniforms[r].value)}),Object.keys(i).forEach(r=>{typeof i[r]=="object"&&i[r].index!==void 0&&(i[r].texture=e.getTexture(i[r].index))}),i}const qZt=Object.freeze(Object.defineProperty({__proto__:null,decode:jZt,encode:HZt,name:NZt},Symbol.toStringTag,{value:"Module"})),Rue=[iWt,BKt,aJt,dJt,pJt,HJt,_Zt,UZt,qZt,SZt,yWt];function GZt(t,e={},i){const r=Rue.filter(o=>Due(o.name,e));for(const o of r)o.preprocess?.(t,e,i)}async function QZt(t,e={},i){const r=Rue.filter(o=>Due(o.name,e));for(const o of r)await o.decode?.(t,e,i)}function Due(t,e){const i=e?.gltf?.excludeExtensions||{};return!(t in i&&!i[t])}const nN="KHR_binary_glTF";function KZt(t){const e=new os(t),{json:i}=e;for(const r of i.images||[]){const o=e.getObjectExtension(r,nN);o&&Object.assign(r,o),e.removeObjectExtension(r,nN)}i.buffers&&i.buffers[0]&&delete i.buffers[0].uri,e.removeExtension(nN)}const _ue={accessors:"accessor",animations:"animation",buffers:"buffer",bufferViews:"bufferView",images:"image",materials:"material",meshes:"mesh",nodes:"node",samplers:"sampler",scenes:"scene",skins:"skin",textures:"texture"},WZt={accessor:"accessors",animations:"animation",buffer:"buffers",bufferView:"bufferViews",image:"images",material:"materials",mesh:"meshes",node:"nodes",sampler:"samplers",scene:"scenes",skin:"skins",texture:"textures"};class JZt{idToIndexMap={animations:{},accessors:{},buffers:{},bufferViews:{},images:{},materials:{},meshes:{},nodes:{},samplers:{},scenes:{},skins:{},textures:{}};json;normalize(e,i){this.json=e.json;const r=e.json;switch(r.asset&&r.asset.version){case"2.0":return;case void 0:case"1.0":break;default:console.warn(`glTF: Unknown version ${r.asset.version}`);return}if(!i.normalize)throw new Error("glTF v1 is not supported.");console.warn("Converting glTF v1 to glTF v2 format. This is experimental and may fail."),this._addAsset(r),this._convertTopLevelObjectsToArrays(r),KZt(e),this._convertObjectIdsToArrayIndices(r),this._updateObjects(r),this._updateMaterial(r)}_addAsset(e){e.asset=e.asset||{},e.asset.version="2.0",e.asset.generator=e.asset.generator||"Normalized to glTF 2.0 by loaders.gl"}_convertTopLevelObjectsToArrays(e){for(const i in _ue)this._convertTopLevelObjectToArray(e,i)}_convertTopLevelObjectToArray(e,i){const r=e[i];if(!(!r||Array.isArray(r))){e[i]=[];for(const o in r){const n=r[o];n.id=n.id||o;const s=e[i].length;e[i].push(n),this.idToIndexMap[i][o]=s}}}_convertObjectIdsToArrayIndices(e){for(const i in _ue)this._convertIdsToIndices(e,i);"scene"in e&&(e.scene=this._convertIdToIndex(e.scene,"scene"));for(const i of e.textures)this._convertTextureIds(i);for(const i of e.meshes)this._convertMeshIds(i);for(const i of e.nodes)this._convertNodeIds(i);for(const i of e.scenes)this._convertSceneIds(i)}_convertTextureIds(e){e.source&&(e.source=this._convertIdToIndex(e.source,"image"))}_convertMeshIds(e){for(const i of e.primitives){const{attributes:r,indices:o,material:n}=i;for(const s in r)r[s]=this._convertIdToIndex(r[s],"accessor");o&&(i.indices=this._convertIdToIndex(o,"accessor")),n&&(i.material=this._convertIdToIndex(n,"material"))}}_convertNodeIds(e){e.children&&(e.children=e.children.map(i=>this._convertIdToIndex(i,"node"))),e.meshes&&(e.meshes=e.meshes.map(i=>this._convertIdToIndex(i,"mesh")))}_convertSceneIds(e){e.nodes&&(e.nodes=e.nodes.map(i=>this._convertIdToIndex(i,"node")))}_convertIdsToIndices(e,i){e[i]||(console.warn(`gltf v1: json doesn't contain attribute ${i}`),e[i]=[]);for(const r of e[i])for(const o in r){const n=r[o],s=this._convertIdToIndex(n,o);r[o]=s}}_convertIdToIndex(e,i){const r=WZt[i];if(r in this.idToIndexMap){const o=this.idToIndexMap[r][e];if(!Number.isFinite(o))throw new Error(`gltf v1: failed to resolve ${i} with id ${e}`);return o}return e}_updateObjects(e){for(const i of this.json.buffers)delete i.type}_updateMaterial(e){for(const i of e.materials){i.pbrMetallicRoughness={baseColorFactor:[1,1,1,1],metallicFactor:1,roughnessFactor:1};const r=i.values?.tex||i.values?.texture2d_0||i.values?.diffuseTex,o=e.textures.findIndex(n=>n.id===r);o!==-1&&(i.pbrMetallicRoughness.baseColorTexture={index:o})}}}function ZZt(t,e={}){return new JZt().normalize(t,e)}async function XZt(t,e,i=0,r,o){return YZt(t,e,i,r),ZZt(t,{normalize:r?.gltf?.normalize}),GZt(t,r,o),r?.gltf?.loadBuffers&&t.json.buffers&&await $Zt(t,r,o),r?.gltf?.loadImages&&await eXt(t,r,o),await QZt(t,r,o),t}function YZt(t,e,i,r){if(r.uri&&(t.baseUri=r.uri),e instanceof ArrayBuffer&&!zWt(e,i,r)&&(e=new TextDecoder().decode(e)),typeof e=="string")t.json=dGt(e);else if(e instanceof ArrayBuffer){const s={};i=VWt(s,e,i,r.glb),Gl(s.type==="glTF",`Invalid GLB magic string ${s.type}`),t._glb=s,t.json=s.json}else Gl(!1,"GLTF: must be ArrayBuffer or string");const o=t.json.buffers||[];if(t.buffers=new Array(o.length).fill(null),t._glb&&t._glb.header.hasBinChunk){const{binChunks:s}=t._glb;t.buffers[0]={arrayBuffer:s[0].arrayBuffer,byteOffset:s[0].byteOffset,byteLength:s[0].byteLength}}const n=t.json.images||[];t.images=new Array(n.length).fill({})}async function $Zt(t,e,i){const r=t.json.buffers||[];for(let o=0;o<r.length;++o){const n=r[o];if(n.uri){const{fetch:s}=i;Gl(s);const a=bue(n.uri,e),l=await(await i?.fetch?.(a))?.arrayBuffer?.();t.buffers[o]={arrayBuffer:l,byteOffset:0,byteLength:l.byteLength},delete n.uri}else t.buffers[o]===null&&(t.buffers[o]={arrayBuffer:new ArrayBuffer(n.byteLength),byteOffset:0,byteLength:n.byteLength})}}async function eXt(t,e,i){const r=tXt(t),o=t.json.images||[],n=[];for(const s of r)n.push(iXt(t,o[s],s,e,i));return await Promise.all(n)}function tXt(t){const e=new Set,i=t.json.textures||[];for(const r of i)r.source!==void 0&&e.add(r.source);return Array.from(e).sort()}async function iXt(t,e,i,r,o){let n;if(e.uri&&!e.hasOwnProperty("bufferView")){const a=bue(e.uri,r),{fetch:l}=o;n=await(await l(a)).arrayBuffer(),e.bufferView={data:n}}if(Number.isFinite(e.bufferView)){const a=hKt(t.json,t.buffers,e.bufferView);n=kde(a.buffer,a.byteOffset,a.byteLength)}Gl(n,"glTF image has no data");let s=await ade(n,[iKt,LWt],{...r,mimeType:e.mimeType,basis:r.basis||{format:vue()}},o);s&&s[0]&&(s={compressed:!0,mipmaps:!1,width:s[0].width,height:s[0].height,data:s[0]}),t.images=t.images||[],t.images[i]=s}const sN={dataType:null,batchType:null,name:"glTF",id:"gltf",module:"gltf",version:bWt,extensions:["gltf","glb"],mimeTypes:["model/gltf+json","model/gltf-binary"],text:!0,binary:!0,tests:["glTF"],parse:rXt,options:{gltf:{normalize:!0,loadBuffers:!0,loadImages:!0,decompressMeshes:!0},log:console}};async function rXt(t,e={},i){e={...sN.options,...e},e.gltf={...sN.options.gltf,...e.gltf};const{byteOffset:r=0}=e;return await XZt({},t,r,e,i)}const oXt={SCALAR:1,VEC2:2,VEC3:3,VEC4:4,MAT2:4,MAT3:9,MAT4:16},nXt={5120:1,5121:1,5122:2,5123:2,5125:4,5126:4},Pc={TEXTURE_MAG_FILTER:10240,TEXTURE_MIN_FILTER:10241,TEXTURE_WRAP_S:10242,TEXTURE_WRAP_T:10243,REPEAT:10497,LINEAR:9729,NEAREST_MIPMAP_LINEAR:9986},sXt={magFilter:Pc.TEXTURE_MAG_FILTER,minFilter:Pc.TEXTURE_MIN_FILTER,wrapS:Pc.TEXTURE_WRAP_S,wrapT:Pc.TEXTURE_WRAP_T},aXt={[Pc.TEXTURE_MAG_FILTER]:Pc.LINEAR,[Pc.TEXTURE_MIN_FILTER]:Pc.NEAREST_MIPMAP_LINEAR,[Pc.TEXTURE_WRAP_S]:Pc.REPEAT,[Pc.TEXTURE_WRAP_T]:Pc.REPEAT};function lXt(){return{id:"default-sampler",parameters:aXt}}function cXt(t){return nXt[t]}function dXt(t){return oXt[t]}class uXt{baseUri="";jsonUnprocessed;json;buffers=[];images=[];postProcess(e,i={}){const{json:r,buffers:o=[],images:n=[]}=e,{baseUri:s=""}=e;return Gl(r),this.baseUri=s,this.buffers=o,this.images=n,this.jsonUnprocessed=r,this.json=this._resolveTree(e.json,i),this.json}_resolveTree(e,i={}){const r={...e};return this.json=r,e.bufferViews&&(r.bufferViews=e.bufferViews.map((o,n)=>this._resolveBufferView(o,n))),e.images&&(r.images=e.images.map((o,n)=>this._resolveImage(o,n))),e.samplers&&(r.samplers=e.samplers.map((o,n)=>this._resolveSampler(o,n))),e.textures&&(r.textures=e.textures.map((o,n)=>this._resolveTexture(o,n))),e.accessors&&(r.accessors=e.accessors.map((o,n)=>this._resolveAccessor(o,n))),e.materials&&(r.materials=e.materials.map((o,n)=>this._resolveMaterial(o,n))),e.meshes&&(r.meshes=e.meshes.map((o,n)=>this._resolveMesh(o,n))),e.nodes&&(r.nodes=e.nodes.map((o,n)=>this._resolveNode(o,n)),r.nodes=r.nodes.map((o,n)=>this._resolveNodeChildren(o))),e.skins&&(r.skins=e.skins.map((o,n)=>this._resolveSkin(o,n))),e.scenes&&(r.scenes=e.scenes.map((o,n)=>this._resolveScene(o,n))),typeof this.json.scene=="number"&&r.scenes&&(r.scene=r.scenes[this.json.scene]),r}getScene(e){return this._get(this.json.scenes,e)}getNode(e){return this._get(this.json.nodes,e)}getSkin(e){return this._get(this.json.skins,e)}getMesh(e){return this._get(this.json.meshes,e)}getMaterial(e){return this._get(this.json.materials,e)}getAccessor(e){return this._get(this.json.accessors,e)}getCamera(e){return this._get(this.json.cameras,e)}getTexture(e){return this._get(this.json.textures,e)}getSampler(e){return this._get(this.json.samplers,e)}getImage(e){return this._get(this.json.images,e)}getBufferView(e){return this._get(this.json.bufferViews,e)}getBuffer(e){return this._get(this.json.buffers,e)}_get(e,i){if(typeof i=="object")return i;const r=e&&e[i];return r||console.warn(`glTF file error: Could not find ${e}[${i}]`),r}_resolveScene(e,i){return{...e,id:e.id||`scene-${i}`,nodes:(e.nodes||[]).map(r=>this.getNode(r))}}_resolveNode(e,i){const r={...e,id:e?.id||`node-${i}`};return e.mesh!==void 0&&(r.mesh=this.getMesh(e.mesh)),e.camera!==void 0&&(r.camera=this.getCamera(e.camera)),e.skin!==void 0&&(r.skin=this.getSkin(e.skin)),e.meshes!==void 0&&e.meshes.length&&(r.mesh=e.meshes.reduce((o,n)=>{const s=this.getMesh(n);return o.id=s.id,o.primitives=o.primitives.concat(s.primitives),o},{primitives:[]})),r}_resolveNodeChildren(e){return e.children&&(e.children=e.children.map(i=>this.getNode(i))),e}_resolveSkin(e,i){const r=typeof e.inverseBindMatrices=="number"?this.getAccessor(e.inverseBindMatrices):void 0;return{...e,id:e.id||`skin-${i}`,inverseBindMatrices:r}}_resolveMesh(e,i){const r={...e,id:e.id||`mesh-${i}`,primitives:[]};return e.primitives&&(r.primitives=e.primitives.map(o=>{const n={...o,attributes:{},indices:void 0,material:void 0},s=o.attributes;for(const a in s)n.attributes[a]=this.getAccessor(s[a]);return o.indices!==void 0&&(n.indices=this.getAccessor(o.indices)),o.material!==void 0&&(n.material=this.getMaterial(o.material)),n})),r}_resolveMaterial(e,i){const r={...e,id:e.id||`material-${i}`};if(r.normalTexture&&(r.normalTexture={...r.normalTexture},r.normalTexture.texture=this.getTexture(r.normalTexture.index)),r.occlusionTexture&&(r.occlusionTexture={...r.occlusionTexture},r.occlusionTexture.texture=this.getTexture(r.occlusionTexture.index)),r.emissiveTexture&&(r.emissiveTexture={...r.emissiveTexture},r.emissiveTexture.texture=this.getTexture(r.emissiveTexture.index)),r.emissiveFactor||(r.emissiveFactor=r.emissiveTexture?[1,1,1]:[0,0,0]),r.pbrMetallicRoughness){r.pbrMetallicRoughness={...r.pbrMetallicRoughness};const o=r.pbrMetallicRoughness;o.baseColorTexture&&(o.baseColorTexture={...o.baseColorTexture},o.baseColorTexture.texture=this.getTexture(o.baseColorTexture.index)),o.metallicRoughnessTexture&&(o.metallicRoughnessTexture={...o.metallicRoughnessTexture},o.metallicRoughnessTexture.texture=this.getTexture(o.metallicRoughnessTexture.index))}return r}_resolveAccessor(e,i){const r=cXt(e.componentType),o=dXt(e.type),n=r*o,s={...e,id:e.id||`accessor-${i}`,bytesPerComponent:r,components:o,bytesPerElement:n,value:void 0,bufferView:void 0,sparse:void 0};if(e.bufferView!==void 0&&(s.bufferView=this.getBufferView(e.bufferView)),s.bufferView){const a=s.bufferView.buffer,{ArrayType:l,byteLength:c}=VU(s,s.bufferView),d=(s.bufferView.byteOffset||0)+(s.byteOffset||0)+a.byteOffset;let u=a.arrayBuffer.slice(d,d+c);s.bufferView.byteStride&&(u=this._getValueFromInterleavedBuffer(a,d,s.bufferView.byteStride,s.bytesPerElement,s.count)),s.value=new l(u)}return s}_getValueFromInterleavedBuffer(e,i,r,o,n){const s=new Uint8Array(n*o);for(let a=0;a<n;a++){const l=i+a*r;s.set(new Uint8Array(e.arrayBuffer.slice(l,l+o)),a*o)}return s.buffer}_resolveTexture(e,i){return{...e,id:e.id||`texture-${i}`,sampler:typeof e.sampler=="number"?this.getSampler(e.sampler):lXt(),source:typeof e.source=="number"?this.getImage(e.source):void 0}}_resolveSampler(e,i){const r={id:e.id||`sampler-${i}`,...e,parameters:{}};for(const o in r){const n=this._enumSamplerParameter(o);n!==void 0&&(r.parameters[n]=r[o])}return r}_enumSamplerParameter(e){return sXt[e]}_resolveImage(e,i){const r={...e,id:e.id||`image-${i}`,image:null,bufferView:e.bufferView!==void 0?this.getBufferView(e.bufferView):void 0},o=this.images[i];return o&&(r.image=o),r}_resolveBufferView(e,i){const r=e.buffer,o=this.buffers[r].arrayBuffer;let n=this.buffers[r].byteOffset||0;return e.byteOffset&&(n+=e.byteOffset),{id:`bufferView-${i}`,...e,buffer:this.buffers[r],data:new Uint8Array(o,n,e.byteLength)}}_resolveCamera(e,i){const r={...e,id:e.id||`camera-${i}`};return r.perspective,r.orthographic,r}}function hXt(t,e){return new uXt().postProcess(t,e)}class pXt{constructor(e){}load(e,i,r,o,n,s,a){o=o||{},fXt(e,i,r,o,n,function(){uo.scheduleTask(function(){n.scene.fire("modelLoaded",n.id),n.fire("loaded",!0,!1)}),s&&s()},function(l){e.error(l),a&&a(l),n.fire("error",l)})}parse(e,i,r,o,n,s,a){o=o||{},aN(e,"",i,r,o,n,function(){n.scene.fire("modelLoaded",n.id),n.fire("loaded",!0,!1),s&&s()},function(l){n.error(l),n.fire("error",l),a&&a(l)})}}function fXt(t,e,i,r,o,n,s){const a=t.viewer.scene.canvas.spinner;a.processes++,e.split(".").pop()==="glb"?t.dataSource.getGLB(e,l=>{r.basePath=Lue(e),aN(t,e,l,i,r,o,n,s),a.processes--},l=>{a.processes--,s(l)}):t.dataSource.getGLTF(e,l=>{r.basePath=Lue(e),aN(t,e,l,i,r,o,n,s),a.processes--},l=>{a.processes--,s(l)})}function Lue(t){const e=t.lastIndexOf("/");return e!==0?t.substring(0,e+1):""}function aN(t,e,i,r,o,n,s,a){const l=t.viewer.scene.canvas.spinner;l.processes++,FU(i,sN,{baseUri:o.basePath}).then(c=>{const d=hXt(c),u={entityId:o.entityId,autoMetaModel:o.autoMetaModel,globalizeObjectIds:o.globalizeObjectIds,metaObjects:[],loadBuffer:o.loadBuffer,basePath:o.basePath,handlenode:o.handlenode,backfaces:!!o.backfaces,gltfData:d,scene:n.scene,plugin:t,sceneModel:n,numObjects:0,nextId:0};gXt(u),mXt(u),o.autoMetaModel&&u.metaObjects.push({id:n.id,type:"Default",name:n.id}),bXt(u),n.finalize(),o.autoMetaModel&&t.viewer.metaScene.createMetaModel(n.id,{metaObjects:u.metaObjects}),l.processes--,s()}).catch(c=>{a&&a(c)})}function gXt(t){const e=t.gltfData.textures;if(e)for(let i=0,r=e.length;i<r;i++)AXt(t,e[i])}function AXt(t,e){if(!e.source||!e.source.image)return;const i=`texture-${t.nextId++}`;let r=aA;switch(e.sampler.minFilter){case 9728:r=xf;break;case 9729:r=aa;break;case 9984:r=D9;break;case 9985:r=_9;break;case 9986:r=aA;break;case 9987:r=lA;break}let o=aa;switch(e.sampler.magFilter){case 9728:o=xf;break;case 9729:o=aa;break}let n=Eo;switch(e.sampler.wrapS){case 33071:n=sa;break;case 33648:n=Th;break;case 10497:n=Eo;break}let s=Eo;switch(e.sampler.wrapT){case 33071:s=sa;break;case 33648:s=Th;break;case 10497:s=Eo;break}let a=Eo;switch(e.sampler.wrapR){case 33071:a=sa;break;case 33648:a=Th;break;case 10497:a=Eo;break}t.sceneModel.createTexture({id:i,image:e.source.image,flipY:!!e.flipY,minFilter:r,magFilter:o,wrapS:n,wrapT:s,wrapR:a,encoding:ho}),e._textureId=i}function mXt(t){const e=t.gltfData.materials;if(e)for(let i=0,r=e.length;i<r;i++){const o=e[i];o._textureSetId=vXt(t,o),o._attributes=yXt(t,o)}}function vXt(t,e){const i={};switch(e.normalTexture&&(i.normalTextureId=e.normalTexture.texture._textureId),e.occlusionTexture&&(i.occlusionTextureId=e.occlusionTexture.texture._textureId),e.emissiveTexture&&(i.emissiveTextureId=e.emissiveTexture.texture._textureId),e.alphaMode){case"OPAQUE":break;case"MASK":const n=e.alphaCutoff;i.alphaCutoff=n!==void 0?n:.5;break}const r=e.pbrMetallicRoughness;if(e.pbrMetallicRoughness){const n=e.pbrMetallicRoughness,s=n.baseColorTexture||n.colorTexture;s&&(s.texture?i.colorTextureId=s.texture._textureId:i.colorTextureId=t.gltfData.textures[s.index]._textureId),r.metallicRoughnessTexture&&(i.metallicRoughnessTextureId=r.metallicRoughnessTexture.texture._textureId)}const o=e.extensions;if(o){const n=o.KHR_materials_pbrSpecularGlossiness;if(n){n.specularTexture;const s=n.specularColorTexture;s!=null&&(i.colorTextureId=t.gltfData.textures[s.index]._textureId)}}return i.normalTextureId!==void 0||i.occlusionTextureId!==void 0||i.emissiveTextureId!==void 0||i.colorTextureId!==void 0||i.metallicRoughnessTextureId!==void 0?(i.id=`textureSet-${t.nextId++};`,t.sceneModel.createTextureSet(i),i.id):null}function yXt(t,e){const i=e.extensions,r={color:new Float32Array([1,1,1,1]),opacity:1,metallic:0,roughness:1,doubleSided:!0};if(i){const n=i.KHR_materials_pbrSpecularGlossiness;if(n){const a=n.diffuseFactor;a!=null&&r.color.set(a)}const s=i.KHR_materials_common;if(s){const a=s.technique,l=s.values||{},c=a==="BLINN",d=a==="PHONG",u=a==="LAMBERT",h=l.diffuse;h&&(c||d||u)&&(Tt.isString(h)||r.color.set(h));const p=l.transparency;p!=null&&(r.opacity=p);const g=l.transparent;g!=null&&(r.opacity=g)}}const o=e.pbrMetallicRoughness;if(o){const n=o.baseColorFactor;n&&(r.color[0]=n[0],r.color[1]=n[1],r.color[2]=n[2],r.opacity=n[3]);const s=o.metallicFactor;s!=null&&(r.metallic=s);const a=o.roughnessFactor;a!=null&&(r.roughness=a)}return r.doubleSided=e.doubleSided!==!1,r}function bXt(t){const e=t.gltfData,i=e.scene||e.scenes[0];if(!i){xXt(t,"glTF has no default scene");return}const r=i.nodes;if(!r)return;(function s(a){a.forEach(l=>{const c=l.mesh;c&&(c.instances||=0,c.instances+=1),l.children&&s(l.children)})})(r);const o=[];let n=null;(function s(a,l,c){a.forEach(d=>{const u=d.name;let h=u!=null&&u||l===0&&"entity-"+t.nextId++;if(h){for(;t.sceneModel.objects[h];)h="entity-"+t.nextId++;o.push(n),n=[]}const p=wXt(d,c);if(d.mesh&&CXt(d,t,p,n),d.children&&s(d.children,l+1,p),h){if(n.length>0){const g=t.globalizeObjectIds?k.globalizeObjectId(t.sceneModel.id,h):h;t.sceneModel.createEntity({id:g,meshIds:n,isObject:!0}),t.autoMetaModel&&t.metaObjects.push({id:g,type:"Default",name:g,parent:t.sceneModel.id})}n=o.pop()}})})(r,0,null)}function wXt(t,e){let i;return t.matrix&&(i=t.matrix,e?e=k.mulMat4(e,i,k.mat4()):e=i),t.translation&&(i=k.translationMat4v(t.translation),e?e=k.mulMat4(e,i,k.mat4()):e=i),t.rotation&&(i=k.quaternionToMat4(t.rotation),e?e=k.mulMat4(e,i,k.mat4()):e=i),t.scale&&(i=k.scalingMat4v(t.scale),e?e=k.mulMat4(e,i,k.mat4()):e=i),e}function CXt(t,e,i,r){const o=t.mesh;if(!o)return;const n=o.primitives.length;if(n>0)for(let s=0;s<n;s++){const a=o.primitives[s];if(a.mode<4)continue;const l={id:e.sceneModel.id+"."+e.numObjects++},c=a.material;c?(l.textureSetId=c._textureSetId,l.color=c._attributes.color,l.opacity=c._attributes.opacity,l.metallic=c._attributes.metallic,l.roughness=c._attributes.roughness):(l.color=new Float32Array([1,1,1]),l.opacity=1);const d=e.backfaces!==!1||c&&c.doubleSided!==!1;switch(a.mode){case 0:l.primitive="points";break;case 1:l.primitive="lines";break;case 2:l.primitive="lines";break;case 3:l.primitive="lines";break;case 4:l.primitive=d?"triangles":"solid";break;case 5:l.primitive=d?"triangles":"solid";break;case 6:l.primitive=d?"triangles":"solid";break;default:l.primitive=d?"triangles":"solid"}const u=a.attributes.POSITION;if(!u)continue;l.localPositions=u.value,l.positions=new Float64Array(l.localPositions.length),a.attributes.NORMAL&&(l.normals=a.attributes.NORMAL.value),a.attributes.TEXCOORD_0&&(l.uv=a.attributes.TEXCOORD_0.value),a.indices&&(l.indices=a.indices.value),i?k.transformPositions3(i,l.localPositions,l.positions):l.positions.set(l.localPositions);const h=k.vec3();fM(l.positions,l.positions,h)&&(l.origin=h),e.sceneModel.createMesh(l),r.push(l.id)}}function xXt(t,e){t.plugin.error(e)}const Fue={DEFAULT:{}};class lN extends kc{constructor(e,i={}){super("GLTFLoader",e,i),this._sceneModelLoader=new pXt(this,i),this.dataSource=i.dataSource,this.objectDefaults=i.objectDefaults}set dataSource(e){this._dataSource=e||new sde}get dataSource(){return this._dataSource}set objectDefaults(e){this._objectDefaults=e||Fue}get objectDefaults(){return this._objectDefaults}load(e={}){e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id);const i=new i7(this.viewer.scene,Tt.apply(e,{isModel:!0,dtxEnabled:e.dtxEnabled})),r=i.id;if(!e.src&&!e.gltf)return this.error("load() param expected: src or gltf"),i;if(e.metaModelSrc||e.metaModelJSON){const o=n=>{this.viewer.metaScene.createMetaModel(r,n,{}),this.viewer.scene.canvas.spinner.processes--,e.src?this._sceneModelLoader.load(this,e.src,n,e,i):this._sceneModelLoader.parse(this,e.gltf,n,e,i)};if(e.metaModelSrc){const n=e.metaModelSrc;this.viewer.scene.canvas.spinner.processes++,this._dataSource.getMetaModel(n,s=>{this.viewer.scene.canvas.spinner.processes--,o(s)},s=>{this.error(`load(): Failed to load model metadata for model '${r} from '${n}' - ${s}`),this.viewer.scene.canvas.spinner.processes--})}else e.metaModelJSON&&o(e.metaModelJSON)}else e.src?this._sceneModelLoader.load(this,e.src,null,e,i):this._sceneModelLoader.parse(this,e.gltf,null,e,i);return i.once("destroyed",()=>{this.viewer.metaScene.destroyMetaModel(r)}),i}destroy(){super.destroy()}}function kXt(t,e,i={}){const r="lightgrey",o=i.hoverColor||"rgba(0,0,0,0.4)",n=i.textColor||"black",s=i.canvasElement||document.body,a=500,l=a+a/3,c=l/24,d=[{boundary:[6,6,6,6],color:i.frontColor||i.color||"#55FF55"},{boundary:[18,6,6,6],color:i.backColor||i.color||"#55FF55"},{boundary:[12,6,6,6],color:i.rightColor||i.color||"#FF5555"},{boundary:[0,6,6,6],color:i.leftColor||i.color||"#FF5555"},{boundary:[6,0,6,6],color:i.topColor||i.color||"#7777FF"},{boundary:[6,12,6,6],color:i.bottomColor||i.color||"#7777FF"}],u=[{label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,1,0],up:[0,0,1]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,-1,0],up:[0,0,1]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,0,1]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,0,1]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,0,1],up:[0,-1,0]},{boundaries:[[7,5,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,0,-1],up:[1,0,1]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-1,-1],up:[0,-1,1]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,0,-1],up:[-1,0,1]},{boundaries:[[7,11,4,2]],dir:[0,1,1],up:[0,-1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,0,1],up:[-1,0,1]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,-1,1],up:[0,1,1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,0,1],up:[1,0,1]},{boundaries:[[5,7,2,4]],dir:[1,1,0],up:[0,0,1]},{boundaries:[[11,7,2,4]],dir:[-1,1,0],up:[0,0,1]},{boundaries:[[17,7,2,4]],dir:[-1,-1,0],up:[0,0,1]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,-1,0],up:[0,0,1]},{boundaries:[[5,11,2,2]],dir:[1,1,1],up:[-1,-1,1]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[1,-1,1],up:[-1,1,1]},{boundaries:[[5,5,2,2]],dir:[1,1,-1],up:[1,1,1]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-1,-1,1],up:[1,1,1]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-1,-1,-1],up:[-1,-1,1]},{boundaries:[[11,11,2,2]],dir:[-1,1,1],up:[1,-1,1]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[1,-1,-1],up:[1,-1,1]},{boundaries:[[11,5,2,2]],dir:[-1,1,-1],up:[-1,1,1]}];i.frontColor||i.color,i.backColor||i.color,i.rightColor||i.color,i.leftColor||i.color,i.topColor||i.color,i.bottomColor||i.color;const h=[{yUp:"",label:"NavCube.front",boundaries:[[7,7,4,4]],dir:[0,0,-1],up:[0,1,0]},{label:"NavCube.back",boundaries:[[19,7,4,4]],dir:[0,0,1],up:[0,1,0]},{label:"NavCube.right",boundaries:[[13,7,4,4]],dir:[-1,0,0],up:[0,1,0]},{label:"NavCube.left",boundaries:[[1,7,4,4]],dir:[1,0,0],up:[0,1,0]},{label:"NavCube.top",boundaries:[[7,1,4,4]],dir:[0,-1,0],up:[0,0,-1]},{label:"NavCube.bottom",boundaries:[[7,13,4,4]],dir:[0,1,0],up:[0,0,1]},{boundaries:[[7,5,4,2]],dir:[0,-.7071,-.7071],up:[0,.7071,-.7071]},{boundaries:[[1,6,4,1],[6,1,1,4]],dir:[1,-1,0],up:[1,1,0]},{boundaries:[[7,0,4,1],[19,6,4,1]],dir:[0,-.7071,.7071],up:[0,.7071,.7071]},{boundaries:[[13,6,4,1],[11,1,1,4]],dir:[-1,-1,0],up:[-1,1,0]},{boundaries:[[7,11,4,2]],dir:[0,1,-1],up:[0,1,1]},{boundaries:[[1,11,4,1],[6,13,1,4]],dir:[1,1,0],up:[-1,1,0]},{boundaries:[[7,17,4,1],[19,11,4,1]],dir:[0,1,1],up:[0,1,-1]},{boundaries:[[13,11,4,1],[11,13,1,4]],dir:[-1,1,0],up:[1,1,0]},{boundaries:[[5,7,2,4]],dir:[1,0,-1],up:[0,1,0]},{boundaries:[[11,7,2,4]],dir:[-1,0,-1],up:[0,1,0]},{boundaries:[[17,7,2,4]],dir:[-1,0,1],up:[0,1,0]},{boundaries:[[0,7,1,4],[23,7,1,4]],dir:[1,0,1],up:[0,1,0]},{boundaries:[[5,11,2,2]],dir:[.5,.7071,-.5],up:[-.5,.7071,.5]},{boundaries:[[23,11,1,1],[6,17,1,1],[0,11,1,1]],dir:[.5,.7071,.5],up:[-.5,.7071,-.5]},{boundaries:[[5,5,2,2]],dir:[.5,-.7071,-.5],up:[.5,.7071,-.5]},{boundaries:[[11,17,1,1],[17,11,2,1]],dir:[-.5,.7071,.5],up:[.5,.7071,-.5]},{boundaries:[[17,6,2,1],[11,0,1,1]],dir:[-.5,-.7071,.5],up:[-.5,.7071,.5]},{boundaries:[[11,11,2,2]],dir:[-.5,.7071,-.5],up:[.5,.7071,.5]},{boundaries:[[0,6,1,1],[6,0,1,1],[23,6,1,1]],dir:[.5,-.7071,.5],up:[.5,.7071,.5]},{boundaries:[[11,5,2,2]],dir:[-.5,-.7071,-.5],up:[-.5,.7071,-.5]}];for(let v=0,y=u.length;v<y;v++)k.normalizeVec3(u[v].dir,u[v].dir),k.normalizeVec3(u[v].up,u[v].up);for(let v=0,y=h.length;v<y;v++)k.normalizeVec3(h[v].dir,h[v].dir),k.normalizeVec3(h[v].up,h[v].up);var p=h;this._textureCanvas=document.createElement("canvas"),this._textureCanvas.width=l,this._textureCanvas.height=a,this._textureCanvas.style.width=l+"px",this._textureCanvas.style.height=a+"px",this._textureCanvas.style.padding="0",this._textureCanvas.style.margin="0",this._textureCanvas.style.top="0",this._textureCanvas.style.background=r,this._textureCanvas.style.position="absolute",this._textureCanvas.style.opacity="1.0",this._textureCanvas.style.visibility="hidden",this._textureCanvas.style["z-index"]=2e6,s.appendChild(this._textureCanvas);const g=this._textureCanvas.getContext("2d");let f=!1;function m(){for(let C=0,M=d.length;C<M;C++){const E=d[C],B=E.boundary,S=Math.round(B[0]*c),I=Math.round(B[1]*c),T=Math.round(B[2]*c),_=Math.round(B[3]*c);g.fillStyle=E.color,g.fillRect(S,I,T,_)}for(let C=0,M=p.length;C<M;C++){let E,B,S,I;const T=p[C],_=T.boundaries;for(var v=0,y=_.length;v<y;v++){const O=_[v];E=Math.round(O[0]*c),B=Math.round(O[1]*c),S=Math.round(O[2]*c),I=Math.round(O[3]*c),T.highlighted&&(g.fillStyle=T.highlighted?o:T.color||r,g.fillRect(E,B,S,I))}if(T.label){g.fillStyle=n,g.font="60px sans-serif",g.textAlign="center";var b=E+S*.5,w=B+I*.7;g.fillText(A(T.label),b,w,80)}}e.glRedraw()}const A=(function(){const v={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},y={"NavCube.front":"NavCube.front","NavCube.back":"NavCube.back","NavCube.right":"NavCube.right","NavCube.left":"NavCube.left","NavCube.top":"NavCube.top","NavCube.bottom":"NavCube.bottom"},b={"NavCube.front":"FRONT","NavCube.back":"BACK","NavCube.right":"RIGHT","NavCube.left":"LEFT","NavCube.top":"TOP","NavCube.bottom":"BOTTOM"};return function(w){const C=f?y:v,M=C?C[w]:null;return M?t.localeService.translate(M)||b[M]||M:w}})();this.setZUp=function(){f=!0,p=u,this.clear()},this.setYUp=function(){f=!1,p=h,this.clear()},this.clear=function(){g.fillStyle=r,g.fillRect(0,0,l,a);for(var v=0,y=p.length;v<y;v++){const b=p[v];b.highlighted=!1}m()},this.getArea=function(v){const y=v[0]*l,b=a-v[1]*a;for(var w=0,C=p.length;w<C;w++){const B=p[w].boundaries;for(var M=0,E=B.length;M<E;M++){const S=B[M];if(y>=S[0]*c&&y<=(S[0]+S[2])*c&&b>=S[1]*c&&b<=(S[1]+S[3])*c)return w}}return-1},this.setAreaHighlighted=function(v,y){var b=p[v];if(!b)throw"Area not found: "+v;b.highlighted=!!y,m()},this.getAreaDir=function(v){var y=p[v];if(!y)throw"Unknown area: "+v;return y.dir},this.getAreaUp=function(v){var y=p[v];if(!y)throw"Unknown area: "+v;return y.up},this.getImage=function(){return this._textureCanvas},this.destroy=function(){this._textureCanvas&&(this._textureCanvas.parentNode.removeChild(this._textureCanvas),this._textureCanvas=null)}}const Oue=k.vec3(),Uue=k.vec3();k.mat4();class cN extends kc{constructor(e,i={}){super("NavCube",e,i),e.navCube=this;try{this._navCubeScene=new eE(e,{canvasId:i.canvasId,canvasElement:i.canvasElement,transparent:!0}),this._navCubeCanvas=this._navCubeScene.canvas.canvas,this._navCubeScene.input.keyboardEnabled=!1}catch(A){this.error(A);return}const r=this._navCubeScene;r.clearLights(),new Ad(r,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new Ad(r,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new Ad(r,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._navCubeCamera=r.camera,this._navCubeCamera.ortho.scale=7,this._navCubeCamera.ortho.near=.1,this._navCubeCamera.ortho.far=2e3,r.edgeMaterial.edgeColor=[.2,.2,.2],r.edgeMaterial.edgeAlpha=.6,this._zUp=!!e.camera.zUp;var o=this;this.setIsProjectNorth(i.isProjectNorth),this.setProjectNorthOffsetAngle(i.projectNorthOffsetAngle);const n=(function(){const A=k.mat4();return function(v,y,b){return k.identityMat4(A),k.rotationMat4v(v*o._projectNorthOffsetAngle*k.DEGTORAD,[0,1,0],A),k.transformVec3(A,y,b)}})();this._synchCamera=(function(){var A=k.rotationMat4c(-90*k.DEGTORAD,1,0,0),v=k.vec3(),y=k.vec3(),b=k.vec3();return function(){var w=e.camera.eye,C=e.camera.look,M=e.camera.up;v=k.mulVec3Scalar(k.normalizeVec3(k.subVec3(w,C,v)),5),o._isProjectNorth&&o._projectNorthOffsetAngle&&(v=n(-1,v,Oue),M=n(-1,M,Uue)),o._zUp?(k.transformVec3(A,v,y),k.transformVec3(A,M,b),o._navCubeCamera.look=[0,0,0],o._navCubeCamera.eye=k.transformVec3(A,v,y),o._navCubeCamera.up=k.transformPoint3(A,M,b)):(o._navCubeCamera.look=[0,0,0],o._navCubeCamera.eye=v,o._navCubeCamera.up=M)}})(),this._cubeTextureCanvas=new kXt(e,r,i),this._cubeSampler=new cA(r,{image:this._cubeTextureCanvas.getImage(),flipY:!0,wrapS:sa,wrapT:sa}),this._cubeMesh=new nr(r,{geometry:new mo(r,{primitive:"triangles",normals:[0,0,1,0,0,1,0,0,1,0,0,1,1,0,0,1,0,0,1,0,0,1,0,0,0,1,0,0,1,0,0,1,0,0,1,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1,0,0,0,-1,0,0,-1,0,0,-1,0,0,-1],positions:[1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,1,1,-1,-1,1,1,-1,1,1,1,1,1,-1,-1,1,-1,-1,1,1,-1,1,1,-1,1,-1,-1,-1,-1,-1,-1,1,-1,-1,-1,1,-1,-1,1,-1,1,-1,-1,1,1,-1,-1,-1,-1,-1,-1,1,-1,1,1,-1],uv:[.5,.6666,.25,.6666,.25,.3333,.5,.3333,.5,.6666,.5,.3333,.75,.3333,.75,.6666,.5,.6666,.5,1,.25,1,.25,.6666,.25,.6666,0,.6666,0,.3333,.25,.3333,.25,0,.5,0,.5,.3333,.25,.3333,.75,.3333,1,.3333,1,.6666,.75,.6666],indices:[0,1,2,0,2,3,4,5,6,4,6,7,8,9,10,8,10,11,12,13,14,12,14,15,16,17,18,16,18,19,20,21,22,20,22,23]}),material:new vo(r,{diffuse:[.4,.4,.4],specular:[.4,.4,.4],emissive:[.6,.6,.6],diffuseMap:this._cubeSampler,emissiveMap:this._cubeSampler}),visible:!0,edges:!0}),this._shadow=i.shadowVisible===!1?null:new nr(r,{geometry:new mo(r,oA({center:[0,0,0],radiusTop:.001,radiusBottom:1.4,height:.01,radialSegments:20,heightSegments:1,openEnded:!0})),material:new vo(r,{diffuse:[0,0,0],specular:[0,0,0],emissive:[0,0,0],alpha:.5}),position:[0,-1.5,0],visible:!0,pickable:!1,backfaces:!1}),this._onCameraMatrix=e.camera.on("matrix",this._synchCamera),this._onCameraWorldAxis=e.camera.on("worldAxis",()=>{e.camera.zUp?(this._zUp=!0,this._cubeTextureCanvas.setZUp(),this._repaint(),this._synchCamera()):e.camera.yUp&&(this._zUp=!1,this._cubeTextureCanvas.setYUp(),this._repaint(),this._synchCamera())}),this._onCameraFOV=e.camera.perspective.on("fov",A=>{this._synchProjection&&(this._navCubeCamera.perspective.fov=A)}),this._onCameraProjection=e.camera.on("projection",A=>{this._synchProjection&&(this._navCubeCamera.projection=A==="ortho"||A==="perspective"?A:"perspective")});var s=-1;function a(A,v){var y=(A-g)*-p,b=(v-f)*-p;e.camera.orbitYaw(y),e.camera.orbitPitch(-b),g=A,f=v}function l(A){const{left:v,top:y}=o._navCubeCanvas.getBoundingClientRect();return[A.clientX-v,A.clientY-y]}{var c=null,d=null,u=!1,h=!1,p=.5,g,f;o._navCubeCanvas.addEventListener("mouseenter",o._onMouseEnter=function(A){h=!0}),o._navCubeCanvas.addEventListener("mouseleave",o._onMouseLeave=function(A){h=!1}),o._navCubeCanvas.addEventListener("mousedown",o._onMouseDown=function(A){if(A.which===1){c=A.x,d=A.y,g=A.clientX,f=A.clientY;var v=l({clientX:A.clientX,clientY:A.clientY}),y=r.pick({canvasPos:v});y?u=!0:u=!1}}),o._navCubeCanvas.addEventListener("mouseup",o._onMouseUp=function(A){if(A.which===1&&(u=!1,c!==null)){var v=l({clientX:A.clientX,clientY:A.clientY}),y=r.pick({canvasPos:v,pickSurface:!0});if(y&&y.uv){var b=o._cubeTextureCanvas.getArea(y.uv);if(b>=0&&(o._navCubeCanvas.style.cursor="pointer",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),b>=0)){if(o._cubeTextureCanvas.setAreaHighlighted(b,!0),s=b,o._repaint(),A.x<c-3||A.x>c+3||A.y<d-3||A.y>d+3)return;var w=o._cubeTextureCanvas.getAreaDir(b);if(w){var C=o._cubeTextureCanvas.getAreaUp(b);o._isProjectNorth&&o._projectNorthOffsetAngle&&(w=n(1,w,Oue),C=n(1,C,Uue)),m(w,C,function(){s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),o._navCubeCanvas.style.cursor="pointer",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),b>=0&&(o._cubeTextureCanvas.setAreaHighlighted(b,!1),s=-1,o._repaint())})}}}}}),o._navCubeCanvas.addEventListener("mousemove",o._onMouseMove=function(A){if(s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1),!(A.buttons===1&&!u)){if(u){var v=A.clientX,y=A.clientY;o._navCubeCanvas.style.cursor="move",a(v,y);return}if(h){var b=l({clientX:A.clientX,clientY:A.clientY}),w=r.pick({canvasPos:b,pickSurface:!0});if(w){if(w.uv){o._navCubeCanvas.style.cursor="pointer";var C=o._cubeTextureCanvas.getArea(w.uv);if(C===s)return;s>=0&&o._cubeTextureCanvas.setAreaHighlighted(s,!1),C>=0&&(o._cubeTextureCanvas.setAreaHighlighted(C,!0),o._repaint(),s=C)}}else o._navCubeCanvas.style.cursor="default",s>=0&&(o._cubeTextureCanvas.setAreaHighlighted(s,!1),o._repaint(),s=-1)}}}),o._navCubeCanvas.addEventListener("touchstart",o._onTouchStart=function(A){if(A.touches.length>0){c=A.touches[0].clientX,d=A.touches[0].clientY,g=A.touches[0].clientX,f=A.touches[0].clientY;var v=l({clientX:A.touches[0].clientX,clientY:A.touches[0].clientY}),y=r.pick({canvasPos:v});y?u=!0:u=!1}},{passive:!1}),o._navCubeCanvas.addEventListener("touchmove",o._onTouchMove=function(A){A.preventDefault();var v=A.touches[0],y=v.clientX,b=v.clientY,w=document.elementFromPoint(y,b);if(h=o._navCubeCanvas===w,!!h&&u){a(y,b);return}},{passive:!1}),o._navCubeCanvas.addEventListener("touchend",o._onTouchEnd=function(A){u=!1});var m=(function(){var A=k.vec3();return function(v,y,b){var w=o._fitVisible?e.scene.getAABB(e.scene.visibleObjectIds):e.scene.aabb,C=k.getAABB3Diag(w);k.getAABB3Center(w,A);var M=Math.abs(C/Math.tan(o._cameraFitFOV*k.DEGTORAD));e.cameraControl.pivotPos=A,o._cameraFly?e.cameraFlight.flyTo({look:A,eye:[A[0]-M*v[0],A[1]-M*v[1],A[2]-M*v[2]],up:y||[0,1,0],orthoScale:C*1.1,fitFOV:o._cameraFitFOV,duration:o._cameraFlyDuration},b):e.cameraFlight.jumpTo({look:A,eye:[A[0]-M*v[0],A[1]-M*v[1],A[2]-M*v[2]],up:y||[0,1,0],orthoScale:C*1.1,fitFOV:o._cameraFitFOV},b)}})()}this._onUpdated=e.localeService.on("updated",()=>{this._cubeTextureCanvas.clear(),this._repaint()}),this.setVisible(i.visible),this.setCameraFitFOV(i.cameraFitFOV),this.setCameraFly(i.cameraFly),this.setCameraFlyDuration(i.cameraFlyDuration),this.setFitVisible(i.fitVisible),this.setSynchProjection(i.synchProjection)}send(e,i){switch(e){case"language":this._cubeTextureCanvas.clear(),this._repaint();break}}_repaint(){const e=this._cubeTextureCanvas.getImage();this._cubeMesh.material.diffuseMap.image=e,this._cubeMesh.material.emissiveMap.image=e}setVisible(e=!0){this._navCubeCanvas&&(this._cubeMesh.visible=e,this._shadow&&(this._shadow.visible=e),this._navCubeCanvas.style.visibility=e?"visible":"hidden")}getVisible(){return this._navCubeCanvas?this._cubeMesh.visible:!1}setFitVisible(e=!1){this._fitVisible=e}getFitVisible(){return this._fitVisible}setCameraFly(e=!0){this._cameraFly=e}getCameraFly(){return this._cameraFly}setCameraFitFOV(e=45){this._cameraFitFOV=e}getCameraFitFOV(){return this._cameraFitFOV}setCameraFlyDuration(e=.5){this._cameraFlyDuration=e}getCameraFlyDuration(){return this._cameraFlyDuration}setSynchProjection(e=!1){this._synchProjection=e}getSynchProjection(){return this._synchProjection}setIsProjectNorth(e=!1){this._isProjectNorth=e}getIsProjectNorth(){return this._isProjectNorth}setProjectNorthOffsetAngle(e){this._projectNorthOffsetAngle=e}getProjectNorthOffsetAngle(){return this._projectNorthOffsetAngle}destroy(){this._navCubeCanvas&&(this.viewer.localeService.off(this._onUpdated),this.viewer.camera.off(this._onCameraMatrix),this.viewer.camera.off(this._onCameraWorldAxis),this.viewer.camera.perspective.off(this._onCameraFOV),this.viewer.camera.off(this._onCameraProjection),this._navCubeCanvas.removeEventListener("mouseenter",this._onMouseEnter),this._navCubeCanvas.removeEventListener("mouseleave",this._onMouseLeave),this._navCubeCanvas.removeEventListener("mousedown",this._onMouseDown),this._navCubeCanvas.removeEventListener("mousemove",this._onMouseMove),this._navCubeCanvas.removeEventListener("mouseup",this._onMouseUp),this._navCubeCanvas.removeEventListener("touchstart",this._onTouchStart),this._navCubeCanvas.removeEventListener("touchmove",this._onTouchMove),this._navCubeCanvas.removeEventListener("touchend",this._onTouchEnd),this._navCubeCanvas=null,this._cubeTextureCanvas.destroy(),this._cubeTextureCanvas=null,this._onMouseEnter=null,this._onMouseLeave=null,this._onMouseDown=null,this._onMouseMove=null,this._onMouseUp=null,this._onTouchStart=null,this._onTouchMove=null,this._onTouchEnd=null),this._navCubeScene.destroy(),this._navCubeScene=null,this._cubeMesh=null,this._shadow=null,super.destroy()}}class MXt{constructor(e){const i=e.cameraControl,r=e.scene,o=r.canvas.canvas,n=!1,s=1,a=.09,l=.01,c=new R9(r,{position:[0,0,0],scale:[5,5,5],isObject:!1}),d=k.vec3();this._setPosition=(function(){const w=k.vec3(),C=k.vec3();return function(M){d.set(M),Cf(M,w,C),c.origin=w,c.position=C}})(),this._setQuaternion=w=>{c.quaternion=w};const u=(w,C)=>new mo(c,oA({radiusTop:.001,radiusBottom:w,radialSegments:32,heightSegments:1,height:C,openEnded:!1})),h=(w,C,M)=>new mo(c,oA({radiusTop:w,radiusBottom:w,radialSegments:M,heightSegments:1,height:C,openEnded:!1})),p=(w,C,M)=>new mo(c,HF({radius:s-.2,tube:w,radialSegments:64,tubeSegments:M,arc:Math.PI*2*C})),g={curve:p(l,.25,14),curveHandle:p(a,.25,14),hoop:p(l,1,8),arrowHead:u(.07,.2),arrowHeadBig:u(.09,.25),arrowHeadHandle:h(a,.37,8),axis:h(l,s,20),axisHandle:h(a,s,20)},f=w=>new vo(c,{diffuse:w,emissive:w,ambient:[0,0,0],specular:[.6,.6,.3],shininess:80,lineWidth:2}),m=(w,C)=>new Lh(c,{edges:!1,fill:!0,fillColor:w,fillAlpha:C}),A=new vo(c,{diffuse:[1,1,0],alpha:0,alphaMode:"blend"}),v={},y=(w,C)=>{k.mulVec3Scalar(w,-1,k.vec3());const M=f(w),E=k.quaternionToRotationMat4(C,k.identityMat4());k.mulMat4(k.rotationMat4v(Math.PI,[0,1,0],k.mat4()),E,E);const B=k.scaleMat4v([.6,.6,.6],k.identityMat4()),S=(se,ue)=>{const be=k.translateMat4v(se,k.identityMat4()),he=k.identityMat4();return k.mulMat4(be,ue,he),k.mulMat4(E,he,he),k.mulMat4(he,B,k.identityMat4())},I=c.addChild(new nr(c,{geometry:g.curve,material:M,matrix:E,pickable:!1,collidable:!0,clippable:!1,backfaces:!0,visible:!1,isUI:!0,isObject:!1}),n),T=c.addChild(new nr(c,{geometry:g.curveHandle,material:A,matrix:E,pickable:!0,collidable:!0,clippable:!1,backfaces:!0,visible:!1,isUI:!0,isObject:!1}),n),_=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:S([.8,.07,0],k.rotationMat4v(180*k.DEGTORAD,[0,0,1],k.identityMat4())),pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),O=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:S([.07,.8,0],k.rotationMat4v(90*k.DEGTORAD,[0,0,1],k.identityMat4())),pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),j=c.addChild(new nr(c,{geometry:g.hoop,material:M,highlighted:!0,highlightMaterial:m(w,.6),matrix:E,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),N=k.quaternionToRotationMat4(k.vec3PairToQuaternion([0,1,0],w),k.identityMat4());k.mulMat4(k.rotationMat4v(Math.PI,[0,1,0],k.mat4()),N,N);const G=se=>k.mulMat4(N,k.translateMat4c(0,se,0,k.identityMat4()),k.identityMat4()),q=G(s+.1),X=G(s/2),me=c.addChild(new nr(c,{geometry:g.arrowHead,material:M,matrix:q,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ce=c.addChild(new nr(c,{geometry:g.arrowHeadHandle,material:A,matrix:q,pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),xe=c.addChild(new nr(c,{geometry:g.axis,material:M,matrix:X,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),Re=c.addChild(new nr(c,{geometry:g.axisHandle,material:A,matrix:X,pickable:!0,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ge=c.addChild(new nr(c,{geometry:g.arrowHeadBig,material:M,matrix:q,pickable:!1,collidable:!0,clippable:!1,visible:!1,isUI:!0,isObject:!1}),n),ee=(se,ue)=>k.vec3ApplyQuaternion(c.quaternion,se,ue),$=(function(){const se=k.vec3(),ue=k.vec3(),be=k.vec3();return(he,Q)=>{ee(w,se);const J=d,te=se;k.canvasPosToWorldRay(o,r.camera.viewMatrix,r.camera.projMatrix,r.camera.projection,he,ue,be);const ne=k.dotVec3(te,be),ae=k.subVec3(ue,J,Q),W=k.dotVec3(ae,te),K=k.dotVec3(ae,be),ve=1-ne*ne;if(Math.abs(ve)>1e-10){const we=(W-ne*K)/ve;return k.addVec3(J,k.mulVec3Scalar(te,we,Q),Q),!0}else return!1}})(),re=k.vec3(),ie=k.vec3();v[ce.id]=v[Re.id]={setActivated:se=>ge.visible=se,initDragAction:se=>$(se,re)&&k.subVec3(re,d,re)&&(ue=>{$(ue,ie)&&(k.subVec3(ie,re,ie),this._setPosition(ie),this._handlers&&this._handlers.onPosition(ie))})},v[T.id]={setActivated:se=>j.visible=se,initDragAction:se=>{const ue=(function(){const he=r.camera.projectWorldPos(d);ee(w,ie),k.transformVec3(r.camera.normalMatrix,ie,ie);const Q=Math.sign(ie[2]);return J=>{const te=J[0]-he[0],ne=J[1]-he[1];return Q*Math.atan2(-ne,te)}})();let be=ue(se);return he=>{const Q=ue(he);c.rotate(w,(Q-be)*180/Math.PI),this._handlers&&this._handlers.onQuaternion(c.quaternion),be=Q}}};let fe=!1,de=!1,Ae=!1;const Ue=()=>{const se=Ae&&fe;ce.visible=Re.visible=me.visible=xe.visible=!!se,se||(ge.visible=!1)},z=()=>{const se=Ae&&de;T.visible=I.visible=_.visible=O.visible=!!se,se||(j.visible=!1)};return{setPositionActive:se=>{fe=se,Ue()},setRotationActive:se=>{de=se,z()},set visible(se){Ae=se,Ue(),z()}}};this._displayMeshes={center:c.addChild(new nr(c,{geometry:new mo(c,nA({radius:.05})),material:new vo(c,{diffuse:[0,0,0],emissive:[0,0,0],ambient:[0,0,0],specular:[.6,.6,.3],shininess:80}),pickable:!1,collidable:!0,clippable:!1,visible:!1,isObject:!1}),n),x:y([1,0,0],k.vec3PairToQuaternion([1,0,0],[0,0,1])),y:y([0,1,0],k.eulerToQuaternion([90,0,0],"XYZ")),z:y([0,0,1],k.identityQuaternion())};const b=[];{let w=-1;const C=E=>{c.scale[0]!==E&&(c.scale=[E,E,E],this._handlers&&this._handlers.onScreenScale&&this._handlers.onScreenScale(c.scale))},M=r.on("tick",()=>{const E=r.camera,B=Math.abs(k.distVec3(E.eye,d));E.projection==="perspective"?B!==w&&C(.07*B*Math.tan(E.perspective.fov*k.DEGTORAD)):E.projection==="ortho"&&C(E.ortho.scale/10),w=B});b.push(()=>r.off(M))}{let w=null,C=null;b.push(()=>{C&&C.cleanup()});const M=k.vec2(),E=(_,O)=>{O[0]=_.pageX,O[1]=_.pageY,vu(o.ownerDocument.documentElement,o,O)},B=_=>{E(_,M);const O=r.pick({canvasPos:M}),j=O&&O.entity,N=j&&j.id;return N in v&&v[N]},S=(_,O)=>{const j=B(O(_));if(j){C&&C.cleanup();const N=j.initDragAction(M);return N&&(i.pointerEnabled=!1,j.setActivated(!0),C={onChange:G=>{const q=O(G);q&&(E(q,M),N(M))},cleanup:function(){C=null,i.pointerEnabled=!0,j.setActivated(!1)}}),!!N}else return!1},I=(_,O)=>{o.addEventListener(_,O),b.push(()=>o.removeEventListener(_,O))},T=_=>{_.preventDefault(),_.stopPropagation(),_.stopImmediatePropagation()};I("mousedown",_=>{_.which===1&&S(_,O=>O.which===1&&O)&&T(_)}),I("mousemove",_=>{if(C)C.onChange(_),T(_);else{w&&w();const O=B(_);O?(O.setActivated(!0),w=()=>O.setActivated(!1)):w=null}}),I("mouseup",_=>{C&&(C.onChange(_),C.cleanup())}),I("touchstart",_=>{if(_.preventDefault(),_.touches.length===1){const O=_.touches[0].identifier;S(_,j=>[...j.changedTouches].find(N=>N.identifier===O))&&T(_)}}),I("touchmove",_=>{C&&(C.onChange(_),T(_))}),I("touchend",_=>{C&&(C.onChange(_),C.cleanup())})}this.__destroy=()=>{b.forEach(w=>w()),c.destroy();for(let w in v)delete v[w]}}destroy(){this.__destroy()}setHandlers(e){Object.values(this._displayMeshes).forEach(i=>i.visible=!!e),this._handlers=e,this._displayMeshes.x.setPositionActive(e&&e.onPosition),this._displayMeshes.y.setPositionActive(e&&e.onPosition),this._displayMeshes.z.setPositionActive(e&&e.onPosition),this._displayMeshes.x.setRotationActive(e&&e.onQuaternion),this._displayMeshes.y.setRotationActive(e&&e.onQuaternion),this._displayMeshes.z.setRotationActive(e&&e.onQuaternion)}setPosition(e){this._setPosition(e)}setQuaternion(e){this._setQuaternion(e)}}let EXt=class{constructor(t,e,i){this.id=i.id,this._sectionPlane=i,this._mesh=new nr(e,{id:i.id,geometry:new mo(e,UF({xSize:.5,ySize:.5,zSize:.001})),material:new vo(e,{emissive:[1,1,1],diffuse:[0,0,0],backfaces:!1}),edgeMaterial:new gO(e,{edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),highlightMaterial:new Lh(e,{fill:!0,fillColor:[.5,1,.5],fillAlpha:.7,edges:!0,edgeColor:[0,0,0],edgeAlpha:1,edgeWidth:1}),selectedMaterial:new Lh(e,{fill:!0,fillColor:[0,0,1],fillAlpha:.7,edges:!0,edgeColor:[1,0,0],edgeAlpha:1,edgeWidth:1}),highlighted:!0,scale:[3,3,3],position:[0,0,0],rotation:[0,0,0],opacity:.3,edges:!0});{const r=k.vec3([0,0,0]),o=k.vec3(),n=k.vec3([0,0,1]),s=k.vec4(4),a=k.vec3(),l=()=>{const c=this._sectionPlane.scene.center,d=[-this._sectionPlane.dir[0],-this._sectionPlane.dir[1],-this._sectionPlane.dir[2]];k.subVec3(c,this._sectionPlane.pos,r);const u=-k.dotVec3(d,r);k.normalizeVec3(d),k.mulVec3Scalar(d,u,o);const h=k.vec3PairToQuaternion(n,this._sectionPlane.dir,s);a[0]=o[0]*.1,a[1]=o[1]*.1,a[2]=o[2]*.1,this._mesh.quaternion=h,this._mesh.position=a};this._onSectionPlanePos=this._sectionPlane.on("pos",l),this._onSectionPlaneDir=this._sectionPlane.on("dir",l)}this._highlighted=!1,this._selected=!1}setHighlighted(t){this._highlighted=!!t,this._mesh.highlighted=this._highlighted,this._mesh.highlightMaterial.fillColor=t?[0,.7,0]:[0,0,0]}getHighlighted(){return this._highlighted}setSelected(t){this._selected=!!t,this._mesh.edgeMaterial.edgeWidth=t?3:1,this._mesh.highlightMaterial.edgeWidth=t?3:1}getSelected(){return this._selected}destroy(){this._sectionPlane.off(this._onSectionPlanePos),this._sectionPlane.off(this._onSectionPlaneDir),this._mesh.destroy()}};class BXt{constructor(e,i){if(!i.onHoverEnterPlane||!i.onHoverLeavePlane||!i.onClickedNothing||!i.onClickedPlane)throw"Missing config(s): onHoverEnterPlane, onHoverLeavePlane, onClickedNothing || onClickedPlane";this.plugin=e,this._viewer=e.viewer,this._onHoverEnterPlane=i.onHoverEnterPlane,this._onHoverLeavePlane=i.onHoverLeavePlane,this._onClickedNothing=i.onClickedNothing,this._onClickedPlane=i.onClickedPlane,this._visible=!0,this._planes={},this._canvas=i.overviewCanvas,this._scene=new eE(this._viewer,{canvasId:this._canvas.id,transparent:!0}),this._scene.clearLights(),new Ad(this._scene,{dir:[.4,-.4,.8],color:[.8,1,1],intensity:1,space:"view"}),new Ad(this._scene,{dir:[-.8,-.3,-.4],color:[.8,.8,.8],intensity:1,space:"view"}),new Ad(this._scene,{dir:[.8,-.6,-.8],color:[1,1,1],intensity:1,space:"view"}),this._scene.camera,this._scene.camera.perspective.fov=70,this._zUp=!1;{const o=this._scene.camera,n=k.rotationMat4c(-90*k.DEGTORAD,1,0,0),s=k.vec3(),a=k.vec3(),l=k.vec3();this._synchCamera=()=>{const c=this._viewer.camera.eye,d=this._viewer.camera.look,u=this._viewer.camera.up;k.mulVec3Scalar(k.normalizeVec3(k.subVec3(c,d,s)),7),this._zUp?(k.transformVec3(n,s,a),k.transformVec3(n,u,l),o.look=[0,0,0],o.eye=k.transformVec3(n,s,a),o.up=k.transformPoint3(n,u,l)):(o.look=[0,0,0],o.eye=s,o.up=u)}}this._onViewerCameraMatrix=this._viewer.camera.on("matrix",this._synchCamera),this._onViewerCameraWorldAxis=this._viewer.camera.on("worldAxis",this._synchCamera),this._onViewerCameraFOV=this._viewer.camera.perspective.on("fov",o=>{this._scene.camera.perspective.fov=o});{var r=null;this._onInputMouseMove=this._scene.input.on("mousemove",o=>{const n=this._scene.pick({canvasPos:o});n?(!r||n.entity.id!==r.id)&&(r&&this._planes[r.id]&&this._onHoverLeavePlane(r.id),r=n.entity,this._planes[r.id]&&this._onHoverEnterPlane(r.id)):r&&(this._onHoverLeavePlane(r.id),r=null)}),this._scene.canvas.canvas.addEventListener("mouseup",this._onCanvasMouseUp=()=>{r?this._planes[r.id]&&this._onClickedPlane(r.id):this._onClickedNothing()}),this._scene.canvas.canvas.addEventListener("mouseout",this._onCanvasMouseOut=()=>{r&&(this._onHoverLeavePlane(r.id),r=null)})}this.setVisible(i.overviewVisible)}addSectionPlane(e){this._planes[e.id]=new EXt(this,this._scene,e)}setPlaneHighlighted(e,i){const r=this._planes[e];r&&r.setHighlighted(i)}setPlaneSelected(e,i){const r=this._planes[e];r&&r.setSelected(i)}removeSectionPlane(e){const i=this._planes[e.id];i&&(i.destroy(),delete this._planes[e.id])}setVisible(e=!0){this._visible=e,this._canvas.style.visibility=e?"visible":"hidden"}getVisible(){return this._visible}destroy(){this._viewer.camera.off(this._onViewerCameraMatrix),this._viewer.camera.off(this._onViewerCameraWorldAxis),this._viewer.camera.perspective.off(this._onViewerCameraFOV),this._scene.input.off(this._onInputMouseMove),this._scene.canvas.canvas.removeEventListener("mouseup",this._onCanvasMouseUp),this._scene.canvas.canvas.removeEventListener("mouseout",this._onCanvasMouseOut),this._scene.destroy()}}const zh=k.AABB3(),_f=k.vec3();class PXt extends kc{constructor(e,i={}){if(super("SectionPlanes",e),this._freeControls=[],this._sectionPlanes=e.scene.sectionPlanes,this._controls={},this._shownControlId=null,i.overviewCanvasId!==null&&i.overviewCanvasId!==void 0){const r=document.getElementById(i.overviewCanvasId);r?this._overview=new BXt(this,{overviewCanvas:r,visible:i.overviewVisible,onHoverEnterPlane:(o=>{this._overview.setPlaneHighlighted(o,!0)}),onHoverLeavePlane:(o=>{this._overview.setPlaneHighlighted(o,!1)}),onClickedPlane:(o=>{if(this.getShownControl()===o){this.hideControl();return}this.showControl(o);const n=this.sectionPlanes[o].pos;zh.set(this.viewer.scene.aabb),k.getAABB3Center(zh,_f),zh[0]+=n[0]-_f[0],zh[1]+=n[1]-_f[1],zh[2]+=n[2]-_f[2],zh[3]+=n[0]-_f[0],zh[4]+=n[1]-_f[1],zh[5]+=n[2]-_f[2],this.viewer.cameraFlight.flyTo({aabb:zh,fitFOV:65})}),onClickedNothing:(()=>{this.hideControl()})}):this.warn("Can't find overview canvas: '"+i.overviewCanvasId+"' - will create plugin without overview")}this._onSceneSectionPlaneCreated=e.scene.on("sectionPlaneCreated",r=>{this._sectionPlaneCreated(r)})}setOverviewVisible(e){this._overview&&this._overview.setVisible(e)}getOverviewVisible(){if(this._overview)return this._overview.getVisible()}get sectionPlanes(){return this._sectionPlanes}createSectionPlane(e={}){return e.id!==void 0&&e.id!==null&&this.viewer.scene.components[e.id]&&(this.error("Viewer component with this ID already exists: "+e.id),delete e.id),new KO(this.viewer.scene,{id:e.id,pos:e.pos,dir:e.dir,active:!0})}_sectionPlaneCreated(e){const i=this._freeControls.length>0?this._freeControls.pop():(()=>{const r=this.viewer.scene,o=(function(){const u=new R9(r,{isObject:!1});return u.addChild(new nr(u,{geometry:new mo(u,{primitive:"triangles",positions:[.5,.5,0,.5,-.5,0,-.5,-.5,0,-.5,.5,0,.5,.5,-0,.5,-.5,-0,-.5,-.5,-0,-.5,.5,-0],indices:[0,1,2,2,3,0]}),material:new vo(u,{emissive:[0,0,0],diffuse:[0,0,0],backfaces:!0}),opacity:.6,ghosted:!0,ghostMaterial:new Lh(u,{edges:!1,filled:!0,fillColor:[1,1,0],edgeColor:[0,0,0],fillAlpha:.1,backfaces:!0}),pickable:!1,collidable:!0,clippable:!1,visible:!1,scale:[2.4,2.4,1],isObject:!1})),u.addChild(new nr(u,{geometry:new mo(u,HF({center:[0,0,0],radius:1.7,tube:.02,radialSegments:4,tubeSegments:4,arc:Math.PI*2})),material:new vo(u,{emissive:[0,0,0],diffuse:[0,0,0],specular:[0,0,0],shininess:0}),highlightMaterial:new Lh(u,{edges:!1,edgeColor:[0,0,0],filled:!0,fillColor:[.8,.8,.8],fillAlpha:1}),pickable:!1,collidable:!1,clippable:!1,visible:!1,scale:[1,1,.1],rotation:[0,0,45],isObject:!1})),{setPosition:(function(){const h=k.vec3(),p=k.vec3();return function(g){Cf(g,h,p),u.origin=h,u.position=p}})(),setQuaternion:h=>{u.quaternion=h},setScale:h=>{u.scale=h},setVisible:h=>{u.visible=h},destroy:()=>{u.destroy()}}})();let n=()=>{};const s=new MXt(this.viewer);let a=!1,l=!1,c=null;const d=()=>{const u=l&&!a;o.setVisible(u),s.setHandlers(u&&c)};return{_destroy:()=>{n(),s.destroy(),o.destroy()},setCulled:u=>{a=u,d()},setVisible:u=>{l=u,d()},_setSectionPlane:u=>{if(n(),u){let h=!1;c={onPosition:A=>{o.setPosition(A),u.pos=A},onQuaternion:A=>{o.setQuaternion(A),h=!0,u.quaternion=A},onScreenScale:A=>{o.setScale(A)}};const p=()=>{o.setPosition(u.pos),s.setPosition(u.pos)},g=()=>{o.setQuaternion(u.quaternion),s.setQuaternion(u.quaternion)};p(),g();const f=u.on("pos",p),m=u.on("dir",()=>{h?h=!1:g()});n=()=>{u.off(f),u.off(m),n=()=>{}}}}}})();i._setSectionPlane(e),i.setVisible(!1),this._controls[e.id]=i,this._overview&&this._overview.addSectionPlane(e),e.once("destroyed",()=>{this._sectionPlaneDestroyed(e)})}flipSectionPlanes(){const e=this.viewer.scene.sectionPlanes;for(let i in e)e[i].flipDir()}showControl(e){const i=this._controls[e];if(!i){this.error("Control not found: "+e);return}this.hideControl(),i.setVisible(!0),this._overview&&this._overview.setPlaneSelected(e,!0),this._shownControlId=e}getShownControl(){return this._shownControlId}hideControl(){for(var e in this._controls)this._controls.hasOwnProperty(e)&&(this._controls[e].setVisible(!1),this._overview&&this._overview.setPlaneSelected(e,!1));this._shownControlId=null}destroySectionPlane(e){var i=this.viewer.scene.sectionPlanes[e];if(!i){this.error("SectionPlane not found: "+e);return}this._sectionPlaneDestroyed(i),i.destroy(),e===this._shownControlId&&(this._shownControlId=null)}_sectionPlaneDestroyed(e){this._overview&&this._overview.removeSectionPlane(e);const i=this._controls[e.id];i&&(i.setVisible(!1),i._setSectionPlane(null),delete this._controls[e.id],this._freeControls.push(i))}clear(){const e=Object.keys(this._sectionPlanes);for(var i=0,r=e.length;i<r;i++)this.destroySectionPlane(e[i])}send(e,i){switch(e){case"snapshotStarting":for(let r in this._controls)this._controls.hasOwnProperty(r)&&this._controls[r].setCulled(!0);break;case"snapshotFinished":for(let r in this._controls)this._controls.hasOwnProperty(r)&&this._controls[r].setCulled(!1);break;case"clearSectionPlanes":this.clear();break}}destroy(){this.clear(),this._overview&&this._overview.destroy(),this._destroyFreeControls(),super.destroy()}_destroyFreeControls(){for(var e=this._freeControls.pop();e;)e._destroy(),e=this._freeControls.pop();this.viewer.scene.off(this._onSceneSectionPlaneCreated)}}class Nue{constructor(e={}){this.cacheBuster=e.cacheBuster!==!1}_cacheBusterURL(e){if(!this.cacheBuster)return e;const i=new Date().getTime();return e.indexOf("?")>-1?e+"&_="+i:e+"?_="+i}getManifest(e,i,r){Tt.loadJSON(this._cacheBusterURL(e),o=>{i(o)},function(o){r(o)})}getMetaModel(e,i,r){Tt.loadJSON(this._cacheBusterURL(e),o=>{i(o)},function(o){r(o)})}getXKT(e,i,r){var o=()=>{};i=i||o,r=r||o;const n=/^data:(.*?)(;base64)?,(.*)$/,s=e.match(n);if(s){const c=!!s[2];var a=s[3];a=window.decodeURIComponent(a),c&&(a=window.atob(a));try{const d=new ArrayBuffer(a.length),u=new Uint8Array(d);for(var l=0;l<a.length;l++)u[l]=a.charCodeAt(l);i(d)}catch(d){r(d)}}else{const c=new XMLHttpRequest;c.open("GET",this._cacheBusterURL(e),!0),c.responseType="arraybuffer",c.onreadystatechange=function(){c.readyState===4&&(c.status===200?i(c.response):r("getXKT error : "+c.response))},c.send(null)}}}var HE={exports:{}},IXt=HE.exports,jue;function SXt(){return jue||(jue=1,(function(t,e){(function(i,r){r(e)})(IXt,(function(i){function r(L){let oe=L.length;for(;--oe>=0;)L[oe]=0}const o=256,n=286,s=30,a=15,l=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]),c=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]),d=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7]),u=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]),h=new Array(576);r(h);const p=new Array(60);r(p);const g=new Array(512);r(g);const f=new Array(256);r(f);const m=new Array(29);r(m);const A=new Array(s);function v(L,oe,U,Oe,De){this.static_tree=L,this.extra_bits=oe,this.extra_base=U,this.elems=Oe,this.max_length=De,this.has_stree=L&&L.length}let y,b,w;function C(L,oe){this.dyn_tree=L,this.max_code=0,this.stat_desc=oe}r(A);const M=L=>L<256?g[L]:g[256+(L>>>7)],E=(L,oe)=>{L.pending_buf[L.pending++]=255&oe,L.pending_buf[L.pending++]=oe>>>8&255},B=(L,oe,U)=>{L.bi_valid>16-U?(L.bi_buf|=oe<<L.bi_valid&65535,E(L,L.bi_buf),L.bi_buf=oe>>16-L.bi_valid,L.bi_valid+=U-16):(L.bi_buf|=oe<<L.bi_valid&65535,L.bi_valid+=U)},S=(L,oe,U)=>{B(L,U[2*oe],U[2*oe+1])},I=(L,oe)=>{let U=0;do U|=1&L,L>>>=1,U<<=1;while(--oe>0);return U>>>1},T=(L,oe,U)=>{const Oe=new Array(16);let De,Te,dt=0;for(De=1;De<=a;De++)dt=dt+U[De-1]<<1,Oe[De]=dt;for(Te=0;Te<=oe;Te++){let We=L[2*Te+1];We!==0&&(L[2*Te]=I(Oe[We]++,We))}},_=L=>{let oe;for(oe=0;oe<n;oe++)L.dyn_ltree[2*oe]=0;for(oe=0;oe<s;oe++)L.dyn_dtree[2*oe]=0;for(oe=0;oe<19;oe++)L.bl_tree[2*oe]=0;L.dyn_ltree[512]=1,L.opt_len=L.static_len=0,L.sym_next=L.matches=0},O=L=>{L.bi_valid>8?E(L,L.bi_buf):L.bi_valid>0&&(L.pending_buf[L.pending++]=L.bi_buf),L.bi_buf=0,L.bi_valid=0},j=(L,oe,U,Oe)=>{const De=2*oe,Te=2*U;return L[De]<L[Te]||L[De]===L[Te]&&Oe[oe]<=Oe[U]},N=(L,oe,U)=>{const Oe=L.heap[U];let De=U<<1;for(;De<=L.heap_len&&(De<L.heap_len&&j(oe,L.heap[De+1],L.heap[De],L.depth)&&De++,!j(oe,Oe,L.heap[De],L.depth));)L.heap[U]=L.heap[De],U=De,De<<=1;L.heap[U]=Oe},G=(L,oe,U)=>{let Oe,De,Te,dt,We=0;if(L.sym_next!==0)do Oe=255&L.pending_buf[L.sym_buf+We++],Oe+=(255&L.pending_buf[L.sym_buf+We++])<<8,De=L.pending_buf[L.sym_buf+We++],Oe===0?S(L,De,oe):(Te=f[De],S(L,Te+o+1,oe),dt=l[Te],dt!==0&&(De-=m[Te],B(L,De,dt)),Oe--,Te=M(Oe),S(L,Te,U),dt=c[Te],dt!==0&&(Oe-=A[Te],B(L,Oe,dt)));while(We<L.sym_next);S(L,256,oe)},q=(L,oe)=>{const U=oe.dyn_tree,Oe=oe.stat_desc.static_tree,De=oe.stat_desc.has_stree,Te=oe.stat_desc.elems;let dt,We,Ut,Xe=-1;for(L.heap_len=0,L.heap_max=573,dt=0;dt<Te;dt++)U[2*dt]!==0?(L.heap[++L.heap_len]=Xe=dt,L.depth[dt]=0):U[2*dt+1]=0;for(;L.heap_len<2;)Ut=L.heap[++L.heap_len]=Xe<2?++Xe:0,U[2*Ut]=1,L.depth[Ut]=0,L.opt_len--,De&&(L.static_len-=Oe[2*Ut+1]);for(oe.max_code=Xe,dt=L.heap_len>>1;dt>=1;dt--)N(L,U,dt);Ut=Te;do dt=L.heap[1],L.heap[1]=L.heap[L.heap_len--],N(L,U,1),We=L.heap[1],L.heap[--L.heap_max]=dt,L.heap[--L.heap_max]=We,U[2*Ut]=U[2*dt]+U[2*We],L.depth[Ut]=(L.depth[dt]>=L.depth[We]?L.depth[dt]:L.depth[We])+1,U[2*dt+1]=U[2*We+1]=Ut,L.heap[1]=Ut++,N(L,U,1);while(L.heap_len>=2);L.heap[--L.heap_max]=L.heap[1],((ct,Fi)=>{const ui=Fi.dyn_tree,Nt=Fi.max_code,vn=Fi.stat_desc.static_tree,Er=Fi.stat_desc.has_stree,yi=Fi.stat_desc.extra_bits,Lr=Fi.stat_desc.extra_base,_i=Fi.stat_desc.max_length;let Ht,Si,Fr,Gt,vr,Oi,bi=0;for(Gt=0;Gt<=a;Gt++)ct.bl_count[Gt]=0;for(ui[2*ct.heap[ct.heap_max]+1]=0,Ht=ct.heap_max+1;Ht<573;Ht++)Si=ct.heap[Ht],Gt=ui[2*ui[2*Si+1]+1]+1,Gt>_i&&(Gt=_i,bi++),ui[2*Si+1]=Gt,Si>Nt||(ct.bl_count[Gt]++,vr=0,Si>=Lr&&(vr=yi[Si-Lr]),Oi=ui[2*Si],ct.opt_len+=Oi*(Gt+vr),Er&&(ct.static_len+=Oi*(vn[2*Si+1]+vr)));if(bi!==0){do{for(Gt=_i-1;ct.bl_count[Gt]===0;)Gt--;ct.bl_count[Gt]--,ct.bl_count[Gt+1]+=2,ct.bl_count[_i]--,bi-=2}while(bi>0);for(Gt=_i;Gt!==0;Gt--)for(Si=ct.bl_count[Gt];Si!==0;)Fr=ct.heap[--Ht],Fr>Nt||(ui[2*Fr+1]!==Gt&&(ct.opt_len+=(Gt-ui[2*Fr+1])*ui[2*Fr],ui[2*Fr+1]=Gt),Si--)}})(L,oe),T(U,Xe,L.bl_count)},X=(L,oe,U)=>{let Oe,De,Te=-1,dt=oe[1],We=0,Ut=7,Xe=4;for(dt===0&&(Ut=138,Xe=3),oe[2*(U+1)+1]=65535,Oe=0;Oe<=U;Oe++)De=dt,dt=oe[2*(Oe+1)+1],++We<Ut&&De===dt||(We<Xe?L.bl_tree[2*De]+=We:De!==0?(De!==Te&&L.bl_tree[2*De]++,L.bl_tree[32]++):We<=10?L.bl_tree[34]++:L.bl_tree[36]++,We=0,Te=De,dt===0?(Ut=138,Xe=3):De===dt?(Ut=6,Xe=3):(Ut=7,Xe=4))},me=(L,oe,U)=>{let Oe,De,Te=-1,dt=oe[1],We=0,Ut=7,Xe=4;for(dt===0&&(Ut=138,Xe=3),Oe=0;Oe<=U;Oe++)if(De=dt,dt=oe[2*(Oe+1)+1],!(++We<Ut&&De===dt)){if(We<Xe)do S(L,De,L.bl_tree);while(--We!=0);else De!==0?(De!==Te&&(S(L,De,L.bl_tree),We--),S(L,16,L.bl_tree),B(L,We-3,2)):We<=10?(S(L,17,L.bl_tree),B(L,We-3,3)):(S(L,18,L.bl_tree),B(L,We-11,7));We=0,Te=De,dt===0?(Ut=138,Xe=3):De===dt?(Ut=6,Xe=3):(Ut=7,Xe=4)}};let ce=!1;const xe=(L,oe,U,Oe)=>{B(L,0+(Oe?1:0),3),O(L),E(L,U),E(L,~U),U&&L.pending_buf.set(L.window.subarray(oe,oe+U),L.pending),L.pending+=U};var Re=(L,oe,U,Oe)=>{let De,Te,dt=0;L.level>0?(L.strm.data_type===2&&(L.strm.data_type=(We=>{let Ut,Xe=4093624447;for(Ut=0;Ut<=31;Ut++,Xe>>>=1)if(1&Xe&&We.dyn_ltree[2*Ut]!==0)return 0;if(We.dyn_ltree[18]!==0||We.dyn_ltree[20]!==0||We.dyn_ltree[26]!==0)return 1;for(Ut=32;Ut<o;Ut++)if(We.dyn_ltree[2*Ut]!==0)return 1;return 0})(L)),q(L,L.l_desc),q(L,L.d_desc),dt=(We=>{let Ut;for(X(We,We.dyn_ltree,We.l_desc.max_code),X(We,We.dyn_dtree,We.d_desc.max_code),q(We,We.bl_desc),Ut=18;Ut>=3&&We.bl_tree[2*u[Ut]+1]===0;Ut--);return We.opt_len+=3*(Ut+1)+5+5+4,Ut})(L),De=L.opt_len+3+7>>>3,Te=L.static_len+3+7>>>3,Te<=De&&(De=Te)):De=Te=U+5,U+4<=De&&oe!==-1?xe(L,oe,U,Oe):L.strategy===4||Te===De?(B(L,2+(Oe?1:0),3),G(L,h,p)):(B(L,4+(Oe?1:0),3),((We,Ut,Xe,ct)=>{let Fi;for(B(We,Ut-257,5),B(We,Xe-1,5),B(We,ct-4,4),Fi=0;Fi<ct;Fi++)B(We,We.bl_tree[2*u[Fi]+1],3);me(We,We.dyn_ltree,Ut-1),me(We,We.dyn_dtree,Xe-1)})(L,L.l_desc.max_code+1,L.d_desc.max_code+1,dt+1),G(L,L.dyn_ltree,L.dyn_dtree)),_(L),Oe&&O(L)},ge={_tr_init:L=>{ce||((()=>{let oe,U,Oe,De,Te;const dt=new Array(16);for(Oe=0,De=0;De<28;De++)for(m[De]=Oe,oe=0;oe<1<<l[De];oe++)f[Oe++]=De;for(f[Oe-1]=De,Te=0,De=0;De<16;De++)for(A[De]=Te,oe=0;oe<1<<c[De];oe++)g[Te++]=De;for(Te>>=7;De<s;De++)for(A[De]=Te<<7,oe=0;oe<1<<c[De]-7;oe++)g[256+Te++]=De;for(U=0;U<=a;U++)dt[U]=0;for(oe=0;oe<=143;)h[2*oe+1]=8,oe++,dt[8]++;for(;oe<=255;)h[2*oe+1]=9,oe++,dt[9]++;for(;oe<=279;)h[2*oe+1]=7,oe++,dt[7]++;for(;oe<=287;)h[2*oe+1]=8,oe++,dt[8]++;for(T(h,287,dt),oe=0;oe<s;oe++)p[2*oe+1]=5,p[2*oe]=I(oe,5);y=new v(h,l,257,n,a),b=new v(p,c,0,s,a),w=new v(new Array(0),d,0,19,7)})(),ce=!0),L.l_desc=new C(L.dyn_ltree,y),L.d_desc=new C(L.dyn_dtree,b),L.bl_desc=new C(L.bl_tree,w),L.bi_buf=0,L.bi_valid=0,_(L)},_tr_stored_block:xe,_tr_flush_block:Re,_tr_tally:(L,oe,U)=>(L.pending_buf[L.sym_buf+L.sym_next++]=oe,L.pending_buf[L.sym_buf+L.sym_next++]=oe>>8,L.pending_buf[L.sym_buf+L.sym_next++]=U,oe===0?L.dyn_ltree[2*U]++:(L.matches++,oe--,L.dyn_ltree[2*(f[U]+o+1)]++,L.dyn_dtree[2*M(oe)]++),L.sym_next===L.sym_end),_tr_align:L=>{B(L,2,3),S(L,256,h),(oe=>{oe.bi_valid===16?(E(oe,oe.bi_buf),oe.bi_buf=0,oe.bi_valid=0):oe.bi_valid>=8&&(oe.pending_buf[oe.pending++]=255&oe.bi_buf,oe.bi_buf>>=8,oe.bi_valid-=8)})(L)}},ee=(L,oe,U,Oe)=>{let De=65535&L|0,Te=L>>>16&65535|0,dt=0;for(;U!==0;){dt=U>2e3?2e3:U,U-=dt;do De=De+oe[Oe++]|0,Te=Te+De|0;while(--dt);De%=65521,Te%=65521}return De|Te<<16|0};const $=new Uint32Array((()=>{let L,oe=[];for(var U=0;U<256;U++){L=U;for(var Oe=0;Oe<8;Oe++)L=1&L?3988292384^L>>>1:L>>>1;oe[U]=L}return oe})());var re=(L,oe,U,Oe)=>{const De=$,Te=Oe+U;L^=-1;for(let dt=Oe;dt<Te;dt++)L=L>>>8^De[255&(L^oe[dt])];return-1^L},ie={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"},fe={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:de,_tr_stored_block:Ae,_tr_flush_block:Ue,_tr_tally:z,_tr_align:se}=ge,{Z_NO_FLUSH:ue,Z_PARTIAL_FLUSH:be,Z_FULL_FLUSH:he,Z_FINISH:Q,Z_BLOCK:J,Z_OK:te,Z_STREAM_END:ne,Z_STREAM_ERROR:ae,Z_DATA_ERROR:W,Z_BUF_ERROR:K,Z_DEFAULT_COMPRESSION:ve,Z_FILTERED:we,Z_HUFFMAN_ONLY:pe,Z_RLE:Se,Z_FIXED:Ke,Z_DEFAULT_STRATEGY:Pe,Z_UNKNOWN:Ve,Z_DEFLATED:Ne}=fe,Je=258,at=262,Bt=42,Mt=113,yt=666,xt=(L,oe)=>(L.msg=ie[oe],oe),ze=L=>2*L-(L>4?9:0),At=L=>{let oe=L.length;for(;--oe>=0;)L[oe]=0},Ct=L=>{let oe,U,Oe,De=L.w_size;oe=L.hash_size,Oe=oe;do U=L.head[--Oe],L.head[Oe]=U>=De?U-De:0;while(--oe);oe=De,Oe=oe;do U=L.prev[--Oe],L.prev[Oe]=U>=De?U-De:0;while(--oe)};let st=(L,oe,U)=>(oe<<L.hash_shift^U)&L.hash_mask;const Ie=L=>{const oe=L.state;let U=oe.pending;U>L.avail_out&&(U=L.avail_out),U!==0&&(L.output.set(oe.pending_buf.subarray(oe.pending_out,oe.pending_out+U),L.next_out),L.next_out+=U,oe.pending_out+=U,L.total_out+=U,L.avail_out-=U,oe.pending-=U,oe.pending===0&&(oe.pending_out=0))},le=(L,oe)=>{Ue(L,L.block_start>=0?L.block_start:-1,L.strstart-L.block_start,oe),L.block_start=L.strstart,Ie(L.strm)},Fe=(L,oe)=>{L.pending_buf[L.pending++]=oe},Qe=(L,oe)=>{L.pending_buf[L.pending++]=oe>>>8&255,L.pending_buf[L.pending++]=255&oe},Pt=(L,oe,U,Oe)=>{let De=L.avail_in;return De>Oe&&(De=Oe),De===0?0:(L.avail_in-=De,oe.set(L.input.subarray(L.next_in,L.next_in+De),U),L.state.wrap===1?L.adler=ee(L.adler,oe,De,U):L.state.wrap===2&&(L.adler=re(L.adler,oe,De,U)),L.next_in+=De,L.total_in+=De,De)},bt=(L,oe)=>{let U,Oe,De=L.max_chain_length,Te=L.strstart,dt=L.prev_length,We=L.nice_match;const Ut=L.strstart>L.w_size-at?L.strstart-(L.w_size-at):0,Xe=L.window,ct=L.w_mask,Fi=L.prev,ui=L.strstart+Je;let Nt=Xe[Te+dt-1],vn=Xe[Te+dt];L.prev_length>=L.good_match&&(De>>=2),We>L.lookahead&&(We=L.lookahead);do if(U=oe,Xe[U+dt]===vn&&Xe[U+dt-1]===Nt&&Xe[U]===Xe[Te]&&Xe[++U]===Xe[Te+1]){Te+=2,U++;do;while(Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Xe[++Te]===Xe[++U]&&Te<ui);if(Oe=Je-(ui-Te),Te=ui-Je,Oe>dt){if(L.match_start=oe,dt=Oe,Oe>=We)break;Nt=Xe[Te+dt-1],vn=Xe[Te+dt]}}while((oe=Fi[oe&ct])>Ut&&--De!=0);return dt<=L.lookahead?dt:L.lookahead},ei=L=>{const oe=L.w_size;let U,Oe,De;do{if(Oe=L.window_size-L.lookahead-L.strstart,L.strstart>=oe+(oe-at)&&(L.window.set(L.window.subarray(oe,oe+oe-Oe),0),L.match_start-=oe,L.strstart-=oe,L.block_start-=oe,L.insert>L.strstart&&(L.insert=L.strstart),Ct(L),Oe+=oe),L.strm.avail_in===0)break;if(U=Pt(L.strm,L.window,L.strstart+L.lookahead,Oe),L.lookahead+=U,L.lookahead+L.insert>=3)for(De=L.strstart-L.insert,L.ins_h=L.window[De],L.ins_h=st(L,L.ins_h,L.window[De+1]);L.insert&&(L.ins_h=st(L,L.ins_h,L.window[De+3-1]),L.prev[De&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=De,De++,L.insert--,!(L.lookahead+L.insert<3)););}while(L.lookahead<at&&L.strm.avail_in!==0)},ii=(L,oe)=>{let U,Oe,De,Te=L.pending_buf_size-5>L.w_size?L.w_size:L.pending_buf_size-5,dt=0,We=L.strm.avail_in;do{if(U=65535,De=L.bi_valid+42>>3,L.strm.avail_out<De||(De=L.strm.avail_out-De,Oe=L.strstart-L.block_start,U>Oe+L.strm.avail_in&&(U=Oe+L.strm.avail_in),U>De&&(U=De),U<Te&&(U===0&&oe!==Q||oe===ue||U!==Oe+L.strm.avail_in)))break;dt=oe===Q&&U===Oe+L.strm.avail_in?1:0,Ae(L,0,0,dt),L.pending_buf[L.pending-4]=U,L.pending_buf[L.pending-3]=U>>8,L.pending_buf[L.pending-2]=~U,L.pending_buf[L.pending-1]=~U>>8,Ie(L.strm),Oe&&(Oe>U&&(Oe=U),L.strm.output.set(L.window.subarray(L.block_start,L.block_start+Oe),L.strm.next_out),L.strm.next_out+=Oe,L.strm.avail_out-=Oe,L.strm.total_out+=Oe,L.block_start+=Oe,U-=Oe),U&&(Pt(L.strm,L.strm.output,L.strm.next_out,U),L.strm.next_out+=U,L.strm.avail_out-=U,L.strm.total_out+=U)}while(dt===0);return We-=L.strm.avail_in,We&&(We>=L.w_size?(L.matches=2,L.window.set(L.strm.input.subarray(L.strm.next_in-L.w_size,L.strm.next_in),0),L.strstart=L.w_size,L.insert=L.strstart):(L.window_size-L.strstart<=We&&(L.strstart-=L.w_size,L.window.set(L.window.subarray(L.w_size,L.w_size+L.strstart),0),L.matches<2&&L.matches++,L.insert>L.strstart&&(L.insert=L.strstart)),L.window.set(L.strm.input.subarray(L.strm.next_in-We,L.strm.next_in),L.strstart),L.strstart+=We,L.insert+=We>L.w_size-L.insert?L.w_size-L.insert:We),L.block_start=L.strstart),L.high_water<L.strstart&&(L.high_water=L.strstart),dt?4:oe!==ue&&oe!==Q&&L.strm.avail_in===0&&L.strstart===L.block_start?2:(De=L.window_size-L.strstart,L.strm.avail_in>De&&L.block_start>=L.w_size&&(L.block_start-=L.w_size,L.strstart-=L.w_size,L.window.set(L.window.subarray(L.w_size,L.w_size+L.strstart),0),L.matches<2&&L.matches++,De+=L.w_size,L.insert>L.strstart&&(L.insert=L.strstart)),De>L.strm.avail_in&&(De=L.strm.avail_in),De&&(Pt(L.strm,L.window,L.strstart,De),L.strstart+=De,L.insert+=De>L.w_size-L.insert?L.w_size-L.insert:De),L.high_water<L.strstart&&(L.high_water=L.strstart),De=L.bi_valid+42>>3,De=L.pending_buf_size-De>65535?65535:L.pending_buf_size-De,Te=De>L.w_size?L.w_size:De,Oe=L.strstart-L.block_start,(Oe>=Te||(Oe||oe===Q)&&oe!==ue&&L.strm.avail_in===0&&Oe<=De)&&(U=Oe>De?De:Oe,dt=oe===Q&&L.strm.avail_in===0&&U===Oe?1:0,Ae(L,L.block_start,U,dt),L.block_start+=U,Ie(L.strm)),dt?3:1)},wi=(L,oe)=>{let U,Oe;for(;;){if(L.lookahead<at){if(ei(L),L.lookahead<at&&oe===ue)return 1;if(L.lookahead===0)break}if(U=0,L.lookahead>=3&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart),U!==0&&L.strstart-U<=L.w_size-at&&(L.match_length=bt(L,U)),L.match_length>=3)if(Oe=z(L,L.strstart-L.match_start,L.match_length-3),L.lookahead-=L.match_length,L.match_length<=L.max_lazy_match&&L.lookahead>=3){L.match_length--;do L.strstart++,L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart;while(--L.match_length!=0);L.strstart++}else L.strstart+=L.match_length,L.match_length=0,L.ins_h=L.window[L.strstart],L.ins_h=st(L,L.ins_h,L.window[L.strstart+1]);else Oe=z(L,0,L.window[L.strstart]),L.lookahead--,L.strstart++;if(Oe&&(le(L,!1),L.strm.avail_out===0))return 1}return L.insert=L.strstart<2?L.strstart:2,oe===Q?(le(L,!0),L.strm.avail_out===0?3:4):L.sym_next&&(le(L,!1),L.strm.avail_out===0)?1:2},Ai=(L,oe)=>{let U,Oe,De;for(;;){if(L.lookahead<at){if(ei(L),L.lookahead<at&&oe===ue)return 1;if(L.lookahead===0)break}if(U=0,L.lookahead>=3&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart),L.prev_length=L.match_length,L.prev_match=L.match_start,L.match_length=2,U!==0&&L.prev_length<L.max_lazy_match&&L.strstart-U<=L.w_size-at&&(L.match_length=bt(L,U),L.match_length<=5&&(L.strategy===we||L.match_length===3&&L.strstart-L.match_start>4096)&&(L.match_length=2)),L.prev_length>=3&&L.match_length<=L.prev_length){De=L.strstart+L.lookahead-3,Oe=z(L,L.strstart-1-L.prev_match,L.prev_length-3),L.lookahead-=L.prev_length-1,L.prev_length-=2;do++L.strstart<=De&&(L.ins_h=st(L,L.ins_h,L.window[L.strstart+3-1]),U=L.prev[L.strstart&L.w_mask]=L.head[L.ins_h],L.head[L.ins_h]=L.strstart);while(--L.prev_length!=0);if(L.match_available=0,L.match_length=2,L.strstart++,Oe&&(le(L,!1),L.strm.avail_out===0))return 1}else if(L.match_available){if(Oe=z(L,0,L.window[L.strstart-1]),Oe&&le(L,!1),L.strstart++,L.lookahead--,L.strm.avail_out===0)return 1}else L.match_available=1,L.strstart++,L.lookahead--}return L.match_available&&(Oe=z(L,0,L.window[L.strstart-1]),L.match_available=0),L.insert=L.strstart<2?L.strstart:2,oe===Q?(le(L,!0),L.strm.avail_out===0?3:4):L.sym_next&&(le(L,!1),L.strm.avail_out===0)?1:2};function Fo(L,oe,U,Oe,De){this.good_length=L,this.max_lazy=oe,this.nice_length=U,this.max_chain=Oe,this.func=De}const Ji=[new Fo(0,0,0,0,ii),new Fo(4,4,8,4,wi),new Fo(4,5,16,8,wi),new Fo(4,6,32,32,wi),new Fo(4,4,16,16,Ai),new Fo(8,16,32,32,Ai),new Fo(8,16,128,128,Ai),new Fo(8,32,128,256,Ai),new Fo(32,128,258,1024,Ai),new Fo(32,258,258,4096,Ai)];function jg(){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=Ne,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),At(this.dyn_ltree),At(this.dyn_dtree),At(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),At(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Uint16Array(573),At(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 Hd=L=>{if(!L)return 1;const oe=L.state;return!oe||oe.strm!==L||oe.status!==Bt&&oe.status!==57&&oe.status!==69&&oe.status!==73&&oe.status!==91&&oe.status!==103&&oe.status!==Mt&&oe.status!==yt?1:0},V6=L=>{if(Hd(L))return xt(L,ae);L.total_in=L.total_out=0,L.data_type=Ve;const oe=L.state;return oe.pending=0,oe.pending_out=0,oe.wrap<0&&(oe.wrap=-oe.wrap),oe.status=oe.wrap===2?57:oe.wrap?Bt:Mt,L.adler=oe.wrap===2?0:1,oe.last_flush=-2,de(oe),te},M0=L=>{const oe=V6(L);var U;return oe===te&&((U=L.state).window_size=2*U.w_size,At(U.head),U.max_lazy_match=Ji[U.level].max_lazy,U.good_match=Ji[U.level].good_length,U.nice_match=Ji[U.level].nice_length,U.max_chain_length=Ji[U.level].max_chain,U.strstart=0,U.block_start=0,U.lookahead=0,U.insert=0,U.match_length=U.prev_length=2,U.match_available=0,U.ins_h=0),oe},q6=(L,oe,U,Oe,De,Te)=>{if(!L)return ae;let dt=1;if(oe===ve&&(oe=6),Oe<0?(dt=0,Oe=-Oe):Oe>15&&(dt=2,Oe-=16),De<1||De>9||U!==Ne||Oe<8||Oe>15||oe<0||oe>9||Te<0||Te>Ke||Oe===8&&dt!==1)return xt(L,ae);Oe===8&&(Oe=9);const We=new jg;return L.state=We,We.strm=L,We.status=Bt,We.wrap=dt,We.gzhead=null,We.w_bits=Oe,We.w_size=1<<We.w_bits,We.w_mask=We.w_size-1,We.hash_bits=De+7,We.hash_size=1<<We.hash_bits,We.hash_mask=We.hash_size-1,We.hash_shift=~~((We.hash_bits+3-1)/3),We.window=new Uint8Array(2*We.w_size),We.head=new Uint16Array(We.hash_size),We.prev=new Uint16Array(We.w_size),We.lit_bufsize=1<<De+6,We.pending_buf_size=4*We.lit_bufsize,We.pending_buf=new Uint8Array(We.pending_buf_size),We.sym_buf=We.lit_bufsize,We.sym_end=3*(We.lit_bufsize-1),We.level=oe,We.strategy=Te,We.method=U,M0(L)};var B1={deflateInit:(L,oe)=>q6(L,oe,Ne,15,8,Pe),deflateInit2:q6,deflateReset:M0,deflateResetKeep:V6,deflateSetHeader:(L,oe)=>Hd(L)||L.state.wrap!==2?ae:(L.state.gzhead=oe,te),deflate:(L,oe)=>{if(Hd(L)||oe>J||oe<0)return L?xt(L,ae):ae;const U=L.state;if(!L.output||L.avail_in!==0&&!L.input||U.status===yt&&oe!==Q)return xt(L,L.avail_out===0?K:ae);const Oe=U.last_flush;if(U.last_flush=oe,U.pending!==0){if(Ie(L),L.avail_out===0)return U.last_flush=-1,te}else if(L.avail_in===0&&ze(oe)<=ze(Oe)&&oe!==Q)return xt(L,K);if(U.status===yt&&L.avail_in!==0)return xt(L,K);if(U.status===Bt&&U.wrap===0&&(U.status=Mt),U.status===Bt){let De=Ne+(U.w_bits-8<<4)<<8,Te=-1;if(Te=U.strategy>=pe||U.level<2?0:U.level<6?1:U.level===6?2:3,De|=Te<<6,U.strstart!==0&&(De|=32),De+=31-De%31,Qe(U,De),U.strstart!==0&&(Qe(U,L.adler>>>16),Qe(U,65535&L.adler)),L.adler=1,U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(U.status===57){if(L.adler=0,Fe(U,31),Fe(U,139),Fe(U,8),U.gzhead)Fe(U,(U.gzhead.text?1:0)+(U.gzhead.hcrc?2:0)+(U.gzhead.extra?4:0)+(U.gzhead.name?8:0)+(U.gzhead.comment?16:0)),Fe(U,255&U.gzhead.time),Fe(U,U.gzhead.time>>8&255),Fe(U,U.gzhead.time>>16&255),Fe(U,U.gzhead.time>>24&255),Fe(U,U.level===9?2:U.strategy>=pe||U.level<2?4:0),Fe(U,255&U.gzhead.os),U.gzhead.extra&&U.gzhead.extra.length&&(Fe(U,255&U.gzhead.extra.length),Fe(U,U.gzhead.extra.length>>8&255)),U.gzhead.hcrc&&(L.adler=re(L.adler,U.pending_buf,U.pending,0)),U.gzindex=0,U.status=69;else if(Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,0),Fe(U,U.level===9?2:U.strategy>=pe||U.level<2?4:0),Fe(U,3),U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(U.status===69){if(U.gzhead.extra){let De=U.pending,Te=(65535&U.gzhead.extra.length)-U.gzindex;for(;U.pending+Te>U.pending_buf_size;){let We=U.pending_buf_size-U.pending;if(U.pending_buf.set(U.gzhead.extra.subarray(U.gzindex,U.gzindex+We),U.pending),U.pending=U.pending_buf_size,U.gzhead.hcrc&&U.pending>De&&(L.adler=re(L.adler,U.pending_buf,U.pending-De,De)),U.gzindex+=We,Ie(L),U.pending!==0)return U.last_flush=-1,te;De=0,Te-=We}let dt=new Uint8Array(U.gzhead.extra);U.pending_buf.set(dt.subarray(U.gzindex,U.gzindex+Te),U.pending),U.pending+=Te,U.gzhead.hcrc&&U.pending>De&&(L.adler=re(L.adler,U.pending_buf,U.pending-De,De)),U.gzindex=0}U.status=73}if(U.status===73){if(U.gzhead.name){let De,Te=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),Ie(L),U.pending!==0)return U.last_flush=-1,te;Te=0}De=U.gzindex<U.gzhead.name.length?255&U.gzhead.name.charCodeAt(U.gzindex++):0,Fe(U,De)}while(De!==0);U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),U.gzindex=0}U.status=91}if(U.status===91){if(U.gzhead.comment){let De,Te=U.pending;do{if(U.pending===U.pending_buf_size){if(U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te)),Ie(L),U.pending!==0)return U.last_flush=-1,te;Te=0}De=U.gzindex<U.gzhead.comment.length?255&U.gzhead.comment.charCodeAt(U.gzindex++):0,Fe(U,De)}while(De!==0);U.gzhead.hcrc&&U.pending>Te&&(L.adler=re(L.adler,U.pending_buf,U.pending-Te,Te))}U.status=103}if(U.status===103){if(U.gzhead.hcrc){if(U.pending+2>U.pending_buf_size&&(Ie(L),U.pending!==0))return U.last_flush=-1,te;Fe(U,255&L.adler),Fe(U,L.adler>>8&255),L.adler=0}if(U.status=Mt,Ie(L),U.pending!==0)return U.last_flush=-1,te}if(L.avail_in!==0||U.lookahead!==0||oe!==ue&&U.status!==yt){let De=U.level===0?ii(U,oe):U.strategy===pe?((Te,dt)=>{let We;for(;;){if(Te.lookahead===0&&(ei(Te),Te.lookahead===0)){if(dt===ue)return 1;break}if(Te.match_length=0,We=z(Te,0,Te.window[Te.strstart]),Te.lookahead--,Te.strstart++,We&&(le(Te,!1),Te.strm.avail_out===0))return 1}return Te.insert=0,dt===Q?(le(Te,!0),Te.strm.avail_out===0?3:4):Te.sym_next&&(le(Te,!1),Te.strm.avail_out===0)?1:2})(U,oe):U.strategy===Se?((Te,dt)=>{let We,Ut,Xe,ct;const Fi=Te.window;for(;;){if(Te.lookahead<=Je){if(ei(Te),Te.lookahead<=Je&&dt===ue)return 1;if(Te.lookahead===0)break}if(Te.match_length=0,Te.lookahead>=3&&Te.strstart>0&&(Xe=Te.strstart-1,Ut=Fi[Xe],Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe])){ct=Te.strstart+Je;do;while(Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Ut===Fi[++Xe]&&Xe<ct);Te.match_length=Je-(ct-Xe),Te.match_length>Te.lookahead&&(Te.match_length=Te.lookahead)}if(Te.match_length>=3?(We=z(Te,1,Te.match_length-3),Te.lookahead-=Te.match_length,Te.strstart+=Te.match_length,Te.match_length=0):(We=z(Te,0,Te.window[Te.strstart]),Te.lookahead--,Te.strstart++),We&&(le(Te,!1),Te.strm.avail_out===0))return 1}return Te.insert=0,dt===Q?(le(Te,!0),Te.strm.avail_out===0?3:4):Te.sym_next&&(le(Te,!1),Te.strm.avail_out===0)?1:2})(U,oe):Ji[U.level].func(U,oe);if(De!==3&&De!==4||(U.status=yt),De===1||De===3)return L.avail_out===0&&(U.last_flush=-1),te;if(De===2&&(oe===be?se(U):oe!==J&&(Ae(U,0,0,!1),oe===he&&(At(U.head),U.lookahead===0&&(U.strstart=0,U.block_start=0,U.insert=0))),Ie(L),L.avail_out===0))return U.last_flush=-1,te}return oe!==Q?te:U.wrap<=0?ne:(U.wrap===2?(Fe(U,255&L.adler),Fe(U,L.adler>>8&255),Fe(U,L.adler>>16&255),Fe(U,L.adler>>24&255),Fe(U,255&L.total_in),Fe(U,L.total_in>>8&255),Fe(U,L.total_in>>16&255),Fe(U,L.total_in>>24&255)):(Qe(U,L.adler>>>16),Qe(U,65535&L.adler)),Ie(L),U.wrap>0&&(U.wrap=-U.wrap),U.pending!==0?te:ne)},deflateEnd:L=>{if(Hd(L))return ae;const oe=L.state.status;return L.state=null,oe===Mt?xt(L,W):te},deflateSetDictionary:(L,oe)=>{let U=oe.length;if(Hd(L))return ae;const Oe=L.state,De=Oe.wrap;if(De===2||De===1&&Oe.status!==Bt||Oe.lookahead)return ae;if(De===1&&(L.adler=ee(L.adler,oe,U,0)),Oe.wrap=0,U>=Oe.w_size){De===0&&(At(Oe.head),Oe.strstart=0,Oe.block_start=0,Oe.insert=0);let Ut=new Uint8Array(Oe.w_size);Ut.set(oe.subarray(U-Oe.w_size,U),0),oe=Ut,U=Oe.w_size}const Te=L.avail_in,dt=L.next_in,We=L.input;for(L.avail_in=U,L.next_in=0,L.input=oe,ei(Oe);Oe.lookahead>=3;){let Ut=Oe.strstart,Xe=Oe.lookahead-2;do Oe.ins_h=st(Oe,Oe.ins_h,Oe.window[Ut+3-1]),Oe.prev[Ut&Oe.w_mask]=Oe.head[Oe.ins_h],Oe.head[Oe.ins_h]=Ut,Ut++;while(--Xe);Oe.strstart=Ut,Oe.lookahead=2,ei(Oe)}return Oe.strstart+=Oe.lookahead,Oe.block_start=Oe.strstart,Oe.insert=Oe.lookahead,Oe.lookahead=0,Oe.match_length=Oe.prev_length=2,Oe.match_available=0,L.next_in=dt,L.input=We,L.avail_in=Te,Oe.wrap=De,te},deflateInfo:"pako deflate (from Nodeca project)"};const dS=(L,oe)=>Object.prototype.hasOwnProperty.call(L,oe);var ow=function(L){const oe=Array.prototype.slice.call(arguments,1);for(;oe.length;){const U=oe.shift();if(U){if(typeof U!="object")throw new TypeError(U+"must be non-object");for(const Oe in U)dS(U,Oe)&&(L[Oe]=U[Oe])}}return L},nw=L=>{let oe=0;for(let Oe=0,De=L.length;Oe<De;Oe++)oe+=L[Oe].length;const U=new Uint8Array(oe);for(let Oe=0,De=0,Te=L.length;Oe<Te;Oe++){let dt=L[Oe];U.set(dt,De),De+=dt.length}return U};let sw=!0;try{String.fromCharCode.apply(null,new Uint8Array(1))}catch{sw=!1}const E0=new Uint8Array(256);for(let L=0;L<256;L++)E0[L]=L>=252?6:L>=248?5:L>=240?4:L>=224?3:L>=192?2:1;E0[254]=E0[254]=1;var G6=L=>{if(typeof TextEncoder=="function"&&TextEncoder.prototype.encode)return new TextEncoder().encode(L);let oe,U,Oe,De,Te,dt=L.length,We=0;for(De=0;De<dt;De++)U=L.charCodeAt(De),(64512&U)==55296&&De+1<dt&&(Oe=L.charCodeAt(De+1),(64512&Oe)==56320&&(U=65536+(U-55296<<10)+(Oe-56320),De++)),We+=U<128?1:U<2048?2:U<65536?3:4;for(oe=new Uint8Array(We),Te=0,De=0;Te<We;De++)U=L.charCodeAt(De),(64512&U)==55296&&De+1<dt&&(Oe=L.charCodeAt(De+1),(64512&Oe)==56320&&(U=65536+(U-55296<<10)+(Oe-56320),De++)),U<128?oe[Te++]=U:U<2048?(oe[Te++]=192|U>>>6,oe[Te++]=128|63&U):U<65536?(oe[Te++]=224|U>>>12,oe[Te++]=128|U>>>6&63,oe[Te++]=128|63&U):(oe[Te++]=240|U>>>18,oe[Te++]=128|U>>>12&63,oe[Te++]=128|U>>>6&63,oe[Te++]=128|63&U);return oe},Ce=(L,oe)=>{const U=oe||L.length;if(typeof TextDecoder=="function"&&TextDecoder.prototype.decode)return new TextDecoder().decode(L.subarray(0,oe));let Oe,De;const Te=new Array(2*U);for(De=0,Oe=0;Oe<U;){let dt=L[Oe++];if(dt<128){Te[De++]=dt;continue}let We=E0[dt];if(We>4)Te[De++]=65533,Oe+=We-1;else{for(dt&=We===2?31:We===3?15:7;We>1&&Oe<U;)dt=dt<<6|63&L[Oe++],We--;We>1?Te[De++]=65533:dt<65536?Te[De++]=dt:(dt-=65536,Te[De++]=55296|dt>>10&1023,Te[De++]=56320|1023&dt)}}return((dt,We)=>{if(We<65534&&dt.subarray&&sw)return String.fromCharCode.apply(null,dt.length===We?dt:dt.subarray(0,We));let Ut="";for(let Xe=0;Xe<We;Xe++)Ut+=String.fromCharCode(dt[Xe]);return Ut})(Te,De)},tt=(L,oe)=>{(oe=oe||L.length)>L.length&&(oe=L.length);let U=oe-1;for(;U>=0&&(192&L[U])==128;)U--;return U<0||U===0?oe:U+E0[L[U]]>oe?U:oe},ft=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 mt=Object.prototype.toString,{Z_NO_FLUSH:$e,Z_SYNC_FLUSH:Ot,Z_FULL_FLUSH:Xt,Z_FINISH:oi,Z_OK:ti,Z_STREAM_END:Bi,Z_DEFAULT_COMPRESSION:Ii,Z_DEFAULT_STRATEGY:Pi,Z_DEFLATED:mr}=fe;function _r(L){this.options=ow({level:Ii,method:mr,chunkSize:16384,windowBits:15,memLevel:8,strategy:Pi},L||{});let oe=this.options;oe.raw&&oe.windowBits>0?oe.windowBits=-oe.windowBits:oe.gzip&&oe.windowBits>0&&oe.windowBits<16&&(oe.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;let U=B1.deflateInit2(this.strm,oe.level,oe.method,oe.windowBits,oe.memLevel,oe.strategy);if(U!==ti)throw new Error(ie[U]);if(oe.header&&B1.deflateSetHeader(this.strm,oe.header),oe.dictionary){let Oe;if(Oe=typeof oe.dictionary=="string"?G6(oe.dictionary):mt.call(oe.dictionary)==="[object ArrayBuffer]"?new Uint8Array(oe.dictionary):oe.dictionary,U=B1.deflateSetDictionary(this.strm,Oe),U!==ti)throw new Error(ie[U]);this._dict_set=!0}}function to(L,oe){const U=new _r(oe);if(U.push(L,!0),U.err)throw U.msg||ie[U.err];return U.result}_r.prototype.push=function(L,oe){const U=this.strm,Oe=this.options.chunkSize;let De,Te;if(this.ended)return!1;for(Te=oe===~~oe?oe:oe===!0?oi:$e,typeof L=="string"?U.input=G6(L):mt.call(L)==="[object ArrayBuffer]"?U.input=new Uint8Array(L):U.input=L,U.next_in=0,U.avail_in=U.input.length;;)if(U.avail_out===0&&(U.output=new Uint8Array(Oe),U.next_out=0,U.avail_out=Oe),(Te===Ot||Te===Xt)&&U.avail_out<=6)this.onData(U.output.subarray(0,U.next_out)),U.avail_out=0;else{if(De=B1.deflate(U,Te),De===Bi)return U.next_out>0&&this.onData(U.output.subarray(0,U.next_out)),De=B1.deflateEnd(this.strm),this.onEnd(De),this.ended=!0,De===ti;if(U.avail_out!==0){if(Te>0&&U.next_out>0)this.onData(U.output.subarray(0,U.next_out)),U.avail_out=0;else if(U.avail_in===0)break}else this.onData(U.output)}return!0},_r.prototype.onData=function(L){this.chunks.push(L)},_r.prototype.onEnd=function(L){L===ti&&(this.result=nw(this.chunks)),this.chunks=[],this.err=L,this.msg=this.strm.msg};var Po={Deflate:_r,deflate:to,deflateRaw:function(L,oe){return(oe=oe||{}).raw=!0,to(L,oe)},gzip:function(L,oe){return(oe=oe||{}).gzip=!0,to(L,oe)}};const jr=16209;var pi=function(L,oe){let U,Oe,De,Te,dt,We,Ut,Xe,ct,Fi,ui,Nt,vn,Er,yi,Lr,_i,Ht,Si,Fr,Gt,vr,Oi,bi;const ir=L.state;U=L.next_in,Oi=L.input,Oe=U+(L.avail_in-5),De=L.next_out,bi=L.output,Te=De-(oe-L.avail_out),dt=De+(L.avail_out-257),We=ir.dmax,Ut=ir.wsize,Xe=ir.whave,ct=ir.wnext,Fi=ir.window,ui=ir.hold,Nt=ir.bits,vn=ir.lencode,Er=ir.distcode,yi=(1<<ir.lenbits)-1,Lr=(1<<ir.distbits)-1;e:do{Nt<15&&(ui+=Oi[U++]<<Nt,Nt+=8,ui+=Oi[U++]<<Nt,Nt+=8),_i=vn[ui&yi];t:for(;;){if(Ht=_i>>>24,ui>>>=Ht,Nt-=Ht,Ht=_i>>>16&255,Ht===0)bi[De++]=65535&_i;else{if(!(16&Ht)){if((64&Ht)==0){_i=vn[(65535&_i)+(ui&(1<<Ht)-1)];continue t}if(32&Ht){ir.mode=16191;break e}L.msg="invalid literal/length code",ir.mode=jr;break e}Si=65535&_i,Ht&=15,Ht&&(Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8),Si+=ui&(1<<Ht)-1,ui>>>=Ht,Nt-=Ht),Nt<15&&(ui+=Oi[U++]<<Nt,Nt+=8,ui+=Oi[U++]<<Nt,Nt+=8),_i=Er[ui&Lr];i:for(;;){if(Ht=_i>>>24,ui>>>=Ht,Nt-=Ht,Ht=_i>>>16&255,!(16&Ht)){if((64&Ht)==0){_i=Er[(65535&_i)+(ui&(1<<Ht)-1)];continue i}L.msg="invalid distance code",ir.mode=jr;break e}if(Fr=65535&_i,Ht&=15,Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8,Nt<Ht&&(ui+=Oi[U++]<<Nt,Nt+=8)),Fr+=ui&(1<<Ht)-1,Fr>We){L.msg="invalid distance too far back",ir.mode=jr;break e}if(ui>>>=Ht,Nt-=Ht,Ht=De-Te,Fr>Ht){if(Ht=Fr-Ht,Ht>Xe&&ir.sane){L.msg="invalid distance too far back",ir.mode=jr;break e}if(Gt=0,vr=Fi,ct===0){if(Gt+=Ut-Ht,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}}else if(ct<Ht){if(Gt+=Ut+ct-Ht,Ht-=ct,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);if(Gt=0,ct<Si){Ht=ct,Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}}}else if(Gt+=ct-Ht,Ht<Si){Si-=Ht;do bi[De++]=Fi[Gt++];while(--Ht);Gt=De-Fr,vr=bi}for(;Si>2;)bi[De++]=vr[Gt++],bi[De++]=vr[Gt++],bi[De++]=vr[Gt++],Si-=3;Si&&(bi[De++]=vr[Gt++],Si>1&&(bi[De++]=vr[Gt++]))}else{Gt=De-Fr;do bi[De++]=bi[Gt++],bi[De++]=bi[Gt++],bi[De++]=bi[Gt++],Si-=3;while(Si>2);Si&&(bi[De++]=bi[Gt++],Si>1&&(bi[De++]=bi[Gt++]))}break}}break}}while(U<Oe&&De<dt);Si=Nt>>3,U-=Si,Nt-=Si<<3,ui&=(1<<Nt)-1,L.next_in=U,L.next_out=De,L.avail_in=U<Oe?Oe-U+5:5-(U-Oe),L.avail_out=De<dt?dt-De+257:257-(De-dt),ir.hold=ui,ir.bits=Nt};const rn=15,Jc=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]),Pl=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]),P1=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]),Aa=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 Zc=(L,oe,U,Oe,De,Te,dt,We)=>{const Ut=We.bits;let Xe,ct,Fi,ui,Nt,vn,Er=0,yi=0,Lr=0,_i=0,Ht=0,Si=0,Fr=0,Gt=0,vr=0,Oi=0,bi=null;const ir=new Uint16Array(16),ma=new Uint16Array(16);let J6,uw,hw,pw=null;for(Er=0;Er<=rn;Er++)ir[Er]=0;for(yi=0;yi<Oe;yi++)ir[oe[U+yi]]++;for(Ht=Ut,_i=rn;_i>=1&&ir[_i]===0;_i--);if(Ht>_i&&(Ht=_i),_i===0)return De[Te++]=20971520,De[Te++]=20971520,We.bits=1,0;for(Lr=1;Lr<_i&&ir[Lr]===0;Lr++);for(Ht<Lr&&(Ht=Lr),Gt=1,Er=1;Er<=rn;Er++)if(Gt<<=1,Gt-=ir[Er],Gt<0)return-1;if(Gt>0&&(L===0||_i!==1))return-1;for(ma[1]=0,Er=1;Er<rn;Er++)ma[Er+1]=ma[Er]+ir[Er];for(yi=0;yi<Oe;yi++)oe[U+yi]!==0&&(dt[ma[oe[U+yi]]++]=yi);if(L===0?(bi=pw=dt,vn=20):L===1?(bi=Jc,pw=Pl,vn=257):(bi=P1,pw=Aa,vn=0),Oi=0,yi=0,Er=Lr,Nt=Te,Si=Ht,Fr=0,Fi=-1,vr=1<<Ht,ui=vr-1,L===1&&vr>852||L===2&&vr>592)return 1;for(;;){J6=Er-Fr,dt[yi]+1<vn?(uw=0,hw=dt[yi]):dt[yi]>=vn?(uw=pw[dt[yi]-vn],hw=bi[dt[yi]-vn]):(uw=96,hw=0),Xe=1<<Er-Fr,ct=1<<Si,Lr=ct;do ct-=Xe,De[Nt+(Oi>>Fr)+ct]=J6<<24|uw<<16|hw|0;while(ct!==0);for(Xe=1<<Er-1;Oi&Xe;)Xe>>=1;if(Xe!==0?(Oi&=Xe-1,Oi+=Xe):Oi=0,yi++,--ir[Er]==0){if(Er===_i)break;Er=oe[U+dt[yi]]}if(Er>Ht&&(Oi&ui)!==Fi){for(Fr===0&&(Fr=Ht),Nt+=Lr,Si=Er-Fr,Gt=1<<Si;Si+Fr<_i&&(Gt-=ir[Si+Fr],!(Gt<=0));)Si++,Gt<<=1;if(vr+=1<<Si,L===1&&vr>852||L===2&&vr>592)return 1;Fi=Oi&ui,De[Fi]=Ht<<24|Si<<16|Nt-Te|0}}return Oi!==0&&(De[Nt+Oi]=Er-Fr<<24|64<<16|0),We.bits=Ht,0};const{Z_FINISH:Co,Z_BLOCK:tl,Z_TREES:ws,Z_OK:Io,Z_STREAM_END:Il,Z_NEED_DICT:Q6,Z_STREAM_ERROR:Sn,Z_DATA_ERROR:nK,Z_MEM_ERROR:sK,Z_BUF_ERROR:Zxe,Z_DEFLATED:aK}=fe,aw=16180,lw=16190,$u=16191,uS=16192,hS=16194,cw=16199,dw=16200,pS=16206,Oo=16209,lK=L=>(L>>>24&255)+(L>>>8&65280)+((65280&L)<<8)+((255&L)<<24);function Xxe(){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 B0=L=>{if(!L)return 1;const oe=L.state;return!oe||oe.strm!==L||oe.mode<aw||oe.mode>16211?1:0},cK=L=>{if(B0(L))return Sn;const oe=L.state;return L.total_in=L.total_out=oe.total=0,L.msg="",oe.wrap&&(L.adler=1&oe.wrap),oe.mode=aw,oe.last=0,oe.havedict=0,oe.flags=-1,oe.dmax=32768,oe.head=null,oe.hold=0,oe.bits=0,oe.lencode=oe.lendyn=new Int32Array(852),oe.distcode=oe.distdyn=new Int32Array(592),oe.sane=1,oe.back=-1,Io},dK=L=>{if(B0(L))return Sn;const oe=L.state;return oe.wsize=0,oe.whave=0,oe.wnext=0,cK(L)},uK=(L,oe)=>{let U;if(B0(L))return Sn;const Oe=L.state;return oe<0?(U=0,oe=-oe):(U=5+(oe>>4),oe<48&&(oe&=15)),oe&&(oe<8||oe>15)?Sn:(Oe.window!==null&&Oe.wbits!==oe&&(Oe.window=null),Oe.wrap=U,Oe.wbits=oe,dK(L))},hK=(L,oe)=>{if(!L)return Sn;const U=new Xxe;L.state=U,U.strm=L,U.window=null,U.mode=aw;const Oe=uK(L,oe);return Oe!==Io&&(L.state=null),Oe};let fS,gS,pK=!0;const Yxe=L=>{if(pK){fS=new Int32Array(512),gS=new Int32Array(32);let oe=0;for(;oe<144;)L.lens[oe++]=8;for(;oe<256;)L.lens[oe++]=9;for(;oe<280;)L.lens[oe++]=7;for(;oe<288;)L.lens[oe++]=8;for(Zc(1,L.lens,0,288,fS,0,L.work,{bits:9}),oe=0;oe<32;)L.lens[oe++]=5;Zc(2,L.lens,0,32,gS,0,L.work,{bits:5}),pK=!1}L.lencode=fS,L.lenbits=9,L.distcode=gS,L.distbits=5},fK=(L,oe,U,Oe)=>{let De;const Te=L.state;return Te.window===null&&(Te.wsize=1<<Te.wbits,Te.wnext=0,Te.whave=0,Te.window=new Uint8Array(Te.wsize)),Oe>=Te.wsize?(Te.window.set(oe.subarray(U-Te.wsize,U),0),Te.wnext=0,Te.whave=Te.wsize):(De=Te.wsize-Te.wnext,De>Oe&&(De=Oe),Te.window.set(oe.subarray(U-Oe,U-Oe+De),Te.wnext),(Oe-=De)?(Te.window.set(oe.subarray(U-Oe,U),0),Te.wnext=Oe,Te.whave=Te.wsize):(Te.wnext+=De,Te.wnext===Te.wsize&&(Te.wnext=0),Te.whave<Te.wsize&&(Te.whave+=De))),0};var eh={inflateReset:dK,inflateReset2:uK,inflateResetKeep:cK,inflateInit:L=>hK(L,15),inflateInit2:hK,inflate:(L,oe)=>{let U,Oe,De,Te,dt,We,Ut,Xe,ct,Fi,ui,Nt,vn,Er,yi,Lr,_i,Ht,Si,Fr,Gt,vr,Oi=0;const bi=new Uint8Array(4);let ir,ma;const J6=new Uint8Array([16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15]);if(B0(L)||!L.output||!L.input&&L.avail_in!==0)return Sn;U=L.state,U.mode===$u&&(U.mode=uS),dt=L.next_out,De=L.output,Ut=L.avail_out,Te=L.next_in,Oe=L.input,We=L.avail_in,Xe=U.hold,ct=U.bits,Fi=We,ui=Ut,vr=Io;e:for(;;)switch(U.mode){case aw:if(U.wrap===0){U.mode=uS;break}for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(2&U.wrap&&Xe===35615){U.wbits===0&&(U.wbits=15),U.check=0,bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0),Xe=0,ct=0,U.mode=16181;break}if(U.head&&(U.head.done=!1),!(1&U.wrap)||(((255&Xe)<<8)+(Xe>>8))%31){L.msg="incorrect header check",U.mode=Oo;break}if((15&Xe)!==aK){L.msg="unknown compression method",U.mode=Oo;break}if(Xe>>>=4,ct-=4,Gt=8+(15&Xe),U.wbits===0&&(U.wbits=Gt),Gt>15||Gt>U.wbits){L.msg="invalid window size",U.mode=Oo;break}U.dmax=1<<U.wbits,U.flags=0,L.adler=U.check=1,U.mode=512&Xe?16189:$u,Xe=0,ct=0;break;case 16181:for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(U.flags=Xe,(255&U.flags)!==aK){L.msg="unknown compression method",U.mode=Oo;break}if(57344&U.flags){L.msg="unknown header flags set",U.mode=Oo;break}U.head&&(U.head.text=Xe>>8&1),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0,U.mode=16182;case 16182:for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.head&&(U.head.time=Xe),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,bi[2]=Xe>>>16&255,bi[3]=Xe>>>24&255,U.check=re(U.check,bi,4,0)),Xe=0,ct=0,U.mode=16183;case 16183:for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.head&&(U.head.xflags=255&Xe,U.head.os=Xe>>8),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0,U.mode=16184;case 16184:if(1024&U.flags){for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.length=Xe,U.head&&(U.head.extra_len=Xe),512&U.flags&&4&U.wrap&&(bi[0]=255&Xe,bi[1]=Xe>>>8&255,U.check=re(U.check,bi,2,0)),Xe=0,ct=0}else U.head&&(U.head.extra=null);U.mode=16185;case 16185:if(1024&U.flags&&(Nt=U.length,Nt>We&&(Nt=We),Nt&&(U.head&&(Gt=U.head.extra_len-U.length,U.head.extra||(U.head.extra=new Uint8Array(U.head.extra_len)),U.head.extra.set(Oe.subarray(Te,Te+Nt),Gt)),512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,U.length-=Nt),U.length))break e;U.length=0,U.mode=16186;case 16186:if(2048&U.flags){if(We===0)break e;Nt=0;do Gt=Oe[Te+Nt++],U.head&&Gt&&U.length<65536&&(U.head.name+=String.fromCharCode(Gt));while(Gt&&Nt<We);if(512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,Gt)break e}else U.head&&(U.head.name=null);U.length=0,U.mode=16187;case 16187:if(4096&U.flags){if(We===0)break e;Nt=0;do Gt=Oe[Te+Nt++],U.head&&Gt&&U.length<65536&&(U.head.comment+=String.fromCharCode(Gt));while(Gt&&Nt<We);if(512&U.flags&&4&U.wrap&&(U.check=re(U.check,Oe,Nt,Te)),We-=Nt,Te+=Nt,Gt)break e}else U.head&&(U.head.comment=null);U.mode=16188;case 16188:if(512&U.flags){for(;ct<16;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(4&U.wrap&&Xe!==(65535&U.check)){L.msg="header crc mismatch",U.mode=Oo;break}Xe=0,ct=0}U.head&&(U.head.hcrc=U.flags>>9&1,U.head.done=!0),L.adler=U.check=0,U.mode=$u;break;case 16189:for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}L.adler=U.check=lK(Xe),Xe=0,ct=0,U.mode=lw;case lw:if(U.havedict===0)return L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,Q6;L.adler=U.check=1,U.mode=$u;case $u:if(oe===tl||oe===ws)break e;case uS:if(U.last){Xe>>>=7&ct,ct-=7&ct,U.mode=pS;break}for(;ct<3;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}switch(U.last=1&Xe,Xe>>>=1,ct-=1,3&Xe){case 0:U.mode=16193;break;case 1:if(Yxe(U),U.mode=cw,oe===ws){Xe>>>=2,ct-=2;break e}break;case 2:U.mode=16196;break;case 3:L.msg="invalid block type",U.mode=Oo}Xe>>>=2,ct-=2;break;case 16193:for(Xe>>>=7&ct,ct-=7&ct;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if((65535&Xe)!=(Xe>>>16^65535)){L.msg="invalid stored block lengths",U.mode=Oo;break}if(U.length=65535&Xe,Xe=0,ct=0,U.mode=hS,oe===ws)break e;case hS:U.mode=16195;case 16195:if(Nt=U.length,Nt){if(Nt>We&&(Nt=We),Nt>Ut&&(Nt=Ut),Nt===0)break e;De.set(Oe.subarray(Te,Te+Nt),dt),We-=Nt,Te+=Nt,Ut-=Nt,dt+=Nt,U.length-=Nt;break}U.mode=$u;break;case 16196:for(;ct<14;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(U.nlen=257+(31&Xe),Xe>>>=5,ct-=5,U.ndist=1+(31&Xe),Xe>>>=5,ct-=5,U.ncode=4+(15&Xe),Xe>>>=4,ct-=4,U.nlen>286||U.ndist>30){L.msg="too many length or distance symbols",U.mode=Oo;break}U.have=0,U.mode=16197;case 16197:for(;U.have<U.ncode;){for(;ct<3;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.lens[J6[U.have++]]=7&Xe,Xe>>>=3,ct-=3}for(;U.have<19;)U.lens[J6[U.have++]]=0;if(U.lencode=U.lendyn,U.lenbits=7,ir={bits:U.lenbits},vr=Zc(0,U.lens,0,19,U.lencode,0,U.work,ir),U.lenbits=ir.bits,vr){L.msg="invalid code lengths set",U.mode=Oo;break}U.have=0,U.mode=16198;case 16198:for(;U.have<U.nlen+U.ndist;){for(;Oi=U.lencode[Xe&(1<<U.lenbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(_i<16)Xe>>>=yi,ct-=yi,U.lens[U.have++]=_i;else{if(_i===16){for(ma=yi+2;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(Xe>>>=yi,ct-=yi,U.have===0){L.msg="invalid bit length repeat",U.mode=Oo;break}Gt=U.lens[U.have-1],Nt=3+(3&Xe),Xe>>>=2,ct-=2}else if(_i===17){for(ma=yi+3;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=yi,ct-=yi,Gt=0,Nt=3+(7&Xe),Xe>>>=3,ct-=3}else{for(ma=yi+7;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=yi,ct-=yi,Gt=0,Nt=11+(127&Xe),Xe>>>=7,ct-=7}if(U.have+Nt>U.nlen+U.ndist){L.msg="invalid bit length repeat",U.mode=Oo;break}for(;Nt--;)U.lens[U.have++]=Gt}}if(U.mode===Oo)break;if(U.lens[256]===0){L.msg="invalid code -- missing end-of-block",U.mode=Oo;break}if(U.lenbits=9,ir={bits:U.lenbits},vr=Zc(1,U.lens,0,U.nlen,U.lencode,0,U.work,ir),U.lenbits=ir.bits,vr){L.msg="invalid literal/lengths set",U.mode=Oo;break}if(U.distbits=6,U.distcode=U.distdyn,ir={bits:U.distbits},vr=Zc(2,U.lens,U.nlen,U.ndist,U.distcode,0,U.work,ir),U.distbits=ir.bits,vr){L.msg="invalid distances set",U.mode=Oo;break}if(U.mode=cw,oe===ws)break e;case cw:U.mode=dw;case dw:if(We>=6&&Ut>=258){L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,pi(L,ui),dt=L.next_out,De=L.output,Ut=L.avail_out,Te=L.next_in,Oe=L.input,We=L.avail_in,Xe=U.hold,ct=U.bits,U.mode===$u&&(U.back=-1);break}for(U.back=0;Oi=U.lencode[Xe&(1<<U.lenbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(Lr&&(240&Lr)==0){for(Ht=yi,Si=Lr,Fr=_i;Oi=U.lencode[Fr+((Xe&(1<<Ht+Si)-1)>>Ht)],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(Ht+yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=Ht,ct-=Ht,U.back+=Ht}if(Xe>>>=yi,ct-=yi,U.back+=yi,U.length=_i,Lr===0){U.mode=16205;break}if(32&Lr){U.back=-1,U.mode=$u;break}if(64&Lr){L.msg="invalid literal/length code",U.mode=Oo;break}U.extra=15&Lr,U.mode=16201;case 16201:if(U.extra){for(ma=U.extra;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.length+=Xe&(1<<U.extra)-1,Xe>>>=U.extra,ct-=U.extra,U.back+=U.extra}U.was=U.length,U.mode=16202;case 16202:for(;Oi=U.distcode[Xe&(1<<U.distbits)-1],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if((240&Lr)==0){for(Ht=yi,Si=Lr,Fr=_i;Oi=U.distcode[Fr+((Xe&(1<<Ht+Si)-1)>>Ht)],yi=Oi>>>24,Lr=Oi>>>16&255,_i=65535&Oi,!(Ht+yi<=ct);){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}Xe>>>=Ht,ct-=Ht,U.back+=Ht}if(Xe>>>=yi,ct-=yi,U.back+=yi,64&Lr){L.msg="invalid distance code",U.mode=Oo;break}U.offset=_i,U.extra=15&Lr,U.mode=16203;case 16203:if(U.extra){for(ma=U.extra;ct<ma;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}U.offset+=Xe&(1<<U.extra)-1,Xe>>>=U.extra,ct-=U.extra,U.back+=U.extra}if(U.offset>U.dmax){L.msg="invalid distance too far back",U.mode=Oo;break}U.mode=16204;case 16204:if(Ut===0)break e;if(Nt=ui-Ut,U.offset>Nt){if(Nt=U.offset-Nt,Nt>U.whave&&U.sane){L.msg="invalid distance too far back",U.mode=Oo;break}Nt>U.wnext?(Nt-=U.wnext,vn=U.wsize-Nt):vn=U.wnext-Nt,Nt>U.length&&(Nt=U.length),Er=U.window}else Er=De,vn=dt-U.offset,Nt=U.length;Nt>Ut&&(Nt=Ut),Ut-=Nt,U.length-=Nt;do De[dt++]=Er[vn++];while(--Nt);U.length===0&&(U.mode=dw);break;case 16205:if(Ut===0)break e;De[dt++]=U.length,Ut--,U.mode=dw;break;case pS:if(U.wrap){for(;ct<32;){if(We===0)break e;We--,Xe|=Oe[Te++]<<ct,ct+=8}if(ui-=Ut,L.total_out+=ui,U.total+=ui,4&U.wrap&&ui&&(L.adler=U.check=U.flags?re(U.check,De,ui,dt-ui):ee(U.check,De,ui,dt-ui)),ui=Ut,4&U.wrap&&(U.flags?Xe:lK(Xe))!==U.check){L.msg="incorrect data check",U.mode=Oo;break}Xe=0,ct=0}U.mode=16207;case 16207:if(U.wrap&&U.flags){for(;ct<32;){if(We===0)break e;We--,Xe+=Oe[Te++]<<ct,ct+=8}if(4&U.wrap&&Xe!==(4294967295&U.total)){L.msg="incorrect length check",U.mode=Oo;break}Xe=0,ct=0}U.mode=16208;case 16208:vr=Il;break e;case Oo:vr=nK;break e;case 16210:return sK;default:return Sn}return L.next_out=dt,L.avail_out=Ut,L.next_in=Te,L.avail_in=We,U.hold=Xe,U.bits=ct,(U.wsize||ui!==L.avail_out&&U.mode<Oo&&(U.mode<pS||oe!==Co))&&fK(L,L.output,L.next_out,ui-L.avail_out),Fi-=L.avail_in,ui-=L.avail_out,L.total_in+=Fi,L.total_out+=ui,U.total+=ui,4&U.wrap&&ui&&(L.adler=U.check=U.flags?re(U.check,De,ui,L.next_out-ui):ee(U.check,De,ui,L.next_out-ui)),L.data_type=U.bits+(U.last?64:0)+(U.mode===$u?128:0)+(U.mode===cw||U.mode===hS?256:0),(Fi===0&&ui===0||oe===Co)&&vr===Io&&(vr=Zxe),vr},inflateEnd:L=>{if(B0(L))return Sn;let oe=L.state;return oe.window&&(oe.window=null),L.state=null,Io},inflateGetHeader:(L,oe)=>{if(B0(L))return Sn;const U=L.state;return(2&U.wrap)==0?Sn:(U.head=oe,oe.done=!1,Io)},inflateSetDictionary:(L,oe)=>{const U=oe.length;let Oe,De,Te;return B0(L)?Sn:(Oe=L.state,Oe.wrap!==0&&Oe.mode!==lw?Sn:Oe.mode===lw&&(De=1,De=ee(De,oe,U,0),De!==Oe.check)?nK:(Te=fK(L,oe,U,U),Te?(Oe.mode=16210,sK):(Oe.havedict=1,Io)))},inflateInfo:"pako inflate (from Nodeca project)"},$xe=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 gK=Object.prototype.toString,{Z_NO_FLUSH:eke,Z_FINISH:tke,Z_OK:K6,Z_STREAM_END:AS,Z_NEED_DICT:mS,Z_STREAM_ERROR:ike,Z_DATA_ERROR:AK,Z_MEM_ERROR:rke}=fe;function W6(L){this.options=ow({chunkSize:65536,windowBits:15,to:""},L||{});const oe=this.options;oe.raw&&oe.windowBits>=0&&oe.windowBits<16&&(oe.windowBits=-oe.windowBits,oe.windowBits===0&&(oe.windowBits=-15)),!(oe.windowBits>=0&&oe.windowBits<16)||L&&L.windowBits||(oe.windowBits+=32),oe.windowBits>15&&oe.windowBits<48&&(15&oe.windowBits)==0&&(oe.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new ft,this.strm.avail_out=0;let U=eh.inflateInit2(this.strm,oe.windowBits);if(U!==K6)throw new Error(ie[U]);if(this.header=new $xe,eh.inflateGetHeader(this.strm,this.header),oe.dictionary&&(typeof oe.dictionary=="string"?oe.dictionary=G6(oe.dictionary):gK.call(oe.dictionary)==="[object ArrayBuffer]"&&(oe.dictionary=new Uint8Array(oe.dictionary)),oe.raw&&(U=eh.inflateSetDictionary(this.strm,oe.dictionary),U!==K6)))throw new Error(ie[U])}function vS(L,oe){const U=new W6(oe);if(U.push(L),U.err)throw U.msg||ie[U.err];return U.result}W6.prototype.push=function(L,oe){const U=this.strm,Oe=this.options.chunkSize,De=this.options.dictionary;let Te,dt,We;if(this.ended)return!1;for(dt=oe===~~oe?oe:oe===!0?tke:eke,gK.call(L)==="[object ArrayBuffer]"?U.input=new Uint8Array(L):U.input=L,U.next_in=0,U.avail_in=U.input.length;;){for(U.avail_out===0&&(U.output=new Uint8Array(Oe),U.next_out=0,U.avail_out=Oe),Te=eh.inflate(U,dt),Te===mS&&De&&(Te=eh.inflateSetDictionary(U,De),Te===K6?Te=eh.inflate(U,dt):Te===AK&&(Te=mS));U.avail_in>0&&Te===AS&&U.state.wrap>0&&L[U.next_in]!==0;)eh.inflateReset(U),Te=eh.inflate(U,dt);switch(Te){case ike:case AK:case mS:case rke:return this.onEnd(Te),this.ended=!0,!1}if(We=U.avail_out,U.next_out&&(U.avail_out===0||Te===AS))if(this.options.to==="string"){let Ut=tt(U.output,U.next_out),Xe=U.next_out-Ut,ct=Ce(U.output,Ut);U.next_out=Xe,U.avail_out=Oe-Xe,Xe&&U.output.set(U.output.subarray(Ut,Ut+Xe),0),this.onData(ct)}else this.onData(U.output.length===U.next_out?U.output:U.output.subarray(0,U.next_out));if(Te!==K6||We!==0){if(Te===AS)return Te=eh.inflateEnd(this.strm),this.onEnd(Te),this.ended=!0,!0;if(U.avail_in===0)break}}return!0},W6.prototype.onData=function(L){this.chunks.push(L)},W6.prototype.onEnd=function(L){L===K6&&(this.options.to==="string"?this.result=this.chunks.join(""):this.result=nw(this.chunks)),this.chunks=[],this.err=L,this.msg=this.strm.msg};var oke={Inflate:W6,inflate:vS,inflateRaw:function(L,oe){return(oe=oe||{}).raw=!0,vS(L,oe)},ungzip:vS};const{Deflate:nke,deflate:ske,deflateRaw:ake,gzip:lke}=Po,{Inflate:cke,inflate:dke,inflateRaw:uke,ungzip:hke}=oke;var mK=nke,vK=ske,yK=ake,bK=lke,wK=cke,CK=dke,xK=uke,kK=hke,MK=fe,pke={Deflate:mK,deflate:vK,deflateRaw:yK,gzip:bK,Inflate:wK,inflate:CK,inflateRaw:xK,ungzip:kK,constants:MK};i.Deflate=mK,i.Inflate=wK,i.constants=MK,i.default=pke,i.deflate=vK,i.deflateRaw=yK,i.gzip=bK,i.inflate=CK,i.inflateRaw=xK,i.ungzip=kK,Object.defineProperty(i,"__esModule",{value:!0})}))})(HE,HE.exports)),HE.exports}var Hue=SXt();const TXt=_8(Hue),yd=gke({__proto__:null,default:TXt},[Hue]);let _a=window.pako||yd;_a.inflate||(_a=_a.default);const RXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function DXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],positionsDecodeMatrix:t[11]}}function _Xt(t){return{positions:new Uint16Array(_a.inflate(t.positions).buffer),normals:new Int8Array(_a.inflate(t.normals).buffer),indices:new Uint32Array(_a.inflate(t.indices).buffer),edgeIndices:new Uint32Array(_a.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(_a.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(_a.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(_a.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(_a.inflate(t.meshColors).buffer),entityIDs:_a.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(_a.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(_a.inflate(t.entityIsObjects).buffer),positionsDecodeMatrix:new Float32Array(_a.inflate(t.positionsDecodeMatrix).buffer)}}function LXt(t,e,i,r,o,n){n.getNextId(),r.positionsCompression="precompressed",r.normalsCompression="precompressed";const s=i.positions,a=i.normals,l=i.indices,c=i.edgeIndices,d=i.meshPositions,u=i.meshIndices,h=i.meshEdgesIndices,p=i.meshColors,g=JSON.parse(i.entityIDs),f=i.entityMeshes,m=i.entityIsObjects,A=d.length,v=f.length;for(let y=0;y<v;y++){const b=g[y],w=e.globalizeObjectIds?k.globalizeObjectId(r.id,b):b,C=t.metaScene.metaObjects[w],M={},E={};if(C){if(e.excludeTypesMap&&C.type&&e.excludeTypesMap[C.type]||e.includeTypesMap&&C.type&&!e.includeTypesMap[C.type])continue;const I=e.objectDefaults?e.objectDefaults[C.type]||e.objectDefaults.DEFAULT:null;I&&(I.visible===!1&&(M.visible=!1),I.pickable===!1&&(M.pickable=!1),I.colorize&&(E.color=I.colorize),I.opacity!==void 0&&I.opacity!==null&&(E.opacity=I.opacity))}else if(e.excludeUnclassifiedObjects)continue;const B=y===v-1,S=[];for(let I=f[y],T=B?f.length:f[y+1];I<T;I++){const _=I===A-1,O=w+".mesh."+I,j=RXt(p.subarray(I*4,I*4+3)),N=p[I*4+3]/255;r.createMesh(Tt.apply(E,{id:O,primitive:"triangles",positionsCompressed:s.subarray(d[I],_?s.length:d[I+1]),normalsCompressed:a.subarray(d[I],_?s.length:d[I+1]),indices:l.subarray(u[I],_?l.length:u[I+1]),edgeIndices:c.subarray(h[I],_?c.length:h[I+1]),positionsDecodeMatrix:i.positionsDecodeMatrix,color:j,opacity:N})),S.push(O)}r.createEntity(Tt.apply(M,{id:w,isObject:m[y]===1,meshIds:S}))}}const zue={version:1,parse:function(t,e,i,r,o,n){const s=DXt(i),a=_Xt(s);LXt(t,e,a,r,o,n)}};let ns=window.pako||yd;ns.inflate||(ns=ns.default);function FXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],positionsDecodeMatrix:t[11],entityMeshIds:t[12],entityMatrices:t[13],entityUsesInstancing:t[14]}}function OXt(t){return{positions:new Uint16Array(ns.inflate(t.positions).buffer),normals:new Int8Array(ns.inflate(t.normals).buffer),indices:new Uint32Array(ns.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ns.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(ns.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(ns.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(ns.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(ns.inflate(t.meshColors).buffer),entityIDs:ns.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(ns.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(ns.inflate(t.entityIsObjects).buffer),positionsDecodeMatrix:new Float32Array(ns.inflate(t.positionsDecodeMatrix).buffer),entityMeshIds:new Uint32Array(ns.inflate(t.entityMeshIds).buffer),entityMatrices:new Float32Array(ns.inflate(t.entityMatrices).buffer),entityUsesInstancing:new Uint8Array(ns.inflate(t.entityUsesInstancing).buffer)}}const UXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function NXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.meshPositions,h=i.meshIndices,p=i.meshEdgesIndices,g=i.meshColors,f=JSON.parse(i.entityIDs),m=i.entityMeshes,A=i.entityIsObjects,v=i.entityMeshIds,y=i.entityMatrices,b=i.entityUsesInstancing,w=u.length,C=m.length,M={};for(let E=0;E<C;E++){const B=f[E],S=e.globalizeObjectIds?k.globalizeObjectId(r.id,B):B,I=t.metaScene.metaObjects[S],T={},_={},O=y.subarray(E*16,E*16+16);if(I){if(e.excludeTypesMap&&I.type&&e.excludeTypesMap[I.type]||e.includeTypesMap&&I.type&&!e.includeTypesMap[I.type])continue;const G=e.objectDefaults?e.objectDefaults[I.type]||e.objectDefaults.DEFAULT:null;G&&(G.visible===!1&&(T.visible=!1),G.pickable===!1&&(T.pickable=!1),G.colorize&&(_.color=G.colorize),G.opacity!==void 0&&G.opacity!==null&&(_.opacity=G.opacity))}else if(e.excludeUnclassifiedObjects)continue;const j=E===C-1,N=[];for(let G=m[E],q=j?v.length:m[E+1];G<q;G++){const X=v[G],me=X===w-1,ce=n.getNextId(),xe=UXt(g.subarray(X*4,X*4+3)),Re=g[X*4+3]/255,ge=a.subarray(u[X],me?a.length:u[X+1]),ee=l.subarray(u[X],me?a.length:u[X+1]),$=c.subarray(h[X],me?c.length:h[X+1]),re=d.subarray(p[X],me?d.length:p[X+1]);if(b[E]===1){const ie=`${s}.geometry.${ce}.${X}`;ie in M||(r.createGeometry({id:ie,positionsCompressed:ge,normalsCompressed:ee,indices:$,edgeIndices:re,primitive:"triangles",positionsDecodeMatrix:i.positionsDecodeMatrix}),M[ie]=!0),r.createMesh(Tt.apply(_,{id:ce,color:xe,opacity:Re,matrix:O,geometryId:ie})),N.push(ce)}else r.createMesh(Tt.apply(_,{id:ce,primitive:"triangles",positionsCompressed:ge,normalsCompressed:ee,indices:$,edgeIndices:re,positionsDecodeMatrix:i.positionsDecodeMatrix,color:xe,opacity:Re})),N.push(ce)}N.length&&r.createEntity(Tt.apply(T,{id:S,isObject:A[E]===1,meshIds:N}))}}const Vue={version:2,parse:function(t,e,i,r,o,n){const s=FXt(i),a=OXt(s);NXt(t,e,a,r,o,n)}};let Kn=window.pako||yd;Kn.inflate||(Kn=Kn.default);function jXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],meshPositions:t[4],meshIndices:t[5],meshEdgesIndices:t[6],meshColors:t[7],entityIDs:t[8],entityMeshes:t[9],entityIsObjects:t[10],instancedPositionsDecodeMatrix:t[11],batchedPositionsDecodeMatrix:t[12],entityMeshIds:t[13],entityMatrices:t[14],entityUsesInstancing:t[15]}}function HXt(t){return{positions:new Uint16Array(Kn.inflate(t.positions).buffer),normals:new Int8Array(Kn.inflate(t.normals).buffer),indices:new Uint32Array(Kn.inflate(t.indices).buffer),edgeIndices:new Uint32Array(Kn.inflate(t.edgeIndices).buffer),meshPositions:new Uint32Array(Kn.inflate(t.meshPositions).buffer),meshIndices:new Uint32Array(Kn.inflate(t.meshIndices).buffer),meshEdgesIndices:new Uint32Array(Kn.inflate(t.meshEdgesIndices).buffer),meshColors:new Uint8Array(Kn.inflate(t.meshColors).buffer),entityIDs:Kn.inflate(t.entityIDs,{to:"string"}),entityMeshes:new Uint32Array(Kn.inflate(t.entityMeshes).buffer),entityIsObjects:new Uint8Array(Kn.inflate(t.entityIsObjects).buffer),instancedPositionsDecodeMatrix:new Float32Array(Kn.inflate(t.instancedPositionsDecodeMatrix).buffer),batchedPositionsDecodeMatrix:new Float32Array(Kn.inflate(t.batchedPositionsDecodeMatrix).buffer),entityMeshIds:new Uint32Array(Kn.inflate(t.entityMeshIds).buffer),entityMatrices:new Float32Array(Kn.inflate(t.entityMatrices).buffer),entityUsesInstancing:new Uint8Array(Kn.inflate(t.entityUsesInstancing).buffer)}}const zXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function VXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.meshPositions,h=i.meshIndices,p=i.meshEdgesIndices,g=i.meshColors,f=JSON.parse(i.entityIDs),m=i.entityMeshes,A=i.entityIsObjects,v=i.entityMeshIds,y=i.entityMatrices,b=i.entityUsesInstancing,w=u.length,C=m.length,M={};for(let _=0;_<C;_++){const O=f[_],j=e.globalizeObjectIds?k.globalizeObjectId(r.id,O):O,N=t.metaScene.metaObjects[j],G={},q={},X=y.subarray(_*16,_*16+16);if(N){if(e.excludeTypesMap&&N.type&&e.excludeTypesMap[N.type]||e.includeTypesMap&&N.type&&!e.includeTypesMap[N.type])continue;const xe=e.objectDefaults?e.objectDefaults[N.type]||e.objectDefaults.DEFAULT:null;xe&&(xe.visible===!1&&(G.visible=!1),xe.pickable===!1&&(G.pickable=!1),xe.colorize&&(q.color=xe.colorize),xe.opacity!==void 0&&xe.opacity!==null&&(q.opacity=xe.opacity))}else if(e.excludeUnclassifiedObjects)continue;const me=_===C-1,ce=[];for(let xe=m[_],Re=me?v.length:m[_+1];xe<Re;xe++){var E=v[xe];const ge=E===w-1,ee=`${s}.${j}.mesh.${E}`,$=zXt(g.subarray(E*4,E*4+3)),re=g[E*4+3]/255;var B=a.subarray(u[E],ge?a.length:u[E+1]),S=l.subarray(u[E],ge?a.length:u[E+1]),I=c.subarray(h[E],ge?c.length:h[E+1]),T=d.subarray(p[E],ge?d.length:p[E+1]);if(b[_]===1){const ie=`${s}.geometry.${ee}.${E}`;ie in M||(r.createGeometry({id:ie,positionsCompressed:B,normalsCompressed:S,indices:I,edgeIndices:T,primitive:"triangles",positionsDecodeMatrix:i.instancedPositionsDecodeMatrix}),M[ie]=!0),r.createMesh(Tt.apply(q,{id:ee,color:$,opacity:re,matrix:X,geometryId:ie})),ce.push(ee)}else r.createMesh(Tt.apply(q,{id:ee,primitive:"triangles",positionsCompressed:B,normalsCompressed:S,indices:I,edgeIndices:T,positionsDecodeMatrix:i.batchedPositionsDecodeMatrix,color:$,opacity:re})),ce.push(ee)}ce.length&&r.createEntity(Tt.apply(G,{id:j,isObject:A[_]===1,meshIds:ce}))}}const que={version:3,parse:function(t,e,i,r,o,n){const s=jXt(i),a=HXt(s);VXt(t,e,a,r,o,n)}};let ss=window.pako||yd;ss.inflate||(ss=ss.default);function qXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],decodeMatrices:t[4],matrices:t[5],eachPrimitivePositionsAndNormalsPortion:t[6],eachPrimitiveIndicesPortion:t[7],eachPrimitiveEdgeIndicesPortion:t[8],eachPrimitiveDecodeMatricesPortion:t[9],eachPrimitiveColor:t[10],primitiveInstances:t[11],eachEntityId:t[12],eachEntityPrimitiveInstancesPortion:t[13],eachEntityMatricesPortion:t[14],eachEntityMatrix:t[15]}}function GXt(t){return{positions:new Uint16Array(ss.inflate(t.positions).buffer),normals:new Int8Array(ss.inflate(t.normals).buffer),indices:new Uint32Array(ss.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ss.inflate(t.edgeIndices).buffer),decodeMatrices:new Float32Array(ss.inflate(t.decodeMatrices).buffer),matrices:new Float32Array(ss.inflate(t.matrices).buffer),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(ss.inflate(t.eachPrimitivePositionsAndNormalsPortion).buffer),eachPrimitiveIndicesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveIndicesPortion).buffer),eachPrimitiveEdgeIndicesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveEdgeIndicesPortion).buffer),eachPrimitiveDecodeMatricesPortion:new Uint32Array(ss.inflate(t.eachPrimitiveDecodeMatricesPortion).buffer),eachPrimitiveColor:new Uint8Array(ss.inflate(t.eachPrimitiveColor).buffer),primitiveInstances:new Uint32Array(ss.inflate(t.primitiveInstances).buffer),eachEntityId:ss.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(ss.inflate(t.eachEntityPrimitiveInstancesPortion).buffer),eachEntityMatricesPortion:new Uint32Array(ss.inflate(t.eachEntityMatricesPortion).buffer)}}const QXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function KXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="precompressed",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.decodeMatrices,h=i.matrices,p=i.eachPrimitivePositionsAndNormalsPortion,g=i.eachPrimitiveIndicesPortion,f=i.eachPrimitiveEdgeIndicesPortion,m=i.eachPrimitiveDecodeMatricesPortion,A=i.eachPrimitiveColor,v=i.primitiveInstances,y=JSON.parse(i.eachEntityId),b=i.eachEntityPrimitiveInstancesPortion,w=i.eachEntityMatricesPortion,C=p.length,M=v.length,E=new Uint8Array(C),B=new Uint32Array(C),S=y.length;for(let _=0;_<C;_++)B[_]=_;B.sort((_,O)=>m[_]<m[O]?-1:m[_]>m[O]?1:0);for(let _=0;_<M;_++){const O=v[_];E[O]++}const I={};for(let _=0;_<S;_++){const O=S-1,j=_===O,N=b[_],G=j?b[O]:b[_+1];for(let q=N;q<G;q++){const X=v[q];E[X]>1||(I[X]=_)}}for(let _=0;_<C;_++){const O=B[_],j=O===C-1,N=E[O]>1,G=QXt(A.subarray(O*4,O*4+3)),q=A[O*4+3]/255,X=a.subarray(p[O],j?a.length:p[O+1]),me=l.subarray(p[O],j?l.length:p[O+1]),ce=c.subarray(g[O],j?c.length:g[O+1]),xe=d.subarray(f[O],j?d.length:f[O+1]),Re=u.subarray(m[O],m[O]+16);if(N){const ge=`${s}-geometry.${O}`;r.createGeometry({id:ge,primitive:"triangles",positionsCompressed:X,normalsCompressed:me,indices:ce,edgeIndices:xe,positionsDecodeMatrix:Re})}else{const ge=`${s}-${O}`,ee=I[O];y[ee];const $={};r.createMesh(Tt.apply($,{id:ge,primitive:"triangles",positionsCompressed:X,normalsCompressed:me,indices:ce,edgeIndices:xe,positionsDecodeMatrix:Re,color:G,opacity:q}))}}let T=0;for(let _=0;_<S;_++){const O=S-1,j=_===O,N=y[_],G=b[_],q=j?b[O]:b[_+1],X=[];for(let me=G;me<q;me++){const ce=v[me];if(E[ce]>1){const xe={},Re=`${s}-instance.${T++}`,ge=`${s}-geometry.${ce}`,ee=w[_]*16,$=h.subarray(ee,ee+16);r.createMesh(Tt.apply(xe,{id:Re,geometryId:ge,matrix:$})),X.push(Re)}else X.push(ce)}if(X.length>0){const me={};r.createEntity(Tt.apply(me,{id:N,isObject:!0,meshIds:X}))}}}const Gue={version:4,parse:function(t,e,i,r,o,n){const s=qXt(i),a=GXt(s);KXt(t,e,a,r,o,n)}};let ca=window.pako||yd;ca.inflate||(ca=ca.default);function WXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],matrices:t[4],eachPrimitivePositionsAndNormalsPortion:t[5],eachPrimitiveIndicesPortion:t[6],eachPrimitiveEdgeIndicesPortion:t[7],eachPrimitiveColor:t[8],primitiveInstances:t[9],eachEntityId:t[10],eachEntityPrimitiveInstancesPortion:t[11],eachEntityMatricesPortion:t[12]}}function JXt(t){return{positions:new Float32Array(ca.inflate(t.positions).buffer),normals:new Int8Array(ca.inflate(t.normals).buffer),indices:new Uint32Array(ca.inflate(t.indices).buffer),edgeIndices:new Uint32Array(ca.inflate(t.edgeIndices).buffer),matrices:new Float32Array(ca.inflate(t.matrices).buffer),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(ca.inflate(t.eachPrimitivePositionsAndNormalsPortion).buffer),eachPrimitiveIndicesPortion:new Uint32Array(ca.inflate(t.eachPrimitiveIndicesPortion).buffer),eachPrimitiveEdgeIndicesPortion:new Uint32Array(ca.inflate(t.eachPrimitiveEdgeIndicesPortion).buffer),eachPrimitiveColor:new Uint8Array(ca.inflate(t.eachPrimitiveColor).buffer),primitiveInstances:new Uint32Array(ca.inflate(t.primitiveInstances).buffer),eachEntityId:ca.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(ca.inflate(t.eachEntityPrimitiveInstancesPortion).buffer),eachEntityMatricesPortion:new Uint32Array(ca.inflate(t.eachEntityMatricesPortion).buffer)}}const ZXt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function XXt(t,e,i,r,o,n){const s=n.getNextId();r.positionsCompression="disabled",r.normalsCompression="precompressed";const a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.matrices,h=i.eachPrimitivePositionsAndNormalsPortion,p=i.eachPrimitiveIndicesPortion,g=i.eachPrimitiveEdgeIndicesPortion,f=i.eachPrimitiveColor,m=i.primitiveInstances,A=JSON.parse(i.eachEntityId),v=i.eachEntityPrimitiveInstancesPortion,y=i.eachEntityMatricesPortion,b=h.length,w=m.length,C=new Uint8Array(b),M=A.length;for(let S=0;S<w;S++){const I=m[S];C[I]++}const E={};for(let S=0;S<M;S++){const I=M-1,T=S===I,_=v[S],O=T?v[I]:v[S+1];for(let j=_;j<O;j++){const N=m[j];C[N]>1||(E[N]=S)}}for(let S=0;S<b;S++){const I=S===b-1,T=C[S]>1,_=ZXt(f.subarray(S*4,S*4+3)),O=f[S*4+3]/255,j=a.subarray(h[S],I?a.length:h[S+1]),N=l.subarray(h[S],I?l.length:h[S+1]),G=c.subarray(p[S],I?c.length:p[S+1]),q=d.subarray(g[S],I?d.length:g[S+1]);if(T){const X=`${s}-geometry.${S}`;r.createGeometry({id:X,primitive:"triangles",positionsCompressed:j,normalsCompressed:N,indices:G,edgeIndices:q})}else{const X=S,me=E[S];A[me];const ce={};r.createMesh(Tt.apply(ce,{id:X,primitive:"triangles",positionsCompressed:j,normalsCompressed:N,indices:G,edgeIndices:q,color:_,opacity:O}))}}let B=0;for(let S=0;S<M;S++){const I=M-1,T=S===I,_=A[S],O=v[S],j=T?v[I]:v[S+1],N=[];for(let G=O;G<j;G++){const q=m[G];if(C[q]>1){const X={},me="instance."+B++,ce="geometry"+q,xe=y[S]*16,Re=u.subarray(xe,xe+16);r.createMesh(Tt.apply(X,{id:me,geometryId:ce,matrix:Re})),N.push(me)}else N.push(q)}if(N.length>0){const G={};r.createEntity(Tt.apply(G,{id:_,isObject:!0,meshIds:N}))}}}const Que={version:5,parse:function(t,e,i,r,o,n){const s=WXt(i),a=JXt(s);XXt(t,e,a,r,o,n)}};let x7=window.pako||yd;x7.inflate||(x7=x7.default);function YXt(t){return{positions:t[0],normals:t[1],indices:t[2],edgeIndices:t[3],matrices:t[4],reusedPrimitivesDecodeMatrix:t[5],eachPrimitivePositionsAndNormalsPortion:t[6],eachPrimitiveIndicesPortion:t[7],eachPrimitiveEdgeIndicesPortion:t[8],eachPrimitiveColorAndOpacity:t[9],primitiveInstances:t[10],eachEntityId:t[11],eachEntityPrimitiveInstancesPortion:t[12],eachEntityMatricesPortion:t[13],eachTileAABB:t[14],eachTileEntitiesPortion:t[15]}}function $Xt(t){function e(i,r){return i.length===0?[]:x7.inflate(i,r).buffer}return{positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedPrimitivesDecodeMatrix:new Float32Array(e(t.reusedPrimitivesDecodeMatrix)),eachPrimitivePositionsAndNormalsPortion:new Uint32Array(e(t.eachPrimitivePositionsAndNormalsPortion)),eachPrimitiveIndicesPortion:new Uint32Array(e(t.eachPrimitiveIndicesPortion)),eachPrimitiveEdgeIndicesPortion:new Uint32Array(e(t.eachPrimitiveEdgeIndicesPortion)),eachPrimitiveColorAndOpacity:new Uint8Array(e(t.eachPrimitiveColorAndOpacity)),primitiveInstances:new Uint32Array(e(t.primitiveInstances)),eachEntityId:x7.inflate(t.eachEntityId,{to:"string"}),eachEntityPrimitiveInstancesPortion:new Uint32Array(e(t.eachEntityPrimitiveInstancesPortion)),eachEntityMatricesPortion:new Uint32Array(e(t.eachEntityMatricesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const eYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function tYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.positions,l=i.normals,c=i.indices,d=i.edgeIndices,u=i.matrices,h=i.reusedPrimitivesDecodeMatrix,p=i.eachPrimitivePositionsAndNormalsPortion,g=i.eachPrimitiveIndicesPortion,f=i.eachPrimitiveEdgeIndicesPortion,m=i.eachPrimitiveColorAndOpacity,A=i.primitiveInstances,v=JSON.parse(i.eachEntityId),y=i.eachEntityPrimitiveInstancesPortion,b=i.eachEntityMatricesPortion,w=i.eachTileAABB,C=i.eachTileEntitiesPortion,M=p.length,E=A.length,B=v.length,S=C.length,I=new Uint32Array(M);for(let O=0;O<E;O++){const j=A[O];I[j]!==void 0?I[j]++:I[j]=1}const T=k.vec3(),_=k.AABB3();for(let O=0;O<S;O++){const j=S-1,N=O===j,G=C[O],q=N?B:C[O+1],X=O*6,me=w.subarray(X,X+6);k.getAABB3Center(me,T),_[0]=me[0]-T[0],_[1]=me[1]-T[1],_[2]=me[2]-T[2],_[3]=me[3]-T[0],_[4]=me[4]-T[1],_[5]=me[5]-T[2];const ce=xi.createPositionsDecodeMatrix(_),xe={};for(let Re=G;Re<q;Re++){const ge=v[Re],ee=e.globalizeObjectIds?k.globalizeObjectId(r.id,ge):ge,$=b[Re],re=u.slice($,$+16),ie=B-1,fe=Re===ie,de=y[Re],Ae=fe?A.length:y[Re+1],Ue=[],z=t.metaScene.metaObjects[ee],se={},ue={};if(z){if(e.excludeTypesMap&&z.type&&e.excludeTypesMap[z.type]||e.includeTypesMap&&z.type&&!e.includeTypesMap[z.type]||e.includeIdsMap&&z.id&&!e.includeIdsMap[z.id])continue;const be=e.objectDefaults?e.objectDefaults[z.type]||e.objectDefaults.DEFAULT:null;be&&(be.visible===!1&&(se.visible=!1),be.pickable===!1&&(se.pickable=!1),be.colorize&&(ue.color=be.colorize),be.opacity!==void 0&&be.opacity!==null&&(ue.opacity=be.opacity))}else if(e.excludeUnclassifiedObjects)continue;for(let be=de;be<Ae;be++){const he=A[be],Q=I[he]>1,J=he===M-1,te=a.subarray(p[he],J?a.length:p[he+1]),ne=l.subarray(p[he],J?l.length:p[he+1]),ae=c.subarray(g[he],J?c.length:g[he+1]),W=d.subarray(f[he],J?d.length:f[he+1]),K=eYt(m.subarray(he*4,he*4+3)),ve=m[he*4+3]/255,we=n.getNextId();if(Q){const pe=`${s}-geometry.${O}.${he}`;xe[pe]||(r.createGeometry({id:pe,primitive:"triangles",positionsCompressed:te,indices:ae,edgeIndices:W,positionsDecodeMatrix:h}),xe[pe]=!0),r.createMesh(Tt.apply(ue,{id:we,geometryId:pe,origin:T,matrix:re,color:K,opacity:ve})),Ue.push(we)}else r.createMesh(Tt.apply(ue,{id:we,origin:T,primitive:"triangles",positionsCompressed:te,normalsCompressed:ne,indices:ae,edgeIndices:W,positionsDecodeMatrix:ce,color:K,opacity:ve})),Ue.push(we)}Ue.length>0&&r.createEntity(Tt.apply(se,{id:ee,isObject:!0,meshIds:Ue}))}}}const Kue={version:6,parse:function(t,e,i,r,o,n){const s=YXt(i),a=$Xt(s);tYt(t,e,a,r,o,n)}};let k7=window.pako||yd;k7.inflate||(k7=k7.default);function iYt(t){return{positions:t[0],normals:t[1],colors:t[2],indices:t[3],edgeIndices:t[4],matrices:t[5],reusedGeometriesDecodeMatrix:t[6],eachGeometryPrimitiveType:t[7],eachGeometryPositionsPortion:t[8],eachGeometryNormalsPortion:t[9],eachGeometryColorsPortion:t[10],eachGeometryIndicesPortion:t[11],eachGeometryEdgeIndicesPortion:t[12],eachMeshGeometriesPortion:t[13],eachMeshMatricesPortion:t[14],eachMeshMaterial:t[15],eachEntityId:t[16],eachEntityMeshesPortion:t[17],eachTileAABB:t[18],eachTileEntitiesPortion:t[19]}}function rYt(t){function e(i,r){return i.length===0?[]:k7.inflate(i,r).buffer}return{positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityId:k7.inflate(t.eachEntityId,{to:"string"}),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const oYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function Wue(t){const e=[];for(let i=0,r=t.length;i<r;i+=3)e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]),e.push(1);return e}function nYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.positions,l=i.normals,c=i.colors,d=i.indices,u=i.edgeIndices,h=i.matrices,p=i.reusedGeometriesDecodeMatrix,g=i.eachGeometryPrimitiveType,f=i.eachGeometryPositionsPortion,m=i.eachGeometryNormalsPortion,A=i.eachGeometryColorsPortion,v=i.eachGeometryIndicesPortion,y=i.eachGeometryEdgeIndicesPortion,b=i.eachMeshGeometriesPortion,w=i.eachMeshMatricesPortion,C=i.eachMeshMaterial,M=JSON.parse(i.eachEntityId),E=i.eachEntityMeshesPortion,B=i.eachTileAABB,S=i.eachTileEntitiesPortion,I=f.length,T=b.length,_=M.length,O=S.length,j=new Uint32Array(I);for(let q=0;q<T;q++){const X=b[q];j[X]!==void 0?j[X]++:j[X]=1}const N=k.vec3(),G=k.AABB3();for(let q=0;q<O;q++){const X=O-1,me=q===X,ce=S[q],xe=me?_:S[q+1],Re=q*6,ge=B.subarray(Re,Re+6);k.getAABB3Center(ge,N),G[0]=ge[0]-N[0],G[1]=ge[1]-N[1],G[2]=ge[2]-N[2],G[3]=ge[3]-N[0],G[4]=ge[4]-N[1],G[5]=ge[5]-N[2];const ee=xi.createPositionsDecodeMatrix(G),$={};for(let re=ce;re<xe;re++){const ie=M[re],fe=e.globalizeObjectIds?k.globalizeObjectId(r.id,ie):ie,de=_-1,Ae=re===de,Ue=E[re],z=Ae?b.length:E[re+1],se=[],ue=t.metaScene.metaObjects[fe],be={},he={};if(ue){if(e.excludeTypesMap&&ue.type&&e.excludeTypesMap[ue.type]||e.includeTypesMap&&ue.type&&!e.includeTypesMap[ue.type]||e.includeIdsMap&&ue.id&&!e.includeIdsMap[ue.id])continue;const Q=e.objectDefaults?e.objectDefaults[ue.type]||e.objectDefaults.DEFAULT:null;Q&&(Q.visible===!1&&(be.visible=!1),Q.pickable===!1&&(be.pickable=!1),Q.colorize&&(he.color=Q.colorize),Q.opacity!==void 0&&Q.opacity!==null&&(he.opacity=Q.opacity),Q.metallic!==void 0&&Q.metallic!==null&&(he.metallic=Q.metallic),Q.roughness!==void 0&&Q.roughness!==null&&(he.roughness=Q.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Q=Ue;Q<z;Q++){const J=b[Q],te=j[J]>1,ne=J===I-1,ae=oYt(C.subarray(Q*6,Q*6+3)),W=C[Q*6+3]/255,K=C[Q*6+4]/255,ve=C[Q*6+5]/255,we=n.getNextId();if(te){const pe=w[Q],Se=h.slice(pe,pe+16),Ke=`${s}-geometry.${q}.${J}`;if(!$[Ke]){const Pe=g[J];let Ve,Ne,Je,at,Bt,Mt;switch(Pe){case 0:Ve="solid",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Je=l.subarray(m[J],ne?l.length:m[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]),Mt=u.subarray(y[J],ne?u.length:y[J+1]);break;case 1:Ve="surface",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Je=l.subarray(m[J],ne?l.length:m[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]),Mt=u.subarray(y[J],ne?u.length:y[J+1]);break;case 2:Ve="points",Ne=a.subarray(f[J],ne?a.length:f[J+1]),at=Wue(c.subarray(A[J],ne?c.length:A[J+1]));break;case 3:Ve="lines",Ne=a.subarray(f[J],ne?a.length:f[J+1]),Bt=d.subarray(v[J],ne?d.length:v[J+1]);break;default:continue}r.createGeometry({id:Ke,primitive:Ve,positionsCompressed:Ne,normalsCompressed:Je,colors:at,indices:Bt,edgeIndices:Mt,positionsDecodeMatrix:p}),$[Ke]=!0}r.createMesh(Tt.apply(he,{id:we,geometryId:Ke,origin:N,matrix:Se,color:ae,metallic:K,roughness:ve,opacity:W})),se.push(we)}else{const pe=g[J];let Se,Ke,Pe,Ve,Ne,Je;switch(pe){case 0:Se="solid",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Pe=l.subarray(m[J],ne?l.length:m[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]),Je=u.subarray(y[J],ne?u.length:y[J+1]);break;case 1:Se="surface",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Pe=l.subarray(m[J],ne?l.length:m[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]),Je=u.subarray(y[J],ne?u.length:y[J+1]);break;case 2:Se="points",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Ve=Wue(c.subarray(A[J],ne?c.length:A[J+1]));break;case 3:Se="lines",Ke=a.subarray(f[J],ne?a.length:f[J+1]),Ne=d.subarray(v[J],ne?d.length:v[J+1]);break;default:continue}r.createMesh(Tt.apply(he,{id:we,origin:N,primitive:Se,positionsCompressed:Ke,normalsCompressed:Pe,colors:Ve,indices:Ne,edgeIndices:Je,positionsDecodeMatrix:ee,color:ae,metallic:K,roughness:ve,opacity:W})),se.push(we)}}se.length>0&&r.createEntity(Tt.apply(be,{id:fe,isObject:!0,meshIds:se}))}}}const Jue={version:7,parse:function(t,e,i,r,o,n){const s=iYt(i),a=rYt(s);nYt(t,e,a,r,o,n)}};let Lf=window.pako||yd;Lf.inflate||(Lf=Lf.default);const Vh=k.vec4(),Zue=k.vec4();function sYt(t){return{types:t[0],eachMetaObjectId:t[1],eachMetaObjectType:t[2],eachMetaObjectName:t[3],eachMetaObjectParent:t[4],positions:t[5],normals:t[6],colors:t[7],indices:t[8],edgeIndices:t[9],matrices:t[10],reusedGeometriesDecodeMatrix:t[11],eachGeometryPrimitiveType:t[12],eachGeometryPositionsPortion:t[13],eachGeometryNormalsPortion:t[14],eachGeometryColorsPortion:t[15],eachGeometryIndicesPortion:t[16],eachGeometryEdgeIndicesPortion:t[17],eachMeshGeometriesPortion:t[18],eachMeshMatricesPortion:t[19],eachMeshMaterial:t[20],eachEntityMetaObject:t[21],eachEntityMeshesPortion:t[22],eachTileAABB:t[23],eachTileEntitiesPortion:t[24]}}function aYt(t){function e(i,r){return i.length===0?[]:Lf.inflate(i,r).buffer}return{types:Lf.inflate(t.types,{to:"string"}),eachMetaObjectId:Lf.inflate(t.eachMetaObjectId,{to:"string"}),eachMetaObjectType:new Uint32Array(e(t.eachMetaObjectType)),eachMetaObjectName:Lf.inflate(t.eachMetaObjectName,{to:"string"}),eachMetaObjectParent:new Uint32Array(e(t.eachMetaObjectParent)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityMetaObject:new Uint32Array(e(t.eachEntityMetaObject)),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const lYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function Xue(t){const e=[];for(let i=0,r=t.length;i<r;i+=3)e.push(t[i]),e.push(t[i+1]),e.push(t[i+2]),e.push(1);return e}function cYt(t,e,i,r,o,n){const s=n.getNextId(),a=JSON.parse(i.types),l=JSON.parse(i.eachMetaObjectId),c=i.eachMetaObjectType,d=JSON.parse(i.eachMetaObjectName),u=i.eachMetaObjectParent,h=i.positions,p=i.normals,g=i.colors,f=i.indices,m=i.edgeIndices,A=i.matrices,v=i.reusedGeometriesDecodeMatrix,y=i.eachGeometryPrimitiveType,b=i.eachGeometryPositionsPortion,w=i.eachGeometryNormalsPortion,C=i.eachGeometryColorsPortion,M=i.eachGeometryIndicesPortion,E=i.eachGeometryEdgeIndicesPortion,B=i.eachMeshGeometriesPortion,S=i.eachMeshMatricesPortion,I=i.eachMeshMaterial,T=i.eachEntityMetaObject,_=i.eachEntityMeshesPortion,O=i.eachTileAABB,j=i.eachTileEntitiesPortion,N=l.length,G=b.length,q=B.length,X=T.length,me=j.length;if(o){const ee={metaObjects:[]};for(let $=0;$<N;$++){const re=l[$],ie=c[$],fe=a[ie]||"default",de=d[$],Ae=u[$],Ue=Ae!==$?l[Ae]:null;ee.metaObjects.push({id:re,type:fe,name:de,parent:Ue})}o.loadData(ee,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds})}const ce=new Uint32Array(G);for(let ee=0;ee<q;ee++){const $=B[ee];ce[$]!==void 0?ce[$]++:ce[$]=1}const xe=k.vec3(),Re=k.AABB3(),ge={};for(let ee=0;ee<me;ee++){const $=me-1,re=ee===$,ie=j[ee],fe=re?X:j[ee+1],de=ee*6,Ae=O.subarray(de,de+6);k.getAABB3Center(Ae,xe),Re[0]=Ae[0]-xe[0],Re[1]=Ae[1]-xe[1],Re[2]=Ae[2]-xe[2],Re[3]=Ae[3]-xe[0],Re[4]=Ae[4]-xe[1],Re[5]=Ae[5]-xe[2];const Ue=xi.createPositionsDecodeMatrix(Re),z={};for(let se=ie;se<fe;se++){const ue=T[se],be=l[ue],he=e.globalizeObjectIds?k.globalizeObjectId(r.id,be):be,Q=X-1,J=se===Q,te=_[se],ne=J?B.length:_[se+1],ae=[],W=t.metaScene.metaObjects[he],K={},ve={};if(W){if(e.excludeTypesMap&&W.type&&e.excludeTypesMap[W.type]||e.includeTypesMap&&W.type&&!e.includeTypesMap[W.type]||e.includeIdsMap&&W.id&&!e.includeIdsMap[W.id])continue;const we=e.objectDefaults?e.objectDefaults[W.type]||e.objectDefaults.DEFAULT:null;we&&(we.visible===!1&&(K.visible=!1),we.pickable===!1&&(K.pickable=!1),we.colorize&&(ve.color=we.colorize),we.opacity!==void 0&&we.opacity!==null&&(ve.opacity=we.opacity),we.metallic!==void 0&&we.metallic!==null&&(ve.metallic=we.metallic),we.roughness!==void 0&&we.roughness!==null&&(ve.roughness=we.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let we=te;we<ne;we++){const pe=B[we],Se=ce[pe]>1,Ke=pe===G-1,Pe=lYt(I.subarray(we*6,we*6+3)),Ve=I[we*6+3]/255,Ne=I[we*6+4]/255,Je=I[we*6+5]/255,at=n.getNextId();if(Se){const Bt=S[we],Mt=A.slice(Bt,Bt+16),yt=`${s}-geometry.${ee}.${pe}`;let xt=ge[yt];if(!xt){xt={batchThisMesh:!e.reuseGeometries};const ze=y[pe];let At=!1;switch(ze){case 0:xt.primitiveName="solid",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryNormals=p.subarray(w[pe],Ke?p.length:w[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),xt.geometryEdgeIndices=m.subarray(E[pe],Ke?m.length:E[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;case 1:xt.primitiveName="surface",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryNormals=p.subarray(w[pe],Ke?p.length:w[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),xt.geometryEdgeIndices=m.subarray(E[pe],Ke?m.length:E[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;case 2:xt.primitiveName="points",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryColors=Xue(g.subarray(C[pe],Ke?g.length:C[pe+1])),At=xt.geometryPositions.length>0;break;case 3:xt.primitiveName="lines",xt.geometryPositions=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt.geometryIndices=f.subarray(M[pe],Ke?f.length:M[pe+1]),At=xt.geometryPositions.length>0&&xt.geometryIndices.length>0;break;default:continue}if(At||(xt=null),xt&&(xt.geometryPositions.length>1e3,xt.batchThisMesh)){xt.decompressedPositions=new Float32Array(xt.geometryPositions.length);const Ct=xt.geometryPositions,st=xt.decompressedPositions;for(let Ie=0,le=Ct.length;Ie<le;Ie+=3)st[Ie+0]=Ct[Ie+0]*v[0]+v[12],st[Ie+1]=Ct[Ie+1]*v[5]+v[13],st[Ie+2]=Ct[Ie+2]*v[10]+v[14];xt.geometryPositions=null,ge[yt]=xt}}if(xt)if(xt.batchThisMesh){const ze=xt.decompressedPositions,At=new Uint16Array(ze.length);for(let Ct=0,st=ze.length;Ct<st;Ct+=3)Vh[0]=ze[Ct+0],Vh[1]=ze[Ct+1],Vh[2]=ze[Ct+2],Vh[3]=1,k.transformVec4(Mt,Vh,Zue),xi.compressPosition(Zue,Re,Vh),At[Ct+0]=Vh[0],At[Ct+1]=Vh[1],At[Ct+2]=Vh[2];r.createMesh(Tt.apply(ve,{id:at,origin:xe,primitive:xt.primitiveName,positionsCompressed:At,normalsCompressed:xt.geometryNormals,colorsCompressed:xt.geometryColors,indices:xt.geometryIndices,edgeIndices:xt.geometryEdgeIndices,positionsDecodeMatrix:Ue,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at)}else z[yt]||(r.createGeometry({id:yt,primitive:xt.primitiveName,positionsCompressed:xt.geometryPositions,normalsCompressed:xt.geometryNormals,colorsCompressed:xt.geometryColors,indices:xt.geometryIndices,edgeIndices:xt.geometryEdgeIndices,positionsDecodeMatrix:v}),z[yt]=!0),r.createMesh(Tt.apply(ve,{id:at,geometryId:yt,origin:xe,matrix:Mt,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at)}else{const Bt=y[pe];let Mt,yt,xt,ze,At,Ct,st=!1;switch(Bt){case 0:Mt="solid",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt=p.subarray(w[pe],Ke?p.length:w[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),Ct=m.subarray(E[pe],Ke?m.length:E[pe+1]),st=yt.length>0&&At.length>0;break;case 1:Mt="surface",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),xt=p.subarray(w[pe],Ke?p.length:w[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),Ct=m.subarray(E[pe],Ke?m.length:E[pe+1]),st=yt.length>0&&At.length>0;break;case 2:Mt="points",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),ze=Xue(g.subarray(C[pe],Ke?g.length:C[pe+1])),st=yt.length>0;break;case 3:Mt="lines",yt=h.subarray(b[pe],Ke?h.length:b[pe+1]),At=f.subarray(M[pe],Ke?f.length:M[pe+1]),st=yt.length>0&&At.length>0;break;default:continue}st&&(r.createMesh(Tt.apply(ve,{id:at,origin:xe,primitive:Mt,positionsCompressed:yt,normalsCompressed:xt,colorsCompressed:ze,indices:At,edgeIndices:Ct,positionsDecodeMatrix:Ue,color:Pe,metallic:Ne,roughness:Je,opacity:Ve})),ae.push(at))}}ae.length>0&&r.createEntity(Tt.apply(K,{id:he,isObject:!0,meshIds:ae}))}}}const Yue={version:8,parse:function(t,e,i,r,o,n){const s=sYt(i),a=aYt(s);cYt(t,e,a,r,o,n)}};let OA=window.pako||yd;OA.inflate||(OA=OA.default);const qh=k.vec4(),$ue=k.vec4();function dYt(t){return{metadata:t[0],positions:t[1],normals:t[2],colors:t[3],indices:t[4],edgeIndices:t[5],matrices:t[6],reusedGeometriesDecodeMatrix:t[7],eachGeometryPrimitiveType:t[8],eachGeometryPositionsPortion:t[9],eachGeometryNormalsPortion:t[10],eachGeometryColorsPortion:t[11],eachGeometryIndicesPortion:t[12],eachGeometryEdgeIndicesPortion:t[13],eachMeshGeometriesPortion:t[14],eachMeshMatricesPortion:t[15],eachMeshMaterial:t[16],eachEntityId:t[17],eachEntityMeshesPortion:t[18],eachTileAABB:t[19],eachTileEntitiesPortion:t[20]}}function uYt(t){function e(i,r){return i.length===0?[]:OA.inflate(i,r).buffer}return{metadata:JSON.parse(OA.inflate(t.metadata,{to:"string"})),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshMaterial:new Uint8Array(e(t.eachMeshMaterial)),eachEntityId:JSON.parse(OA.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const hYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();function pYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.positions,c=i.normals,d=i.colors,u=i.indices,h=i.edgeIndices,p=i.matrices,g=i.reusedGeometriesDecodeMatrix,f=i.eachGeometryPrimitiveType,m=i.eachGeometryPositionsPortion,A=i.eachGeometryNormalsPortion,v=i.eachGeometryColorsPortion,y=i.eachGeometryIndicesPortion,b=i.eachGeometryEdgeIndicesPortion,w=i.eachMeshGeometriesPortion,C=i.eachMeshMatricesPortion,M=i.eachMeshMaterial,E=i.eachEntityId,B=i.eachEntityMeshesPortion,S=i.eachTileAABB,I=i.eachTileEntitiesPortion,T=m.length,_=w.length,O=B.length,j=I.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});const N=new Uint32Array(T);for(let me=0;me<_;me++){const ce=w[me];N[ce]!==void 0?N[ce]++:N[ce]=1}const G=k.vec3(),q=k.AABB3(),X={};for(let me=0;me<j;me++){const ce=j-1,xe=me===ce,Re=I[me],ge=xe?O-1:I[me+1]-1,ee=me*6,$=S.subarray(ee,ee+6);k.getAABB3Center($,G),q[0]=$[0]-G[0],q[1]=$[1]-G[1],q[2]=$[2]-G[2],q[3]=$[3]-G[0],q[4]=$[4]-G[1],q[5]=$[5]-G[2];const re=xi.createPositionsDecodeMatrix(q),ie={};for(let fe=Re;fe<=ge;fe++){const de=E[fe],Ae=e.globalizeObjectIds?k.globalizeObjectId(r.id,de):de,Ue=O-1,z=fe===Ue,se=B[fe],ue=z?w.length-1:B[fe+1]-1,be=[],he=t.metaScene.metaObjects[Ae],Q={},J={};if(!(e.includeIdsMap&&de&&!e.includeIdsMap[de])){if(he){if(e.excludeTypesMap&&he.type&&e.excludeTypesMap[he.type]||e.includeTypesMap&&he.type&&!e.includeTypesMap[he.type]||e.includeIdsMap&&he.id&&!e.includeIdsMap[he.id])continue;const te=e.objectDefaults?e.objectDefaults[he.type]||e.objectDefaults.DEFAULT:null;te&&(te.visible===!1&&(Q.visible=!1),te.pickable===!1&&(Q.pickable=!1),te.colorize&&(J.color=te.colorize),te.opacity!==void 0&&te.opacity!==null&&(J.opacity=te.opacity),te.metallic!==void 0&&te.metallic!==null&&(J.metallic=te.metallic),te.roughness!==void 0&&te.roughness!==null&&(J.roughness=te.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let te=se;te<=ue;te++){const ne=w[te],ae=N[ne]>1,W=ne===T-1,K=hYt(M.subarray(te*6,te*6+3)),ve=M[te*6+3]/255,we=M[te*6+4]/255,pe=M[te*6+5]/255,Se=n.getNextId();if(ae){const Ke=C[te],Pe=p.slice(Ke,Ke+16),Ve=`${s}-geometry.${me}.${ne}`;let Ne=X[Ve];if(!Ne){Ne={batchThisMesh:!e.reuseGeometries};const Je=f[ne];let at=!1;switch(Je){case 0:Ne.primitiveName="solid",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryNormals=c.subarray(A[ne],W?c.length:A[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),Ne.geometryEdgeIndices=h.subarray(b[ne],W?h.length:b[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;case 1:Ne.primitiveName="surface",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryNormals=c.subarray(A[ne],W?c.length:A[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),Ne.geometryEdgeIndices=h.subarray(b[ne],W?h.length:b[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;case 2:Ne.primitiveName="points",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryColors=d.subarray(v[ne],W?d.length:v[ne+1]),at=Ne.geometryPositions.length>0;break;case 3:Ne.primitiveName="lines",Ne.geometryPositions=l.subarray(m[ne],W?l.length:m[ne+1]),Ne.geometryIndices=u.subarray(y[ne],W?u.length:y[ne+1]),at=Ne.geometryPositions.length>0&&Ne.geometryIndices.length>0;break;default:continue}if(at||(Ne=null),Ne&&(Ne.geometryPositions.length>1e3,Ne.batchThisMesh)){Ne.decompressedPositions=new Float32Array(Ne.geometryPositions.length),Ne.transformedAndRecompressedPositions=new Uint16Array(Ne.geometryPositions.length);const Bt=Ne.geometryPositions,Mt=Ne.decompressedPositions;for(let yt=0,xt=Bt.length;yt<xt;yt+=3)Mt[yt+0]=Bt[yt+0]*g[0]+g[12],Mt[yt+1]=Bt[yt+1]*g[5]+g[13],Mt[yt+2]=Bt[yt+2]*g[10]+g[14];Ne.geometryPositions=null,X[Ve]=Ne}}if(Ne)if(Ne.batchThisMesh){const Je=Ne.decompressedPositions,at=Ne.transformedAndRecompressedPositions;for(let Bt=0,Mt=Je.length;Bt<Mt;Bt+=3)qh[0]=Je[Bt+0],qh[1]=Je[Bt+1],qh[2]=Je[Bt+2],qh[3]=1,k.transformVec4(Pe,qh,$ue),xi.compressPosition($ue,q,qh),at[Bt+0]=qh[0],at[Bt+1]=qh[1],at[Bt+2]=qh[2];r.createMesh(Tt.apply(J,{id:Se,origin:G,primitive:Ne.primitiveName,positionsCompressed:at,normalsCompressed:Ne.geometryNormals,colorsCompressed:Ne.geometryColors,indices:Ne.geometryIndices,edgeIndices:Ne.geometryEdgeIndices,positionsDecodeMatrix:re,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se)}else ie[Ve]||(r.createGeometry({id:Ve,primitive:Ne.primitiveName,positionsCompressed:Ne.geometryPositions,normalsCompressed:Ne.geometryNormals,colorsCompressed:Ne.geometryColors,indices:Ne.geometryIndices,edgeIndices:Ne.geometryEdgeIndices,positionsDecodeMatrix:g}),ie[Ve]=!0),r.createMesh(Tt.apply(J,{id:Se,geometryId:Ve,origin:G,matrix:Pe,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se)}else{const Ke=f[ne];let Pe,Ve,Ne,Je,at,Bt,Mt=!1;switch(Ke){case 0:Pe="solid",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Ne=c.subarray(A[ne],W?c.length:A[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Bt=h.subarray(b[ne],W?h.length:b[ne+1]),Mt=Ve.length>0&&at.length>0;break;case 1:Pe="surface",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Ne=c.subarray(A[ne],W?c.length:A[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Bt=h.subarray(b[ne],W?h.length:b[ne+1]),Mt=Ve.length>0&&at.length>0;break;case 2:Pe="points",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),Je=d.subarray(v[ne],W?d.length:v[ne+1]),Mt=Ve.length>0;break;case 3:Pe="lines",Ve=l.subarray(m[ne],W?l.length:m[ne+1]),at=u.subarray(y[ne],W?u.length:y[ne+1]),Mt=Ve.length>0&&at.length>0;break;default:continue}Mt&&(r.createMesh(Tt.apply(J,{id:Se,origin:G,primitive:Pe,positionsCompressed:Ve,normalsCompressed:Ne,colorsCompressed:Je,indices:at,edgeIndices:Bt,positionsDecodeMatrix:re,color:K,metallic:we,roughness:pe,opacity:ve})),be.push(Se))}}be.length>0&&r.createEntity(Tt.apply(Q,{id:Ae,isObject:!0,meshIds:be}))}}}}const ehe={version:9,parse:function(t,e,i,r,o,n){const s=dYt(i),a=uYt(s);pYt(t,e,a,r,o,n)}};let UA=window.pako||yd;UA.inflate||(UA=UA.default);const Gh=k.vec4(),the=k.vec4(),fYt=9;function gYt(t){let e=0;return{metadata:t[e++],textureData:t[e++],eachTextureDataPortion:t[e++],eachTextureAttributes:t[e++],positions:t[e++],normals:t[e++],colors:t[e++],uvs:t[e++],indices:t[e++],edgeIndices:t[e++],eachTextureSetTextures:t[e++],matrices:t[e++],reusedGeometriesDecodeMatrix:t[e++],eachGeometryPrimitiveType:t[e++],eachGeometryPositionsPortion:t[e++],eachGeometryNormalsPortion:t[e++],eachGeometryColorsPortion:t[e++],eachGeometryUVsPortion:t[e++],eachGeometryIndicesPortion:t[e++],eachGeometryEdgeIndicesPortion:t[e++],eachMeshGeometriesPortion:t[e++],eachMeshMatricesPortion:t[e++],eachMeshTextureSet:t[e++],eachMeshMaterialAttributes:t[e++],eachEntityId:t[e++],eachEntityMeshesPortion:t[e++],eachTileAABB:t[e++],eachTileEntitiesPortion:t[e++]}}function AYt(t){function e(i,r){return i.length===0?[]:UA.inflate(i,r).buffer}return{metadata:JSON.parse(UA.inflate(t.metadata,{to:"string"})),textureData:new Uint8Array(e(t.textureData)),eachTextureDataPortion:new Uint32Array(e(t.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(e(t.eachTextureAttributes)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),uvs:new Float32Array(e(t.uvs)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),eachTextureSetTextures:new Int32Array(e(t.eachTextureSetTextures)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(e(t.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(e(t.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(e(t.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(UA.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const mYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function vYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryPositionsPortion,C=i.eachGeometryNormalsPortion,M=i.eachGeometryColorsPortion,E=i.eachGeometryUVsPortion,B=i.eachGeometryIndicesPortion,S=i.eachGeometryEdgeIndicesPortion,I=i.eachMeshGeometriesPortion,T=i.eachMeshMatricesPortion,_=i.eachMeshTextureSet,O=i.eachMeshMaterialAttributes,j=i.eachEntityId,N=i.eachEntityMeshesPortion,G=i.eachTileAABB,q=i.eachTileEntitiesPortion,X=c.length,me=A.length/5,ce=w.length,xe=I.length,Re=N.length,ge=q.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let fe=0;fe<X;fe++){const de=fe===X-1,Ae=c[fe],Ue=de?l.length:c[fe+1],z=Ue-Ae>0,se=fe*fYt,ue=d[se+0]===1,be=d[se+1];d[se+2],d[se+3];const he=d[se+4],Q=d[se+5],J=d[se+6],te=d[se+7],ne=d[se+8];if(z){const ae=new Uint8Array(l.subarray(Ae,Ue)).buffer,W=`${s}-texture-${fe}`;if(ue)r.createTexture({id:W,buffers:[ae],minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne});else{const K=be===xM?"image/jpeg":be===kM?"image/png":"image/gif",ve=new Blob([ae],{type:K}),we=(window.URL||window.webkitURL).createObjectURL(ve),pe=document.createElement("img");pe.src=we,r.createTexture({id:W,image:pe,minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne})}}}for(let fe=0;fe<me;fe++){const de=fe*5,Ae=`${s}-textureSet-${fe}`,Ue=A[de+0],z=A[de+1],se=A[de+2],ue=A[de+3],be=A[de+4];r.createTextureSet({id:Ae,colorTextureId:Ue>=0?`${s}-texture-${Ue}`:null,normalsTextureId:se>=0?`${s}-texture-${se}`:null,metallicRoughnessTextureId:z>=0?`${s}-texture-${z}`:null,emissiveTextureId:ue>=0?`${s}-texture-${ue}`:null,occlusionTextureId:be>=0?`${s}-texture-${be}`:null})}const ee=new Uint32Array(ce);for(let fe=0;fe<xe;fe++){const de=I[fe];ee[de]!==void 0?ee[de]++:ee[de]=1}const $=k.vec3(),re=k.AABB3(),ie={};for(let fe=0;fe<ge;fe++){const de=ge-1,Ae=fe===de,Ue=q[fe],z=Ae?Re-1:q[fe+1]-1,se=fe*6,ue=G.subarray(se,se+6);k.getAABB3Center(ue,$),re[0]=ue[0]-$[0],re[1]=ue[1]-$[1],re[2]=ue[2]-$[2],re[3]=ue[3]-$[0],re[4]=ue[4]-$[1],re[5]=ue[5]-$[2];const be=xi.createPositionsDecodeMatrix(re),he={};for(let Q=Ue;Q<=z;Q++){const J=j[Q],te=e.globalizeObjectIds?k.globalizeObjectId(r.id,J):J,ne=Re-1,ae=Q===ne,W=N[Q],K=ae?I.length-1:N[Q+1]-1,ve=[],we=t.metaScene.metaObjects[te],pe={},Se={};if(!(e.includeIdsMap&&J&&!e.includeIdsMap[J])){if(we){if(e.excludeTypesMap&&we.type&&e.excludeTypesMap[we.type]||e.includeTypesMap&&we.type&&!e.includeTypesMap[we.type]||e.includeIdsMap&&we.id&&!e.includeIdsMap[we.id])continue;const Ke=e.objectDefaults?e.objectDefaults[we.type]||e.objectDefaults.DEFAULT:null;Ke&&(Ke.visible===!1&&(pe.visible=!1),Ke.pickable===!1&&(pe.pickable=!1),Ke.colorize&&(Se.color=Ke.colorize),Ke.opacity!==void 0&&Ke.opacity!==null&&(Se.opacity=Ke.opacity),Ke.metallic!==void 0&&Ke.metallic!==null&&(Se.metallic=Ke.metallic),Ke.roughness!==void 0&&Ke.roughness!==null&&(Se.roughness=Ke.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Ke=W;Ke<=K;Ke++){const Pe=I[Ke],Ve=ee[Pe]>1,Ne=Pe===ce-1,Je=_[Ke],at=Je>=0?`${s}-textureSet-${Je}`:null,Bt=mYt(O.subarray(Ke*6,Ke*6+3)),Mt=O[Ke*6+3]/255,yt=O[Ke*6+4]/255,xt=O[Ke*6+5]/255,ze=n.getNextId();if(Ve){const At=T[Ke],Ct=v.slice(At,At+16),st=`${s}-geometry.${fe}.${Pe}`;let Ie=ie[st];if(!Ie){Ie={batchThisMesh:!e.reuseGeometries};const le=b[Pe];let Fe=!1;switch(le){case 0:Ie.primitiveName="solid",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 1:Ie.primitiveName="surface",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 2:Ie.primitiveName="points",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryColors=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),Fe=Ie.geometryPositions.length>0;break;case 3:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 4:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=ihe(Ie.geometryPositions,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;default:continue}if(Fe||(Ie=null),Ie&&(Ie.geometryPositions.length>1e3,Ie.batchThisMesh)){Ie.decompressedPositions=new Float32Array(Ie.geometryPositions.length),Ie.transformedAndRecompressedPositions=new Uint16Array(Ie.geometryPositions.length);const Qe=Ie.geometryPositions,Pt=Ie.decompressedPositions;for(let bt=0,ei=Qe.length;bt<ei;bt+=3)Pt[bt+0]=Qe[bt+0]*y[0]+y[12],Pt[bt+1]=Qe[bt+1]*y[5]+y[13],Pt[bt+2]=Qe[bt+2]*y[10]+y[14];Ie.geometryPositions=null,ie[st]=Ie}}if(Ie)if(Ie.batchThisMesh){const le=Ie.decompressedPositions,Fe=Ie.transformedAndRecompressedPositions;for(let Qe=0,Pt=le.length;Qe<Pt;Qe+=3)Gh[0]=le[Qe+0],Gh[1]=le[Qe+1],Gh[2]=le[Qe+2],Gh[3]=1,k.transformVec4(Ct,Gh,the),xi.compressPosition(the,re,Gh),Fe[Qe+0]=Gh[0],Fe[Qe+1]=Gh[1],Fe[Qe+2]=Gh[2];r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ie.primitiveName,positionsCompressed:Fe,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze)}else he[st]||(r.createGeometry({id:st,primitive:Ie.primitiveName,positionsCompressed:Ie.geometryPositions,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:y}),he[st]=!0),r.createMesh(Tt.apply(Se,{id:ze,geometryId:st,textureSetId:at,matrix:Ct,color:Bt,metallic:yt,roughness:xt,opacity:Mt,origin:$})),ve.push(ze)}else{const At=b[Pe];let Ct,st,Ie,le,Fe,Qe,Pt,bt=!1;switch(At){case 0:Ct="solid",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 1:Ct="surface",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 2:Ct="points",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Fe=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),bt=st.length>0;break;case 3:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 4:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=ihe(st,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),bt=st.length>0&&Qe.length>0;break;default:continue}bt&&(r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ct,positionsCompressed:st,normalsCompressed:Ie,uv:le&&le.length>0?le:null,colorsCompressed:Fe,indices:Qe,edgeIndices:Pt,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze))}}ve.length>0&&r.createEntity(Tt.apply(pe,{id:te,isObject:!0,meshIds:ve}))}}}}function ihe(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const rhe={version:10,parse:function(t,e,i,r,o,n){const s=gYt(i),a=AYt(s);vYt(t,e,a,r,o,n)}},Qh=k.vec4(),ohe=k.vec4(),yYt=9;function bYt(t){const e=(function(){const o=new ArrayBuffer(2);return new Uint16Array(o)[0]=1,new Uint8Array(o)[0]!==1})(),i=(function(){let o=0;const n=new DataView(t);return function(s){const a=1+2*o++,l=n.getUint32(a*4,!0),c=n.getUint32((a+1)*4,!0),d=s.BYTES_PER_ELEMENT;if(e&&d>1){const u=new Uint8Array(t,l,c),h=d/2,p=u.length/d;for(let g=0;g<p;g++){const f=g*d;for(let m=0;m<h;m++){const A=f+m,v=f-m+d-1,y=u[A];u[A]=u[v],u[v]=y}}}return new s(t,l,c/d)}})(),r=(function(){const o=new TextDecoder;return()=>JSON.parse(o.decode(i(Uint8Array)))})();return{metadata:r(),textureData:i(Uint8Array),eachTextureDataPortion:i(Uint32Array),eachTextureAttributes:i(Uint16Array),positions:i(Uint16Array),normals:i(Int8Array),colors:i(Uint8Array),uvs:i(Float32Array),indices:i(Uint32Array),edgeIndices:i(Uint32Array),eachTextureSetTextures:i(Int32Array),matrices:i(Float32Array),reusedGeometriesDecodeMatrix:i(Float32Array),eachGeometryPrimitiveType:i(Uint8Array),eachGeometryPositionsPortion:i(Uint32Array),eachGeometryNormalsPortion:i(Uint32Array),eachGeometryColorsPortion:i(Uint32Array),eachGeometryUVsPortion:i(Uint32Array),eachGeometryIndicesPortion:i(Uint32Array),eachGeometryEdgeIndicesPortion:i(Uint32Array),eachMeshGeometriesPortion:i(Uint32Array),eachMeshMatricesPortion:i(Uint32Array),eachMeshTextureSet:i(Int32Array),eachMeshMaterialAttributes:i(Uint8Array),eachEntityId:r(),eachEntityMeshesPortion:i(Uint32Array),eachTileAABB:i(Float64Array),eachTileEntitiesPortion:i(Uint32Array)}}const wYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function CYt(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryPositionsPortion,C=i.eachGeometryNormalsPortion,M=i.eachGeometryColorsPortion,E=i.eachGeometryUVsPortion,B=i.eachGeometryIndicesPortion,S=i.eachGeometryEdgeIndicesPortion,I=i.eachMeshGeometriesPortion,T=i.eachMeshMatricesPortion,_=i.eachMeshTextureSet,O=i.eachMeshMaterialAttributes,j=i.eachEntityId,N=i.eachEntityMeshesPortion,G=i.eachTileAABB,q=i.eachTileEntitiesPortion,X=c.length,me=A.length/5,ce=w.length,xe=I.length,Re=N.length,ge=q.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let fe=0;fe<X;fe++){const de=fe===X-1,Ae=c[fe],Ue=de?l.length:c[fe+1],z=Ue-Ae>0,se=fe*yYt,ue=d[se+0]===1,be=d[se+1];d[se+2],d[se+3];const he=d[se+4],Q=d[se+5],J=d[se+6],te=d[se+7],ne=d[se+8];if(z){const ae=new Uint8Array(l.subarray(Ae,Ue)).buffer,W=`${s}-texture-${fe}`;if(ue)r.createTexture({id:W,buffers:[ae],minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne});else{const K=be===xM?"image/jpeg":be===kM?"image/png":"image/gif",ve=new Blob([ae],{type:K}),we=(window.URL||window.webkitURL).createObjectURL(ve),pe=document.createElement("img");pe.src=we,r.createTexture({id:W,image:pe,minFilter:he,magFilter:Q,wrapS:J,wrapT:te,wrapR:ne})}}}for(let fe=0;fe<me;fe++){const de=fe*5,Ae=`${s}-textureSet-${fe}`,Ue=A[de+0],z=A[de+1],se=A[de+2],ue=A[de+3],be=A[de+4];r.createTextureSet({id:Ae,colorTextureId:Ue>=0?`${s}-texture-${Ue}`:null,normalsTextureId:se>=0?`${s}-texture-${se}`:null,metallicRoughnessTextureId:z>=0?`${s}-texture-${z}`:null,emissiveTextureId:ue>=0?`${s}-texture-${ue}`:null,occlusionTextureId:be>=0?`${s}-texture-${be}`:null})}const ee=new Uint32Array(ce);for(let fe=0;fe<xe;fe++){const de=I[fe];ee[de]!==void 0?ee[de]++:ee[de]=1}const $=k.vec3(),re=k.AABB3(),ie={};for(let fe=0;fe<ge;fe++){const de=ge-1,Ae=fe===de,Ue=q[fe],z=Ae?Re-1:q[fe+1]-1,se=fe*6,ue=G.subarray(se,se+6);k.getAABB3Center(ue,$),re[0]=ue[0]-$[0],re[1]=ue[1]-$[1],re[2]=ue[2]-$[2],re[3]=ue[3]-$[0],re[4]=ue[4]-$[1],re[5]=ue[5]-$[2];const be=xi.createPositionsDecodeMatrix(re),he={};for(let Q=Ue;Q<=z;Q++){const J=j[Q],te=e.globalizeObjectIds?k.globalizeObjectId(r.id,J):J,ne=Re-1,ae=Q===ne,W=N[Q],K=ae?I.length-1:N[Q+1]-1,ve=[],we=t.metaScene.metaObjects[te],pe={},Se={};if(!(e.includeIdsMap&&J&&!e.includeIdsMap[J])){if(we){if(e.excludeTypesMap&&we.type&&e.excludeTypesMap[we.type]||e.includeTypesMap&&we.type&&!e.includeTypesMap[we.type]||e.includeIdsMap&&we.id&&!e.includeIdsMap[we.id])continue;const Ke=e.objectDefaults?e.objectDefaults[we.type]||e.objectDefaults.DEFAULT:null;Ke&&(Ke.visible===!1&&(pe.visible=!1),Ke.pickable===!1&&(pe.pickable=!1),Ke.colorize&&(Se.color=Ke.colorize),Ke.opacity!==void 0&&Ke.opacity!==null&&(Se.opacity=Ke.opacity),Ke.metallic!==void 0&&Ke.metallic!==null&&(Se.metallic=Ke.metallic),Ke.roughness!==void 0&&Ke.roughness!==null&&(Se.roughness=Ke.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Ke=W;Ke<=K;Ke++){const Pe=I[Ke],Ve=ee[Pe]>1,Ne=Pe===ce-1,Je=_[Ke],at=Je>=0?`${s}-textureSet-${Je}`:null,Bt=wYt(O.subarray(Ke*6,Ke*6+3)),Mt=O[Ke*6+3]/255,yt=O[Ke*6+4]/255,xt=O[Ke*6+5]/255,ze=n.getNextId();if(Ve){const At=T[Ke],Ct=v.slice(At,At+16),st=`${s}-geometry.${fe}.${Pe}`;let Ie=ie[st];if(!Ie){Ie={batchThisMesh:!e.reuseGeometries};const le=b[Pe];let Fe=!1;switch(le){case 0:Ie.primitiveName="solid",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 1:Ie.primitiveName="surface",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryNormals=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),Ie.geometryUVs=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Ie.geometryEdgeIndices=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 2:Ie.primitiveName="points",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryColors=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),Fe=Ie.geometryPositions.length>0;break;case 3:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;case 4:Ie.primitiveName="lines",Ie.geometryPositions=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie.geometryIndices=nhe(Ie.geometryPositions,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),Fe=Ie.geometryPositions.length>0&&Ie.geometryIndices.length>0;break;default:continue}if(Fe||(Ie=null),Ie&&(Ie.geometryPositions.length>1e3,Ie.batchThisMesh)){Ie.decompressedPositions=new Float32Array(Ie.geometryPositions.length),Ie.transformedAndRecompressedPositions=new Uint16Array(Ie.geometryPositions.length);const Qe=Ie.geometryPositions,Pt=Ie.decompressedPositions;for(let bt=0,ei=Qe.length;bt<ei;bt+=3)Pt[bt+0]=Qe[bt+0]*y[0]+y[12],Pt[bt+1]=Qe[bt+1]*y[5]+y[13],Pt[bt+2]=Qe[bt+2]*y[10]+y[14];Ie.geometryPositions=null,ie[st]=Ie}}if(Ie)if(Ie.batchThisMesh){const le=Ie.decompressedPositions,Fe=Ie.transformedAndRecompressedPositions;for(let Qe=0,Pt=le.length;Qe<Pt;Qe+=3)Qh[0]=le[Qe+0],Qh[1]=le[Qe+1],Qh[2]=le[Qe+2],Qh[3]=1,k.transformVec4(Ct,Qh,ohe),xi.compressPosition(ohe,re,Qh),Fe[Qe+0]=Qh[0],Fe[Qe+1]=Qh[1],Fe[Qe+2]=Qh[2];r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ie.primitiveName,positionsCompressed:Fe,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze)}else he[st]||(r.createGeometry({id:st,primitive:Ie.primitiveName,positionsCompressed:Ie.geometryPositions,normalsCompressed:Ie.geometryNormals,uv:Ie.geometryUVs,colorsCompressed:Ie.geometryColors,indices:Ie.geometryIndices,edgeIndices:Ie.geometryEdgeIndices,positionsDecodeMatrix:y}),he[st]=!0),r.createMesh(Tt.apply(Se,{id:ze,geometryId:st,textureSetId:at,matrix:Ct,color:Bt,metallic:yt,roughness:xt,opacity:Mt,origin:$})),ve.push(ze)}else{const At=b[Pe];let Ct,st,Ie,le,Fe,Qe,Pt,bt=!1;switch(At){case 0:Ct="solid",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 1:Ct="surface",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Ie=h.subarray(C[Pe],Ne?h.length:C[Pe+1]),le=g.subarray(E[Pe],Ne?g.length:E[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),Pt=m.subarray(S[Pe],Ne?m.length:S[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 2:Ct="points",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Fe=p.subarray(M[Pe],Ne?p.length:M[Pe+1]),bt=st.length>0;break;case 3:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=f.subarray(B[Pe],Ne?f.length:B[Pe+1]),bt=st.length>0&&Qe.length>0;break;case 4:Ct="lines",st=u.subarray(w[Pe],Ne?u.length:w[Pe+1]),Qe=nhe(st,f.subarray(B[Pe],Ne?f.length:B[Pe+1])),bt=st.length>0&&Qe.length>0;break;default:continue}bt&&(r.createMesh(Tt.apply(Se,{id:ze,textureSetId:at,origin:$,primitive:Ct,positionsCompressed:st,normalsCompressed:Ie,uv:le&&le.length>0?le:null,colorsCompressed:Fe,indices:Qe,edgeIndices:Pt,positionsDecodeMatrix:be,color:Bt,metallic:yt,roughness:xt,opacity:Mt})),ve.push(ze))}}ve.length>0&&r.createEntity(Tt.apply(pe,{id:te,isObject:!0,meshIds:ve}))}}}}function nhe(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const she={version:11,parseArrayBuffer:function(t,e,i,r,o,n){const s=bYt(i);CYt(t,e,s,r,o,n)}};let Ff=window.pako||yd;Ff.inflate||(Ff=Ff.default);const Kh=k.vec4(),ahe=k.vec4(),xYt=9;function kYt(t){const e=(function(){const o=new ArrayBuffer(2);return new Uint16Array(o)[0]=1,new Uint8Array(o)[0]!==1})(),i=(function(){let o=0;const n=new DataView(t);return function(s){const a=1+2*o++,l=n.getUint32(a*4,!0),c=n.getUint32((a+1)*4,!0),d=s.BYTES_PER_ELEMENT;if(e&&d>1){const u=new Uint8Array(t,l,c),h=d/2,p=u.length/d;for(let g=0;g<p;g++){const f=g*d;for(let m=0;m<h;m++){const A=f+m,v=f-m+d-1,y=u[A];u[A]=u[v],u[v]=y}}}return new s(t,l,c/d)}})(),r=(function(){const o=new TextDecoder;return()=>JSON.parse(o.decode(i(Uint8Array)))})();return{metadata:r(),textureData:i(Uint8Array),eachTextureDataPortion:i(Uint32Array),eachTextureAttributes:i(Uint16Array),positions:i(Uint16Array),normals:i(Int8Array),colors:i(Uint8Array),uvs:i(Float32Array),indices:i(Uint32Array),edgeIndices:i(Uint32Array),eachTextureSetTextures:i(Int32Array),matrices:i(Float32Array),reusedGeometriesDecodeMatrix:i(Float32Array),eachGeometryPrimitiveType:i(Uint8Array),eachGeometryAxisLabel:r(),eachGeometryPositionsPortion:i(Uint32Array),eachGeometryNormalsPortion:i(Uint32Array),eachGeometryColorsPortion:i(Uint32Array),eachGeometryUVsPortion:i(Uint32Array),eachGeometryIndicesPortion:i(Uint32Array),eachGeometryEdgeIndicesPortion:i(Uint32Array),eachMeshGeometriesPortion:i(Uint32Array),eachMeshMatricesPortion:i(Uint32Array),eachMeshTextureSet:i(Int32Array),eachMeshMaterialAttributes:i(Uint8Array),eachEntityId:r(),eachEntityMeshesPortion:i(Uint32Array),eachTileAABB:i(Float64Array),eachTileEntitiesPortion:i(Uint32Array)}}function MYt(t){let e=0;return{metadata:t[e++],textureData:t[e++],eachTextureDataPortion:t[e++],eachTextureAttributes:t[e++],positions:t[e++],normals:t[e++],colors:t[e++],uvs:t[e++],indices:t[e++],edgeIndices:t[e++],eachTextureSetTextures:t[e++],matrices:t[e++],reusedGeometriesDecodeMatrix:t[e++],eachGeometryPrimitiveType:t[e++],eachGeometryAxisLabel:t[e++],eachGeometryPositionsPortion:t[e++],eachGeometryNormalsPortion:t[e++],eachGeometryColorsPortion:t[e++],eachGeometryUVsPortion:t[e++],eachGeometryIndicesPortion:t[e++],eachGeometryEdgeIndicesPortion:t[e++],eachMeshGeometriesPortion:t[e++],eachMeshMatricesPortion:t[e++],eachMeshTextureSet:t[e++],eachMeshMaterialAttributes:t[e++],eachEntityId:t[e++],eachEntityMeshesPortion:t[e++],eachTileAABB:t[e++],eachTileEntitiesPortion:t[e++]}}function EYt(t){function e(i,r){return i.length===0?[]:Ff.inflate(i,r).buffer}return{metadata:JSON.parse(Ff.inflate(t.metadata,{to:"string"})),textureData:new Uint8Array(e(t.textureData)),eachTextureDataPortion:new Uint32Array(e(t.eachTextureDataPortion)),eachTextureAttributes:new Uint16Array(e(t.eachTextureAttributes)),positions:new Uint16Array(e(t.positions)),normals:new Int8Array(e(t.normals)),colors:new Uint8Array(e(t.colors)),uvs:new Float32Array(e(t.uvs)),indices:new Uint32Array(e(t.indices)),edgeIndices:new Uint32Array(e(t.edgeIndices)),eachTextureSetTextures:new Int32Array(e(t.eachTextureSetTextures)),matrices:new Float32Array(e(t.matrices)),reusedGeometriesDecodeMatrix:new Float32Array(e(t.reusedGeometriesDecodeMatrix)),eachGeometryPrimitiveType:new Uint8Array(e(t.eachGeometryPrimitiveType)),eachGeometryAxisLabel:JSON.parse(Ff.inflate(t.eachGeometryAxisLabel,{to:"string"})),eachGeometryPositionsPortion:new Uint32Array(e(t.eachGeometryPositionsPortion)),eachGeometryNormalsPortion:new Uint32Array(e(t.eachGeometryNormalsPortion)),eachGeometryColorsPortion:new Uint32Array(e(t.eachGeometryColorsPortion)),eachGeometryUVsPortion:new Uint32Array(e(t.eachGeometryUVsPortion)),eachGeometryIndicesPortion:new Uint32Array(e(t.eachGeometryIndicesPortion)),eachGeometryEdgeIndicesPortion:new Uint32Array(e(t.eachGeometryEdgeIndicesPortion)),eachMeshGeometriesPortion:new Uint32Array(e(t.eachMeshGeometriesPortion)),eachMeshMatricesPortion:new Uint32Array(e(t.eachMeshMatricesPortion)),eachMeshTextureSet:new Int32Array(e(t.eachMeshTextureSet)),eachMeshMaterialAttributes:new Uint8Array(e(t.eachMeshMaterialAttributes)),eachEntityId:JSON.parse(Ff.inflate(t.eachEntityId,{to:"string"})),eachEntityMeshesPortion:new Uint32Array(e(t.eachEntityMeshesPortion)),eachTileAABB:new Float64Array(e(t.eachTileAABB)),eachTileEntitiesPortion:new Uint32Array(e(t.eachTileEntitiesPortion))}}const BYt=(function(){const t=new Float32Array(3);return function(e){return t[0]=e[0]/255,t[1]=e[1]/255,t[2]=e[2]/255,t}})();(function(){const t=document.createElement("canvas"),e=t.getContext("2d");return function(i){return t.width=i.width,t.height=i.height,e.putImageData(i,0,0),t.toDataURL()}})();function lhe(t,e,i,r,o,n){const s=n.getNextId(),a=i.metadata,l=i.textureData,c=i.eachTextureDataPortion,d=i.eachTextureAttributes,u=i.positions,h=i.normals,p=i.colors,g=i.uvs,f=i.indices,m=i.edgeIndices,A=i.eachTextureSetTextures,v=i.matrices,y=i.reusedGeometriesDecodeMatrix,b=i.eachGeometryPrimitiveType,w=i.eachGeometryAxisLabel,C=i.eachGeometryPositionsPortion,M=i.eachGeometryNormalsPortion,E=i.eachGeometryColorsPortion,B=i.eachGeometryUVsPortion,S=i.eachGeometryIndicesPortion,I=i.eachGeometryEdgeIndicesPortion,T=i.eachMeshGeometriesPortion,_=i.eachMeshMatricesPortion,O=i.eachMeshTextureSet,j=i.eachMeshMaterialAttributes,N=i.eachEntityId,G=i.eachEntityMeshesPortion,q=i.eachTileAABB,X=i.eachTileEntitiesPortion,me=c.length,ce=A.length/5,xe=C.length,Re=T.length,ge=G.length,ee=X.length;o&&o.loadData(a,{includeTypes:e.includeTypes,excludeTypes:e.excludeTypes,globalizeObjectIds:e.globalizeObjectIds});for(let de=0;de<me;de++){const Ae=de===me-1,Ue=c[de],z=Ae?l.length:c[de+1],se=z-Ue>0,ue=de*xYt,be=d[ue+0]===1,he=d[ue+1];d[ue+2],d[ue+3];const Q=d[ue+4],J=d[ue+5],te=d[ue+6],ne=d[ue+7],ae=d[ue+8];if(se){const W=new Uint8Array(l.subarray(Ue,z)).buffer,K=`${s}-texture-${de}`;if(be)r.createTexture({id:K,buffers:[W],minFilter:Q,magFilter:J,wrapS:te,wrapT:ne,wrapR:ae});else{const ve=he===xM?"image/jpeg":he===kM?"image/png":"image/gif",we=new Blob([W],{type:ve}),pe=(window.URL||window.webkitURL).createObjectURL(we),Se=document.createElement("img");Se.src=pe,r.createTexture({id:K,image:Se,minFilter:Q,magFilter:J,wrapS:te,wrapT:ne,wrapR:ae})}}}for(let de=0;de<ce;de++){const Ae=de*5,Ue=`${s}-textureSet-${de}`,z=A[Ae+0],se=A[Ae+1],ue=A[Ae+2],be=A[Ae+3],he=A[Ae+4];r.createTextureSet({id:Ue,colorTextureId:z>=0?`${s}-texture-${z}`:null,normalsTextureId:ue>=0?`${s}-texture-${ue}`:null,metallicRoughnessTextureId:se>=0?`${s}-texture-${se}`:null,emissiveTextureId:be>=0?`${s}-texture-${be}`:null,occlusionTextureId:he>=0?`${s}-texture-${he}`:null})}const $=new Uint32Array(xe);for(let de=0;de<Re;de++){const Ae=T[de];$[Ae]!==void 0?$[Ae]++:$[Ae]=1}const re=k.vec3(),ie=k.AABB3(),fe={};for(let de=0;de<ee;de++){const Ae=ee-1,Ue=de===Ae,z=X[de],se=Ue?ge-1:X[de+1]-1,ue=de*6,be=q.subarray(ue,ue+6);k.getAABB3Center(be,re),ie[0]=be[0]-re[0],ie[1]=be[1]-re[1],ie[2]=be[2]-re[2],ie[3]=be[3]-re[0],ie[4]=be[4]-re[1],ie[5]=be[5]-re[2];const he=xi.createPositionsDecodeMatrix(ie),Q={};for(let J=z;J<=se;J++){const te=N[J],ne=e.globalizeObjectIds?k.globalizeObjectId(r.id,te):te,ae=ge-1,W=J===ae,K=G[J],ve=W?T.length-1:G[J+1]-1,we=[],pe=t.metaScene.metaObjects[ne],Se={},Ke={};if(!(e.includeIdsMap&&te&&!e.includeIdsMap[te])){if(pe){if(e.excludeTypesMap&&pe.type&&e.excludeTypesMap[pe.type]||e.includeTypesMap&&pe.type&&!e.includeTypesMap[pe.type]||e.includeIdsMap&&pe.id&&!e.includeIdsMap[pe.id])continue;const Pe=e.objectDefaults?e.objectDefaults[pe.type]||e.objectDefaults.DEFAULT:null;Pe&&(Pe.visible===!1&&(Se.visible=!1),Pe.pickable===!1&&(Se.pickable=!1),Pe.colorize&&(Ke.color=Pe.colorize),Pe.opacity!==void 0&&Pe.opacity!==null&&(Ke.opacity=Pe.opacity),Pe.metallic!==void 0&&Pe.metallic!==null&&(Ke.metallic=Pe.metallic),Pe.roughness!==void 0&&Pe.roughness!==null&&(Ke.roughness=Pe.roughness))}else if(e.excludeUnclassifiedObjects)continue;for(let Pe=K;Pe<=ve;Pe++){const Ve=T[Pe],Ne=$[Ve]>1,Je=Ve===xe-1,at=O[Pe],Bt=at>=0?`${s}-textureSet-${at}`:null,Mt=BYt(j.subarray(Pe*6,Pe*6+3)),yt=j[Pe*6+3]/255,xt=j[Pe*6+4]/255,ze=j[Pe*6+5]/255,At=n.getNextId();if(Ne){const Ct=_[Pe],st=v.slice(Ct,Ct+16),Ie=`${s}-geometry.${de}.${Ve}`;let le=fe[Ie];if(!le){le={batchThisMesh:!e.reuseGeometries};const Fe=b[Ve],Qe=w[Ve];let Pt=!1,bt;switch(Fe){case 0:le.primitiveName="solid",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryNormals=h.subarray(M[Ve],Je?h.length:M[Ve+1]),le.geometryUVs=g.subarray(B[Ve],Je?g.length:B[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),le.geometryEdgeIndices=m.subarray(I[Ve],Je?m.length:I[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 1:le.primitiveName="surface",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryNormals=h.subarray(M[Ve],Je?h.length:M[Ve+1]),le.geometryUVs=g.subarray(B[Ve],Je?g.length:B[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),le.geometryEdgeIndices=m.subarray(I[Ve],Je?m.length:I[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 2:le.primitiveName="points",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryColors=p.subarray(E[Ve],Je?p.length:E[Ve+1]),Pt=le.geometryPositions.length>0;break;case 3:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryIndices=f.subarray(S[Ve],Je?f.length:S[Ve+1]),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 4:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.geometryIndices=che(le.geometryPositions,f.subarray(S[Ve],Je?f.length:S[Ve+1])),Pt=le.geometryPositions.length>0&&le.geometryIndices.length>0;break;case 7:le.primitiveName="lines",le.geometryPositions=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le.decompressedPositions=xi.decompressPositions(le.geometryPositions,y),bt=sA({origin:le.decompressedPositions,text:Qe,size:2}),le.decompressedPositions=bt.positions,le.geometryIndices=bt.indices,le.geometryPositions=null,Pt=le.decompressedPositions.length>0&&le.geometryIndices.length>0;break;default:continue}if(Pt||(le=null),le&&(le.geometryPositions&&le.geometryPositions.length>1e3,le.batchThisMesh)){if(Fe===7)le.transformedAndRecompressedPositions=new Uint16Array(le.decompressedPositions.length);else{le.decompressedPositions=new Float32Array(le.geometryPositions.length),le.transformedAndRecompressedPositions=new Uint16Array(le.geometryPositions.length);const ei=le.geometryPositions,ii=le.decompressedPositions;for(let wi=0,Ai=ei.length;wi<Ai;wi+=3)ii[wi+0]=ei[wi+0]*y[0]+y[12],ii[wi+1]=ei[wi+1]*y[5]+y[13],ii[wi+2]=ei[wi+2]*y[10]+y[14];le.geometryPositions=null}fe[Ie]=le}}if(le)if(le.batchThisMesh){const Fe=le.decompressedPositions,Qe=le.transformedAndRecompressedPositions;for(let Pt=0,bt=Fe.length;Pt<bt;Pt+=3)Kh[0]=Fe[Pt+0],Kh[1]=Fe[Pt+1],Kh[2]=Fe[Pt+2],Kh[3]=1,k.transformVec4(st,Kh,ahe),xi.compressPosition(ahe,ie,Kh),Qe[Pt+0]=Kh[0],Qe[Pt+1]=Kh[1],Qe[Pt+2]=Kh[2];r.createMesh(Tt.apply(Ke,{id:At,textureSetId:Bt,origin:re,primitive:le.primitiveName,positionsCompressed:Qe,normalsCompressed:le.geometryNormals,uv:le.geometryUVs,colorsCompressed:le.geometryColors,indices:le.geometryIndices,edgeIndices:le.geometryEdgeIndices,positionsDecodeMatrix:he,color:Mt,metallic:xt,roughness:ze,opacity:yt})),we.push(At)}else{if(!Q[Ie]){let Fe={id:Ie,primitive:le.primitiveName,normalsCompressed:le.geometryNormals,uv:le.geometryUVs,colorsCompressed:le.geometryColors,indices:le.geometryIndices,edgeIndices:le.geometryEdgeIndices};le.geometryPositions?Fe={...Fe,positionsCompressed:le.geometryPositions,positionsDecodeMatrix:y}:Fe={...Fe,positions:le.decompressedPositions},r.createGeometry(Fe),Q[Ie]=!0}r.createMesh(Tt.apply(Ke,{id:At,geometryId:Ie,textureSetId:Bt,matrix:st,color:Mt,metallic:xt,roughness:ze,opacity:yt,origin:re})),we.push(At)}}else{const Ct=b[Ve],st=w[Ve];let Ie,le,Fe,Qe,Pt,bt,ei,ii=!1,wi;switch(Ct){case 0:Ie="solid",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Fe=h.subarray(M[Ve],Je?h.length:M[Ve+1]),Qe=g.subarray(B[Ve],Je?g.length:B[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ei=m.subarray(I[Ve],Je?m.length:I[Ve+1]),ii=le.length>0&&bt.length>0;break;case 1:Ie="surface",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Fe=h.subarray(M[Ve],Je?h.length:M[Ve+1]),Qe=g.subarray(B[Ve],Je?g.length:B[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ei=m.subarray(I[Ve],Je?m.length:I[Ve+1]),ii=le.length>0&&bt.length>0;break;case 2:Ie="points",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),Pt=p.subarray(E[Ve],Je?p.length:E[Ve+1]),ii=le.length>0;break;case 3:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),bt=f.subarray(S[Ve],Je?f.length:S[Ve+1]),ii=le.length>0&&bt.length>0;break;case 4:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),bt=che(le,f.subarray(S[Ve],Je?f.length:S[Ve+1])),ii=le.length>0&&bt.length>0;break;case 7:Ie="lines",le=u.subarray(C[Ve],Je?u.length:C[Ve+1]),le=xi.decompressPositions(le,he),wi=sA({origin:le,text:st,size:2}),le=wi.positions,bt=wi.indices,ii=le.length>0&&bt.length>0;break;default:continue}if(ii){let Ai=Tt.apply(Ke,{id:At,textureSetId:Bt,origin:re,primitive:Ie,normalsCompressed:Fe,uv:Qe&&Qe.length>0?Qe:null,colorsCompressed:Pt,indices:bt,edgeIndices:ei,color:Mt,metallic:xt,roughness:ze,opacity:yt});Ct!==7?Ai={...Ai,positionsCompressed:le,positionsDecodeMatrix:he}:Ai={...Ai,positions:le},r.createMesh(Ai),we.push(At)}}}we.length>0&&r.createEntity(Tt.apply(Se,{id:ne,isObject:!0,meshIds:we}))}}}}function che(t,e){const i=[];if(e.length>1)for(let r=0,o=e.length-1;r<o;r++)i.push(e[r]),i.push(e[r+1]);else if(t.length>1)for(let r=0,o=t.length/3-1;r<o;r++)i.push(r),i.push(r+1);return i}const dhe={version:12,parseArrayBuffer:function(t,e,i,r,o,n){const s=kYt(i);lhe(t,e,s,r,o,n)},parse:function(t,e,i,r,o,n){const s=MYt(i),a=EYt(s);lhe(t,e,a,r,o,n)}},La={};La[zue.version]=zue,La[Vue.version]=Vue,La[que.version]=que,La[Gue.version]=Gue,La[Que.version]=Que,La[Kue.version]=Kue,La[Jue.version]=Jue,La[Yue.version]=Yue,La[ehe.version]=ehe,La[rhe.version]=rhe,La[she.version]=she,La[dhe.version]=dhe;class zE extends kc{constructor(e,i={}){super("XKTLoader",e,i),this._maxGeometryBatchSize=i.maxGeometryBatchSize,this.textureTranscoder=i.textureTranscoder,this.dataSource=i.dataSource,this.objectDefaults=i.objectDefaults,this.includeTypes=i.includeTypes,this.excludeTypes=i.excludeTypes,this.excludeUnclassifiedObjects=i.excludeUnclassifiedObjects,this.reuseGeometries=i.reuseGeometries}get supportedVersions(){return Object.keys(La)}get textureTranscoder(){return this._textureTranscoder}set textureTranscoder(e){this._textureTranscoder=e}get dataSource(){return this._dataSource}set dataSource(e){this._dataSource=e||new Nue}get objectDefaults(){return this._objectDefaults}set objectDefaults(e){this._objectDefaults=e||Fue}get includeTypes(){return this._includeTypes}set includeTypes(e){this._includeTypes=e}get excludeTypes(){return this._excludeTypes}set excludeTypes(e){this._excludeTypes=e}get includeIds(){return this._includeIds}set includeIds(e){this._includeIds=e}get excludeUnclassifiedObjects(){return this._excludeUnclassifiedObjects}set excludeUnclassifiedObjects(e){this._excludeUnclassifiedObjects=!!e}get globalizeObjectIds(){return this._globalizeObjectIds}set globalizeObjectIds(e){this._globalizeObjectIds=!!e}get reuseGeometries(){return this._reuseGeometries}set reuseGeometries(e){this._reuseGeometries=e!==!1}load(e={}){if(e.id&&this.viewer.scene.components[e.id]&&(this.error("Component with this ID already exists in viewer: "+e.id+" - will autogenerate this ID"),delete e.id),!e.src&&!e.xkt&&!e.manifestSrc&&!e.manifest)throw new Error("XKTLoaderPlugin: load() param expected: src, xkt, manifestSrc or manifestData");const i={},r=e.includeTypes||this._includeTypes,o=e.excludeTypes||this._excludeTypes,n=e.includeIds||this._includeIds,s=e.objectDefaults||this._objectDefaults;if(i.reuseGeometries=e.reuseGeometries!==null&&e.reuseGeometries!==void 0?e.reuseGeometries:this._reuseGeometries!==!1,r){i.includeTypesMap={};for(let g=0,f=r.length;g<f;g++)i.includeTypesMap[r[g]]=!0}if(o){i.excludeTypesMap={};for(let g=0,f=o.length;g<f;g++)i.excludeTypesMap[o[g]]=!0}if(n){i.includeIdsMap={};for(let g=0,f=n.length;g<f;g++)i.includeIdsMap[n[g]]=!0}s&&(i.objectDefaults=s),i.excludeUnclassifiedObjects=e.excludeUnclassifiedObjects!==void 0?!!e.excludeUnclassifiedObjects:this._excludeUnclassifiedObjects,i.globalizeObjectIds=e.globalizeObjectIds!==void 0&&e.globalizeObjectIds!==null?!!e.globalizeObjectIds:this._globalizeObjectIds;const a=new i7(this.viewer.scene,Tt.apply(e,{isModel:!0,textureTranscoder:this._textureTranscoder,maxGeometryBatchSize:this._maxGeometryBatchSize,origin:e.origin,disableVertexWelding:e.disableVertexWelding||!1,disableIndexRebucketing:e.disableIndexRebucketing||!1,dtxEnabled:e.dtxEnabled,renderOrder:e.renderOrder})),l=a.id,c=new Nce({metaScene:this.viewer.metaScene,id:l});this.viewer.scene.canvas.spinner.processes++;const d=()=>{a.destroyed||(a.finalize(),c.finalize(),this.viewer.scene.canvas.spinner.processes--,a.once("destroyed",()=>{this.viewer.metaScene.destroyMetaModel(c.id)}),this.scheduleTask(()=>{a.destroyed||(a.scene.fire("modelLoaded",a.id),a.fire("loaded",!0,!1))}))},u=g=>{this.viewer.scene.canvas.spinner.processes--,this.error(g),a.fire("error",g)};let h=0;const p={getNextId:()=>`${l}.${h++}`};if(e.metaModelSrc||e.metaModelData)if(e.metaModelSrc){const g=e.metaModelSrc;this._dataSource.getMetaModel(g,f=>{a.destroyed||(c.loadData(f,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),e.src?this._loadModel(e.src,i,a,null,p,d,u):(this._parseModel(e.xkt,i,a,null,p),d()))},f=>{u(`load(): Failed to load model metadata for model '${l} from '${g}' - ${f}`)})}else e.metaModelData&&(c.loadData(e.metaModelData,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),e.src?this._loadModel(e.src,i,a,null,p,d,u):(this._parseModel(e.xkt,i,a,null,p),d()));else if(e.src)this._loadModel(e.src,i,a,c,p,d,u);else if(e.xkt)this._parseModel(e.xkt,i,a,c,p),d();else if(e.manifestSrc||e.manifest){const g=e.manifestSrc?PYt(e.manifestSrc):"",f=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getMetaModel(`${g}${v[w]}`,M=>{c.loadData(M,{includeTypes:r,excludeTypes:o,globalizeObjectIds:i.globalizeObjectIds}),w++,this.scheduleTask(C,200)},b)};C()},m=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getXKT(`${g}${v[w]}`,M=>{this._parseModel(M,i,a,null,p),a.preFinalize(),w++,this.scheduleTask(C,200)},b)};C()},A=(v,y,b)=>{let w=0;const C=()=>{a.destroyed||w>=v.length?y():this._dataSource.getXKT(`${g}${v[w]}`,M=>{this._parseModel(M,i,a,c,p),a.preFinalize(),w++,this.scheduleTask(C,200)},b)};C()};if(e.manifest){const v=e.manifest,y=v.xktFiles;if(!y||y.length===0){u("load(): Failed to load model manifest - manifest not valid");return}const b=v.metaModelFiles;b?f(b,()=>{m(y,d,u)},u):A(y,d,u)}else this._dataSource.getManifest(e.manifestSrc,v=>{if(a.destroyed)return;const y=v.xktFiles;if(!y||y.length===0){u("load(): Failed to load model manifest - manifest not valid");return}const b=v.metaModelFiles;b?f(b,()=>{m(y,d,u)},u):A(y,d,u)},u)}return a}_loadModel(e,i,r,o,n,s,a){this._dataSource.getXKT(e,l=>{this._parseModel(l,i,r,o,n),r.preFinalize(),s()},a)}async _parseModel(e,i,r,o,n){if(r.destroyed)return;const s=new DataView(e),a=new Uint8Array(e),l=s.getUint32(0,!0),c=l&2147483647,d=c<11||c>=12&&l>>>31,u=La[c];if(!u){this.error("Unsupported .XKT file version: "+c+" - this XKTLoaderPlugin supports versions "+Object.keys(La));return}if(!d){u.parseArrayBuffer(this.viewer,i,e,r,o,n);return}const h=s.getUint32(4,!0),p=[];let g=(h+2)*4;for(let f=0;f<h;f++){const m=s.getUint32((f+2)*4,!0);p.push(a.subarray(g,g+m)),g+=m}u.parse(this.viewer,i,p,r,o,n)}}function PYt(t){t.indexOf("?")>-1&&(t=t.split("?")[0]);const e=t.split("/");return e.pop(),e.join("/")+"/"}let IYt=1;class KQ{constructor(e,i,r=null){this.tileset=e,this.computePriority=e.plugin.computePriority,this.distanceFactorToFreeData=e.plugin.distanceFactorToFreeData,this.src=i.content?.uri??null;const o=this.src?new URL(this.src).pathname:null;this.name=`${e.name}_${o?o.substring(o.lastIndexOf("/")+1):`tileWithNoContent_${IYt++}`}`,this.parent=r,this.refine=i.refine,this.data=null,this.fetching=null,this.depth=r?r.depth+1:1,this.model=null,this.loadProcess=null,this.loading=!1,this.currentDistanceFromCamera=null,this._visible=!r,this.priority=1,this.geometricError=i.geometricError;const[n,s,a,l,c,d,u,h,p,g,f,m]=i.boundingVolume.box,A=[n,a,-s];e.rootTransform&&(A[0]+=e.rootTransform[12],A[1]+=e.rootTransform[14],A[2]-=e.rootTransform[13]),this.center=Object.freeze(A);const v=[l,c,d],y=[-u,-h,-p],b=[g,f,m];this.xSize=k.lenVec3(v),this.ySize=k.lenVec3(b),this.zSize=k.lenVec3(y),this.volume=this.xSize*2*this.ySize*2*this.zSize*2,this.children=i.children?.map(w=>new KQ(e,w,this))??[],e.tiles.add(this)}get visible(){return this._visible}set visible(e){this._visible!==e&&(this._visible=e,e?this.tileset.visibleTiles.add(this):this.tileset.visibleTiles.delete(this))}get loaded(){return!!this.model}get viewDistance(){return this.tileset.sensitivity*this.geometricError}get isWithinCameraVisibleRange(){return this.currentDistanceFromCamera<=this.viewDistance}updateVisibility(e){this.currentDistanceFromCamera=k.distVec3(this.center,e),this.parent&&(this.visible=this.isWithinCameraVisibleRange,this.currentDistanceFromCamera>this.viewDistance*this.distanceFactorToFreeData&&(this.data=null)),this.visible&&this.children.forEach(i=>i.updateVisibility(e)),this.priority=this.computePriority(this)}fetchData(){return this.data?this.data:this.src?(this.fetching||(this.fetching=new Promise((e,i)=>{fetch(this.src).then(r=>{r.ok?r.arrayBuffer().then(o=>{this.data=o,this.fetching=null,e(this.data)}):i(r)})})),this.fetching):null}showBoundingBox(){const{viewer:e}=this.tileset.plugin,{xSize:i,ySize:r,zSize:o,center:n}=this,s=1/this.depth;this.boxLines=new nr(e.scene,{geometry:new mo(e.scene,NF({center:n,xSize:i,ySize:r,zSize:o})),material:new vo(e.scene,{emissive:[1-s,s,(1-s)/2]})})}async load(){if(this.loading)return this.loadProcess;if(this.loaded)return this.model;if(this.loading=!0,!this.data)try{await this.fetchData()}catch(e){return console.warn(`[Xeokit - TilesetLoaderPlugin] Impossible to fetch data of tile "${this.name}".`,e),this.loading=!1,null}if(!this.visible)return this.loading=!1,null;this.tileset.plugin.debugMode&&this.showBoundingBox();try{const e=new Promise(i=>{const r=this.tileset.plugin.loader.load({id:this.name,xkt:this.data,metaModelData:{metaObjects:[{id:"metaModelRoot"}]}});r.once("loaded",()=>{this.loading=!1,this.loadProcess=null,this.model=r,this.tileset.destroyed||!this.visible?(this.unload(),i(null)):(this.tileset.loadedTiles.add(this),i(r))}),r.once("destroyed",()=>{this.loading=!1,this.loadProcess=null,i(null)})});return this.loadProcess=e,this.loadProcess}catch(e){return console.warn(`[Xeokit - TilesetLoaderPlugin] Impossible to load tile "${this.name}".`,e),null}}unload(){this.boxLines&&(this.boxLines.destroy(),this.boxLines=null),this.model&&(this.model.destroy(),this.model=null),this.tileset.loadedTiles.delete(this),this.children.forEach(e=>{e.loaded&&e.unload()})}}function SYt(t,e,i){const r=Array.from(t),o=r.splice(0,e),n=async s=>{if(await i(s),r.length>0){const a=r.shift();n(a)}};o.forEach(n)}function TYt(t){let e=!1;return{cancel(){e=!0},async run(i){for(let r of t){if(e)break;await new Promise(o=>setTimeout(()=>(i(r)||Promise.resolve()).then(o)))}}}}let RYt=0;class DYt{constructor(e,i){this.plugin=e,this.name=i.name||`tileset-${RYt++}`,this.tiles=new Set,this.visibleTiles=new Set,this.loadedTiles=new Set,this.queue=null,this.renderNeeded=!0,this.destroyed=!1,this._sensitivity=e.sensitivity,i.root.transform&&(this.rootTransform=i.root.transform),this.root=new KQ(this,i.root),this.root.load().then(r=>e.viewer.cameraFlight.flyTo(r))}get sensitivity(){return this._sensitivity}set sensitivity(e){this._sensitivity=e,this.updateVisibility()}updateVisibility(){this.tiles.forEach(e=>{e!==this.root&&(e.visible=!1)}),this.root.updateVisibility(this.plugin.viewer.camera.eye),this.renderNeeded=!0}render(){if(!this.renderNeeded)return;this.queue&&this.queue.cancel(),this.loadedTiles.forEach(i=>{i.visible||i.unload()});const e=Array.from(this.visibleTiles).filter(i=>!i.loaded).sort((i,r)=>i.priority-r.priority);SYt(e,40,i=>i.fetchData()),this.queue=TYt(e),this.queue.run(i=>i.load()),this.renderNeeded=!1}destroy(){this.queue&&this.queue.cancel(),this.loadedTiles.forEach(e=>e.unload()),this.destroyed=!0,this.plugin.tilesets.delete(this)}}function _Yt(t){return t.depth}class uhe extends kc{constructor(e,i={}){super("TilesetLoader",e);const{computePriority:r=_Yt,sensitivity:o=50,distanceFactorToFreeData:n=3,debugMode:s=!1}=i;this._sensitivity=o,this.distanceFactorToFreeData=n,this.computePriority=r,this.debugMode=s,this.tilesets=new Set,e.camera.on("matrix",this.updateTilesetsVisibilityCallback=()=>this.updateTilesetsVisibility()),e.scene.on("tick",this.renderTilesetsCallback=()=>this.renderTilesets()),this.loader=new zE(e)}load(e){const i=new DYt(this,e);return this.tilesets.add(i),i}updateTilesetsVisibility(){this.tilesets.forEach(e=>e.updateVisibility())}renderTilesets(){this.tilesets.forEach(e=>e.render())}get sensitivity(){return this._sensitivity}set sensitivity(e){this._sensitivity=e,this.tilesets.forEach(i=>i.sensitivity=this._sensitivity)}destroy(){this.viewer.camera.off(this.updateTilesetsVisibilityCallback),this.viewer.scene.off(this.renderTilesetsCallback),this.tilesets.forEach(e=>e.destroy()),super.destroy()}}const LYt="2.6.90";typeof window<"u"&&(window.__XEOKIT__?console.warn("WARNING: Multiple instances of xeokit-sdk being imported."):window.__XEOKIT__=LYt);const Wh=Object.freeze(Object.defineProperty({__proto__:null,AlphaFormat:Qse,AmbientLight:VO,AngleMeasurementEditMouseControl:cqt,AngleMeasurementEditTouchControl:dqt,AngleMeasurementsControl:mU,AngleMeasurementsMouseControl:Jce,AngleMeasurementsPlugin:uE,AngleMeasurementsTouchControl:lqt,AnnotationsPlugin:yU,AxisGizmoPlugin:gqt,BCFViewpointsPlugin:mE,Bitmap:Bae,ByteType:Fse,CameraMemento:ezt,CameraPath:EFt,CameraPathAnimation:bs,ClampToEdgeWrapping:sa,Component:Hi,CompressedMediaType:ZFt,Configs:RM,ContextMenu:VLt,CubicBezierCurve:rzt,Curve:S9,DefaultLoadingManager:Dle,DepthFormat:Zse,DepthStencilFormat:Xse,DirLight:Ad,DistanceMeasurementEditControl:wU,DistanceMeasurementEditMouseControl:xqt,DistanceMeasurementEditTouchControl:kqt,DistanceMeasurementsControl:bU,DistanceMeasurementsMouseControl:ede,DistanceMeasurementsPlugin:tde,DistanceMeasurementsTouchControl:Cqt,EdgeMaterial:gO,EmphasisMaterial:Lh,FastNavPlugin:nde,FloatType:Hse,Fresnel:VOt,Frustum:zl,FrustumPlane:yf,GIFMediaType:JFt,GLTFDefaultDataSource:sde,GLTFLoaderPlugin:lN,HalfFloatType:zse,ImagePlane:LOt,IntType:Nse,JPEGMediaType:xM,KTX2TextureTranscoder:Nd,LOD:$le,LambertMaterial:FOt,LightMap:YHt,LineSet:Kle,LinearEncoding:dl,LinearFilter:aa,LinearMipMapLinearFilter:lA,LinearMipMapNearestFilter:_9,LinearMipmapLinearFilter:kf,LinearMipmapNearestFilter:WFt,Loader:_le,LoadingManager:Rle,LocaleService:Ase,LuminanceAlphaFormat:Jse,LuminanceFormat:Wse,Map:xc,Marker:o7,MarqueePicker:Yu,MarqueePickerMouseControl:MFt,Mesh:nr,MeshSurfaceArea:Rae,MeshVolume:Iae,MetallicMaterial:NOt,MirroredRepeatWrapping:Th,ModelMemento:tzt,NavCubePlugin:cN,NearestFilter:xf,NearestMipMapLinearFilter:aA,NearestMipMapNearestFilter:D9,NearestMipmapLinearFilter:Lse,NearestMipmapNearestFilter:_se,Node:R9,ObjectsKdTree3:KLt,ObjectsMemento:izt,PNGMediaType:kM,Path:ozt,PerformanceModel:szt,PhongMaterial:vo,PickResult:JM,Plugin:kc,PointLight:JHt,PointerCircle:RF,PointerLens:qLt,QuadraticBezierCurve:nzt,Queue:sse,RGBAFormat:L9,RGBAIntegerFormat:iae,RGBA_ASTC_10x10_Format:iO,RGBA_ASTC_10x5_Format:$F,RGBA_ASTC_10x6_Format:eO,RGBA_ASTC_10x8_Format:tO,RGBA_ASTC_12x10_Format:rO,RGBA_ASTC_12x12_Format:oO,RGBA_ASTC_4x4_Format:wM,RGBA_ASTC_5x4_Format:QF,RGBA_ASTC_5x5_Format:KF,RGBA_ASTC_6x5_Format:WF,RGBA_ASTC_6x6_Format:JF,RGBA_ASTC_8x5_Format:ZF,RGBA_ASTC_8x6_Format:XF,RGBA_ASTC_8x8_Format:YF,RGBA_BPTC_Format:CM,RGBA_ETC2_EAC_Format:bM,RGBA_PVRTC_2BPPV1_Format:qF,RGBA_PVRTC_4BPPV1_Format:vM,RGBA_S3TC_DXT1_Format:gM,RGBA_S3TC_DXT3_Format:AM,RGBA_S3TC_DXT5_Format:O9,RGBFormat:Kse,RGB_ETC1_Format:GF,RGB_ETC2_Format:yM,RGB_PVRTC_2BPPV1_Format:VF,RGB_PVRTC_4BPPV1_Format:mM,RGB_S3TC_DXT1_Format:F9,RGFormat:eae,RGIntegerFormat:tae,ReadableGeometry:mo,RedFormat:Yse,RedIntegerFormat:$se,ReflectionMap:XHt,RepeatWrapping:Eo,SceneModel:i7,SceneModelMesh:_ae,SceneModelTransform:jle,SectionPlane:KO,SectionPlanesPlugin:PXt,ShortType:Ose,SpecularMaterial:zOt,SplineCurve:cM,SpriteMarker:$Ht,Texture:cA,TextureTranscoder:czt,TilesetLoaderPlugin:uhe,UnsignedByteType:zF,UnsignedInt248Type:Gse,UnsignedIntType:jse,UnsignedShort4444Type:Vse,UnsignedShort5551Type:qse,UnsignedShortType:Use,VBOGeometry:xse,VFC:hce,Viewer:Wce,WorkerPool:Fle,XKTDefaultDataSource:Nue,XKTLoaderPlugin:zE,buildBoxGeometry:UF,buildBoxLinesGeometry:NF,buildBoxLinesGeometryFromAABB:VFt,buildCylinderGeometry:oA,buildGridGeometry:kse,buildLineGeometry:Ese,buildPlaneGeometry:jF,buildPolylineGeometry:Mse,buildPolylineGeometryFromCurve:GFt,buildSphereGeometry:nA,buildTorusGeometry:HF,buildVectorTextGeometry:sA,createCombinedTexture:oqt,createRTCViewMat:Or,createSkyboxMesh:nqt,createSphereMapMesh:sqt,frustumIntersectsAABB3:lM,getKTX2TextureTranscoder:Ole,getPlaneRTCPos:un,isTriangleMeshSolid:Pae,load3DSGeometry:HFt,loadOBJGeometry:zFt,math:k,meshSurfaceArea:H9,meshVolume:uA,os:YO,rtcToWorldPos:KFt,sRGBEncoding:ho,setFrustum:gse,stats:br,utils:Tt,worldToRTCPos:Cf,worldToRTCPositions:fM},Symbol.toStringTag,{value:"Module"}));function NA(t){let e=t.substring(1);const i=[];let r=null;for(;e.length>0;)r=e.substring(0,2),e=e.substring(2),i.push(parseInt(r,16)/255);return i}function hhe(t){let e="";return e+=Math.round(t[0]*255).toString(16).padStart(2,"0"),e+=Math.round(t[1]*255).toString(16).padStart(2,"0"),e+=Math.round(t[2]*255).toString(16).padStart(2,"0"),`#${e}`}const FYt={class:"annotations-3d"},OYt={__name:"Annotations3D",setup(t){const e=kt("$viewer"),{localContext:i}=e,{xeokit:r}=i.viewer,o=r.scene.canvas.canvas,n=PF(),s=$n(new WeakSet),a=qe(()=>n.value.filter(u=>s.has(u))),l=new Map;Et(n,()=>{n.value.forEach(u=>{if(!l.has(u.id)){const{x:h,y:p,z:g}=u,f=new o7(r.scene,{worldPos:[h,g,p]});l.set(u.id,f);const[m,A]=f.canvasPos;f.style=ke(`left: ${m}px; top: ${A}px;`),f.on("canvasPos",([b,w])=>{f.style.value=`left: ${b}px; top: ${w}px;`}),f.on("visible",b=>b?s.add(u):s.delete(u)),f.on("destroyed",()=>{e.state.hub.off(y),e.state.hub.off(v)});const v=e.state.hub.on("annotation-updated",({annotation:b})=>{if(b.id===u.id){const{x:w,y:C,z:M}=b;f.worldPos=[w,M,C],f._update(),r.scene._renderer._occlusionTester._occlusionTestListDirty=!0}}),y=e.state.hub.on("annotation-removed",({annotation:b})=>{b.id===u.id&&(l.delete(u.id),f.destroy())})}})},{flush:"sync"});const c=(u,h)=>{const{clientX:p,clientY:g}=h,{x:f,y:m}=o.getBoundingClientRect(),A=r.scene.pick({pickSurface:!0,canvasPos:[p-f,g-m]});if(A){const[v,y,b]=A.worldPos;Object.assign(u,{x:v,y:b,z:y})}},d=u=>l.get(u.id).style.value;return(u,h)=>(P(),F("div",FYt,[(P(!0),F(lt,null,Vt(a.value,p=>(P(),Y(IF,{key:p.instanceId,annotation:p,canvas:pt(o),style:Ee(d(p)),onAnnotationDrag:g=>c(p,g)},null,8,["annotation","canvas","style","onAnnotationDrag"]))),128))]))}},phe=V(OYt,[["__scopeId","data-v-10ceb001"]]),UYt={setup(){const t=kt("$viewer"),e=t.localContext.pluginComponentInstances.get("viewer3d"),{math:i}=e.xeokitSdk,r=()=>{const n=e.xeokit,s=[0,0,-1],a=n.scene.aabb,l=i.getAABB3Diag(a),c=i.vec3();i.getAABB3Center(a,c);const d=45,u=Math.abs(l/Math.tan(d*i.DEGTORAD));n.cameraControl.pivotPos=c,n.cameraFlight.jumpTo({look:c,eye:[c[0]-u*s[0],c[1]-u*s[1],c[2]-u*s[2]],up:[0,1,0],orthoScale:l*1.1,fitFOV:d})},o=()=>{const n=t.localContext.loadedModels.flatMap(s=>s.objects.filter(a=>a.visible===!1).map(a=>a.id));t.state.showObjects(n)};return{onClick:()=>{r(),o(),e.reintegrateObjects()}}}};function NYt(t,e,i,r,o,n){const s=R("BIMDataIconHome"),a=R("BIMDataButton");return P(),Y(a,{color:"default",ghost:"",rounded:"",icon:"",onClick:r.onClick},{default:H(()=>[D(s,{size:"xs"})]),_:1},8,["onClick"])}const jYt=V(UYt,[["render",NYt]]),HYt={computed:{active(){return this.$viewer.localContext.pluginComponentInstances.has("navigationVersionsModel")?this.$viewer.localContext.pluginComponentInstances.get("navigationVersionsModel").isOpen.value:!1}},methods:{onClick(){this.$viewer.localContext.pluginComponentInstances.get("navigationVersionsModel").toggle()}}};function zYt(t,e,i,r,o,n){const s=R("BIMDataIcon"),a=R("BIMDataButton"),l=R("BIMDataTooltip");return P(),Y(l,{text:t.$t("navigationVersionsModel.tooltip")},{default:H(()=>[D(a,{class:Me(["bimdata-navigation-versions-model",{active:n.active}]),color:"primary",ghost:"",rounded:"",icon:"",onClick:n.onClick},{default:H(()=>[D(s,{name:"versioning",fill:"",color:"primary",size:"xxs"})]),_:1},8,["class","onClick"])]),_:1},8,["text"])}const VYt=V(HYt,[["render",zYt],["__scopeId","data-v-ced27a96"]]),qYt={key:0,width:"159",height:"116",viewBox:"0 0 159 116",fill:"none",xmlns:"http://www.w3.org/2000/svg"},GYt={key:1,width:"159",height:"116",viewBox:"0 0 159 116",fill:"none",xmlns:"http://www.w3.org/2000/svg"},QYt={__name:"KeyboardNavigate",setup(t){const e=kt("$viewer").i18n.locale==="fr";return(i,r)=>e?(P(),F("svg",qYt,[...r[0]||(r[0]=[Ys('<path d="M79 0L87 11H71L79 0Z" fill="#2F374A"></path><path d="M159 79.1111L148 87.1111L148 71.1111L159 79.1111Z" fill="#2F374A"></path><path d="M9.5399e-08 79.1111L11 71.1111L11 87.1111L9.5399e-08 79.1111Z" fill="#2F374A"></path><path d="M79 115.222L71 104.222L87 104.222L79 115.222Z" fill="#2F374A"></path><rect x="61.3333" y="18" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M82.5998 38.834V40H76.6759V38.834H82.5998ZM82.465 32.377L77.2209 40H76.2365V39.0684L81.4982 31.4688H82.465V32.377ZM81.9201 31.4688V32.6406H76.2716V31.4688H81.9201Z" fill="#6B6B6B"></path><rect x="104.667" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M122.148 83.1111H120.326L120.338 81.9451H122.148C122.676 81.9451 123.117 81.8298 123.473 81.5994C123.832 81.3689 124.101 81.0388 124.281 80.6091C124.465 80.1794 124.557 79.6677 124.557 79.074V78.6111C124.557 78.1501 124.504 77.7419 124.398 77.3865C124.297 77.031 124.144 76.7322 123.941 76.49C123.742 76.2478 123.496 76.0642 123.203 75.9392C122.914 75.8142 122.58 75.7517 122.201 75.7517H120.291V74.5798H122.201C122.767 74.5798 123.285 74.6755 123.754 74.8669C124.223 75.0544 124.627 75.3259 124.967 75.6814C125.31 76.0369 125.574 76.4626 125.758 76.9587C125.941 77.4548 126.033 78.0095 126.033 78.6228V79.074C126.033 79.6873 125.941 80.2419 125.758 80.738C125.574 81.2341 125.31 81.6599 124.967 82.0154C124.623 82.3669 124.213 82.6384 123.736 82.8298C123.264 83.0173 122.734 83.1111 122.148 83.1111ZM121.141 74.5798V83.1111H119.67V74.5798H121.141Z" fill="#6B6B6B"></path><rect x="18" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M37.3036 81.9744L39.5478 83.7556L38.5927 84.5935L36.3896 82.8298L37.3036 81.9744ZM39.5653 78.6111V79.0798C39.5653 79.7244 39.4814 80.3025 39.3134 80.8142C39.1454 81.3259 38.9052 81.7615 38.5927 82.1208C38.2802 82.4802 37.9071 82.7556 37.4735 82.947C37.04 83.1345 36.5595 83.2283 36.0321 83.2283C35.5087 83.2283 35.0302 83.1345 34.5966 82.947C34.1669 82.7556 33.7939 82.4802 33.4775 82.1208C33.161 81.7615 32.915 81.3259 32.7392 80.8142C32.5673 80.3025 32.4814 79.7244 32.4814 79.0798V78.6111C32.4814 77.9666 32.5673 77.3904 32.7392 76.8826C32.911 76.3708 33.1532 75.9353 33.4657 75.5759C33.7821 75.2126 34.1552 74.9373 34.5849 74.7498C35.0185 74.5583 35.497 74.4626 36.0204 74.4626C36.5478 74.4626 37.0282 74.5583 37.4618 74.7498C37.8993 74.9373 38.2743 75.2126 38.5868 75.5759C38.8993 75.9353 39.1396 76.3708 39.3075 76.8826C39.4794 77.3904 39.5653 77.9666 39.5653 78.6111ZM38.0888 79.0798V78.5994C38.0888 78.1228 38.0419 77.7029 37.9482 77.3396C37.8583 76.9724 37.7235 76.6658 37.5439 76.4197C37.3681 76.1697 37.1513 75.9822 36.8935 75.8572C36.6396 75.7283 36.3485 75.6638 36.0204 75.6638C35.7001 75.6638 35.413 75.7283 35.1591 75.8572C34.9052 75.9822 34.6884 76.1697 34.5087 76.4197C34.329 76.6658 34.1923 76.9724 34.0985 77.3396C34.0048 77.7029 33.9579 78.1228 33.9579 78.5994V79.0798C33.9579 79.5564 34.0048 79.9783 34.0985 80.3455C34.1923 80.7126 34.329 81.0232 34.5087 81.2771C34.6923 81.5271 34.911 81.7166 35.165 81.8455C35.4228 81.9705 35.7118 82.033 36.0321 82.033C36.3603 82.033 36.6513 81.9705 36.9052 81.8455C37.1591 81.7166 37.3739 81.5271 37.5497 81.2771C37.7255 81.0232 37.8583 80.7126 37.9482 80.3455C38.0419 79.9783 38.0888 79.5564 38.0888 79.0798Z" fill="#6B6B6B"></path><rect x="61.3333" y="61.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M81.1115 81.025C81.1115 80.8492 81.0841 80.693 81.0295 80.5563C80.9787 80.4196 80.8869 80.2946 80.7541 80.1813C80.6213 80.068 80.4338 79.9586 80.1916 79.8531C79.9533 79.7438 79.6486 79.6324 79.2775 79.5192C78.8713 79.3942 78.4963 79.2555 78.1525 79.1031C77.8127 78.9469 77.5158 78.7672 77.2619 78.5641C77.008 78.3571 76.8107 78.1207 76.6701 77.8551C76.5295 77.5856 76.4591 77.275 76.4591 76.9235C76.4591 76.5758 76.5314 76.2594 76.6759 75.9742C76.8244 75.6891 77.0334 75.443 77.3029 75.236C77.5763 75.025 77.8986 74.8629 78.2697 74.7496C78.6408 74.6324 79.0509 74.5739 79.5002 74.5739C80.133 74.5739 80.6779 74.691 81.1349 74.9254C81.5959 75.1598 81.9494 75.4742 82.1955 75.8688C82.4455 76.2633 82.5705 76.6989 82.5705 77.1754H81.1115C81.1115 76.8942 81.0509 76.6461 80.9298 76.4313C80.8127 76.2125 80.633 76.0406 80.3908 75.9156C80.1525 75.7906 79.8498 75.7281 79.4826 75.7281C79.1349 75.7281 78.8459 75.7809 78.6154 75.8864C78.3849 75.9918 78.213 76.1344 78.0998 76.3141C77.9865 76.4938 77.9298 76.6969 77.9298 76.9235C77.9298 77.0836 77.967 77.2301 78.0412 77.3629C78.1154 77.4918 78.2287 77.6129 78.381 77.7262C78.5334 77.8356 78.7248 77.9391 78.9552 78.0367C79.1857 78.1344 79.4572 78.2281 79.7697 78.318C80.2423 78.4586 80.6545 78.6149 81.006 78.7867C81.3576 78.9547 81.6505 79.1461 81.8849 79.361C82.1193 79.5758 82.2951 79.8199 82.4123 80.0934C82.5295 80.3629 82.588 80.6696 82.588 81.0133C82.588 81.3727 82.5158 81.6969 82.3713 81.986C82.2267 82.2711 82.0197 82.5153 81.7502 82.7184C81.4845 82.9176 81.1642 83.0719 80.7892 83.1813C80.4181 83.2867 80.0041 83.3395 79.547 83.3395C79.1369 83.3395 78.7326 83.2848 78.3341 83.1754C77.9396 83.066 77.5802 82.9 77.256 82.6774C76.9318 82.4508 76.674 82.1696 76.4826 81.8336C76.2912 81.4938 76.1955 81.0973 76.1955 80.6442H77.6662C77.6662 80.9215 77.713 81.1578 77.8068 81.3531C77.9045 81.5485 78.0392 81.7086 78.2111 81.8336C78.383 81.9547 78.5822 82.0446 78.8088 82.1031C79.0392 82.1617 79.2853 82.191 79.547 82.191C79.8908 82.191 80.1779 82.1422 80.4084 82.0446C80.6427 81.9469 80.8185 81.8102 80.9357 81.6344C81.0529 81.4586 81.1115 81.2555 81.1115 81.025Z" fill="#6B6B6B"></path>',12)])])):(P(),F("svg",GYt,[...r[1]||(r[1]=[Ys('<path d="M79 0L87 11H71L79 0Z" fill="#2F374A"></path><path d="M159 79.1111L148 87.1111L148 71.1111L159 79.1111Z" fill="#2F374A"></path><path d="M9.5399e-08 79.1111L11 71.1111L11 87.1111L9.5399e-08 79.1111Z" fill="#2F374A"></path><path d="M79 115.222L71 104.222L87 104.222L79 115.222Z" fill="#2F374A"></path><rect x="61.3333" y="18" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M77.1095 38.084L78.8088 31.4688H79.6994L79.5998 33.1738L77.7834 40H76.8576L77.1095 38.084ZM75.838 31.4688L77.215 38.0312L77.338 40H76.3537L74.3791 31.4688H75.838ZM81.6271 38.0137L82.9865 31.4688H84.4513L82.4767 40H81.4923L81.6271 38.0137ZM80.0451 31.4688L81.7267 38.1016L81.9728 40H81.047L79.2599 33.1738L79.1662 31.4688H80.0451Z" fill="#6B6B6B"></path><rect x="104.667" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M122.148 83.1111H120.326L120.338 81.9451H122.148C122.676 81.9451 123.117 81.8298 123.473 81.5994C123.832 81.3689 124.101 81.0388 124.281 80.6091C124.465 80.1794 124.557 79.6677 124.557 79.074V78.6111C124.557 78.1501 124.504 77.7419 124.398 77.3865C124.297 77.031 124.144 76.7322 123.941 76.49C123.742 76.2478 123.496 76.0642 123.203 75.9392C122.914 75.8142 122.58 75.7517 122.201 75.7517H120.291V74.5798H122.201C122.767 74.5798 123.285 74.6755 123.754 74.8669C124.223 75.0544 124.627 75.3259 124.967 75.6814C125.31 76.0369 125.574 76.4626 125.758 76.9587C125.941 77.4548 126.033 78.0095 126.033 78.6228V79.074C126.033 79.6873 125.941 80.2419 125.758 80.738C125.574 81.2341 125.31 81.6599 124.967 82.0154C124.623 82.3669 124.213 82.6384 123.736 82.8298C123.264 83.0173 122.734 83.1111 122.148 83.1111ZM121.141 74.5798V83.1111H119.67V74.5798H121.141Z" fill="#6B6B6B"></path><rect x="18" y="61" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M36.2665 75.7166L33.7177 83.1111H32.1767L35.3876 74.5798H36.372L36.2665 75.7166ZM38.3993 83.1111L35.8446 75.7166L35.7333 74.5798H36.7235L39.9462 83.1111H38.3993ZM38.2763 79.947V81.113H33.6357V79.947H38.2763Z" fill="#6B6B6B"></path><rect x="61.3333" y="61.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M81.1115 81.025C81.1115 80.8492 81.0841 80.693 81.0295 80.5563C80.9787 80.4196 80.8869 80.2946 80.7541 80.1813C80.6213 80.068 80.4338 79.9586 80.1916 79.8531C79.9533 79.7438 79.6486 79.6324 79.2775 79.5192C78.8713 79.3942 78.4963 79.2555 78.1525 79.1031C77.8127 78.9469 77.5158 78.7672 77.2619 78.5641C77.008 78.3571 76.8107 78.1207 76.6701 77.8551C76.5295 77.5856 76.4591 77.275 76.4591 76.9235C76.4591 76.5758 76.5314 76.2594 76.6759 75.9742C76.8244 75.6891 77.0334 75.443 77.3029 75.236C77.5763 75.025 77.8986 74.8629 78.2697 74.7496C78.6408 74.6324 79.0509 74.5739 79.5002 74.5739C80.133 74.5739 80.6779 74.691 81.1349 74.9254C81.5959 75.1598 81.9494 75.4742 82.1955 75.8688C82.4455 76.2633 82.5705 76.6989 82.5705 77.1754H81.1115C81.1115 76.8942 81.0509 76.6461 80.9298 76.4313C80.8127 76.2125 80.633 76.0406 80.3908 75.9156C80.1525 75.7906 79.8498 75.7281 79.4826 75.7281C79.1349 75.7281 78.8459 75.7809 78.6154 75.8864C78.3849 75.9918 78.213 76.1344 78.0998 76.3141C77.9865 76.4938 77.9298 76.6969 77.9298 76.9235C77.9298 77.0836 77.967 77.2301 78.0412 77.3629C78.1154 77.4918 78.2287 77.6129 78.381 77.7262C78.5334 77.8356 78.7248 77.9391 78.9552 78.0367C79.1857 78.1344 79.4572 78.2281 79.7697 78.318C80.2423 78.4586 80.6545 78.6149 81.006 78.7867C81.3576 78.9547 81.6505 79.1461 81.8849 79.361C82.1193 79.5758 82.2951 79.8199 82.4123 80.0934C82.5295 80.3629 82.588 80.6696 82.588 81.0133C82.588 81.3727 82.5158 81.6969 82.3713 81.986C82.2267 82.2711 82.0197 82.5153 81.7502 82.7184C81.4845 82.9176 81.1642 83.0719 80.7892 83.1813C80.4181 83.2867 80.0041 83.3395 79.547 83.3395C79.1369 83.3395 78.7326 83.2848 78.3341 83.1754C77.9396 83.066 77.5802 82.9 77.256 82.6774C76.9318 82.4508 76.674 82.1696 76.4826 81.8336C76.2912 81.4938 76.1955 81.0973 76.1955 80.6442H77.6662C77.6662 80.9215 77.713 81.1578 77.8068 81.3531C77.9045 81.5485 78.0392 81.7086 78.2111 81.8336C78.383 81.9547 78.5822 82.0446 78.8088 82.1031C79.0392 82.1617 79.2853 82.191 79.547 82.191C79.8908 82.191 80.1779 82.1422 80.4084 82.0446C80.6427 81.9469 80.8185 81.8102 80.9357 81.6344C81.0529 81.4586 81.1115 81.2555 81.1115 81.025Z" fill="#6B6B6B"></path>',12)])]))}},KYt={key:0,width:"37",height:"129",viewBox:"0 0 37 129",fill:"none",xmlns:"http://www.w3.org/2000/svg"},WYt={key:1,width:"37",height:"129",viewBox:"0 0 37 129",fill:"none",xmlns:"http://www.w3.org/2000/svg"},JYt={__name:"KeyboardStorey",setup(t){const e=kt("$viewer"),i=qe(()=>e.i18n.locale==="fr");return(r,o)=>i.value?(P(),F("svg",KYt,[...o[0]||(o[0]=[Ys('<rect y="25" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M16.2509 38.4688L18.0614 41.5801L19.872 38.4688H21.5653L18.9872 42.6934L21.6298 47H19.9189L18.0614 43.8301L16.204 47H14.4872L17.1357 42.6934L14.5517 38.4688H16.2509Z" fill="#6B6B6B"></path><rect y="68.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M15.7763 88.3063L17.4755 81.691H18.3661L18.2665 83.3961L16.4501 90.2223H15.5243L15.7763 88.3063ZM14.5048 81.691L15.8817 88.2535L16.0048 90.2223H15.0204L13.0458 81.691H14.5048ZM20.2939 88.236L21.6532 81.691H23.1181L21.1435 90.2223H20.1591L20.2939 88.236ZM18.7118 81.691L20.3935 88.3239L20.6396 90.2223H19.7138L17.9267 83.3961L17.8329 81.691H18.7118Z" fill="#6B6B6B"></path><path d="M18 0L26 11H10L18 0Z" fill="#2F374A"></path><rect x="14" y="13" width="8" height="2" fill="#2F374A"></rect><rect x="14" y="17" width="8" height="4" fill="#2F374A"></rect><path d="M18 129L10 118L26 118L18 129Z" fill="#2F374A"></path><rect x="22" y="116" width="8" height="2" transform="rotate(-180 22 116)" fill="#2F374A"></rect><rect x="22" y="112" width="8" height="4" transform="rotate(-180 22 112)" fill="#2F374A"></rect>',10)])])):(P(),F("svg",WYt,[...o[1]||(o[1]=[Ys('<rect y="25" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M16.2509 38.4688L18.0614 41.5801L19.872 38.4688H21.5653L18.9872 42.6934L21.6298 47H19.9189L18.0614 43.8301L16.204 47H14.4872L17.1357 42.6934L14.5517 38.4688H16.2509Z" fill="#6B6B6B"></path><rect y="68.1112" width="36.1112" height="36.1112" rx="5" fill="#D8D8D8"></rect><path d="M21.2665 89.0563V90.2223H15.3427V89.0563H21.2665ZM21.1317 82.5992L15.8876 90.2223H14.9032V89.2906L20.165 81.691H21.1317V82.5992ZM20.5868 81.691V82.8629H14.9384V81.691H20.5868Z" fill="#6B6B6B"></path><path d="M18 0L26 11H10L18 0Z" fill="#2F374A"></path><rect x="14" y="13" width="8" height="2" fill="#2F374A"></rect><rect x="14" y="17" width="8" height="4" fill="#2F374A"></rect><path d="M18 129L10 118L26 118L18 129Z" fill="#2F374A"></path><rect x="22" y="116" width="8" height="2" transform="rotate(-180 22 116)" fill="#2F374A"></rect><rect x="22" y="112" width="8" height="4" transform="rotate(-180 22 112)" fill="#2F374A"></rect>',10)])]))}},ZYt={},XYt={width:"174",height:"130",viewBox:"0 0 174 130",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function YYt(t,e){return P(),F("svg",XYt,[...e[0]||(e[0]=[Ys('<path d="M33.1118 0.382324H131.606L141.853 99.4882H23.4L33.1118 0.382324Z" fill="#F2F2F2"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M22.9412 99.8706H142.235L131.988 0.305882V0H32.8059L23.0176 99.4882L22.9412 99.8706ZM141.394 99.1059H23.7823L33.4941 0.764706H131.3L141.394 99.1059Z" fill="#9E9E9E"></path><path d="M62.1705 9.86475L60.7941 46.953H103.771V9.86475H62.1705Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M60.4117 47.3354H104.153H104.229V9.48242H61.8647L60.4117 47.3354ZM103.388 46.5707H61.1764L62.5529 10.2471H103.388V46.5707Z" fill="#9E9E9E"></path><path d="M60.7942 46.9529L64.5412 61.7882H100.1L103.771 46.9529H60.7942Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M64.2353 62.1706H100.406L104.306 46.5706H60.3353L64.2353 62.1706ZM99.7942 61.4059H64.8471L61.3294 47.3353H103.312L99.7942 61.4059Z" fill="#9E9E9E"></path><path d="M85.2648 34.7939L85.0354 53.8351L90.0825 49.0175L97.806 49.5528L85.2648 34.7939Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M83.8118 57.5823L83.7354 31.5823L100.406 51.4646L90.3883 49.9352L83.8118 57.5823ZM85.8765 37.3176L85.953 51.9235L89.6236 47.6411L95.2824 48.4823L85.8765 37.3176Z" fill="black"></path><path d="M26.3059 128.241H25.9236C17.5883 128.241 10.7059 121.359 10.7059 113.024V100.253C10.7059 91.9178 17.5883 85.0354 25.9236 85.0354H26.3059C34.6412 85.0354 41.5236 91.9178 41.5236 100.253V113.024C41.5236 121.359 34.6412 128.241 26.3059 128.241Z" fill="white"></path><path d="M137.188 128.241H136.806C128.471 128.241 121.588 121.359 121.588 113.024V100.253C121.588 91.9178 128.471 85.0354 136.806 85.0354H137.188C145.524 85.0354 152.406 91.9178 152.406 100.253V113.024C152.406 121.359 145.524 128.241 137.188 128.241Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M25.4647 129.159H26.9942C35.6353 129.159 42.6706 122.2 42.5942 113.559V99.6413C42.5942 91.0766 35.6353 84.0413 26.9942 84.0413H25.4647C16.9 84.0413 9.86475 91.0001 9.86475 99.6413V113.559C9.86475 122.124 16.8236 129.159 25.4647 129.159ZM12.1589 99.5648C12.1589 92.2236 18.1236 86.2589 25.4647 86.2589H26.9942C34.3353 86.2589 40.3 92.2236 40.3 99.5648V113.482C40.3 120.824 34.3353 126.788 26.9942 126.788H25.4647C18.1236 126.788 12.1589 120.824 12.1589 113.482V99.5648Z" fill="#30374B"></path><path d="M26.3823 104.459C25.5411 104.459 24.8529 103.771 24.8529 102.929V98.4176C24.8529 97.5764 25.5411 96.8882 26.3823 96.8882C27.2235 96.8882 27.9117 97.5764 27.9117 98.4176V102.929C27.9117 103.771 27.2235 104.459 26.3823 104.459Z" fill="#30374B"></path><path d="M15.3706 84.1177C14.8353 84.1177 14.3765 83.6589 14.3765 83.1236V75.4765C14.3765 74.9412 14.8353 74.4824 15.3706 74.4824C15.9059 74.4824 16.3647 74.9412 16.3647 75.4765V83.1236C16.3647 83.6589 15.9059 84.1177 15.3706 84.1177Z" fill="#F8C62C"></path><path d="M9.63529 90.3884C9.63529 90.9237 9.17647 91.3825 8.64118 91.3825H0.994118C0.458824 91.3825 0 90.9237 0 90.3884C0 89.8531 0.458824 89.3943 0.994118 89.3943H8.64118C9.17647 89.3943 9.63529 89.8531 9.63529 90.3884Z" fill="#F8C62C"></path><path d="M11.9294 86.4117C11.5471 86.7941 10.8589 86.7941 10.4765 86.4117L3.74709 79.6823C3.36474 79.3 3.36474 78.6117 3.74709 78.2294C4.12944 77.847 4.81768 77.847 5.20003 78.2294L11.9294 84.9588C12.3118 85.3412 12.3118 86.0294 11.9294 86.4117Z" fill="#F8C62C"></path><path d="M87.7117 105.682H82.9706V100.941H80.8294V105.682H76.1647V107.747H80.8294V112.488H82.9706V107.747H87.7117V105.682Z" fill="#F8C62C"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M136.194 129.159H137.724C146.365 129.159 153.4 122.2 153.324 113.559V99.6413C153.324 91.0766 146.365 84.0413 137.724 84.0413H136.194C127.629 84.0413 120.594 91.0001 120.594 99.6413V113.559C120.594 122.124 127.553 129.159 136.194 129.159ZM122.888 99.5648C122.888 92.2236 128.853 86.2589 136.194 86.2589H137.724C145.065 86.2589 151.029 92.2236 151.029 99.5648V113.482C151.029 120.824 145.065 126.788 137.724 126.788H136.194C128.853 126.788 122.888 120.824 122.888 113.482V99.5648Z" fill="#30374B"></path><path d="M137.112 104.459C136.271 104.459 135.582 103.771 135.582 102.929V98.4176C135.582 97.5764 136.271 96.8882 137.112 96.8882C137.953 96.8882 138.641 97.5764 138.641 98.4176V102.929C138.641 103.771 137.953 104.459 137.112 104.459Z" fill="#30374B"></path><path d="M102.776 106.753L108.129 101.4C108.588 100.941 108.588 100.253 108.129 99.7941C107.671 99.3352 106.982 99.3352 106.524 99.7941L100.406 105.912C100.176 106.141 100.1 106.447 100.1 106.753C100.1 107.059 100.176 107.365 100.406 107.594L106.524 113.712C106.982 114.171 107.671 114.171 108.129 113.712C108.588 113.253 108.588 112.565 108.129 112.106L102.776 106.753Z" fill="#F8C62C"></path><path d="M171.218 106.753L165.865 101.4C165.406 100.941 165.406 100.253 165.865 99.7941C166.324 99.3352 167.012 99.3352 167.471 99.7941L173.588 105.912C173.818 106.141 173.894 106.447 173.894 106.753C173.894 107.059 173.818 107.365 173.588 107.594L167.471 113.712C167.012 114.171 166.324 114.171 165.865 113.712C165.406 113.253 165.406 112.565 165.865 112.106L171.218 106.753Z" fill="#F8C62C"></path>',20)])])}const $Yt=V(ZYt,[["render",YYt]]),e$t={},t$t={width:"42",height:"55",viewBox:"0 0 42 55",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function i$t(t,e){return P(),F("svg",t$t,[...e[0]||(e[0]=[Ys('<path d="M1.7192 47.4914L0.501465 10.6013H40.8298L40.3284 47.4914H1.7192Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M1.36104 47.8495H40.6866L41.188 10.2432H0.143311L1.36104 47.8495ZM39.9703 47.1332H2.07735L0.859623 10.9595H40.4717L39.9703 47.1332Z" fill="#9E9E9E"></path><path d="M4.29792 0.429688L0.501465 10.6013H40.8298L37.5348 0.429688H4.29792Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M0 10.9596H41.3312L37.7496 0H4.01135L0 10.9596ZM40.3284 10.2433H1.00284L4.51277 0.716312H37.2482L40.3284 10.2433Z" fill="#9E9E9E"></path><path d="M18.9312 23.0255C19.4326 23.0255 19.8624 22.5957 19.8624 22.0943V14.9312C19.8624 14.4298 19.4326 14 18.9312 14C18.4298 14 18 14.4298 18 14.9312V22.0943C18 22.5957 18.4298 23.0255 18.9312 23.0255Z" fill="#F8C62C"></path><path d="M24.3035 28.9708C24.3035 29.4722 24.7333 29.902 25.2347 29.902H32.3978C32.8992 29.902 33.329 29.4722 33.329 28.9708C33.329 28.4693 32.8992 28.0395 32.3978 28.0395H25.2347C24.7333 27.9679 24.3035 28.3977 24.3035 28.9708Z" fill="#F8C62C"></path><path d="M22.1546 25.2461C22.5128 25.6043 23.1575 25.6043 23.5156 25.2461L29.8192 18.9426C30.1773 18.5844 30.1773 17.9398 29.8192 17.5816C29.461 17.2234 28.8163 17.2234 28.4582 17.5816L22.1546 23.8852C21.7248 24.2433 21.7248 24.8164 22.1546 25.2461Z" fill="#F8C62C"></path><path d="M21.5855 31.4087L21.3477 51.0688L26.5798 46.0745L34.5865 46.6294L21.5855 31.4087Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M20.0793 54.9534L20 28L37.2819 48.6114L26.8969 47.0259L20.0793 54.9534ZM22.2197 33.9456L22.299 49.087L26.1041 44.6477L31.9705 45.5197L22.2197 33.9456Z" fill="black"></path>',9)])])}const r$t=V(e$t,[["render",i$t]]),o$t={},n$t={width:"124",height:"152",viewBox:"0 0 124 152",fill:"none",xmlns:"http://www.w3.org/2000/svg"};function s$t(t,e){return P(),F("svg",n$t,[...e[0]||(e[0]=[Ys('<path d="M10.5436 0.396484H112.649L123.272 103.216H0.475708L10.5436 0.396484Z" fill="#F2F2F2"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M0 103.612H123.668L113.046 0.317098V0H10.2264L0.0792746 103.216L0 103.612ZM122.876 102.819H0.951324L10.9399 0.792766H112.332L122.876 102.819Z" fill="#9E9E9E"></path><path d="M40.7472 10.2266L39.241 48.6747H83.7933V10.2266H40.7472Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M38.8446 49.071H84.1897H84.269V9.83008H40.3508L38.8446 49.071ZM83.4762 48.2783H39.7166L41.0643 10.6228H83.4762V48.2783Z" fill="#9E9E9E"></path><path d="M39.2408 48.6748L43.1253 64.0541H79.988L83.7932 48.6748H39.2408Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M42.8083 64.4503H80.3052L84.3482 48.2783H38.7653L42.8083 64.4503ZM79.671 63.6576H43.4425L39.7958 49.0711H83.3176L79.671 63.6576Z" fill="#9E9E9E"></path><path d="M64.6088 36.1494L64.371 55.8095L69.6031 50.8152L77.6098 51.3701L64.6088 36.1494Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M63.1026 59.6938L63.0233 32.7405L80.3052 53.3519L69.9202 51.7664L63.1026 59.6938ZM65.243 38.6861L65.3223 53.8275L69.1275 49.3881L74.9938 50.2602L65.243 38.6861Z" fill="black"></path><path d="M61.7549 130.724H61.3585C52.7176 130.724 45.5829 123.589 45.5829 114.948V101.709C45.5829 93.0686 52.7176 85.9338 61.3585 85.9338H61.7549C70.3958 85.9338 77.5306 93.0686 77.5306 101.709V114.948C77.5306 123.589 70.4751 130.724 61.7549 130.724Z" fill="white"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M44.7902 114.79C44.7902 124.144 52.4005 131.754 61.7549 131.754C71.1093 131.754 78.7197 124.065 78.7197 114.79V101.947C78.7197 92.5928 71.1093 84.9824 61.7549 84.9824C52.4005 84.9824 44.7902 92.5928 44.7902 101.947V114.79ZM47.1684 101.868C47.1684 93.8612 53.6689 87.2814 61.7549 87.2814C69.7617 87.2814 76.3415 93.7819 76.3415 101.868V114.71C76.3415 122.717 69.8409 129.297 61.7549 129.297C53.7482 129.297 47.1684 122.796 47.1684 114.71V101.868Z" fill="#30374B"></path><path d="M61.8341 106.069C60.9621 106.069 60.2487 105.356 60.2487 104.484V100.996C60.2487 100.124 60.9621 99.4104 61.8341 99.4104C62.7062 99.4104 63.4196 100.124 63.4196 100.996V104.484C63.4196 105.356 62.7062 106.069 61.8341 106.069Z" fill="#30374B"></path><path d="M61.8341 97.7457C60.9621 97.7457 60.2487 97.0322 60.2487 96.1602C60.2487 95.2882 60.9621 94.5747 61.8341 94.5747C62.7062 94.5747 63.4196 95.2882 63.4196 96.1602C63.4196 97.0322 62.7062 97.7457 61.8341 97.7457Z" fill="#30374B"></path><path d="M61.8341 110.826C60.9621 110.826 60.2487 110.113 60.2487 109.241C60.2487 108.369 60.9621 107.655 61.8341 107.655C62.7062 107.655 63.4196 108.369 63.4196 109.241C63.4196 110.113 62.7062 110.826 61.8341 110.826Z" fill="#30374B"></path><path d="M61.8342 142.298L67.3834 136.749C67.859 136.273 68.5725 136.273 69.0481 136.749C69.5238 137.224 69.5238 137.938 69.0481 138.414L62.7062 144.756C62.4684 144.993 62.1513 145.073 61.8342 145.073C61.5171 145.073 61.2 144.993 60.9621 144.756L54.6202 138.414C54.1445 137.938 54.1445 137.224 54.6202 136.749C55.0958 136.273 55.8093 136.273 56.2849 136.749L61.8342 142.298Z" fill="#F8C62C"></path><path d="M61.8342 149.195L67.3834 143.646C67.859 143.17 68.5725 143.17 69.0481 143.646C69.5238 144.121 69.5238 144.835 69.0481 145.311L62.7062 151.653C62.4684 151.89 62.1513 151.97 61.8342 151.97C61.5171 151.97 61.2 151.89 60.9621 151.653L54.6202 145.311C54.1445 144.835 54.1445 144.121 54.6202 143.646C55.0958 143.17 55.8093 143.17 56.2849 143.646L61.8342 149.195Z" fill="#F8C62C"></path>',15)])])}const a$t=V(o$t,[["render",s$t]]),l$t={name:"FirstPersonViewHelper",components:{KeyboardNavigate:QYt,KeyboardStorey:JYt,MouseMove:$Yt,MouseStorey:r$t,MouseZoom:a$t},emits:["close"],methods:{close(){this.$emit("close")},clear(){localStorage.setItem("firstPersonViewHelper","false"),this.close()}}},c$t={class:"bimdata-first-person-view-helper"},d$t={class:"bimdata-first-person-view-helper__header"},u$t={class:"bimdata-first-person-view-helper__content"},h$t={class:"bimdata-first-person-view-helper__content__main"},p$t={class:"bimdata-first-person-view-helper__content__main__left"},f$t={class:"bimdata-first-person-view-helper__content__main__left__element"},g$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},A$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},m$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},v$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},y$t={class:"bimdata-first-person-view-helper__content__main__left__element"},b$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},w$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},C$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},x$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},k$t={class:"bimdata-first-person-view-helper__content__main__left__element"},M$t={class:"bimdata-first-person-view-helper__content__main__left__element__picture"},E$t={class:"bimdata-first-person-view-helper__content__main__left__element__text"},B$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__tilte"},P$t={class:"bimdata-first-person-view-helper__content__main__left__element__text__list"},I$t={class:"bimdata-first-person-view-helper__content__main__right"},S$t={class:"bimdata-first-person-view-helper__content__main__right__title"},T$t={class:"bimdata-first-person-view-helper__content__main__right__content"},R$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture"},D$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture__element"},_$t={class:"bimdata-first-person-view-helper__content__main__right__content__picture__element"},L$t={class:"bimdata-first-person-view-helper__content__main__right__content__text"},F$t={class:"bimdata-first-person-view-helper__content__footer"},O$t={class:"bimdata-first-person-view-helper__footer-buttons"};function U$t(t,e,i,r,o,n){const s=R("KeyboardNavigate"),a=R("MouseMove"),l=R("MouseZoom"),c=R("MouseStorey"),d=R("KeyboardStorey"),u=R("BIMDataButton");return P(),F("div",c$t,[x("h1",d$t,Z(t.$t("viewer3d.firstPersonViewHelper.title")),1),x("div",u$t,[x("div",h$t,[x("div",p$t,[x("div",f$t,[x("div",g$t,[D(s)]),x("div",A$t,[x("h4",m$t,Z(t.$t("viewer3d.firstPersonViewHelper.keyboardUsage")),1),x("ul",v$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.forward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.backward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.left")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.right")),1)])])]),x("div",y$t,[x("div",b$t,[D(a)]),x("div",w$t,[x("h4",C$t,Z(t.$t("viewer3d.firstPersonViewHelper.mouseOrientation")),1),x("ul",x$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.pressLeft")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseMove")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseVertical")),1)])])]),x("div",k$t,[x("div",M$t,[D(l)]),x("div",E$t,[x("h4",B$t,Z(t.$t("viewer3d.firstPersonViewHelper.mouseZoom")),1),x("ul",P$t,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseWheelForward")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.mouseWheelBackward")),1)])])])]),x("div",I$t,[x("h4",S$t,Z(t.$t("viewer3d.firstPersonViewHelper.changeStorey")),1),x("div",T$t,[x("div",R$t,[x("div",D$t,[D(c)]),x("div",_$t,[D(d)])]),x("div",L$t,[x("ul",null,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.storeyClick")),1),x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.moveCameraToObject")),1)]),x("ul",null,[x("li",null,Z(t.$t("viewer3d.firstPersonViewHelper.keyboardStoreyChange")),1)])])])])]),x("div",F$t,Z(t.$t("viewer3d.firstPersonViewHelper.contentFooter")),1)]),x("div",O$t,[D(u,{color:"primary",fill:"",radius:"",width:"200px",onClick:n.close},{default:H(()=>[rt(Z(t.$t("viewer3d.firstPersonViewHelper.understand")),1)]),_:1},8,["onClick"]),D(u,{color:"primary",outline:"",radius:"",width:"200px",onClick:n.clear},{default:H(()=>[rt(Z(t.$t("viewer3d.firstPersonViewHelper.noRecall")),1)]),_:1},8,["onClick"])])])}const fhe=V(l$t,[["render",U$t],["__scopeId","data-v-77cce9d5"]]),N$t={components:{ShortcutsModal:eM,FirstPersonViewHelper:fhe},data(){const t=this.$t;return{tabs:[{id:0,get label(){return t("viewer3d.modals.3d")}},{id:1,get label(){return t("viewer3d.modals.firstPerson")}}],activeTab:0,elements:[{image:"shortcutRotate",title:this.$t("shortcuts-helper.title_rotate"),text:this.$t("shortcuts-helper.text_rotate")},{image:"shortcutZoom",title:this.$t("shortcuts-helper.title_zoom"),text:this.$t("shortcuts-helper.text_zoom")},{image:"shortcutOpen",title:this.$t("shortcuts-helper.title_open"),text:this.$t("shortcuts-helper.text_open")}],shortcuts:[{letter:"F",text:this.$t("context_menu.fit_view")},{letter:"C",text:this.$t("context_menu.select_all")},{letter:"V",text:this.$t("context_menu.deselect_all")},{letter:"H",text:this.$t("context_menu.hide")},{letter:"Y",text:this.$t("context_menu.select_similar")},{letter:"I",text:this.$t("context_menu.isolate")},{letter:"U",text:this.$t("context_menu.reintegrate")},{letter:"R",text:this.$t("context_menu.show_all")},{letter:"1",text:this.$t("shortcuts-helper.shortcut_1")},{letter:"2",text:this.$t("shortcuts-helper.shortcut_2")},{letter:"3",text:this.$t("shortcuts-helper.shortcut_3")},{letter:"4",text:this.$t("shortcuts-helper.shortcut_4")},{letter:"5",text:this.$t("shortcuts-helper.shortcut_5")},{letter:"6",text:this.$t("shortcuts-helper.shortcut_6")},{maj:!0,text:this.$t("shortcuts-helper.shortcut_pan"),illustration:"click"},{alt:!0,text:this.$t("shortcuts-helper.shortcut_open"),illustration:"click"},{shift:!0,text:this.$t("shortcuts-helper.shortcut_multiselect"),illustration:"click"}]}}},j$t={class:"bimdata-shortcuts-helper__header"};function H$t(t,e,i,r,o,n){const s=R("BIMDataTabs"),a=R("ShortcutsModal"),l=R("FirstPersonViewHelper");return P(),F("div",null,[x("div",j$t,[D(s,{tabs:o.tabs,width:"490px",height:"44px",tabSize:"245",onTabSelected:e[0]||(e[0]=c=>o.activeTab=o.tabs.indexOf(c)),selected:o.activeTab},null,8,["tabs","selected"])]),o.activeTab===0?(P(),Y(a,{key:0,elements:o.elements,shortcuts:o.shortcuts,onClose:e[1]||(e[1]=c=>t.$emit("close"))},{title:H(()=>[rt(Z(t.$t("shortcuts-helper.title_modal")),1)]),_:1},8,["elements","shortcuts"])):(P(),Y(l,{key:1,onClose:e[2]||(e[2]=c=>t.$emit("close"))}))])}const z$t=V(N$t,[["render",H$t],["__scopeId","data-v-a26872a0"]]),V$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M1.20102%2023.5V24.5H2.20102H10.261C11.4116%2029.9278%2016.2295%2034%2022%2034C27.7705%2034%2032.5884%2029.9278%2033.739%2024.5H41.799H42.799V23.5V20.5V19.5H41.799H33.739C32.5884%2014.0722%2027.7705%2010%2022%2010C16.2295%2010%2011.4116%2014.0722%2010.261%2019.5H2.20102H1.20102V20.5V23.5ZM14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C26.0764%2014.619%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",q$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M6.23222%2034.2322L5.52512%2034.9393L6.23222%2035.6464L8.35354%2037.7678L9.06065%2038.4749L9.76776%2037.7678L15.4677%2032.0678C17.3477%2033.2898%2019.592%2034%2022%2034C24.408%2034%2026.6523%2033.2898%2028.5323%2032.0678L34.2322%2037.7678L34.9393%2038.4749L35.6464%2037.7678L37.7678%2035.6465L38.4749%2034.9393L37.7678%2034.2322L32.0678%2028.5323C33.2898%2026.6523%2034%2024.408%2034%2022C34%2019.592%2033.2898%2017.3477%2032.0678%2015.4677L37.7678%209.76776L38.4749%209.06065L37.7678%208.35354L35.6464%206.23222L34.9393%205.52512L34.2322%206.23222L28.5322%2011.9322C26.6523%2010.7102%2024.408%2010%2022%2010C19.592%2010%2017.3477%2010.7102%2015.4677%2011.9322L9.76776%206.23224L9.06065%205.52513L8.35354%206.23224L6.23222%208.35356L5.52512%209.06066L6.23222%209.76777L11.9322%2015.4678C10.7102%2017.3477%2010%2019.592%2010%2022C10%2024.408%2010.7102%2026.6523%2011.9322%2028.5323L6.23222%2034.2322ZM14.619%2022C14.619%2017.9236%2017.9236%2014.6191%2022%2014.6191C26.0764%2014.6191%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",G$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3ccircle%20cx='22'%20cy='22'%20r='2'%20fill='%232F374A'/%3e%3cpath%20d='M14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C26.0764%2014.619%2029.381%2017.9236%2029.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C17.9236%2029.381%2014.619%2026.0764%2014.619%2022ZM22%2010C15.3726%2010%2010%2015.3726%2010%2022C10%2028.6274%2015.3726%2034%2022%2034C28.6274%2034%2034%2028.6274%2034%2022C34%2015.3726%2028.6274%2010%2022%2010Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",Q$t="data:image/svg+xml,%3csvg%20width='44'%20height='44'%20viewBox='0%200%2044%2044'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M14.619%2022C14.619%2017.9236%2017.9236%2014.619%2022%2014.619C23.8642%2014.619%2025.5667%2015.3094%2026.8665%2016.4504L14.7593%2023.4405C14.6673%2022.9751%2014.619%2022.4935%2014.619%2022ZM29.381%2022C29.381%2026.0764%2026.0764%2029.381%2022%2029.381C20.0879%2029.381%2018.3459%2028.6547%2017.0341%2027.4608L29.2136%2020.4289C29.3232%2020.9347%2029.381%2021.4602%2029.381%2022ZM22%2010C15.3726%2010%2010%2015.3726%2010%2022C10%2028.6274%2015.3726%2034%2022%2034C28.6274%2034%2034%2028.6274%2034%2022C34%2015.3726%2028.6274%2010%2022%2010Z'%20fill='%232F374A'%20stroke='white'%20stroke-width='2'/%3e%3c/svg%3e",K$t="data:image/svg+xml,%3csvg%20width='33'%20height='33'%20viewBox='0%200%2033%2033'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M1.70001%2016.8667V17.3667H2.20001H7.33335H7.83335V16.8667V16.1333V15.6333H7.33335L2.20001%2015.6333H1.70001V16.1333L1.70001%2016.8667ZM30.8%2017.3667H31.3V16.8667V16.1333V15.6333H30.8L25.6667%2015.6333H25.1667V16.1333V16.8667V17.3667H25.6667H30.8Z'%20fill='%232F374A'%20stroke='white'/%3e%3cpath%20d='M16.1333%201.70001L15.6333%201.70001L15.6333%202.20001L15.6333%207.33335L15.6333%207.83335L16.1333%207.83335L16.8667%207.83335L17.3667%207.83335L17.3667%207.33335L17.3667%202.20001L17.3667%201.70001L16.8667%201.70001L16.1333%201.70001ZM15.6333%2030.8L15.6333%2031.3L16.1333%2031.3L16.8667%2031.3L17.3667%2031.3L17.3667%2030.8L17.3667%2025.6667L17.3667%2025.1667L16.8667%2025.1667L16.1333%2025.1667L15.6333%2025.1667L15.6333%2025.6667L15.6333%2030.8Z'%20fill='%232F374A'%20stroke='white'/%3e%3c/svg%3e",W$t={0:{positions:[36.5625,31.640625,36.5625,19.51171875,36.42067337036133,16.11605453491211,35.99519348144531,13.020120620727539,35.28605651855469,10.223917961120605,34.293270111083984,7.727446556091309,33.01683044433594,5.530706882476807,30.959993362426758,3.3593661785125732,28.725576400756836,1.6479235887527466,26.31357765197754,.39637935161590576,23.723995208740234,-.39526674151420593,20.956830978393555,-.7270146012306213,20.3203125,-.73828125,17.307449340820312,-.5108020901679993,14.569392204284668,.17163534462451935,12.106142044067383,1.3090311288833618,9.917699813842773,2.9013850688934326,8.174575805664062,5.153988838195801,6.733142375946045,7.555612087249756,5.593398094177246,10.106253623962402,4.755343437194824,12.805914878845215,4.218978404998779,15.654594421386719,3.9843032360076904,18.652292251586914,3.97265625,19.51171875,3.97265625,31.640625,4.115384578704834,35.0230827331543,4.543569564819336,38.11090850830078,5.257210731506348,40.904109954833984,6.256308555603027,43.40268325805664,7.540863037109375,45.606624603271484,9.608292579650879,47.79111099243164,11.846480369567871,49.51402282714844,14.255425453186035,50.775352478027344,16.835128784179688,51.57510757446289,19.585588455200195,51.91328811645508,20.25,51.92578125,23.26165771484375,51.697608947753906,25.997068405151367,51.013092041015625,28.456228256225586,49.872230529785156,30.639141082763672,48.2750244140625,32.375572204589844,46.0158576965332,33.81153869628906,43.60895538330078,34.947044372558594,41.0543212890625,35.78208923339844,38.35194778442383,36.31666946411133,35.5018424987793,36.55078887939453,32.50400161743164,36.5625,31.640625,29.63671875,18.10546875,29.63671875,33.1171875,29.450082778930664,36.561954498291016,28.89017677307129,39.497215270996094,27.956998825073242,41.92298126220703,25.967069625854492,44.22639083862305,23.724157333374023,45.72625732421875,21.228260040283203,46.422576904296875,20.25,46.4765625,17.354780197143555,46.07659912109375,14.97888469696045,44.876708984375,13.33356761932373,42.470394134521484,12.110569953918457,39.9057731628418,11.309891700744629,37.1828498840332,10.931534767150879,34.30161666870117,10.8984375,33.1171875,10.8984375,18.10546875,11.085087776184082,14.669450759887695,11.645040512084961,11.733874320983887,12.578293800354004,9.298736572265625,14.569818496704102,6.974865436553955,16.804428100585938,5.454482555389404,19.282119750976562,4.737586975097656,20.3203125,4.67578125,23.212167739868164,5.077450752258301,25.581016540527344,6.282459735870361,27.21183204650879,8.69408893585205,28.425546646118164,11.263723373413086,29.2221622467041,13.991360664367676,29.6016788482666,16.877002716064453],indices:[0,2,1,2,4,3,4,6,5,6,8,7,8,10,9,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,63,62,61,24,62,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,0,45,0,4,2,4,8,6,8,12,10,12,16,14,16,20,18,20,24,22,24,64,63,60,24,61,24,28,26,28,32,30,32,36,34,36,40,38,40,44,42,44,4,0,4,12,8,12,20,16,20,64,24,59,24,60,24,32,28,32,40,36,40,4,44,20,65,64,58,24,59,20,66,65,57,24,58,12,66,20,57,32,24,12,67,66,56,32,57,12,68,67,55,32,56,12,69,68,54,32,55,12,70,69,53,32,54,12,71,70,53,40,32,4,71,12,52,40,53,4,72,71,51,40,52,4,73,72,50,40,51,4,74,73,49,40,50,4,75,74,48,40,49,4,76,75,47,40,48,40,76,4,76,40,47],width:32.58984375},1:{positions:[23.94140625,51.1875,23.94140625,0,17.015625,0,17.015625,44.4375,6.5390625,44.296875,6.5390625,49.2890625],indices:[0,2,1,3,5,4,0,3,2,3,0,5],width:17.40234375},2:{positions:[37.3359375,5.4140625,37.3359375,0,4.1484375,0,4.1484375,4.74609375,20.91796875,23.37890625,23.33412742614746,26.180971145629883,25.239078521728516,28.61744499206543,26.632823944091797,30.68832778930664,27.938528060913086,33.606327056884766,28.560094833374023,36.34145736694336,28.6171875,37.40625,28.23740577697754,40.36100769042969,27.09806251525879,42.90309143066406,24.87748908996582,45.0150146484375,22.4631290435791,46.19827651977539,20.4609375,46.4765625,17.237478256225586,46.17487716674805,14.632962226867676,45.26981735229492,12.647390365600586,43.76138687133789,11.200069427490234,41.599464416503906,10.360716819763184,38.91020965576172,10.125,36.10546875,3.48046875,36.10546875,3.41015625,36.31640625,3.580944538116455,39.24900436401367,4.255249977111816,41.95781326293945,5.433072566986084,44.442840576171875,7.114412784576416,46.704078674316406,9.256887435913086,48.52997589111328,11.61109447479248,49.96455383300781,14.177034378051758,51.007816314697266,16.954708099365234,51.659759521484375,19.944114685058594,51.920387268066406,20.4609375,51.92578125,23.575925827026367,51.698787689208984,26.37569808959961,51.01780319213867,28.86025619506836,49.88283157348633,31.029598236083984,48.29386901855469,32.93091583251953,46.07616424560547,34.31552505493164,43.65195846557617,35.18342971801758,41.0212516784668,35.53462600708008,38.18403625488281,35.54296875,37.65234375,35.271297454833984,34.8802490234375,34.45627975463867,32.10430145263672,33.097923278808594,29.324501037597656,31.655981063842773,27.067161560058594,29.948768615722656,24.73398208618164,27.976285934448242,22.324962615966797,26.12109375,20.25,12.65625,5.58984375,12.7265625,5.4140625],indices:[51,1,0,1,3,2,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,46,45,46,48,47,48,50,49,51,3,1,19,22,20,22,26,24,26,30,28,30,34,32,34,38,36,38,42,40,42,46,44,46,50,48,50,3,51,18,22,19,22,30,26,30,38,34,38,46,42,46,3,50,18,30,22,46,4,3,17,30,18,46,5,4,16,30,17,46,6,5,15,30,16,46,7,6,14,30,15,46,8,7,13,30,14,38,8,46,13,38,30,38,9,8,12,38,13,38,10,9,11,38,12,38,11,10],width:33.92578125},3:{positions:[13.640625,23.37890625,13.640625,28.79296875,19.6875,28.79296875,22.903934478759766,29.15167236328125,25.282482147216797,30.227783203125,26.954715728759766,32.621280670166016,27.896883010864258,35.25688171386719,28.125,37.51171875,27.781084060668945,40.67007064819336,26.749338150024414,43.162776947021484,24.544097900390625,45.051876068115234,22.03769302368164,46.1552734375,19.51171875,46.4765625,16.51466941833496,46.0916633605957,14.03652286529541,44.93696212768555,12.056009292602539,42.62509536743164,10.906388282775879,40.13740539550781,10.58203125,37.79296875,3.9375,37.79296875,3.8671875,38.00390625,4.073190689086914,40.847023010253906,4.870357036590576,43.464176177978516,6.258687496185303,45.85536193847656,8.649903297424316,47.949581146240234,11.105090141296387,49.6024169921875,13.624245643615723,50.81385803222656,16.207372665405273,51.58391189575195,18.854469299316406,51.912574768066406,19.51171875,51.92578125,22.69034194946289,51.71705627441406,25.550539016723633,51.090885162353516,28.09231185913086,50.04726028442383,30.315656661987305,48.58618927001953,32.206153869628906,46.54783248901367,33.6175651550293,44.22849655151367,34.54988479614258,41.62818145751953,35.00312423706055,38.74688720703125,35.05078125,37.37109375,34.68306350708008,34.60222244262695,33.579917907714844,31.84009552001953,31.788928985595703,29.416330337524414,29.652488708496094,27.526569366455078,27.38671875,26.26171875,30.2706241607666,24.998523712158203,32.5009765625,23.31671142578125,34.190120697021484,20.399517059326172,35.28596115112305,17.665790557861328,35.78849792480469,15.115530967712402,35.82421875,14.2734375,35.583168029785156,11.223187446594238,34.860015869140625,8.486950874328613,33.65475845336914,6.064727306365967,31.9674015045166,3.9565165042877197,29.64410972595215,2.185784339904785,27.159265518188477,.8323085308074951,24.512863159179688,-.10391119122505188,21.704906463623047,-.6228747963905334,19.51171875,-.73828125,16.397254943847656,-.535150945186615,13.541664123535156,.07424008101224899,10.9449462890625,1.089891791343689,8.607102394104004,2.5118041038513184,6.504549980163574,4.569301605224609,4.957869052886963,6.847413539886475,3.9670591354370117,9.34614086151123,3.5321204662323,12.065483093261719,3.515625,13.2890625,3.62109375,13.5,10.23046875,13.5,10.628458976745605,10.52513313293457,11.822431564331055,8.080921173095703,14.14232063293457,6.207763671875,16.670166015625,5.072887420654297,19.405969619750977,4.6762919425964355,19.51171875,4.67578125,22.593053817749023,5.02486515045166,25.119962692260742,6.072116374969482,27.08766746520996,8.277663230895996,28.33972930908203,10.727699279785156,28.876150131225586,13.422224998474121,28.8984375,14.1328125,28.579307556152344,17.37627601623535,27.621917724609375,19.90043067932129,25.462261199951172,21.754257202148438,22.976253509521484,22.91082000732422,20.163896560668945,23.3701229095459,19.6875,23.37890625],indices:[86,1,0,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,42,44,43,44,46,45,46,48,47,48,50,49,50,52,51,52,54,53,54,56,55,56,58,57,58,60,59,60,62,61,62,64,63,64,66,65,66,68,67,85,1,86,15,18,16,18,22,20,22,26,24,26,30,28,30,34,32,34,38,36,38,42,40,42,46,44,46,50,48,50,54,52,54,58,56,58,62,60,62,66,64,66,69,68,84,1,85,14,18,15,18,26,22,26,34,30,34,42,38,42,50,46,50,58,54,58,66,62,66,70,69,83,1,84,14,26,18,58,70,66,83,2,1,13,26,14,58,71,70,82,2,83,12,26,13,58,72,71,82,3,2,11,26,12,58,73,72,82,4,3,10,26,11,58,74,73,81,4,82,10,34,26,58,75,74,9,34,10,50,75,58,8,34,9,50,76,75,7,34,8,50,77,76,6,34,7,50,78,77,5,34,6,50,79,78,5,42,34,50,80,79,4,42,5,50,81,80,81,42,4,42,81,50],width:32.30859375},4:{positions:[31.81640625,51.1875,31.81640625,17.2265625,38.8828125,17.2265625,38.8828125,11.8125,31.81640625,11.8125,31.81640625,0,24.92578125,0,24.92578125,11.8125,1.93359375,11.8125,1.93359375,15.71484375,24.50390625,51.1875,31.81640625,51.1875,24.046875,39.515625,9.31640625,17.2265625,24.92578125,17.2265625,24.92578125,41.23828125,24.71484375,41.2734375],indices:[1,3,2,4,6,5,7,9,8,9,14,13,16,13,12,13,10,9,10,1,0,1,4,3,4,7,6,7,14,9,16,10,13,10,4,1,4,14,7,15,10,16,4,15,14,15,4,10],width:36.94921875},5:{positions:[11.91796875,22.5,6.15234375,23.09765625,9.10546875,51.1875,34.734375,51.1875,34.734375,45.03515625,14.9765625,45.03515625,13.2890625,30.65625,14.99853515625,31.75048828125,16.892578125,32.642578125,19.03271484375,33.25341796875,21.48046875,33.50390625,21.48046875,33.50390625,24.524171829223633,33.29277038574219,27.260135650634766,32.595733642578125,29.6883602142334,31.412792205810547,31.808847427368164,29.743946075439453,33.53106689453125,27.481525421142578,34.8779411315918,25.034576416015625,35.84947204589844,22.40309715270996,36.44565963745117,19.58709144592285,36.66650390625,16.586557388305664,36.66796875,16.3125,36.47660446166992,13.1383056640625,35.90251541137695,10.244234085083008,34.94569778442383,7.630287170410156,33.60615158081055,5.296463966369629,31.54420280456543,3.2312631607055664,29.28870391845703,1.597025990486145,26.839656829833984,.3937528729438782,24.197057723999023,-.3785564601421356,21.360912322998047,-.7199019193649292,20.49609375,-.73828125,17.404800415039062,-.5199803113937378,14.58151912689209,.13492262363433838,12.026251792907715,1.226427435874939,9.738997459411621,2.7545342445373535,7.902623653411865,4.662389278411865,6.586172580718994,6.943535327911377,5.78964376449585,9.59797191619873,5.513038158416748,12.625699043273926,5.51953125,13.25390625,5.58984375,13.46484375,11.84765625,13.46484375,12.231374740600586,10.424592018127441,13.382529258728027,7.983725547790527,15.769926071166992,6.059262275695801,18.29474449157715,4.960567474365234,20.49609375,4.67578125,23.407373428344727,5.077446937561035,25.80744171142578,6.282444000244141,27.603513717651367,8.744783401489258,28.85628890991211,11.317317962646484,29.565767288208008,14.000046730041504,29.7421875,16.2421875,29.464466094970703,19.35067367553711,28.631298065185547,22.06241226196289,26.50613021850586,24.628503799438477,24.30402374267578,26.380647659301758,22.024982452392578,27.31884002685547,20.49609375,27.4921875,17.11406707763672,27.2115478515625,14.758378028869629,26.369632720947266,13.049945831298828,24.7330322265625],indices:[2,4,3,6,8,7,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,36,38,37,38,40,39,40,42,41,2,5,4,6,9,8,12,16,14,16,20,18,20,24,22,24,28,26,28,32,30,32,36,34,36,40,38,40,43,42,1,5,2,12,20,16,20,28,24,28,36,32,36,43,40,1,6,5,36,44,43,1,9,6,36,45,44,28,45,36,28,46,45,28,47,46,28,48,47,28,49,48,20,49,28,20,50,49,20,51,50,20,52,51,20,53,52,20,54,53,20,55,54,12,55,20,12,56,55,12,57,56,12,58,57,12,59,58,12,60,59,12,61,60,1,11,9,11,61,12,62,1,0,1,61,11,61,1,62],width:31.154930591583252},6:{positions:[23.73046875,51.92578125,23.73046875,51.92578125,26.35400390625,51.7763671875,28.951171875,51.328125,31.31103515625,50.6513671875,33.22265625,49.81640625,33.22265625,49.81640625,31.74609375,44.5078125,29.98388671875,45.30322265625,28.142578125,45.931640625,26.09912109375,46.34033203125,23.73046875,46.4765625,23.73046875,46.4765625,20.900758743286133,46.15056610107422,18.386611938476562,45.17258071899414,16.18802833557129,43.5426025390625,14.465424537658691,41.076210021972656,13.138894081115723,38.50679397583008,12.208439826965332,35.8343505859375,11.67405891418457,33.05888366699219,11.53125,30.62109375,11.53125,29.8125,13.904020309448242,31.542055130004883,16.591995239257812,32.85417938232422,19.408527374267578,33.66147994995117,22.372249603271484,33.98829650878906,22.921875,33.99609375,25.913307189941406,33.7476806640625,28.614002227783203,33.002437591552734,31.023962020874023,31.7603702545166,33.143184661865234,30.021472930908203,34.91127014160156,27.67707633972168,36.273963928222656,25.183759689331055,37.23126983642578,22.541519165039062,37.783180236816406,19.750356674194336,37.93359375,17.2265625,37.749637603759766,14.08007526397705,37.19777297973633,11.182336807250977,36.27799606323242,8.533347129821777,34.99031066894531,6.1331071853637695,32.81218719482422,3.8232548236846924,30.5310001373291,1.9849358797073364,28.146751403808594,.6181499361991882,25.65943717956543,-.2771027684211731,23.069063186645508,-.7008222937583923,22.0078125,-.73828125,19.07733154296875,-.5163767337799072,16.358732223510742,.14933684468269348,13.852017402648926,1.2588595151901245,11.557185173034668,2.8121912479400635,9.638298988342285,5.0737128257751465,8.030496597290039,7.450648784637451,6.733777046203613,9.942998886108398,5.748140335083008,12.550763130187988,5.073586463928223,15.273941993713379,4.710115432739258,18.112533569335938,4.640625,20.07421875,4.640625,29.84765625,4.791966915130615,33.015262603759766,5.245992183685303,35.97719955444336,6.0027008056640625,38.73346710205078,7.062093257904053,41.28406524658203,8.424168586730957,43.62899398803711,10.08892822265625,45.768253326416016,12.196839332580566,47.81597900390625,14.478988647460938,49.4511604309082,16.93537712097168,50.673797607421875,19.56600570678711,51.483890533447266,22.370872497558594,51.881439208984375,21.375,28.828125,21.375,28.828125,18.29266357421875,28.514667510986328,15.669046401977539,27.57429313659668,13.216089248657227,25.754901885986328,11.53125,23.5546875,11.53125,23.5546875,11.53125,19.40625,11.72034740447998,16.05575180053711,12.287637710571289,13.114592552185059,13.233122825622559,10.582772254943848,15.422850608825684,7.959404945373535,17.641748428344727,6.1007585525512695,19.889812469482422,5.006833076477051,22.0078125,4.67578125,24.755970001220703,5.117502212524414,27.043012619018555,6.4426655769348145,28.768321990966797,9.139809608459473,30.00419807434082,11.825053215026855,30.75064468383789,14.498397827148438,31.007658004760742,17.15984344482422,31.0078125,17.2265625,30.737268447875977,20.334959030151367,29.925634384155273,23.062726974487305,28.57291030883789,25.409866333007812,26.557069778442383,27.331403732299805,24.112672805786133,28.470571517944336],indices:[2,4,3,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,61,60,61,63,62,63,65,64,65,67,66,21,25,23,25,29,27,29,33,31,33,37,35,37,41,39,41,45,43,45,49,47,49,53,51,53,57,55,57,61,59,61,65,63,65,68,67,21,29,25,29,37,33,37,45,41,45,53,49,57,65,61,57,68,65,73,57,74,68,2,1,2,6,4,6,8,7,53,75,57,72,57,73,68,6,2,6,9,8,53,76,75,71,57,72,68,9,6,53,77,76,70,57,71,68,10,9,53,78,77,68,12,10,53,79,78,68,13,12,45,79,53,68,14,13,45,80,79,68,15,14,45,81,80,57,15,68,45,82,81,57,16,15,45,83,82,57,17,16,45,84,83,57,18,17,37,84,45,57,19,18,37,85,84,57,20,19,37,86,85,57,21,20,37,87,86,70,21,57,37,88,87,70,29,21,37,89,88,95,29,70,37,90,89,94,29,95,29,90,37,93,29,94,29,91,90,92,29,93,29,92,91],width:33.29296875},7:{positions:[37.3359375,51.1875,37.3359375,45.73828125,35.06884002685547,42.96620559692383,32.99747848510742,40.27573776245117,31.121856689453125,37.666873931884766,29.441970825195312,35.13961410522461,27.957822799682617,32.6939582824707,26.669410705566406,30.329906463623047,25.576738357543945,28.047460556030273,24.585519790649414,25.34857940673828,23.679515838623047,22.592660903930664,22.85872459411621,19.779708862304688,22.123149871826172,16.909719467163086,21.47278594970703,13.982696533203125,20.907638549804688,10.998638153076172,20.427703857421875,7.957544803619385,20.109375,5.51953125,19.546875,0,12.62109375,0,13.18359375,5.51953125,13.624162673950195,8.682632446289062,14.162458419799805,11.7554292678833,14.798481941223145,14.737921714782715,15.532232284545898,17.630107879638672,16.363710403442383,20.431991577148438,17.29291534423828,23.14356803894043,18.319847106933594,25.764841079711914,19.59184455871582,28.50404167175293,20.94556999206543,31.184146881103516,22.381019592285156,33.80515670776367,23.898197174072266,36.367069244384766,25.497098922729492,38.86988830566406,27.17772674560547,41.31361389160156,28.940080642700195,43.6982421875,30.55078125,45.73828125,2.70703125,45.73828125,2.70703125,51.1875],indices:[36,1,0,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,28,30,29,30,32,31,32,34,33,34,36,35,15,18,16,18,22,20,22,26,24,26,30,28,30,34,32,34,1,36,14,18,15,18,26,22,26,34,30,34,2,1,13,18,14,18,34,26,34,3,2,12,18,13,34,4,3,11,18,12,34,5,4,10,18,11,34,6,5,9,18,10,34,7,6,8,18,9,34,8,7,8,34,18],width:34.62890625},8:{positions:[35.5078125,37.828125,35.5078125,37.828125,35.171749114990234,34.87995147705078,34.16355895996094,32.23108673095703,32.111854553222656,29.74087905883789,29.926387786865234,27.833354949951172,27.60715675354004,26.50851058959961,27.17578125,26.33203125,29.95149040222168,25.094419479370117,32.32651901245117,23.460092544555664,34.43555450439453,20.72713279724121,35.900413513183594,18.128986358642578,36.721099853515625,15.665656089782715,36.9140625,13.8515625,36.669769287109375,10.764041900634766,35.936893463134766,8.031349182128906,34.71543502807617,5.653482913970947,33.00539016723633,3.630444288253784,30.672534942626953,1.9876797199249268,28.159135818481445,.7305349111557007,25.465194702148438,-.14099019765853882,22.590709686279297,-.6268956065177917,20.28515625,-.73828125,17.073928833007812,-.5518752932548523,14.154998779296875,.007342617027461529,11.52836799621582,.9393724799156189,9.194035530090332,2.2442142963409424,7.087226867675781,4.249664306640625,5.474374294281006,6.483748912811279,4.355478763580322,8.946466445922852,3.730539560317993,11.637818336486816,3.5859375,13.8515625,3.9077277183532715,16.76708984375,4.873098373413086,19.430402755737305,6.983664512634277,21.999971389770508,9.1663179397583,24.03520965576172,11.421058654785156,25.536113739013672,13.21875,26.33203125,10.521642684936523,27.690086364746094,8.310940742492676,29.498327255249023,6.554880142211914,32.2148551940918,5.462681293487549,34.86786651611328,5.034343719482422,37.45735549926758,5.02734375,37.828125,5.274991512298584,40.936737060546875,6.0179338455200195,43.679622650146484,7.256171703338623,46.056785583496094,8.989704132080078,48.0682258605957,11.195730209350586,49.67716598510742,13.679861068725586,50.85453796386719,16.442096710205078,51.60033416748047,19.482437133789062,51.914554595947266,20.21484375,51.92578125,23.33972930908203,51.71018600463867,26.17371940612793,51.06340789794922,28.716812133789062,49.98543930053711,30.96900749206543,48.476287841796875,32.855812072753906,46.481101989746094,34.23870849609375,44.16929626464844,35.11769485473633,41.54087829589844,35.49277114868164,38.5958366394043,30.0234375,13.9921875,30.0234375,13.9921875,29.64218521118164,16.91078758239746,28.498428344726562,19.414352416992188,26.08045768737793,21.54735565185547,23.622779846191406,22.934738159179688,21.125396728515625,23.576496124267578,20.21484375,23.625,17.24955177307129,23.25731658935547,14.728343963623047,22.15427017211914,12.576437950134277,19.76153564453125,11.184748649597168,17.31914710998535,10.553275108337402,14.827102661132812,10.51171875,13.9921875,10.887092590332031,10.988458633422852,12.013215065002441,8.51321792602539,14.405669212341309,6.533318519592285,16.906885147094727,5.263905048370361,19.516860961914062,4.704977512359619,20.28515625,4.67578125,23.29867172241211,5.026233196258545,25.858081817626953,6.077588081359863,28.013742446899414,8.338984489440918,29.392438888549805,10.737264633178711,29.994173049926758,13.27242660522461,28.58203125,37.6875,28.58203125,37.6875,28.174694061279297,40.610374450683594,26.952680587768555,43.08668899536133,24.61227035522461,45.108375549316406,22.137697219848633,46.228328704833984,20.21484375,46.4765625,17.313322067260742,46.03565979003906,14.926724433898926,44.71294403076172,13.154691696166992,42.36640930175781,12.172061920166016,39.77567672729492,11.953125,37.6875,12.353304862976074,34.70274353027344,13.553845405578613,32.25563430786133,15.877814292907715,30.335918426513672,18.399682998657227,29.288454055786133,20.28515625,29.07421875,23.187891006469727,29.511512756347656,25.59459114074707,30.82339859008789,27.39614486694336,33.1435661315918,28.379940032958984,35.7212028503418],indices:[96,43,97,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,1,60,1,3,2,3,5,4,5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,75,74,73,31,74,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,98,97,95,43,96,43,47,45,47,51,49,51,55,53,55,59,57,59,3,1,3,7,5,7,11,9,11,15,13,15,19,17,19,23,21,23,27,25,27,31,29,31,76,75,72,31,73,31,35,33,37,41,39,41,98,43,94,43,95,43,51,47,51,59,55,59,7,3,7,15,11,15,23,19,23,31,27,31,77,76,71,31,72,31,37,35,37,98,41,94,51,43,23,77,31,70,31,71,37,99,98,93,51,94,23,78,77,70,37,31,37,100,99,92,51,93,23,79,78,69,37,70,37,101,100,91,51,92,23,80,79,68,37,69,37,102,101,90,51,91,23,81,80,67,37,68,37,103,102,89,51,90,15,81,23,66,37,67,89,59,51,15,82,81,66,103,37,88,59,89,15,83,82,65,103,66,87,59,88,15,84,83,64,103,65,106,59,87,15,85,84,64,104,103,105,59,106,15,62,85,63,104,64,104,59,105,15,63,62,104,7,59,7,63,15,63,7,104],width:33.328125},9:{positions:[17.96484375,4.67578125,17.96484375,4.67578125,20.832611083984375,5.023819923400879,23.333181381225586,6.067935943603516,25.466554641723633,7.80812931060791,26.91764259338379,9.993691444396973,28.0020751953125,12.483912467956543,28.7198543548584,15.278792381286621,29.070980072021484,18.378332138061523,29.109375,19.8984375,29.109375,22.21875,27.17138671875,20.02587890625,24.802734375,18.439453125,22.097061157226562,17.482282638549805,19.10603904724121,17.156333923339844,19.0546875,17.15625,15.962648391723633,17.374753952026367,13.161947250366211,18.030263900756836,10.65258502960205,19.12278175354004,8.43455982208252,20.652305603027344,6.556478023529053,22.870075225830078,5.067807197570801,25.25521469116211,3.968548536300659,27.80772590637207,3.2587015628814697,30.527606964111328,2.9382660388946533,33.414859771728516,2.91796875,34.3828125,3.1171858310699463,37.45964050292969,3.7148373126983643,40.29710006713867,4.710922718048096,42.89520263671875,6.105442523956299,45.253936767578125,8.45276927947998,47.5704231262207,10.840720176696777,49.39479446411133,13.269293785095215,50.72705078125,15.738492012023926,51.56719207763672,18.248313903808594,51.915218353271484,18.7734375,51.92578125,21.87710189819336,51.72084045410156,24.703197479248047,51.10601806640625,27.25172233581543,50.0813102722168,29.52267837524414,48.646724700927734,31.40683364868164,46.456634521484375,32.97002410888672,44.11880111694336,34.212249755859375,41.63322067260742,35.133514404296875,38.99989700317383,35.73381423950195,36.21882629394531,36.01314926147461,33.29001235961914,36.03515625,32.16796875,36.03515625,19.96875,35.885276794433594,16.642547607421875,35.435638427734375,13.59611988067627,34.686241149902344,10.8294677734375,33.6370849609375,8.34259033203125,32.28816604614258,6.135488033294678,30.066654205322266,3.964623212814331,27.738887786865234,2.2044835090637207,25.30486488342285,.8550683259963989,22.764589309692383,-.08362190425395966,20.118059158325195,-.6115872859954834,17.96484375,-.73828125,15.23583984375,-.61083984375,12.462890625,-.228515625,9.81298828125,.41748046875,7.453125,1.3359375,7.453125,1.3359375,8.5078125,6.64453125,10.62158203125,5.71728515625,12.814453125,5.115234375,15.21826171875,4.78564453125,17.96484375,4.67578125,19.0546875,22.5703125,19.0546875,22.5703125,22.15691566467285,22.88543701171875,24.769695281982422,23.830808639526367,27.256725311279297,25.793380737304688,28.883312225341797,27.970977783203125,29.109375,28.44140625,29.109375,32.87109375,28.917926788330078,36.28435516357422,28.34358024597168,39.213134765625,27.386337280273438,41.657432556152344,25.37175941467285,43.94849395751953,23.127288818359375,45.50687026977539,20.652921676635742,46.33256530761719,18.984375,46.4765625,16.33090591430664,46.012935638427734,13.984920501708984,44.62206268310547,12.139910697937012,42.07911682128906,10.835031509399414,39.48687744140625,10.070281982421875,36.84534454345703,9.84375,34.3828125,10.09748363494873,31.21339988708496,10.858684539794922,28.454280853271484,12.127352714538574,26.105453491210938,14.162574768066406,24.085222244262695,16.57485580444336,22.90838050842285],indices:[60,63,61,63,65,64,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,89,25,88,25,89,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,49,51,50,51,53,52,53,55,54,55,57,56,57,59,58,59,63,60,63,66,65,10,14,12,14,18,16,18,22,20,22,89,24,87,25,88,25,29,27,29,33,31,33,37,35,37,41,39,41,45,43,45,49,47,49,53,51,53,57,55,57,63,59,63,67,66,10,18,14,18,89,22,86,25,87,25,33,29,33,41,37,41,49,45,49,57,53,57,67,63,18,90,89,85,25,86,57,1,67,18,91,90,85,33,25,57,2,1,18,92,91,84,33,85,57,3,2,18,93,92,83,33,84,49,3,57,18,94,93,82,33,83,49,4,3,18,70,94,81,33,82,49,5,4,10,70,18,80,33,81,49,6,5,10,71,70,80,41,33,49,7,6,10,72,71,79,41,80,41,7,49,10,73,72,78,41,79,41,8,7,10,74,73,77,41,78,41,9,8,10,75,74,76,41,77,41,10,9,75,41,76,41,75,10],width:33.1171875},".":{positions:[12.5859375,7.1015625,12.5859375,0,5.66015625,0,5.66015625,7.1015625],indices:[3,1,0,1,3,2],width:6.92578125},m:{positions:[5.02734375,38.0390625,11.21484375,38.0390625,11.70703125,33.046875,13.634581565856934,35.28191375732422,15.986680030822754,37.00302505493164,18.700471878051758,38.111698150634766,21.567134857177734,38.6696662902832,23.09765625,38.7421875,26.139192581176758,38.42292022705078,28.791221618652344,37.465118408203125,31.15591812133789,35.599586486816406,32.90284729003906,33.37240219116211,33.71484375,31.7109375,35.408084869384766,34.171592712402344,37.503177642822266,36.16951370239258,40.22900390625,37.6488037109375,42.961280822753906,38.50468063354492,45.3515625,38.7421875,48.32835006713867,38.446842193603516,50.9460334777832,37.5608024597168,53.204620361328125,36.084068298339844,54.8843879699707,33.86517333984375,56.19401931762695,31.434070587158203,57.133506774902344,28.79076385498047,57.70286178588867,25.93524932861328,57.90207290649414,22.867528915405273,57.90234375,22.74609375,57.90234375,0,50.9765625,0,50.9765625,22.81640625,50.74445724487305,26.319555282592773,50.04814529418945,29.033550262451172,47.956382751464844,31.33014678955078,45.659942626953125,32.691036224365234,43.27734375,33.1171875,40.4267463684082,32.6451530456543,38.09538650512695,31.229045867919922,36.33670425415039,28.815231323242188,35.26606750488281,26.190664291381836,34.9453125,24.43359375,34.9453125,24.15234375,34.9453125,0,27.984375,0,27.984375,22.81640625,27.73810386657715,26.2243709564209,26.99928855895996,28.921852111816406,24.89556121826172,31.278352737426758,22.623031616210938,32.67652893066406,20.28515625,33.1171875,17.40234375,32.7919921875,15.08203125,31.81640625,13.2802734375,30.251953125,11.953125,28.16015625,11.953125,28.16015625,11.953125,0,5.02734375,0],indices:[55,1,0,2,4,3,4,6,5,6,8,7,8,10,9,10,12,11,12,14,13,14,16,15,16,18,17,18,20,19,20,22,21,22,24,23,24,26,25,26,28,27,40,42,41,54,1,55,2,6,4,6,10,8,12,16,14,16,20,18,20,24,22,24,28,26,39,42,40,54,2,1,2,10,6,12,20,16,20,28,24,38,42,39,20,29,28,38,43,42,20,30,29,37,43,38,20,31,30,36,43,37,20,32,31,36,44,43,20,33,32,35,44,36,20,34,33,35,45,44,12,34,20,12,35,34,12,45,35,10,45,12,10,46,45,10,47,46,10,48,47,2,48,10,2,49,48,2,50,49,2,51,50,2,53,51,53,2,54],width:52.875},c:{positions:[20.49609375,4.67578125,20.49609375,4.67578125,23.36757469177246,5.087423801422119,25.919267654418945,6.322350978851318,28.055252075195312,8.557517051696777,29.08038330078125,10.95840835571289,29.1796875,12.0234375,35.40234375,12.0234375,35.47265625,11.8125,35.209197998046875,9.178794860839844,34.224666595458984,6.713964939117432,32.519065856933594,4.418010711669922,29.943574905395508,2.4374680519104004,27.361528396606445,.9345490336418152,24.772926330566406,-.0907462015748024,22.177766799926758,-.6384177803993225,20.49609375,-.73828125,17.386640548706055,-.5293084979057312,14.578433990478516,.09760986268520355,12.071474075317383,1.142473816871643,9.86575984954834,2.605283260345459,7.9612932205200195,4.4860382080078125,6.3618083000183105,6.765913009643555,5.107275009155273,9.241913795471191,4.197693824768066,11.914040565490723,3.633063793182373,14.782294273376465,3.4133858680725098,17.8466739654541,3.41015625,18.28125,3.41015625,19.7578125,3.5838754177093506,22.87480926513672,4.105032920837402,25.780019760131836,4.973628997802734,28.473445892333984,6.189663410186768,30.95508575439453,7.753136157989502,33.22494125366211,9.646564483642578,35.16857147216797,11.828062057495117,36.69178771972656,14.297628402709961,37.79460144042969,17.05526351928711,38.47700500488281,20.100967407226562,38.73899841308594,20.49609375,38.7421875,23.570213317871094,38.5140495300293,26.36119842529297,37.82963943481445,28.869049072265625,36.6889533996582,31.093765258789062,35.09199523925781,33.085479736328125,32.87481689453125,34.484825134277344,30.467679977416992,35.29180145263672,27.87058448791504,35.5078125,25.13671875,35.4375,24.92578125,29.1796875,24.92578125,28.72093391418457,27.737882614135742,27.34467315673828,30.163320541381836,24.98297119140625,32.04195022583008,22.43872833251953,33.074039459228516,20.49609375,33.29296875,17.510202407836914,32.94111633300781,15.082853317260742,31.88556480407715,13.214049339294434,30.12630844116211,11.89155101776123,27.541250228881836,10.979540824890137,24.808610916137695,10.478017807006836,21.928388595581055,10.37109375,19.7578125,10.37109375,18.28125,10.565627098083496,15.065240859985352,11.149227142333984,12.176401138305664,12.121894836425781,9.614731788635254,13.855029106140137,7.324370861053467,15.960027694702148,5.741883754730225,18.4368896484375,4.867271423339844],indices:[5,7,6,7,9,8,9,11,10,11,13,12,13,15,14,15,17,16,17,19,18,19,21,20,21,23,22,23,25,24,25,27,26,27,29,28,29,31,30,31,33,32,33,35,34,35,37,36,37,39,38,39,41,40,41,43,42,43,45,44,45,47,46,47,49,48,4,7,5,7,11,9,11,15,13,15,19,17,19,23,21,23,27,25,27,31,29,31,35,33,35,39,37,39,43,41,43,47,45,47,50,49,3,7,4,7,15,11,15,23,19,23,31,27,31,39,35,39,47,43,47,51,50,3,15,7,39,51,47,2,15,3,39,52,51,39,53,52,39,54,53,39,55,54,31,55,39,31,56,55,31,57,56,31,58,57,23,58,31,23,59,58,23,60,59,23,61,60,23,62,61,23,63,62,23,64,63,23,65,64,23,66,65,15,66,23,15,67,66,15,68,67,15,1,68,1,15,2],width:32.09765625},k:{positions:[28.828125,0,16.48828125,17.54296875,11.98828125,17.54296875,11.98828125,0,5.0625,0,5.0625,54.84375,11.98828125,54.84375,11.98828125,23.0625,16.41796875,23.0625,26.82421875,38.0390625,35.12109375,38.0390625,22.11328125,20.7421875,36.984375,0],indices:[12,1,0,2,4,3,4,6,5,8,10,9,11,1,12,4,7,6,8,11,10,11,2,1,2,7,4,7,11,8,11,7,2],width:31.921875},t:{positions:[0,0,30,0],indices:[0,2,1],width:30}," ":{width:16,positions:[],indices:[]}};function J$t({text:t,size:e=1,zOffset:i=0}){const r=[],o=[];let n=0,s=0;const a=10;e/=100;for(const l of t){const c=W$t[l];if(!c)throw new Error("Unknown character: "+l);const d=s;for(let h=0;h<c.positions.length;h+=2)r.push(c.positions[h]*e+d,c.positions[h+1]*e,i);const u=n===0?0:n+1;for(const h of c.indices)o.push(h+u),n=Math.max(n,h+u);s+=(c.width+a)*e}return{positions:r,indices:o,primitive:"triangles"}}function ghe(t,{content:e,size:i,matrix:r,offset:o=0}){const{material:n,origin:s,plugin:a}=t,{textSizeRatio:l,textBottomMarginRatio:c,xeokitSdk:d,viewer:u}=a,{Mesh:h,VBOGeometry:p,math:g}=d,{scene:f}=u,{primitive:m,positions:A,indices:v}=J$t({text:e,size:i*l,zOffset:o});let y=A[0],b=A[0];for(let B=0;B<A.length;B+=3){const S=A[B];S<y&&(y=S),S>b&&(b=S)}const w=-(b-y)/2,C=g.mat4(),M=g.translationMat4v([w,i*c,0]);g.mulMat4(r,g.rotationMat4v(Math.PI,[0,1,0],g.mat4()),C),g.mulMat4(r,M),g.mulMat4(C,M);const E=new p(f,{primitive:m,positions:A,indices:v});return[new h(f,{geometry:E,material:n,pickable:!1,origin:s,matrix:r}),new h(f,{geometry:E,material:n,pickable:!1,origin:s,matrix:C})]}class Z$t{constructor(e,i,r){this.plugin=e;const{viewer:o}=e;this.line=null,this.texts=null,this.length=0;const{math:n,worldToRTCPos:s,Node:a,PhongMaterial:l}=e.xeokitSdk,c=n.vec3(),d=n.vec3();s(i,d,c),this.material=new l(o.scene,{emissive:NA(e.defaultColor)}),this.node=new a(o.scene,{pickable:!1,origin:d,children:[]}),this.origin=d,this.p1=c,this.normal=r}move(e,i){const{arrowSizeRatio:r,offsetRatio:o,xeokitSdk:n,viewer:s}=this.plugin,{math:a,Mesh:l,VBOGeometry:c}=n,{scene:d}=s,u=this.p1;this.p2=a.subVec3(e,this.origin),this.node.removeChildren(),this.line?.destroy();const h=a.subVec3(e,u,a.vec3());if(h.every(ee=>ee===0))return;const p=a.normalizeVec3(h,a.vec3()),g=a.mulVec3Scalar(p,-1,a.vec3()),f=a.lenVec3(h);this.length=f;const m=o*f;let A=0;const v=a.mulVec3Scalar(h,.5,a.vec3()),y=a.addVec3(u,v,a.vec3());let b=a.normalizeVec3(a.cross3Vec3(i,a.normalizeVec3(h,a.vec3()),a.vec3()));const w=a.dotVec3(i,this.normal)>.999,C=a.vec3([0,1,0]),M=a.dotVec3(p,C);if(w){const ee=Math.abs(M)<.01;A=m;let $=null;if(ee){const{look:re,up:ie,eye:fe}=d.camera,de=a.normalizeVec3(a.subVec3(re,fe,a.vec3())),Ae=a.cross3Vec3(de,ie);$=a.dotVec3(p,Ae)}else{const re=a.cross3Vec3(C,i,a.vec3());$=a.dotVec3(p,re)}$<0&&(b=a.negateVec3(b),A=-A)}else if(Math.abs(M)>.99){const{look:ee,eye:$}=d.camera,re=a.normalizeVec3(a.subVec3(ee,$,a.vec3()));b=a.normalizeVec3(a.cross3Vec3(p,re,a.vec3())),i=a.normalizeVec3(a.cross3Vec3(b,p,a.vec3()))}else i=a.normalizeVec3(a.cross3Vec3(C,p,a.vec3())),b=a.normalizeVec3(a.cross3Vec3(p,i,a.vec3())),a.dotVec3(b,C)<0&&(b=a.negateVec3(b));const E=a.negateVec3(b,a.vec3()),B=a.mulVec3Scalar(b,f*r,a.vec3()),S=a.mulVec3Scalar(E,f*r,a.vec3()),I=a.addVec3(u,B,a.vec3()),T=a.addVec3(u,S,a.vec3()),_=a.addVec3(e,B,a.vec3()),O=a.addVec3(e,S,a.vec3()),j=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(b,p,a.vec3())),f*r*Math.SQRT2),N=a.addVec3(u,j,a.vec3()),G=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(E,p,a.vec3())),f*r*Math.SQRT2),q=a.addVec3(u,G,a.vec3()),X=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(b,g,a.vec3())),f*r*Math.SQRT2),me=a.addVec3(e,X,a.vec3()),ce=a.mulVec3Scalar(a.normalizeVec3(a.addVec3(E,g,a.vec3())),f*r*Math.SQRT2),xe=a.addVec3(e,ce,a.vec3()),Re=a.translationMat4v(a.mulVec3Scalar(i,m,a.vec3()));this.line=new l(s.scene,{geometry:new c(s.scene,{primitive:"lines",positions:[...u,...e,...I,...T,..._,...O,...N,...q,...me,...xe],indices:[0,1,0,2,0,3,0,6,0,7,1,4,1,5,1,8,1,9]}),material:this.material,matrix:Re,pickable:!1,origin:this.origin}),this.node.addChild(this.line),this.texts?.forEach(ee=>ee.destroy());const ge=a.mat4([...p,0,...b,0,...i,0,...y,1]);this.texts=this._makeTexts(f.toFixed(2)+" m",f,ge,A),this.texts.forEach(ee=>this.node.addChild(ee))}_makeTexts(e,i,r,o=0){return ghe(this,{content:e,size:i,matrix:r,offset:o})}destroy(){this.node.destroy(),this.line?.destroy(),this.texts?.forEach(e=>e.destroy()),this.plugin.measurements=this.plugin.measurements.filter(e=>e!==this)}get visible(){return this.node.visible}set visible(e){this.node.visible=e}get color(){return hhe(this.material.emissive)}set color(e=this.plugin.defaultColor){this.material.emissive=NA(e)}}class Ahe{constructor(e,i,r={}){this.viewer=e,this.xeokitSdk=i,this.arrowSizeRatio=r.arrowSizeRatio??.04,this.textSizeRatio=r.textSizeRatio??.1,this.textBottomMarginRatio=r.textBottomMarginRatio??.02,this.offsetRatio=r.offsetRatio??.003,this.snapPickRadius=r.snapPickRadius??15,this.defaultColor=r.defaultColor??"#ffffff";const o=document.createElement("img"),n=e.scene.canvas.canvas;n.parentNode.insertBefore(o,n),o.style.width="28px",o.style.height="28px",o.style.position="absolute",o.style.pointerEvents="none",o.style.transform="translate(-50%, -50%)",o.style.display="none",this.imgElement=o,this.measurements=[],this.measurementEndCallbackId=0,this.measurementEndCallbacks={},this.control=new X$t(this)}on(e,i){if(e==="measurementEnd")return this.measurementEndCallbacks[this.measurementEndCallbackId++]=i,this.measurementEndCallbackId}off(e){this.measurementEndCallbacks[e]=null}}class X$t{constructor(e){this.plugin=e,this.currentMeasurement=null,this.lastPosition=null,this.mouseDown=!1,this.dragging=!1,this.activated=!1}_updateCursor(e){const{imgElement:i,viewer:r}=this.plugin,{scene:o}=r;o.canvas.canvas.style.cursor=`url("${K$t}") 16 16, auto`;const n=o.pick({canvasPos:e,snapRadius:this.plugin.snapPickRadius,snapToEdge:!0,snapToVertex:!0});if(n?.snappedWorldPos||n?.worldPos){if(n.snappedCanvasPos)i.style.left=`${n.snappedCanvasPos[0]}px`,i.style.top=`${n.snappedCanvasPos[1]}px`,i.src=n.snapType==="vertex"?q$t:V$t;else{const s=n.canvasPos;i.style.left=`${s[0]}px`,i.style.top=`${s[1]}px`,i.src=G$t}this.lastPosition=n.snappedWorldPos??n.worldPos,this.lastPosition.worldNormal=n.snappedWorldNormal??n.worldNormal}else i.style.left=`${e[0]}px`,i.style.top=`${e[1]}px`,i.src=Q$t,this.lastPosition=null}_onMouseMove(e){this.mouseDown&&(this.dragging=!0),e.preventDefault(),this._updateCursor([e.offsetX,e.offsetY]),this.lastPosition&&this.currentMeasurement?.move(this.lastPosition,this.lastPosition.worldNormal)}_onMouseDown(){this.mouseDown=!0}_onMouseUp(){this.mouseDown=!1;const e=this.dragging;this.dragging=!1,!e&&this.lastPosition&&(this.currentMeasurement?(this.plugin.measurements.push(this.currentMeasurement),Object.values(this.plugin.measurementEndCallbacks).forEach(i=>i?.(this.currentMeasurement)),this.currentMeasurement=null):this.currentMeasurement=new Z$t(this.plugin,this.lastPosition,this.lastPosition.worldNormal))}activate(){if(this.activated)return;const{canvas:e}=this.plugin.viewer.scene.canvas;this.plugin.imgElement.style.display="block";const i=this._onMouseMove.bind(this),r=this._onMouseDown.bind(this),o=this._onMouseUp.bind(this);e.addEventListener("mousemove",i),e.addEventListener("mousedown",r),document.addEventListener("mouseup",o),this._unsubscribe=()=>{e.removeEventListener("mousemove",i),e.removeEventListener("mousedown",r),document.removeEventListener("mouseup",o)},this.activated=!0}deactivate(){this.activated&&(this._unsubscribe?.(),this.currentMeasurement?.destroy(),this.currentMeasurement=null,this.lastPosition=null,this.plugin.imgElement.style.display="none",this.activated=!1)}}class Y$t{constructor(e,i){this.plugin=e;const{xeokitSdk:r,viewer:o}=e,{Mesh:n,ReadableGeometry:s,buildSphereGeometry:a,PhongMaterial:l,Node:c,math:d,worldToRTCPos:u}=r,h=d.vec3(),p=d.vec3();this._length=0;const{entity:g,worldPos:f}=i;u(f,p,h);const m=new l(o.scene,{emissive:NA(e.defaultColor),diffuse:[0,0,0]}),A=(C=!0)=>new n(o.scene,{geometry:new s(o.scene,a({radius:.03})),material:m,pickable:!1,visible:C,origin:p}),v=A(),y=A(!1),b=new n(o.scene,{geometry:new s(o.scene,{primitive:"lines",positions:[0,0,0,0,0,0],indices:[0,1]}),material:m,pickable:!1,visible:!1,origin:p}),w=new c(o.scene,{pickable:!1,visible:!0,position:h,origin:p,children:[v,b,y]});this.origin=p,this.modelId=g.model.id,this.node=w,this.toSphere=y,this.fromSphere=v,this.line=b,this.material=m}show(e){const{node:i,fromSphere:r,toSphere:o,line:n,texts:s,plugin:a}=this,{math:l}=a.xeokitSdk;i.position=l.subVec3(e.worldPos,i.origin,l.vec3()),i.visible=!0;const{viewer:c}=a,d=c.scene.pick({pickSurface:!0,origin:e.worldPos,direction:e.worldNormal});if(s&&(s.forEach(u=>u.destroy()),this.texts=null),d){o.visible=!0,n.visible=!0,o.position=l.subVec3(d.worldPos,o.origin,l.vec3()),o.position=l.subVec3(o.position,i.position,l.vec3()),n.position=l.vec3().set(i.position),n.geometry.positions=[0,0,0,...o.position];const u=l.lenVec3(o.position);this._length=u;const h=r.position,p=o.position,g=l.subVec3(p,h,l.vec3()),f=l.normalizeVec3(g,l.vec3()),m=l.mulVec3Scalar(g,.5,l.vec3()),A=l.addVec3(h,m,l.vec3()),v=[0,1,0],y=l.dotVec3(f,v),b=Math.abs(y)>.9;let w;if(b){const C=l.normalizeVec3(l.subVec3(c.scene.camera.eye,c.scene.camera.look,l.vec3()),l.vec3()),M=l.normalizeVec3(l.cross3Vec3(C,f,l.vec3()),l.vec3()),E=l.normalizeVec3(l.cross3Vec3(M,f,l.vec3()),l.vec3());w=l.mat4([...f,0,...M,0,...E,0,...A,1])}else{const C=l.normalizeVec3(l.cross3Vec3(v,f,l.vec3()),l.vec3()),M=l.normalizeVec3(l.cross3Vec3(f,C,l.vec3()),l.vec3());w=l.mat4([...f,0,...M,0,...C,0,...A,1])}this.texts=this._makeTexts(u.toFixed(2)+" m",u,w),this.texts.forEach(C=>i.addChild(C))}else o.visible=!1,n.visible=!1,this._length=0}hide(){this.node.visible=!1}destroy(){this.node.destroy(),this.line.destroy(),this.fromSphere.destroy(),this.toSphere.destroy(),this.texts?.forEach(e=>e.destroy())}set length(e){this._length=e}get length(){return this.visible?this._length:0}get visible(){return this.node.visible===!0}set visible(e){this.node.visible=!!e}get color(){return hhe(this.material.emissive)}set color(e=this.plugin.defaultColor){this.material.emissive=NA(e)}_makeTexts(e,i,r){return ghe(this,{content:e,size:i,matrix:r})}}class mhe{constructor(e,i,r={}){this.viewer=e,this.xeokitSdk=i,this.textSizeRatio=r.textSizeRatio??.1,this.textBottomMarginRatio=r.textBottomMarginRatio??.01,this.defaultColor=r.defaultColor??"#ffffff",this.measurements=[],this.measurementEndCallbackId=0,this.measurementEndCallbacks={},this.control=new $$t(this)}on(e,i){if(e==="measurementEnd")return this.measurementEndCallbacks[this.measurementEndCallbackId++]=i,this.measurementEndCallbackId}off(e){this.measurementEndCallbacks[e]=null}}class $$t{constructor(e){this.plugin=e,this.currentMeasure=null,this.pickedSpaceMeasureSubscription=null,this.hitHelperMouseMoveSubscription=null}activate(){const{plugin:e}=this,{viewer:i}=e;this.pickedSpaceMeasureSubscription=i.scene.input.on("mouseclicked",()=>{if(!this.currentMeasure?.length)return;const r=this.currentMeasure;this.currentMeasure=null,Object.values(this.plugin.measurementEndCallbacks).forEach(o=>o(r))}),this.hitHelperMouseMoveSubscription=i.scene.input.on("mousemove",r=>{const o=i.scene.pick({canvasPos:r,pickSurface:!0});o?.entity?.model&&(o?((!this.currentMeasure||this.currentMeasure.modelId!==o.entity.model.id)&&(this.currentMeasure?.destroy(),this.currentMeasure=new Y$t(this.plugin,o)),this.currentMeasure.show(o)):this.currentMeasure?.hide())})}deactivate(){const{viewer:e}=this.plugin;this.currentMeasure?.destroy(),this.currentMeasure=null,e.scene.input.off(this.pickedSpaceMeasureSubscription),e.scene.input.off(this.hitHelperMouseMoveSubscription)}}const eei=`onmessage = async event => {
1385
1385
  const sources = event.data;
1386
1386
  for (const source of sources) {
1387
1387
  const response = await fetch(source);
@@ -5314,7 +5314,7 @@ void main() {
5314
5314
  --bimdata-local-context-width: ${r.width}px;
5315
5315
  --bimdata-local-context-center-width: ${r.centerWidth}px;
5316
5316
  --bimdata-local-context-resolution: ${r.resolution};
5317
- `),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),x("div",zTi,[r.windowPlugins.leftSidePanel?(P(),Y(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ye("",!0),x("div",VTi,[(P(!0),F(lt,null,Vt(r.windowPlugins.free,h=>(P(),Y(l,{key:h.name,class:Me({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(P(),Y(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ye("",!0)]),r.loading?(P(),F("div",qTi,[r.spinner&&r.spinner.component?(P(),Y(So(r.spinner.component),uc(ka({key:0},r.spinner.props)),null,16)):(P(),Y(d,{key:1,size:"20px",border:"3px"}))])):ye("",!0),r.layoutSettingsDisplayed?(P(),F("div",GTi,[D(u)])):ye("",!0)],36)}const KTi=V(HTi,[["render",QTi],["__scopeId","data-v-485f288e"]]);let WTi=class{constructor(t=!0){const e=LSi(jY,null,{resizable:t});e.registerContent("default",KTi),this.settings=$n({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?FSi(t):null}copy(t,e=!0){return OSi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const i=new Set(t.windowState?.modelIds),r=new Set(e.windowState?.modelIds);return i.size===r.size&&[...i].every(o=>r.has(o))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((i,r)=>this.compare(i,e.children[r]))}};const JTi="2.15.0-beta.6",ZTi={version:JTi};let XTi=1;class YTi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.instanceId=XTi++,this.pluginManager=new xEi(e),this.windowManager=new MEi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new HIi(i),this.globalContext=new MTe(this),this.state=eSi(this),this.shortcutManager=vke(this.state),this.uiSettings=r||{},this.i18n=new xTe(o),this._contextMenu=null,this.layout=new WTi(this.uiSettings.resizable!==!1),this._darkTheme=ke(r?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return ZTi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Ake}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function $Ti(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const eRi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),K5=Object.freeze({READ:"read",WRITE:"write"});function f7e(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const tRi={token_scopes:[],usable_scopes:[],user_role:25};function g7e(t=tRi){const e=f7e(t.token_scopes),i=f7e(t.usable_scopes);return{...Nre(t),tokenScopes:e,usableScopes:i,userRole:eRi[t.user_role],user:t.user?Nre(t.user):null,hasBcfReadPermission:i.bcf?.includes(K5.READ)??!1,hasBcfWritePermission:i.bcf?.includes(K5.WRITE)??!1,hasModelReadPermission:i.model?.includes(K5.READ)??!1,hasModelWritePermission:i.model?.includes(K5.WRITE)??!1,hasDocReadPermission:i.document?.includes(K5.READ)??!1,hasDocWritePermission:i.document?.includes(K5.WRITE)??!1}}const iRi={back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis",documentsLabel:"Dokumente",documentsCount:"Dokumente \u2013 {count} ausgew\xE4hlte Dokumente",groupsLabel:"Berechtigungen",groupsCount:"Berechtigungen \u2013 {count} ausgew\xE4hlte Gruppen",groupsText:"W\xE4hlen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren d\xFCrfen.",validate:"Best\xE4tigen"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss",edited:"bearbeitet"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},rRi={BcfComponents:iRi},oRi={back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",groupsLabel:"Permissions",groupsCount:"Permissions - {count} selected groups",groupsText:"You are now setting the access rights: choose the user group(s) that will be exclusively authorized to see and interact with this topic.",validate:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},nRi={BcfComponents:oRi},sRi={back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},aRi={BcfComponents:sRi},lRi={back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",groupsLabel:"Permissions",groupsCount:"Permissions - {count} groupes s\xE9lectionn\xE9s",groupsText:"S\xE9lectionner les groupes utilisateur qui peuvent voir ce topic et int\xE9ragir avec.",validate:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edit\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},cRi={BcfComponents:lRi},dRi={back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},uRi={BcfComponents:dRi},hRi={de:rRi,en:nRi,es:aRi,fr:cRi,it:uRi},pRi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?Ir.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(hRi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(AOe).forEach(([o,n])=>{r.component(o,n)})}}),fRi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},gRi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},ARi={BuildingMaker:fRi,FileManager:gRi},mRi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},vRi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},yRi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},bRi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},wRi={title:"Photosphere Building"},CRi={BIMDataComponents:mRi,BuildingMaker:vRi,FileManager:yRi,MetaBuildingStructure:bRi,PhotosphereBuilding:wRi},xRi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},kRi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},MRi={BuildingMaker:xRi,FileManager:kRi},ERi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},BRi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},PRi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},IRi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},SRi={title:"Photosph\xE8re Building"},TRi={BIMDataComponents:ERi,BuildingMaker:BRi,FileManager:PRi,MetaBuildingStructure:IRi,PhotosphereBuilding:SRi},RRi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},DRi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},_Ri={BuildingMaker:RRi,FileManager:DRi},LRi={de:ARi,en:CRi,es:MRi,fr:TRi,it:_Ri},FRi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(LRi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(D0i).forEach(([i,r])=>{e.component(i,r)})}}),ORi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},URi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:tu,BIMDataClickInputAway:ORi},Symbol.toStringTag,{value:"Module"})),NRi=t=>({install(e){Object.entries(l0t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(URi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),jRi={name:"LiWrapper",render(){return sn("li",this.$slots.default())}};function HRi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const Tu=Ws("id"),zRi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(zd(yr("visible"),P0("selected"))).map(Tu)),predicate:()=>e.some(zd(yr("visible"),P0("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(yr("selected")).map(Tu)),predicate:()=>e.some(yr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(Tu);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(zd(yr("visible"),yr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(yr("selected")).map(Tu)),n=new Set(e.filter(yr("visible")).map(Tu));i.selectObjects(Array.from(HRi(n,o)),{exclusive:!0})},predicate:()=>e.some(zd(P0("selected"),yr("visible")))&&e.some(zd(yr("selected"),yr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(P0("visible")).map(Tu)),predicate:()=>e.some(P0("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(yr("selected"));o.length>0&&i.deselectObjects(o.map(Tu)),i.hideObjects(this.objectsToHide.map(Tu))},predicate(){return this.objectsToHide=e.filter(zd(yr("selected"),yr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(yr("visible"));o.some(yr("selected"))&&i.deselectObjects(o.filter(yr("selected")).map(Tu)),i.hideObjects(o.map(Tu))},predicate:()=>e.some(yr("visible"))}].filter(o=>o.predicate()),VRi={components:{LiWrapper:jRi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),zRi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},qRi={key:0,class:"separator"},GRi={class:"menu-text"},QRi={key:1,class:"menu-picto"},KRi={key:0,class:"context-menu__spinner"};function WRi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=Qi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Lt((P(),F("ul",{key:0,class:"bimdata-list context-menu",style:Ee(n.position)},[(P(!0),F(lt,null,Vt(o.currentCommands,(d,u)=>(P(),Y(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:H(()=>[n.isGroupIntersection(u)?(P(),F("div",qRi)):ye("",!0),x("div",GRi,Z(d.label),1),!d.component&&d.picto?(P(),F("span",QRi,Z(d.picto),1)):d.component?(P(),Y(s,{key:2,size:"xxs",class:"fill-primary"})):ye("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(P(),F("li",KRi,[D(l)])):ye("",!0)],4)),[[c,n.away]]):ye("",!0)}const JRi=V(VRi,[["render",WRi],["__scopeId","data-v-5b87d4a3"]]),ZRi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=kt("$viewer"),e=$n(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:qe(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:qe(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},XRi={class:"viewer-header"},YRi={class:"viewer-header__content"},$Ri={class:"viewer-header__content__left"},eDi={class:"viewer-header__content__right"},tDi={key:0,class:"m-l-6 flex items-center"},iDi={key:1,class:"viewer-header__version"};function rDi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Lt((P(),F("div",XRi,[x("div",YRi,[x("div",$Ri,[(P(!0),F(lt,null,Vt(r.headerLeftContentComponents,a=>(P(),Y(So(a),{key:a.name}))),128))]),x("div",eDi,[(P(!0),F(lt,null,Vt(r.headerRightContentComponents,a=>(P(),Y(So(a),{key:a.name}))),128))])]),r.logo||r.version?(P(),F("div",tDi,[r.logo?(P(),Y(s,{key:0,name:"logo",width:"30px",height:"30px"})):ye("",!0),r.version?(P(),F("div",iDi,Z(r.version),1)):ye("",!0)])):ye("",!0)],512)),[[hi,i.visible]])}const oDi=V(ZRi,[["render",rDi],["__scopeId","data-v-5c9ea6b6"]]),nDi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},sDi={class:"bimdata-separator"};function aDi(t,e,i,r,o,n){return P(),F("div",sDi,[e[1]||(e[1]=x("div",{class:"bimdata-separator__line"},null,-1)),x("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const lDi=V(nDi,[["render",aDi],["__scopeId","data-v-79a3b3af"]]),cDi={components:{Separator:lDi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=ke(null),i=ke(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Et(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},dDi={class:"bimdata-global-side-panel__component"};function uDi(t,e,i,r,o,n){const s=R("Separator");return P(),F("div",{class:"bimdata-global-side-panel",style:Ee(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(P(),Y(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ye("",!0),x("div",dDi,[(P(),Y(So(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(P(),Y(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ye("",!0)],4)}const hDi=V(cDi,[["render",uDi],["__scopeId","data-v-82d0d4cb"]]),pDi={name:"BimdataViewer",components:{ContextMenu:JRi,ViewerHeader:oDi,ModalManager:u7e,GlobalSidePanel:hDi},setup(){const t=kt("$viewer"),{globalContext:e,shortcutManager:i}=t;hr(()=>{i&&i.destroy(),e.hub.clear()}),Gi(()=>{t.pluginManager.runPluginsScripts(t)});const r=qe(()=>t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),o=qe(()=>t.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?t.version:null),n=qe(()=>e.leftSidePanel),s=qe(()=>e.rightSidePanel),a=qe(()=>{const p=t.uiSettings.header!==!1,g=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(n.value||s.value);return p&&(!g||f)}),l=t.uiSettings.contextMenu!==!1,c=ke(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:qe(()=>e.loading),spinner:qe(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},fDi={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},gDi={key:2,class:"viewer__logo"},ADi={key:1,class:"version m-t-6"};function mDi(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return P(),F("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(P(),Y(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ye("",!0),D(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),x("div",{class:"bimdata-viewer__content",style:Ee(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(P(),Y(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ye("",!0),(P(),Y(So(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(P(),Y(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ye("",!0)],4),r.loading?(P(),F("div",fDi,[r.spinner&&r.spinner.component?(P(),Y(So(r.spinner.component),uc(ka({key:0},r.spinner.props)),null,16)):(P(),Y(d,{key:1,size:"40px",border:"5px"}))])):ye("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(P(),F("div",gDi,[r.bimdataLogoOnSingleWindow?(P(),Y(u,{key:0,name:"logo"})):ye("",!0),r.viewerVersionOnSingleWindow?(P(),F("div",ADi,Z(r.version),1)):ye("",!0)])):ye("",!0)],544)}const vDi=V(pDi,[["render",mDi],["__scopeId","data-v-0c1c941a"]]),yDi=["src"],bDi={class:"bimdata-models__header"},wDi={key:0,class:"bimdata-models__header__loader"},CDi={class:"bimdata-models__header__picto"},xDi={class:"bimdata-models__header__name"},kDi={key:0,class:"bimdata-models__header__name--empty"},MDi={key:1,class:"bimdata-models__header__name--empty"},EDi={key:3},BDi=["onMousemove","onClick"],PDi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=kt("$viewer"),r=ke(),o=ke(0),n=ke(0),s=ke(),a=or([]),l=ke(!1),c=qe(()=>i.localContext.loadedModels),d=qe(()=>i.localContext.loadedModelIds),u=qe(()=>i.localContext.loadingModelIds),h=qe(()=>i.localContext.multiModel),p=qe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(C=>c.value.find(M=>M.document?.head_id!=null&&M.document.head_id===C.document.id)??C)),g=C=>d.value.includes(C),f=C=>u.value.includes(C),m=qe(()=>{const{x:C,y:M}=s.value?.getBoundingClientRect()??{x:0,y:0};return`top:${n.value-M}px; left:${o.value-C}px;`}),A=C=>{!h.value&&g(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},v=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(C,M)=>{C?.viewer_360_file&&(o.value=M.clientX,n.value=M.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(M=>i.state.models.some(E=>E.archived)||!M.archived).sort(nu("updated_at",!1))}catch(M){console.error("[Models] Cannot get project models. Error: ",M)}finally{l.value=!1}return[]},w=C=>C.children?.some(M=>g(M.id))??!1;return b(i.localContext.modelTypes).then(C=>{a.value=C}),(C,M)=>{const E=R("BIMDataSpinner"),B=R("BIMDataIconModel3D"),S=R("BIMDataTextbox"),I=R("BIMDataCheckbox"),T=R("BIMDataRadio"),_=R("BIMDataIcon"),O=R("BIMDataDropdownList");return P(),F("div",{ref_key:"templateRef",ref:s,class:Me(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(P(),F("div",{key:0,class:"bimdata-models__preview",style:Ee(m.value)},[x("img",{src:r.value},null,8,yDi)],4)):ye("",!0),D(O,{style:Ee(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:A},{header:H(({isOpen:j})=>[x("div",bDi,[l.value||u.value.length>0?(P(),F("div",wDi,[D(E)])):(P(),F(lt,{key:1},[x("div",CDi,[D(B)]),x("div",{class:Me(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[x("span",null,Z(d.value.length),1)],2),x("div",xDi,[p.value.length===0?(P(),F("span",kDi,Z(C.$t("model.no_model")),1)):d.value.length===0?(P(),F("span",MDi,Z(C.$t("model.no_loaded_model")),1)):d.value.length===1?(P(),Y(S,{key:2,text:c.value[0].name,tooltip:!j},null,8,["text","tooltip"])):d.value.length>1?(P(),F("span",EDi,Z(C.$t("model.selected_models")),1)):ye("",!0)])],64))])]),element:H(({element:j,close:N})=>[x("div",{class:"bimdata-models__model",onMousemove:G=>t.preview&&y(j,G),onMouseout:M[0]||(M[0]=G=>t.preview&&y()),onClick:()=>{!h.value&&!g(j.id)&&N()}},[h.value?(P(),Y(I,{key:0,"model-value":g(j.id)||w(j),disabled:j.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(P(),Y(T,{key:1,"model-value":g(j.id)||w(j),disabled:j.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(_,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(j.status),size:"xs",class:Me({"fill-success":j.status==="C","fill-high":j.status==="E"})},null,8,["name","class"]),D(S,{class:Me({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":j.status!=="C"||u.value.length>0}),text:j.name,width:`calc(100% -
5317
+ `),onMouseenter:e[0]||(e[0]=(...h)=>r.onMouseEnter&&r.onMouseEnter(...h)),onMouseleave:e[1]||(e[1]=(...h)=>r.onMouseLeave&&r.onMouseLeave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),x("div",zTi,[r.windowPlugins.leftSidePanel?(P(),Y(a,{key:0,plugin:r.windowPlugins.leftSidePanel},null,8,["plugin"])):ye("",!0),x("div",VTi,[(P(!0),F(lt,null,Vt(r.windowPlugins.free,h=>(P(),Y(l,{key:h.name,class:Me({"window-container__content__center__viewer":h.isViewer}),plugin:h},null,8,["class","plugin"]))),128)),D(c,{position:"left",plugins:r.windowPlugins.leftButtonColumn},null,8,["plugins"]),D(c,{position:"right",plugins:r.windowPlugins.rightButtonColumn},null,8,["plugins"])]),r.windowPlugins.rightSidePanel?(P(),Y(a,{key:1,plugin:r.windowPlugins.rightSidePanel},null,8,["plugin"])):ye("",!0)]),r.loading?(P(),F("div",qTi,[r.spinner&&r.spinner.component?(P(),Y(So(r.spinner.component),uc(ka({key:0},r.spinner.props)),null,16)):(P(),Y(d,{key:1,size:"20px",border:"3px"}))])):ye("",!0),r.layoutSettingsDisplayed?(P(),F("div",GTi,[D(u)])):ye("",!0)],36)}const KTi=V(HTi,[["render",QTi],["__scopeId","data-v-485f288e"]]);let WTi=class{constructor(t=!0){const e=LSi(jY,null,{resizable:t});e.registerContent("default",KTi),this.settings=$n({edit:!1,swap:!1,full:!1}),this.areas=e}get resizable(){return this.areas.resizable}set resizable(t){this.areas.resizable=t}apply(t=null){this.areas.layout=t?FSi(t):null}copy(t,e=!0){return OSi(this.areas.layout,t,e)}open({ratio:t,direction:e,insertAfter:i,windowName:r=null,windowState:o=null,localContextId:n=null}={}){const s=r?{options:{windowName:r,windowState:o}}:null;return n===null?this.areas.splitLayout(t,e,i,s):this.areas.split(n,t,e,i,s)}swap(t,e){return this.areas.swap(t,e)}close(t){return this.areas.delete(t)}compare(t,e){if(!t&&!e)return!0;if(!t||!e)return!1;if(typeof t=="string"&&typeof e=="string")return t===e;if(typeof t=="string"||typeof e=="string")return!1;if(t.windowName&&e.windowName){if(t.windowName!==e.windowName)return!1;const i=new Set(t.windowState?.modelIds),r=new Set(e.windowState?.modelIds);return i.size===r.size&&[...i].every(o=>r.has(o))}return t.windowName||e.windowName||t.direction!==e.direction||t.children.length!==e.children.length?!1:t.children.every((i,r)=>this.compare(i,e.children[r]))}};const JTi="2.15.0-beta.7",ZTi={version:JTi};let XTi=1;class YTi{constructor({plugins:e,api:i,ui:r,locale:o="fr"}){this.instanceId=XTi++,this.pluginManager=new xEi(e),this.windowManager=new MEi,this.windowManager.registerAndAddPluginsToWindows([...this.pluginManager.registeredPlugins.values()]),this.api=new HIi(i),this.globalContext=new MTe(this),this.state=eSi(this),this.shortcutManager=vke(this.state),this.uiSettings=r||{},this.i18n=new xTe(o),this._contextMenu=null,this.layout=new WTi(this.uiSettings.resizable!==!1),this._darkTheme=ke(r?.darkTheme??!1),this.localContext=null,window.$viewer=this}get darkTheme(){return this._darkTheme.value}set darkTheme(e){this._darkTheme.value=e}get version(){return ZTi.version}get locale(){return this.i18n.locale}get contextMenu(){return this._contextMenu||Ake}set contextMenu(e){this._contextMenu=e}get registeredWindows(){return[...this.windowManager.registeredWindows.keys()]}get registeredPlugins(){return[...this.pluginManager.registeredPlugins.keys()]}get pluginsCfg(){return this.pluginManager.cfg}registerPlugin(e){this.pluginManager.registerPlugin(e),this.windowManager.registerAndAddPluginsToWindows([e])}}function $Ti(t,e={}){e.backgroundColor&&(t.style.setProperty("--bimdata-viewer-background-color",e.backgroundColor),e.backgroundColor==="transparent"&&t.style.setProperty("--areas-separator-color","transparent")),e.colorPrimary&&t.style.setProperty("--color-primary",e.colorPrimary),e.colorPrimaryLighter&&t.style.setProperty("--color-primary-lighter",e.colorPrimaryLighter),e.colorPrimaryLight&&t.style.setProperty("--color-primary-light",e.colorPrimaryLight),e.colorPrimaryDark&&t.style.setProperty("--color-primary-dark",e.colorPrimaryDark),e.colorSecondary&&t.style.setProperty("--color-secondary",e.colorSecondary),e.colorSecondaryLighter&&t.style.setProperty("--color-secondary-lighter",e.colorSecondaryLighter),e.colorSecondaryLight&&t.style.setProperty("--color-secondary-light",e.colorSecondaryLight),e.colorSecondaryDark&&t.style.setProperty("--color-secondary-dark",e.colorSecondaryDark),e.colorSilverLight&&t.style.setProperty("--color-silver-light",e.colorSilverLight),e.colorSilver&&t.style.setProperty("--color-silver",e.colorSilver),e.colorSilverDark&&t.style.setProperty("--color-silver-dark",e.colorSilverDark),e.colorGraniteLight&&t.style.setProperty("--color-granite-light",e.colorGraniteLight),e.colorGranite&&t.style.setProperty("--color-granite",e.colorGranite),e.colorSuccess&&t.style.setProperty("--color-success",e.colorSuccess),e.colorSuccessLighter&&t.style.setProperty("--color-success-Lighter",e.colorSuccessLighter),e.colorSuccessLight&&t.style.setProperty("--color-success-Light",e.colorSuccessLight),e.colorSuccessDark&&t.style.setProperty("--color-success-Dark",e.colorSuccessDark),e.colorWarning&&t.style.setProperty("--color-warning",e.colorWarning),e.colorWarningLighter&&t.style.setProperty("--color-warning-Lighter",e.colorWarningLighter),e.colorWarningLight&&t.style.setProperty("--color-warning-Light",e.colorWarningLight),e.colorWarningDark&&t.style.setProperty("--color-warning-Dark",e.colorWarningDark),e.colorHigh&&t.style.setProperty("--color-high",e.colorHigh),e.colorHighLighter&&t.style.setProperty("--color-high-lighter",e.colorHighLighter),e.colorHighLight&&t.style.setProperty("--color-high-light",e.colorHighLight),e.colorHighDark&&t.style.setProperty("--color-high-dark",e.colorHighDark),e.colorText&&t.style.setProperty("--color-text",e.colorText),(!e.backgroundColor||e.backgroundColor!=="transparent")&&t.style.setProperty("--areas-separator-color","rgba(216, 216, 216, 1)"),e.headerHeight!=null&&t.style.setProperty("--bimdata-viewer-header-height",e.headerHeight),t.style.setProperty("--areas-background-color","transparent")}const eRi=Object.freeze({25:"GUEST",50:"USER",100:"ADMIN"}),K5=Object.freeze({READ:"read",WRITE:"write"});function f7e(t){const e={};return t.forEach(i=>{const[r,o]=i.split(":");e[r]?e[r].push(o):e[r]=[o]}),e}const tRi={token_scopes:[],usable_scopes:[],user_role:25};function g7e(t=tRi){const e=f7e(t.token_scopes),i=f7e(t.usable_scopes);return{...Nre(t),tokenScopes:e,usableScopes:i,userRole:eRi[t.user_role],user:t.user?Nre(t.user):null,hasBcfReadPermission:i.bcf?.includes(K5.READ)??!1,hasBcfWritePermission:i.bcf?.includes(K5.WRITE)??!1,hasModelReadPermission:i.model?.includes(K5.READ)??!1,hasModelWritePermission:i.model?.includes(K5.WRITE)??!1,hasDocReadPermission:i.document?.includes(K5.READ)??!1,hasDocWritePermission:i.document?.includes(K5.WRITE)??!1}}const iRi={back:"Zur\xFCck",BcfFilters:{filtersButton:"Filter",filtersTitle:"Filter",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",creatorsLabel:"Erstellt von",tagsLabel:"Tags",resetButton:"Zur\xFCcksetzen",searchButton:"Suchen",undefined:"Nicht definiert",datePlaceholder:"Erstellungsdatum"},BcfSettings:{title:"BCF-Parameter",text:"Erstellen, f\xFCllen und listen Sie die BCF-Einstellungen auf, die Sie f\xFCr dieses Projekt haben m\xF6chten.",validateButton:"Die BCF-Parameter anerkennen"},BcfStatistics:{emptyText:"F\xFCgen Sie Fragen hinzu, um zugeh\xF6rige Statistiken hier anzuzeigen.",issues:"Probleme",extension:{Priority:"Priorit\xE4t",PriorityNotDefined:"Keine Priorit\xE4t",PriorityTitle:"Priorit\xE4ten",Status:"Status",StatusNotDefined:"Kein Status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priorit\xE4t",noPriority:"Keine",assignedTo:"Zugewiesen an",elements:"Elemente",notSpecified:"Nicht definiert",see:"Anzeigen"},BcfTopicCreationCard:{text:"Ein neues BCF-Thema erstellen",createBcfSideTitle:"Ein Problem melden"},BcfTopicForm:{dragDropImageText:"Bitte w\xE4hlen Sie eine Datei aus.",addObjectButton:"Objekt",addAnnotationButton:"Annotation",annotationButtonTooltip:"Zu diesem Thema gibt es derzeit keine Ansichten.",addPictureButton:"F\xFCgen Sie ein Bild hinzu.",titlePlaceholder:"Titel *",titleErrorMessage:"Titel fehlt",typeLabel:"Typ",priorityLabel:"Priorit\xE4t",statusLabel:"Status",stageLabel:"Phase",assignedToLabel:"Zugewiesen an",dueDateLabel:"F\xE4lligkeitsdatum (TT.MM.JJJJ)",descriptionLabel:"Beschreibung",labelsLabel:"Tags",createButton:"Best\xE4tigen",updateButton:"\xC4nderungen \xFCbernehmen",modalText:"Sie sind dabei, die Bearbeitung der Ausgabe {Name} zu beenden, aber es gibt noch ungespeicherte \xC4nderungen.",cancelButton:"\xC4nderungen verwerfen",continueButton:"\xC4nderungen fortsetzen",createTitle:"Ein Problem melden",dragDropImageTextTablet:"Foto machen",takeSnapshot:"Mach einen Schnappschuss",importFile:"Eine Datei importieren",searchPlaceholder:"Suchen",emptySearch:"kein Ergebnis",documentsLabel:"Dokumente",documentsCount:"Dokumente \u2013 {count} ausgew\xE4hlte Dokumente",groupsLabel:"Berechtigungen",groupsCount:"Berechtigungen \u2013 {count} ausgew\xE4hlte Gruppen",groupsText:"W\xE4hlen Sie die Benutzergruppen aus, die dieses Thema sehen und damit interagieren d\xFCrfen.",validate:"Best\xE4tigen"},BcfTopicOverview:{openViewer:"Im Viewer \xF6ffnen",openViewerNoModels:"Es sind keine Vorlagen zur Ansicht bereit",elements:"{count} Elemente",noElements:"kein Element",type:"Typ",noTypeSpecified:"Kein Typ angegeben",description:"Beschreibung",noDescriptionProvided:"Keine Beschreibung angegeben",assignedTo:"Zugeteilt an",notAssigned:"Nicht zugewiesen",dueDate:"F\xE4lligkeitsdatum",noDueDate:"Kein F\xE4lligkeitsdatum",informations:"Informationen",status:"Status",noStatusSpecified:"Kein Status angegeben",stage:"Phase",noStageProvided:"Keine Phase angegeben",priority:"Priorit\xE4t",priorityNotDefined:"Nicht definiert",tags:"Tags",noTags:"Keine Tags",commentButton:"Ein Kommentar ver\xF6ffentlichen",deleteText:"Sie l\xF6schen jetzt {Name}",deleteBcfButton:"Dieses BCF l\xF6schen",keepBcfButton:"Dieses BCF beibehalten",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE4t",status:"Status",title:"Titel",creator:"Autor",date:"Datum"}},BcfTopicActionsCell:{seeButton:"Anzeigen"},BcfTopicComments:{commentButton:"Ein Kommentar verfassen",commentLabel:"Ein Kommentar verfassen",commentText:"Kommentar",cancelButton:"Abbrechen",publishButton:"Ver\xF6ffentlichen",commentsText:"Kommentare",deleteCommentText:"Diesen Kommentar l\xF6schen?",deleteButton:"L\xF6schen",takeSnapshot:"Mach einen Schnappschuss",edited:"bearbeitet"},BcfTopicPriorityCell:{noPriority:"Keine"},SettingCard:{addButton:"ein Element hinzuf\xFCgen",cancelButton:"Abbrechen",validateButton:"Best\xE4tigen",deleteExtensionText:"Diesen Parameter l\xF6schen",deleteButton:"L\xF6schen",title:{Priority:"Priorit\xE4ten",Label:"Tags",Status:"Status",Type:"Typen",Stage:"Phasen"},input:{Priority:"Eine neue Priorit\xE4t hinzuf\xFCgen",Label:"Ein neues Etikett hinzuf\xFCgen",Status:"Einen neuen Status hinzuf\xFCgen",Type:"Einen neuen Typ hinzuf\xFCgen",Stage:"Eine neue Phase hinzuf\xFCgen"},text:{Priority:"Liste der Priorit\xE4ten",Label:"Liste von Tags",Status:"Liste der Status",Type:"Liste der Typen",Stage:"Liste der Phasen"}}},rRi={BcfComponents:iRi},oRi={back:"Back",BcfFilters:{filtersButton:"Filters",filtersTitle:"Filters",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",creatorsLabel:"Created by",tagsLabel:"Tags",resetButton:"Reset",searchButton:"Search",undefined:"Not defined",datePlaceholder:"Creation date"},BcfSettings:{title:"BCF Settings",text:"Create, enter in, and list the BCF settings you would like to have for this project",validateButton:"Validate BCF settings"},BcfStatistics:{emptyText:"Add BCF Topics to start to have some stats here.",issues:"issues",extension:{Priority:"Priority",PriorityNotDefined:"No priority",PriorityTitle:"Priorities",Status:"Status",StatusNotDefined:"No status",StatusTitle:"Status"}},BcfTopicCard:{priority:"Priority",noPriority:"None",assignedTo:"Assigned to",elements:"Elements",notSpecified:"Not specified",see:"See"},BcfTopicCreationCard:{text:"Create a new BCF topic",createBcfSideTitle:"Report a problem"},BcfTopicForm:{dragDropImageText:"Please select a file",addObjectButton:"Object",addAnnotationButton:"Annotation",annotationButtonTooltip:"This topic has no viewpoint",addPictureButton:"Add a picture",titlePlaceholder:"Title *",titleErrorMessage:"Missing title",typeLabel:"Type",priorityLabel:"Priority",statusLabel:"Status",stageLabel:"Stage",assignedToLabel:"Assigned to",dueDateLabel:"Due date",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Validate",updateButton:"Modify this BCF",modalText:"You are about to quit editing issue {name} but there are unsaved changes.",cancelButton:"Discard changes",continueButton:"Continue editing",createTitle:"Report a problem",dragDropImageTextTablet:"Take a picture",takeSnapshot:"Take a snapshot",importFile:"Import a file",searchPlaceholder:"Search",emptySearch:"No result",documentsLabel:"Add a file",documentsCount:"Files - {count} selected files",groupsLabel:"Permissions",groupsCount:"Permissions - {count} selected groups",groupsText:"You are now setting the access rights: choose the user group(s) that will be exclusively authorized to see and interact with this topic.",validate:"Validate"},BcfTopicOverview:{openViewer:"Open in viewer",openViewerNoModels:"No model to open",elements:"{count} Elements",noElements:"No element",type:"Type",noTypeSpecified:"No type specified",description:"Description",noDescriptionProvided:"No description provided",assignedTo:"Assigned to",notAssigned:"Not assigned",dueDate:"Due date",noDueDate:"No due date",informations:"Informations",status:"Status",noStatusSpecified:"No status specified",stage:"Stage",noStageProvided:"No stage provided",priority:"Priority",priorityNotDefined:"Not defined",tags:"Tags",noTags:"No tags",commentButton:"Post a comment",deleteText:"You are about to delete {name}",deleteBcfButton:"Delete this BCF",keepBcfButton:"Keep this BCF",author:"Author"},BcfTopicsTable:{headers:{index:"#",priority:"Priority",status:"Status",title:"Title",creator:"Author",date:"Date"}},BcfTopicActionsCell:{seeButton:"See"},BcfTopicComments:{commentButton:"Post a comment",commentLabel:"Post a comment",commentText:"Comment",cancelButton:"Cancel",publishButton:"Publish",commentsText:"Comments",deleteCommentText:"Delete this comment ?",deleteButton:"Delete",takeSnapshot:"Take a snapshot",edited:"edited"},BcfTopicPriorityCell:{noPriority:"None"},SettingCard:{addButton:"add an element",cancelButton:"Cancel",validateButton:"Validate",deleteExtensionText:"Remove this setting",deleteButton:"Delete",title:{Priority:"Priorities",Label:"Labels",Status:"Status",Type:"Types",Stage:"Stages"},input:{Priority:"Add a new priority",Label:"Add a new label",Status:"Add new status",Type:"Add a new type",Stage:"Add a new stage"},text:{Priority:"Priority list",Label:"Labels list",Status:"Status list",Type:"Type list",Stage:"Stage list"}}},nRi={BcfComponents:oRi},sRi={back:"Volver",BcfFilters:{filtersButton:"Filtros",filtersTitle:"Filtros",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",creatorsLabel:"Creado por",tagsLabel:"Etiquetas:",resetButton:"Restablecer",searchButton:"Buscar en",undefined:"No definido",datePlaceholder:"Fecha de creaci\xF3n"},BcfSettings:{title:"Par\xE1metros del BCF",text:"Cree, rellene y enumere los par\xE1metros del BCF que desea tener en este proyecto",validateButton:"Validar los par\xE1metros del BCF"},BcfStatistics:{emptyText:"A\xF1ada preguntas para ver las estad\xEDsticas asociadas aqu\xED.",issues:"problemas",extension:{Priority:"Prioridad",PriorityNotDefined:"Sin prioridad",PriorityTitle:"Prioridades",Status:"Estado",StatusNotDefined:"Sin estado",StatusTitle:"Estatutos"}},BcfTopicCard:{priority:"Prioridad",noPriority:"Sin",assignedTo:"Asignado a",elements:"Elementos",notSpecified:"No definido",see:"Ver"},BcfTopicCreationCard:{text:"Crear un nuevo tema BCF",createBcfSideTitle:"Informar de un problema"},BcfTopicForm:{dragDropImageText:"Seleccione un archivo",addObjectButton:"Objeto",addAnnotationButton:"Anotaci\xF3n",annotationButtonTooltip:"Actualmente este tema no posee ning\xFAn punto de vista",addPictureButton:"A\xF1adir una imagen",titlePlaceholder:"T\xEDtulo *",titleErrorMessage:"Falta el t\xEDtulo",typeLabel:"Tipo",priorityLabel:"Prioridad",statusLabel:"Estado",stageLabel:"Fase",assignedToLabel:"Asignado a",dueDateLabel:"Fecha de vencimiento (DD/MM/AAAA)",descriptionLabel:"Descripci\xF3n",labelsLabel:"Etiquetas",createButton:"Validar",updateButton:"Modificar este BCF",modalText:"Est\xE1 a punto de salir de la edici\xF3n del problema de {name} pero hay cambios sin guardar.",cancelButton:"Cancelar los cambios",continueButton:"Continuar con los cambios",createTitle:"Informar de un problema",dragDropImageTextTablet:"Tomar una fotograf\xEDa",takeSnapshot:"Tomar un snapshot",importFile:"Importar un archivo",searchPlaceholder:"Buscar",emptySearch:"No hay resultados"},BcfTopicOverview:{openViewer:"Abrir en el visor",openViewerNoModels:"No hay ning\xFAn modelo listo para la visualizaci\xF3n",elements:"{count} Elementos",noElements:"Ning\xFAn elemento",type:"Tipo",noTypeSpecified:"No se especifica el tipo",description:"Descripci\xF3n",noDescriptionProvided:"No hay descripci\xF3n",assignedTo:"Asignado a",notAssigned:"No asignado",dueDate:"Plazo",noDueDate:"Sin fecha de vencimiento",informations:"Informaci\xF3n",status:"Estado",noStatusSpecified:"No se especifica el estado",stage:"Fase",noStageProvided:"No se indica ninguna fase",priority:"Prioridad",priorityNotDefined:"No definido",tags:"Etiquetas",noTags:"Sin etiquetas",commentButton:"Publicar un comentario",deleteText:"Est\xE1s a punto de borrar {name}",deleteBcfButton:"Borrar este BCF",keepBcfButton:"Mantenga este BCF",author:"Autor"},BcfTopicsTable:{headers:{index:"#",priority:"Prioridad",status:"Estado",title:"T\xEDtulo",creator:"Autor",date:"Fecha"}},BcfTopicActionsCell:{seeButton:"Ver"},BcfTopicComments:{commentButton:"Publicar un comentario",commentLabel:"Publicar un comentario",commentText:"Comentario",cancelButton:"Cancelar",publishButton:"Publicar",commentsText:"comentarios",deleteCommentText:"\xBFBorrar este comentario?",deleteButton:"Borrar",takeSnapshot:"Tomar un snapshot"},BcfTopicPriorityCell:{noPriority:"Sin"},SettingCard:{addButton:"a\xF1adir un elemento",cancelButton:"Cancelar",validateButton:"Validar",deleteExtensionText:"Borrar esta configuraci\xF3n",deleteButton:"Borrar",title:{Priority:"Prioridades",Label:"Etiquetas:",Status:"Estatutos",Type:"Tipos",Stage:"Fases"},input:{Priority:"A\xF1adir una nueva prioridad",Label:"A\xF1adir una nueva etiqueta",Status:"A\xF1adir un nuevo estado",Type:"A\xF1adir un nuevo tipo",Stage:"A\xF1adir una nueva fase"},text:{Priority:"Lista de prioridades",Label:"Lista de etiquetas",Status:"Lista de estatutos",Type:"Lista de tipos",Stage:"Lista de fases"}}},aRi={BcfComponents:sRi},lRi={back:"Retour",BcfFilters:{filtersButton:"Filtres",filtersTitle:"Filtres",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",creatorsLabel:"Cr\xE9\xE9 par",tagsLabel:"Tags",resetButton:"R\xE9initialiser",searchButton:"Rechercher",undefined:"Non d\xE9fini",datePlaceholder:"Date de cr\xE9ation"},BcfSettings:{title:"Param\xE8tres BCF",text:"Cr\xE9ez, renseignez et listez les param\xE8tres BCF que vous souhaitez avoir sur ce projet",validateButton:"Valider les param\xE8tres BCF"},BcfStatistics:{emptyText:"Ajoutez des questions pour voir les statistiques associ\xE9es ici.",issues:"probl\xE8mes",extension:{Priority:"Priorit\xE9",PriorityNotDefined:"Aucune priorit\xE9",PriorityTitle:"Priorit\xE9s",Status:"Statut",StatusNotDefined:"Aucun statut",StatusTitle:"Statuts"}},BcfTopicCard:{priority:"Priorit\xE9",noPriority:"Aucune",assignedTo:"Assign\xE9 \xE0",elements:"{n} \xC9lements",notSpecified:"Non d\xE9fini",see:"Voir"},BcfTopicCreationCard:{text:"Cr\xE9er un nouveau topic BCF",createBcfSideTitle:"Signaler un probl\xE8me"},BcfTopicForm:{dragDropImageText:"Veuillez s\xE9lectionner un fichier",addObjectButton:"Objet",addAnnotationButton:"Annotation",annotationButtonTooltip:"Ce topic ne poss\xE8de actuellement aucun point de vue",addPictureButton:"Ajouter une image",titlePlaceholder:"Titre *",titleErrorMessage:"Titre manquant",typeLabel:"Type",priorityLabel:"Priorit\xE9",statusLabel:"Statut",stageLabel:"Phase",assignedToLabel:"Assign\xE9 \xE0",dueDateLabel:"Date d'\xE9ch\xE9ance",descriptionLabel:"Description",labelsLabel:"Tags",createButton:"Valider",updateButton:"Modifier ce BCF",modalText:"Vous \xEAtes sur le point de quitter l'\xE9dition de l'issue {name} mais il y'a des modifications non enregistr\xE9es.",cancelButton:"Annuler les modifications",continueButton:"Continuer les modifications",createTitle:"Signaler un probl\xE8me",dragDropImageTextTablet:"Prendre une photo",takeSnapshot:"Prendre un snapshot",importFile:"Importer un fichier",searchPlaceholder:"Rechercher",emptySearch:"Pas de r\xE9sultat",documentsLabel:"Documents",documentsCount:"Documents - {count} documents s\xE9lectionn\xE9s",groupsLabel:"Permissions",groupsCount:"Permissions - {count} groupes s\xE9lectionn\xE9s",groupsText:"S\xE9lectionner les groupes utilisateur qui peuvent voir ce topic et int\xE9ragir avec.",validate:"Valider"},BcfTopicOverview:{openViewer:"Ouvrir dans le viewer",openViewerNoModels:"Il n'y a aucun mod\xE8le pr\xEAt pour une visualisation",elements:"{count} \xC9lements",noElements:"Aucun \xE9l\xE9ment concern\xE9",type:"Type",noTypeSpecified:"Pas de type sp\xE9cifi\xE9",description:"Description",noDescriptionProvided:"Pas de description renseign\xE9e",assignedTo:"Assign\xE9 \xE0",notAssigned:"Non assign\xE9",dueDate:"\xC9ch\xE9ance",noDueDate:"Pas de date d'\xE9ch\xE9ance",informations:"Informations",status:"Statut",noStatusSpecified:"Pas de statut sp\xE9cifi\xE9",stage:"Phase",noStageProvided:"Pas de phase renseign\xE9e",priority:"Priorit\xE9",priorityNotDefined:"Non d\xE9fini",tags:"Tags",noTags:"Pas de tags",commentButton:"Poster un commentaire",deleteText:"Vous \xEAtes sur le point de supprimer {name}",deleteBcfButton:"Supprimer ce BCF",keepBcfButton:"Conserver ce BCF",author:"Auteur"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE9",status:"Statut",title:"Titre",creator:"Auteur",date:"Date"}},BcfTopicActionsCell:{seeButton:"Voir"},BcfTopicComments:{commentButton:"Poster un commentaire",commentLabel:"Poster un commentaire",commentText:"Commentaire",cancelButton:"Annuler",publishButton:"Publier",commentsText:"commentaires",deleteCommentText:"Supprimer ce commentaire ?",deleteButton:"Supprimer",takeSnapshot:"Prendre un snapshot",edited:"edit\xE9"},BcfTopicPriorityCell:{noPriority:"Aucune"},SettingCard:{addButton:"ajouter un \xE9l\xE9ment",cancelButton:"Annuler",validateButton:"Valider",deleteExtensionText:"Supprimmer ce param\xE8tre",deleteButton:"Supprimer",title:{Priority:"Priorit\xE9s",Label:"Tags",Status:"Statuts",Type:"Types",Stage:"Phases"},input:{Priority:"Ajouter une nouvelle priorit\xE9",Label:"Ajouter un nouveau label",Status:"Ajouter un nouveau statut",Type:"Ajouter un nouveau type",Stage:"Ajouter une nouvelle phase"},text:{Priority:"Liste des priorit\xE9s",Label:"Liste des tags",Status:"Liste des statuts",Type:"Liste des types",Stage:"Liste des phases"}}},cRi={BcfComponents:lRi},dRi={back:"Indietro",BcfFilters:{filtersButton:"Filtri",filtersTitle:"Filtri",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",datePlaceholder:"Data di creazione",assignedToLabel:"Assegnato a",creatorsLabel:"Creato da",tagsLabel:"Etichette",resetButton:"Ripristina",searchButton:"Cerca",undefined:"Non definito"},BcfSettings:{title:"Parametri BCF",text:"Creare, notificare e elencare i parametri BCF che si desidera avere su questo progetto",validateButton:"Conferma i parametri BCF"},BcfStatistics:{emptyText:"Aggiungi delle domande per vedere le statistiche associate qui.",issues:"problemi",extension:{Priority:"Priorit\xE0",PriorityNotDefined:"Nessuna priorit\xE0",PriorityTitle:"Priorit\xE0",Status:"Stato",StatusNotDefined:"Nessuno stato",StatusTitle:"Stati"}},BcfTopicCard:{priority:"Priorit\xE0",noPriority:"Nessuno",assignedTo:"Assegnato a",elements:"Elementi",noElements:"0 elementi",notSpecified:"Non definito",see:"Visualizza"},BcfTopicCreationCard:{text:"Crea un nuovo topic BCF",createBcfSideTitle:"Segnala un problema"},BcfTopicForm:{dragDropImageText:"Selezionare un file",addObjectButton:"Oggetto",addAnnotationButton:"Annotazione",annotationButtonTooltip:"Attualmente questo argomento non presenta alcun punto di vista",addPictureButton:"Aggiungere un'immagine",titlePlaceholder:"Titolo *",titleErrorMessage:"Titolo mancante",typeLabel:"Tipo",priorityLabel:"Priorit\xE0",statusLabel:"Stato",stageLabel:"Fase",assignedToLabel:"Assegnato a",dueDateLabel:"Data di scadenza",descriptionLabel:"Descrizione",labelsLabel:"Tag",createButton:"Conferma",updateButton:"Modificare questo BCF",modalText:"State per abbandonare la modifica di {name} ma ci sono modifiche non salvate.",cancelButton:"Annullare le modifiche",continueButton:"Continuare le modifiche",createTitle:"Segnala un problema"},BcfTopicOverview:{openViewer:"Apri nel visualizzatore",openViewerNoModels:"Non esistono modelli pronti per la visualizzazione",elements:"{count} Elementi",noElements:"Nessun elemento",type:"Tipo",noTypeSpecified:"Nessun tipo specificato",description:"Descrizione",noDescriptionProvided:"Nessuna descrizione inserita",assignedTo:"Assegnato a",notAssigned:"Non assegnato",dueDate:"Scadenza",noDueDate:"Nessuna data di scadenza",informations:"Informazioni",status:"Stato",noStatusSpecified:"Nessuno stato specificato",stage:"Fase",noStageProvided:"Nessuna fase inserita",priority:"Priorit\xE0",priorityNotDefined:"Non definita",tags:"Etichette",noTags:"Nessuna etichetta",commentButton:"Pubblica un commento",deleteText:"Stai per eliminare {name}",deleteBcfButton:"Elimina questo BCF",keepBcfButton:"Conserva questo BCF",author:"Autore"},BcfTopicsTable:{headers:{index:"#",priority:"Priorit\xE0",status:"Stato",title:"Titolo",creator:"Autore",date:"Data"}},BcfTopicActionsCell:{seeButton:"Visualizza"},BcfTopicComments:{commentButton:"Pubblica un commento",commentLabel:"Pubblica un commento",commentText:"Commento",cancelButton:"Annulla",publishButton:"Pubblica",commentsText:"commenti",deleteCommentText:"Eliminare questo commento?",deleteButton:"Elimina"},BcfTopicPriorityCell:{noPriority:"Nessuno"},SettingCard:{addButton:"aggiungi un elemento",cancelButton:"Annulla",validateButton:"Conferma",deleteExtensionText:"Elimina questo parametro",deleteButton:"Elimina",title:{Priority:"Priorit\xE0",Label:"Etichette",Status:"Stati",Type:"Tipi",Stage:"Fasi"},input:{Priority:"Aggiungi una nuova priorit\xE0",Label:"Aggiungi una nuova etichetta",Status:"Aggiungi un nuovo stato",Type:"Aggiungi un nuovo tipo",Stage:"Aggiungi una nuova fase"},text:{Priority:"Elenco delle priorit\xE0",Label:"Elenco delle etichette",Status:"Elenco degli stati",Type:"Elenco dei tipi",Stage:"Elenco delle fasi"}}},uRi={BcfComponents:dRi},hRi={de:rRi,en:nRi,es:aRi,fr:cRi,it:uRi},pRi=({apiClient:t,fetchUsers:e,i18nPlugin:i}={})=>({install(r){t?Ir.setup({apiClient:t,fetchUsers:e}):console.error("[BCF Components Plugin] No api client provided. You must provide an api client for the components to work properly."),i?Object.entries(hRi).forEach(([o,n])=>{i.global.mergeLocaleMessage(o,n)}):console.warn("[BCF Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(AOe).forEach(([o,n])=>{r.component(o,n)})}}),fRi={title:"Building Maker",back:"Zur\xFCck",list:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",createButton:"Neues Projekt",updateButton:"Umbenennen",deleteButton:"L\xF6schen"},form:{text:"Erstellen und bearbeiten Sie die Etagen und laden Sie anschlie\xDFend Ihre PDFs herunter.",input:"Name des Geb\xE4udes",error:"Ung\xFCltiger Name",createButton:"Erstellen",updateButton:"Best\xE4tigen"},view:{addStoreyButton:"Etage",addPlanButton:"Grundriss",closeButton:"Fertigstellen",submitFilesButton:"Best\xE4tigen"},storeyForm:{title:"Neue Etage",input:"Name",error:"Ung\xFCltiger Name",cancelButton:"Abbrechen",submitButton:"Best\xE4tigen"}},gRi={creationFormTitle:"Ordner erstellen",renameFormPlaceholder:"Datei- / Ordnernam",nameInputPlaceholder:"Ordnername",emptyFolder:"Dieser Ordner ist leer",newFolderSuccess:"Neuer Ordner erstellt",renameFolderSuccess:"Umbenannter Ordner",deleteFolderSuccess:"Ordner gel\xF6scht",newFileSuccess:"Datei hinzugef\xFCgt",renameFileSuccess:"Umbenannte Datei",deleteFileSuccess:"Datei gel\xF6scht",nameInputErrorMessage:"Ung\xFCltiger name",cancel:"Abbrechen",submit:"Best\xE4tigen",buttonText:"Neuer Ordner",addFileButtonText:"Datei laden",rename:"Umbenennen",view:"Sehen",download:"Herunterladen",delete:"L\xF6schen",deleteTitle:"Dateien l\xF6schen",deleteDetail:"Sie sind im Begriff, die folgenden Dateien / Ordner endg\xFCltig zu l\xF6schen"},ARi={BuildingMaker:fRi,FileManager:gRi},mRi={t:{back:"Back",cancel:"Cancel",create:"Create",delete:"Delete",download:"Download",finish:"Finish",rename:"Rename",search:"Search",see:"View",storey:"Storey",validate:"Validate"}},vRi={title:"Building Maker",list:{text:"Create and edit storeys, then download your PDFs.",new:"New project"},form:{input:"Building name",error:"Invalid"},view:{addStorey:"Add Storey",addFile:"Add File",addPlan:"Add Plan"},storeyForm:{title:"New storey",input:"Name",error:"Invalid name"}},yRi={creationFormTitle:"Create folder",renameFormPlaceholder:"Folder/File name",nameInputPlaceholder:"Folder name",emptyFolder:"This folder is empty",newFolderSuccess:"New folder created",renameFolderSuccess:"Folder renamed",deleteFolderSuccess:"Folder deleted",newFileSuccess:"File added",renameFileSuccess:"File renamed",deleteFileSuccess:"File deleted",nameInputErrorMessage:"Invalid name",buttonText:"New folder",addFileButtonText:"Upload a file",deleteTitle:"Deleting Files",deleteDetail:"You are about to permanently delete the following files / folders",dmsRoot:"Root of the project's DMS",pdfPageSelectorTitle:"Select a page"},bRi={title:"Meta-Building Structure",tab:{structure:"Structure",zones:"Zones",equipments:"Equipments"},StoreySelector:{placeholder:"Select a storey"}},wRi={title:"Photosphere Building"},CRi={BIMDataComponents:mRi,BuildingMaker:vRi,FileManager:yRi,MetaBuildingStructure:bRi,PhotosphereBuilding:wRi},xRi={title:"Building Maker",back:"Vuelta",list:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",createButton:"Nuevo proyecto",updateButton:"Renombrar",deleteButton:"Suprimir"},form:{text:"Cree y edite los pisos despu\xE9s cargue los PDF.",input:"Nombre del edificio",error:"Nombre no v\xE1lido",createButton:"Crear",updateButton:"Validar"},view:{addStoreyButton:"Piso",addPlanButton:"Plano",closeButton:"Terminar",submitFilesButton:"Validar"},storeyForm:{title:"Nuevo piso",input:"Nombre",error:"Nombre no v\xE1lido",cancelButton:"Anular",submitButton:"Validar"}},kRi={creationFormTitle:"Crear un archivo",renameFormPlaceholder:"Nombre de archivo / carpeta",nameInputPlaceholder:"Nombre de la carpeta",emptyFolder:"Esta carpeta est\xE1 vac\xEDa",newFolderSuccess:"Nueva carpeta creada",renameFolderSuccess:"Carpeta renombrada",deleteFolderSuccess:"Carpeta eliminada",newFileSuccess:"Archivo agregado",renameFileSuccess:"Archivo renombrado",deleteFileSuccess:"Archivo eliminado",nameInputErrorMessage:"Nombre inv\xE1lida",cancel:"Cancelar",submit:"Validar",buttonText:"Carpeta nueva",addFileButtonText:"Cargar un archivo",rename:"Renombrar",view:"Ver",download:"Descargar",delete:"Borrar",deleteTitle:"Eliminar archivos",deleteDetail:"Est\xE1 a punto de eliminar permanentemente los siguientes archivos / carpetas"},MRi={BuildingMaker:xRi,FileManager:kRi},ERi={t:{back:"Retour",cancel:"Annuler",create:"Cr\xE9er",delete:"Supprimer",download:"T\xE9l\xE9charger",finish:"Terminer",rename:"Renommer",search:"Rechercher",see:"Voir",storey:"\xC9tage",validate:"Valider"}},BRi={title:"Building Maker",list:{text:"Cr\xE9ez et \xE9ditez les \xE9tages puis t\xE9l\xE9chagez vos PDF.",new:"Nouveau projet"},form:{input:"Nom du b\xE2timent",error:"Nom invalide"},view:{addStorey:"Ajouter un \xC9tage",addFile:"Ajouter un fichier",addPlan:"Ajouter un plan"},storeyForm:{title:"Nouvel \xE9tage",input:"Nom",error:"Nom invalide"}},PRi={creationFormTitle:"Cr\xE9er un dossier",renameFormPlaceholder:"Nom du fichier/dosier",nameInputPlaceholder:"Nom du dossier",emptyFolder:"Ce dossier est vide",newFolderSuccess:"Nouveau dossier cr\xE9\xE9",renameFolderSuccess:"Dossier renomm\xE9",deleteFolderSuccess:"Dossier supprim\xE9",newFileSuccess:"Fichier ajout\xE9",renameFileSuccess:"Fichier renomm\xE9",deleteFileSuccess:"Fichier supprim\xE9",nameInputErrorMessage:"Nom invalide",buttonText:"Nouveau dossier",addFileButtonText:"Charger un fichier",deleteTitle:"Supression de fichiers",deleteDetail:"Vous \xEAtes sur le point de supprimer d\xE9finitivement les fichiers/dossiers suivants",dmsRoot:"Racine de la GED du projet",pdfPageSelectorTitle:"S\xE9lectionner une page"},IRi={title:"Structure M\xE9ta-Building",tab:{structure:"Structure",zones:"Zones",equipments:"\xC9quipements"},StoreySelector:{placeholder:"S\xE9lectionner un \xE9tage"}},SRi={title:"Photosph\xE8re Building"},TRi={BIMDataComponents:ERi,BuildingMaker:BRi,FileManager:PRi,MetaBuildingStructure:IRi,PhotosphereBuilding:SRi},RRi={title:"Building Maker",back:"Reso",list:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",createButton:"Nuovo progetto",updateButton:"Rinominare",deleteButton:"Eliminare"},form:{text:"Crea e modifica i piani e poi scarica i tuoi PDF.",input:"Nome della costruzione",error:"Nome non corretto",createButton:"Creare",updateButton:"Convalidare"},view:{addStoreyButton:"Piano",addPlanButton:"Mappa",closeButton:"Finire",submitFilesButton:"Convalidare"},storeyForm:{title:"Nuovo piano",input:"Nome",error:"Nome non corretto",cancelButton:"Annullare",submitButton:"Convalidare"}},DRi={creationFormTitle:"Crea una cartella",renameFormPlaceholder:"Nome file/cartella",nameInputPlaceholder:"Nome della cartella",emptyFolder:"Questa cartella \xE8 vuota",newFolderSuccess:"Nuova cartella creata",renameFolderSuccess:"Cartella rinominata",deleteFolderSuccess:"Cartella eliminata",newFileSuccess:"File aggiunto",renameFileSuccess:"File rinominato",deleteFileSuccess:"File cancellato",nameInputErrorMessage:"Nome non valido",cancel:"Annulla",submit:"Invia",buttonText:"Nuova cartella",addFileButtonText:"Carica un file",rename:"Rinominare",view:"Vedere",download:"Scaricare",delete:"Cancellare",deleteTitle:"Eliminazione di file",deleteDetail:"Stai per eliminare definitivamente i seguenti file/cartelle"},_Ri={BuildingMaker:RRi,FileManager:DRi},LRi={de:ARi,en:CRi,es:MRi,fr:TRi,it:_Ri},FRi=({i18nPlugin:t}={})=>({install(e){t?Object.entries(LRi).forEach(([i,r])=>{t.global.mergeLocaleMessage(i,r)}):console.warn("[BIMData Components Plugin] No i18n instance provided. You should either provide an i18n instance or define your own translations in order have text displayed properly."),Object.entries(D0i).forEach(([i,r])=>{e.component(i,r)})}}),ORi={beforeMount(t,e){if(typeof e.value!="function")throw Error(`click away directive needs function, got ${typeof e.value}`);t.clickAwayHandler=i=>{(i.path||i.composedPath&&i.composedPath()).find(r=>r===t)||e.value()},window.addEventListener("mousedown",t.clickAwayHandler,!0)},unmounted(t){window.removeEventListener("mousedown",t.clickAwayHandler,!0),delete t.clickAwayHandler}},URi=Object.freeze(Object.defineProperty({__proto__:null,BIMDataClickAway:tu,BIMDataClickInputAway:ORi},Symbol.toStringTag,{value:"Module"})),NRi=t=>({install(e){Object.entries(l0t).forEach(([i,r])=>{e.component(i,r)}),Object.entries(URi).forEach(([i,r])=>e.directive(i.split("BIMData")[1],r))}}),jRi={name:"LiWrapper",render(){return sn("li",this.$slots.default())}};function HRi(t,e){var i=new Set([]);return t.forEach(r=>{e.has(r)||i.add(r)}),i}const Tu=Ws("id"),zRi=({contextMenu:t,objects:e=[],state:i=t.$viewer.state,pictos:r})=>[{name:"selectAll",get group(){return t.groupPositions.select},position:1,get label(){return t.$t("context_menu.select_all")},get picto(){return r.get(this.name)},execute:()=>i.selectObjects(e.filter(zd(yr("visible"),P0("selected"))).map(Tu)),predicate:()=>e.some(zd(yr("visible"),P0("selected")))},{name:"deselectAll",get group(){return t.groupPositions.select},position:2,get label(){return t.$t("context_menu.deselect_all")},get picto(){return r.get(this.name)},execute:()=>i.deselectObjects(e.filter(yr("selected")).map(Tu)),predicate:()=>e.some(yr("selected"))},{name:"selectSimilar",get group(){return t.groupPositions.select},position:3,get label(){return t.$t("context_menu.select_similar")},get picto(){return r.get(this.name)},execute(){const o=e.filter(n=>n.visible&&n.type===this.selectedObject.type&&n.id!==this.selectedObject.id).map(Tu);i.selectObjects(o)},selectedObject:null,predicate(){const o=e.filter(zd(yr("visible"),yr("selected")));return o.length===1&&o[0].type!==void 0?(this.selectedObject=o[0],!0):(this.selectedObject=null,!1)}},{name:"reverseSelection",get label(){return t.$t("context_menu.reverse_selection")},get group(){return t.groupPositions.select},position:4,execute:()=>{const o=new Set(e.filter(yr("selected")).map(Tu)),n=new Set(e.filter(yr("visible")).map(Tu));i.selectObjects(Array.from(HRi(n,o)),{exclusive:!0})},predicate:()=>e.some(zd(P0("selected"),yr("visible")))&&e.some(zd(yr("selected"),yr("visible")))},{name:"showAll",get group(){return t.groupPositions.visibility},position:1,get label(){return t.$t("context_menu.show_all")},get picto(){return r.get(this.name)},execute:()=>i.showObjects(e.filter(P0("visible")).map(Tu)),predicate:()=>e.some(P0("visible"))},{name:"hide",get group(){return t.groupPositions.visibility},position:2,get label(){return t.$t("context_menu.hide")},get picto(){return r.get(this.name)},objectsToHide:null,execute(){const o=this.objectsToHide.filter(yr("selected"));o.length>0&&i.deselectObjects(o.map(Tu)),i.hideObjects(this.objectsToHide.map(Tu))},predicate(){return this.objectsToHide=e.filter(zd(yr("selected"),yr("visible"))),this.objectsToHide.length>0}},{name:"hideAll",get group(){return t.groupPositions.visibility},position:3,get label(){return t.$t("context_menu.hide_all")},execute:()=>{const o=e.filter(yr("visible"));o.some(yr("selected"))&&i.deselectObjects(o.filter(yr("selected")).map(Tu)),i.hideObjects(o.map(Tu))},predicate:()=>e.some(yr("visible"))}].filter(o=>o.predicate()),VRi={components:{LiWrapper:jRi},inject:["$viewer"],data(){return{defaultPrevented:!1,displayed:!1,top:null,bottom:null,left:null,width:200,nextCommandId:1,currentCommands:[],contextCommands:[],registeredCommands:[],groupPositions:{select:10,visibility:20},asyncPredicateRunning:!1}},computed:{position(){return{top:this.top?this.top+"px":"unset",bottom:this.bottom?this.bottom+"px":"unset",left:this.left+"px",width:this.width+"px"}}},watch:{displayed(t){t?document.addEventListener("keydown",this.onKeyDown):document.removeEventListener("keydown",this.onKeyDown)}},created(){this.$viewer.contextMenu=this,this.asyncPredicates=new Set},methods:{onKeyDown(t){t.key==="Escape"&&this.away()},setPosition(t){const e=(document.fullscreenElement?document.fullscreenElement:this.$parent.$el).getBoundingClientRect();this.left=t.clientX-e.left,this.top=t.clientY-e.top,this.left+this.width>e.width&&(this.left=this.left-this.width),t.clientY>e.top+e.height/2?(this.bottom=e.height-this.top,this.top=null):this.bottom=null},typeCheckCommand(t={}){let e=null;if((!t.execute||typeof t.execute!="function")&!t.component&&(e="Cannot register context menu command. A command must have an execute function or a component property."),t.label||(e="Cannot register context menu command. A command must have a label."),e)throw console.error(e),new Error(e);return t.id=this.nextCommandId++,t},open(t){this.currentCommands=[],this.setPosition(t),this.originEvent=t,t.preventDefault(),this.setCurrentCommands(),this.groupCurrentCommands(),this.defaultPrevented=!1,this.displayed=!0,document.fullscreenElement?(this.$el.parentElement.removeChild(this.$el),this.adoptiveParent=document.fullscreenElement,this.adoptiveParent.appendChild(this.$el)):this.adoptiveParent&&this.adoptiveParent!==this.$viewer.globalContext.el&&(this.adoptiveParent.removeChild(this.$el),this.$viewer.globalContext.el.appendChild(this.$el),this.adoptiveParent=null)},setCurrentCommands(){this.asyncPredicates.clear(),this.asyncPredicateRunning=!1,this.defaultPrevented||this.registeredCommands.forEach(async t=>{if(typeof t.predicate=="function"){const e=t.predicate(this.$viewer.globalContext.activeLocalContext);if(e===!0)this.currentCommands.push(t);else if(typeof e?.then=="function"){this.asyncPredicates.add(e),this.asyncPredicateRunning=!0;const i=await e;this.asyncPredicates.has(e)&&(this.asyncPredicates.delete(e),this.asyncPredicateRunning=this.asyncPredicates.size>0,i===!0&&this.currentCommands.push(t))}}else this.currentCommands.push(t)}),this.currentCommands.push(...this.contextCommands),this.contextCommands=[]},getDefaultCommands({objects:t=[],state:e=this.$viewer.state,context:i=null}){const r=new Map;return i&&this.$viewer.shortcutManager.getShortcuts(i).forEach(o=>r.set(o.name,o.key)),zRi({contextMenu:this,objects:t,state:e,pictos:r})},executeCommand(t){if(t.execute&&(t.execute(this.originEvent),this.displayed=!1),t.component&&!t.menu)throw new Error("Command with component property must have a `menu` property")},away(){this.displayed=!1},groupCurrentCommands(){const t=new Map;this.currentCommands.forEach(i=>{(i.group===null||i.group===void 0)&&(i.group=0),t.has(i.group)?t.get(i.group).push(i):t.set(i.group,[i])}),t.forEach(i=>i.sort((r,o)=>(r.position=r.position||0,o.position=o.position||0,r.position-o.position)));const e=[...t.keys()].sort((i,r)=>i-r).map(i=>t.get(i)).flat();this.currentCommands=e},isGroupIntersection(t){if(t===0)return!1;const e=this.currentCommands[t-1],i=this.currentCommands[t];return e.group<i.group},registerContextCommand(t){const e=this.typeCheckCommand(t);return this.contextCommands.push(e),t.id},registerCommand(t){const e=this.typeCheckCommand(t);return this.registeredCommands.push(e),t.id},unregisterCommand(t){return this.registeredCommands.find(e=>e.id===t)?(this.registeredCommands=this.registeredCommands.filter(e=>e.id!==t),!0):!1},preventDefault(){this.defaultPrevented=!0}}},qRi={key:0,class:"separator"},GRi={class:"menu-text"},QRi={key:1,class:"menu-picto"},KRi={key:0,class:"context-menu__spinner"};function WRi(t,e,i,r,o,n){const s=R("BIMDataIconChevron"),a=R("LiWrapper"),l=R("BIMDataSpinner"),c=Qi("click-away");return o.displayed&&(o.currentCommands.length||o.asyncPredicateRunning)?Lt((P(),F("ul",{key:0,class:"bimdata-list context-menu",style:Ee(n.position)},[(P(!0),F(lt,null,Vt(o.currentCommands,(d,u)=>(P(),Y(a,{key:d.label,class:"context-menu__element",onClick:h=>n.executeCommand(d)},{default:H(()=>[n.isGroupIntersection(u)?(P(),F("div",qRi)):ye("",!0),x("div",GRi,Z(d.label),1),!d.component&&d.picto?(P(),F("span",QRi,Z(d.picto),1)):d.component?(P(),Y(s,{key:2,size:"xxs",class:"fill-primary"})):ye("",!0)]),_:2},1032,["onClick"]))),128)),o.asyncPredicateRunning?(P(),F("li",KRi,[D(l)])):ye("",!0)],4)),[[c,n.away]]):ye("",!0)}const JRi=V(VRi,[["render",WRi],["__scopeId","data-v-5b87d4a3"]]),ZRi={name:"ViewerHeader",inject:["$viewer"],props:{visible:{type:Boolean,default:!0}},setup(){const t=kt("$viewer"),e=$n(new Map),i=o=>{if(!o.name)throw new TypeError("[Viewer Header] Content must have a name");if(e.has(o.name))throw new Error(`[Viewer Header] Content with name ${o.name} already exists`);e.set(o.name,o)},r=o=>e.has(o)?(e.delete(o),!0):!1;return{logo:t.uiSettings.bimdataLogo!==!1,version:t.uiSettings.version!==!1?t.version:null,headerContent:e,headerRightContentComponents:qe(()=>Array.from(e.values()).filter(o=>o.position==="right").sort((o,n)=>o.order-n.order).map(o=>o.component)),headerLeftContentComponents:qe(()=>Array.from(e.values()).filter(o=>o.position==="left").sort((o,n)=>o.order-n.order).map(o=>o.component)),addContent:i,removeContent:r}}},XRi={class:"viewer-header"},YRi={class:"viewer-header__content"},$Ri={class:"viewer-header__content__left"},eDi={class:"viewer-header__content__right"},tDi={key:0,class:"m-l-6 flex items-center"},iDi={key:1,class:"viewer-header__version"};function rDi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return Lt((P(),F("div",XRi,[x("div",YRi,[x("div",$Ri,[(P(!0),F(lt,null,Vt(r.headerLeftContentComponents,a=>(P(),Y(So(a),{key:a.name}))),128))]),x("div",eDi,[(P(!0),F(lt,null,Vt(r.headerRightContentComponents,a=>(P(),Y(So(a),{key:a.name}))),128))])]),r.logo||r.version?(P(),F("div",tDi,[r.logo?(P(),Y(s,{key:0,name:"logo",width:"30px",height:"30px"})):ye("",!0),r.version?(P(),F("div",iDi,Z(r.version),1)):ye("",!0)])):ye("",!0)],512)),[[hi,i.visible]])}const oDi=V(ZRi,[["render",rDi],["__scopeId","data-v-5c9ea6b6"]]),nDi={emits:["resize"],setup(t,{emit:e}){return{onResizerMousedown:i=>{i.preventDefault();let r=i.clientX;const o=s=>{s.preventDefault();const a=s.clientX-r;r=s.clientX,e("resize",a)},n=s=>{s.preventDefault(),window.removeEventListener("mousemove",o),window.removeEventListener("mouseup",n)};window.addEventListener("mousemove",o),window.addEventListener("mouseup",n)}}}},sDi={class:"bimdata-separator"};function aDi(t,e,i,r,o,n){return P(),F("div",sDi,[e[1]||(e[1]=x("div",{class:"bimdata-separator__line"},null,-1)),x("div",{class:"bimdata-separator__resizer",onMousedown:e[0]||(e[0]=(...s)=>r.onResizerMousedown&&r.onResizerMousedown(...s))},null,32)])}const lDi=V(nDi,[["render",aDi],["__scopeId","data-v-79a3b3af"]]),cDi={components:{Separator:lDi},props:{position:{type:String,required:!0,validator(t){return["left","right"].includes(t)}},sidePanel:{type:Object,required:!0,validator(t){if(t.width&&(typeof t.width!="number"||t.width<0))return console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof t.width}`),!1;const e=typeof t?.component=="object";return e||console.error("[GlobalSidePanel] sidePanel must have a component property"),e}}},setup(t){const e=ke(null),i=ke(t.sidePanel.width??400),r=(o,n=1)=>{const s=i.value+o*n;i.value=Math.max(0,s)};return Et(()=>t.sidePanel,()=>{Object.defineProperty(t.sidePanel,"width",{get(){return i.value},set(o){if(typeof o!="number"||o<=0){console.error(`[GlobalSidePanel] sidePanel.width must be a strictly positive number, received ${typeof o}`);return}i.value=o}}),Object.defineProperty(t.sidePanel,"componentInstance",{get(){return e.value},enumerable:!0})},{immediate:!0}),{componentInstance:e,width:i,onResize:r}}},dDi={class:"bimdata-global-side-panel__component"};function uDi(t,e,i,r,o,n){const s=R("Separator");return P(),F("div",{class:"bimdata-global-side-panel",style:Ee(`width: ${r.width}px`)},[i.sidePanel.resizable&&i.position==="right"?(P(),Y(s,{key:0,onResize:e[0]||(e[0]=a=>r.onResize(a,-1))})):ye("",!0),x("div",dDi,[(P(),Y(So(i.sidePanel.component),{ref:"componentInstance"},null,512))]),i.sidePanel.resizable&&i.position==="left"?(P(),Y(s,{key:1,onResize:e[1]||(e[1]=a=>r.onResize(a))})):ye("",!0)],4)}const hDi=V(cDi,[["render",uDi],["__scopeId","data-v-82d0d4cb"]]),pDi={name:"BimdataViewer",components:{ContextMenu:JRi,ViewerHeader:oDi,ModalManager:u7e,GlobalSidePanel:hDi},setup(){const t=kt("$viewer"),{globalContext:e,shortcutManager:i}=t;hr(()=>{i&&i.destroy(),e.hub.clear()}),Gi(()=>{t.pluginManager.runPluginsScripts(t)});const r=qe(()=>t.uiSettings.bimdataLogo!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)),o=qe(()=>t.uiSettings.version!==!1&&(e.localContexts.length!==1||e.localContexts[0].window?.logoAndVersion)?t.version:null),n=qe(()=>e.leftSidePanel),s=qe(()=>e.rightSidePanel),a=qe(()=>{const p=t.uiSettings.header!==!1,g=e.localContexts.length===1&&e.localContexts[0].window?.header===!1,f=!!(n.value||s.value);return p&&(!g||f)}),l=t.uiSettings.contextMenu!==!1,c=ke(null);function d(p){l&&c.value.open(p)}function u(){t.shortcutManager.active=!0}function h(){t.shortcutManager.active=!1}return{Layout:t.layout.areas.component,onContextMenu:d,onMouseenter:u,onMouseleave:h,isHeaderVisible:a,viewerTemplateRef:e.templateRef,modalManagerTemplateRef:e.modalManagerTemplateRef,headerTemplateRef:e.headerTemplateRef,contextMenuTemplateRef:c,contextMenuEnabled:l,bimdataLogoOnSingleWindow:r,viewerVersionOnSingleWindow:o,version:t.version,loading:qe(()=>e.loading),spinner:qe(()=>e.spinner),leftSidePanel:n,rightSidePanel:s}}},fDi={key:1,class:"bimdata-context-loading-overlay",style:{"z-index":"3"}},gDi={key:2,class:"viewer__logo"},ADi={key:1,class:"version m-t-6"};function mDi(t,e,i,r,o,n){const s=R("ModalManager"),a=R("ContextMenu"),l=R("ViewerHeader"),c=R("GlobalSidePanel"),d=R("BIMDataSpinner"),u=R("BIMDataIllustration");return P(),F("div",{id:"bimdata-viewer",ref:"viewerTemplateRef",class:"bimdata-viewer bimdata-design-system bimdata-scrollbar",onContextmenu:e[0]||(e[0]=(...h)=>r.onContextMenu&&r.onContextMenu(...h)),onMouseenter:e[1]||(e[1]=(...h)=>r.onMouseenter&&r.onMouseenter(...h)),onMouseleave:e[2]||(e[2]=(...h)=>r.onMouseleave&&r.onMouseleave(...h))},[D(s,{ref:"modalManagerTemplateRef"},null,512),r.contextMenuEnabled?(P(),Y(a,{key:0,ref:"contextMenuTemplateRef"},null,512)):ye("",!0),D(l,{ref:"headerTemplateRef",visible:r.isHeaderVisible},null,8,["visible"]),x("div",{class:"bimdata-viewer__content",style:Ee(r.isHeaderVisible?"height: calc(100% - var(--bimdata-viewer-header-height, 40px))":"height: 100%")},[r.leftSidePanel?(P(),Y(c,{key:0,"side-panel":r.leftSidePanel,position:"left"},null,8,["side-panel"])):ye("",!0),(P(),Y(So(r.Layout),{style:"height: 100%; flex-grow: 1;"})),r.rightSidePanel?(P(),Y(c,{key:1,"side-panel":r.rightSidePanel,position:"right"},null,8,["side-panel"])):ye("",!0)],4),r.loading?(P(),F("div",fDi,[r.spinner&&r.spinner.component?(P(),Y(So(r.spinner.component),uc(ka({key:0},r.spinner.props)),null,16)):(P(),Y(d,{key:1,size:"40px",border:"5px"}))])):ye("",!0),!r.isHeaderVisible&&(r.bimdataLogoOnSingleWindow||r.viewerVersionOnSingleWindow)?(P(),F("div",gDi,[r.bimdataLogoOnSingleWindow?(P(),Y(u,{key:0,name:"logo"})):ye("",!0),r.viewerVersionOnSingleWindow?(P(),F("div",ADi,Z(r.version),1)):ye("",!0)])):ye("",!0)],544)}const vDi=V(pDi,[["render",mDi],["__scopeId","data-v-0c1c941a"]]),yDi=["src"],bDi={class:"bimdata-models__header"},wDi={key:0,class:"bimdata-models__header__loader"},CDi={class:"bimdata-models__header__picto"},xDi={class:"bimdata-models__header__name"},kDi={key:0,class:"bimdata-models__header__name--empty"},MDi={key:1,class:"bimdata-models__header__name--empty"},EDi={key:3},BDi=["onMousemove","onClick"],PDi={__name:"Models",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=kt("$viewer"),r=ke(),o=ke(0),n=ke(0),s=ke(),a=or([]),l=ke(!1),c=qe(()=>i.localContext.loadedModels),d=qe(()=>i.localContext.loadedModelIds),u=qe(()=>i.localContext.loadingModelIds),h=qe(()=>i.localContext.multiModel),p=qe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(C=>c.value.find(M=>M.document?.head_id!=null&&M.document.head_id===C.document.id)??C)),g=C=>d.value.includes(C),f=C=>u.value.includes(C),m=qe(()=>{const{x:C,y:M}=s.value?.getBoundingClientRect()??{x:0,y:0};return`top:${n.value-M}px; left:${o.value-C}px;`}),A=C=>{!h.value&&g(C.id)||u.value.length>0||(i.localContext.loadedModelIds.includes(C.id)?i.localContext.unloadModels([C.id]):i.localContext.loadModels([C.id]))},v=C=>{switch(C){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},y=(C,M)=>{C?.viewer_360_file&&(o.value=M.clientX,n.value=M.clientY),r.value=C?.viewer_360_file},b=async C=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,C)).filter(M=>i.state.models.some(E=>E.archived)||!M.archived).sort(nu("updated_at",!1))}catch(M){console.error("[Models] Cannot get project models. Error: ",M)}finally{l.value=!1}return[]},w=C=>C.children?.some(M=>g(M.id))??!1;return b(i.localContext.modelTypes).then(C=>{a.value=C}),(C,M)=>{const E=R("BIMDataSpinner"),B=R("BIMDataIconModel3D"),S=R("BIMDataTextbox"),I=R("BIMDataCheckbox"),T=R("BIMDataRadio"),_=R("BIMDataIcon"),O=R("BIMDataDropdownList");return P(),F("div",{ref_key:"templateRef",ref:s,class:Me(["bimdata-models",{"bimdata-models--window-positioning":t.windowPositioning}])},[r.value?(P(),F("div",{key:0,class:"bimdata-models__preview",style:Ee(m.value)},[x("img",{src:r.value},null,8,yDi)],4)):ye("",!0),D(O,{style:Ee(`--bimdata-models-width: ${t.width};`),width:t.width,list:p.value,"element-key":"id","per-page":40,loading:l.value,class:"bimdata-models__list",disabled:p.value.length===0,onElementClick:A},{header:H(({isOpen:j})=>[x("div",bDi,[l.value||u.value.length>0?(P(),F("div",wDi,[D(E)])):(P(),F(lt,{key:1},[x("div",CDi,[D(B)]),x("div",{class:Me(["bimdata-models__header__number bimdata-info-length",{"bimdata-models__header__number--empty":d.value.length===0}])},[x("span",null,Z(d.value.length),1)],2),x("div",xDi,[p.value.length===0?(P(),F("span",kDi,Z(C.$t("model.no_model")),1)):d.value.length===0?(P(),F("span",MDi,Z(C.$t("model.no_loaded_model")),1)):d.value.length===1?(P(),Y(S,{key:2,text:c.value[0].name,tooltip:!j},null,8,["text","tooltip"])):d.value.length>1?(P(),F("span",EDi,Z(C.$t("model.selected_models")),1)):ye("",!0)])],64))])]),element:H(({element:j,close:N})=>[x("div",{class:"bimdata-models__model",onMousemove:G=>t.preview&&y(j,G),onMouseout:M[0]||(M[0]=G=>t.preview&&y()),onClick:()=>{!h.value&&!g(j.id)&&N()}},[h.value?(P(),Y(I,{key:0,"model-value":g(j.id)||w(j),disabled:j.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])):(P(),Y(T,{key:1,"model-value":g(j.id)||w(j),disabled:j.status!=="C"||u.value.length>0},null,8,["model-value","disabled"])),D(_,{margin:"0 calc(var(--spacing-unit) / 2)",name:v(j.status),size:"xs",class:Me({"fill-success":j.status==="C","fill-high":j.status==="E"})},null,8,["name","class"]),D(S,{class:Me({"bimdata-models__model__name":!0,"bimdata-models__model__name--disabled":j.status!=="C"||u.value.length>0}),text:j.name,width:`calc(100% -
5318
5318
  ${h.value?13:23}px - 2 * 6px - 16px)`},null,8,["class","text","width"]),j.document&&!j.document.is_head_version?(P(),Y(_,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ye("",!0)],40,BDi),f(j.id)?(P(),Y(E,{key:0,class:"bimdata-models__model__spinner"})):ye("",!0)]),_:1},8,["style","width","list","loading","disabled"])],2)}}},A7e=V(PDi,[["__scopeId","data-v-34c2cf79"]]),IDi="data:image/svg+xml,%3csvg%20width='16'%20height='21'%20viewBox='0%200%2016%2021'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20fill-rule='evenodd'%20clip-rule='evenodd'%20d='M7.47193%202.76644C7.65699%202.84439%207.77716%203.02565%207.777%203.22661L7.77339%207.94624C7.77318%208.22238%207.54916%208.44655%207.27301%208.44693L2.4192%208.45366C2.21569%208.45394%202.03258%208.33085%201.95617%208.1424C1.87975%207.95394%201.92528%207.73773%202.07129%207.59566L6.92872%202.86931C7.0729%202.72902%207.28688%202.6885%207.47193%202.76644ZM3.65141%207.45195L6.77378%207.44762L6.7761%204.41157L3.65141%207.45195ZM5.81657%200.893911L6.02338%200.893274L13.3879%200.870595C14.679%200.866619%2015.7208%201.91642%2015.722%203.20083L15.2221%203.20237L15.722%203.20052L15.722%203.20083L15.745%2017.8999L15.745%2017.9002C15.7462%2019.1846%2014.7063%2020.2408%2013.4153%2020.2448L2.35929%2020.2788C1.07114%2020.2828%200.0171799%2019.2362%200.0159721%2017.9486L0.00563138%206.92409L0.00543684%206.71668L0.152103%206.56972L5.67032%201.04045L5.81657%200.893911ZM6.23113%201.89264L1.00582%207.12841L1.01597%2017.9455C1.01666%2018.6791%201.62068%2019.2811%202.35835%2019.2788L13.4143%2019.2448C14.1484%2019.2425%2014.7456%2018.6402%2014.745%2017.9035C14.745%2017.9034%2014.745%2017.9033%2014.745%2017.9033L14.722%203.20423L14.722%203.20391C14.7213%202.46716%2014.123%201.86833%2013.3888%201.87059L6.23113%201.89264Z'%20fill='%232F374A'/%3e%3c/svg%3e",SDi=["src"],TDi={key:0,class:"bimdata-multi-model-loader__header-container"},RDi={key:0,class:"bimdata-multi-model-loader__header__loader"},DDi={class:"bimdata-multi-model-loader__header__picto"},_Di=["src"],LDi={class:"bimdata-multi-model-loader__header__name"},FDi={key:0,class:"bimdata-multi-model-loader__header__name--empty"},ODi={key:1,class:"bimdata-multi-model-loader__header__name--empty"},UDi={key:3},NDi={key:1,class:"bimdata-multi-model-loader__main"},jDi=["onMousemove","onClick"],HDi={__name:"BIMDataMultiModelLoader",props:{preview:{type:Boolean,default:!1},windowPositioning:{type:Boolean,default:!0},customFilter:{type:Function,default:null},width:{type:String,default:"350px"}},setup(t){const e=t,i=kt("$viewer"),r=ke(),o=ke(0),n=ke(0),s=ke(),a=or([]),l=ke(!1),c=ke(!0),d=T=>{T.key==="Escape"?c.value=!0:T.key==="Enter"&&E()};Et(c,T=>{T?(window.removeEventListener("keydown",d),y.clear(),v.clear(),r.value=null):window.addEventListener("keydown",d)});const u=qe(()=>i.localContext.loadedModels),h=qe(()=>i.localContext.loadedModelIds),p=qe(()=>i.localContext.loadingModelIds),g=qe(()=>i.localContext.multiModel),f=qe(()=>(e.customFilter?a.value.filter(e.customFilter):a.value).map(T=>u.value.find(_=>_.document?.head_id!=null&&_.document.head_id===T.document.id)??T)),m=T=>h.value.includes(T),A=T=>p.value.includes(T),v=$n(new Set),y=$n(new Set),b=T=>T.children?.some(_=>m(_.id))??!1,w=T=>(m(T.id)||b(T)||v.has(T))&&!y.has(T),C=qe(()=>{const{x:T,y:_}=s.value.getBoundingClientRect();return`top:${n.value-_}px; left:${o.value-T}px;`}),M=T=>{T.status==="C"&&(!g.value&&m(T.id)||(m(T.id)?y.has(T)?y.delete(T):y.add(T):v.has(T)?v.delete(T):v.add(T)))},E=()=>{v.size>0&&i.localContext.loadModels(Array.from(v).map(T=>T.id)),y.size>0&&i.localContext.unloadModels(Array.from(y).map(T=>T.id)),c.value=!0},B=T=>{switch(T){case"C":return"success";case"E":return"failed";case"P":case"I":return"sandglass"}},S=T=>T.document&&!T.document.is_head_version,I=(T,_)=>{!e.preview||c.value||(T?.viewer_360_file&&(o.value=_.clientX,n.value=_.clientY),r.value=T?.viewer_360_file)};return(async T=>{l.value=!0;try{return(await i.api.apiClient.modelApi.getModels(i.api.cloudId,i.api.projectId,void 0,void 0,T)).filter(_=>i.state.models.some(O=>O.archived)||!_.archived).sort(nu("updated_at",!1))}catch(_){console.error("[Models] Cannot get project models. Error: ",_)}finally{l.value=!1}return[]})(i.localContext.modelTypes).then(T=>{a.value=T}),(T,_)=>{const O=R("BIMDataSpinner"),j=R("BIMDataTextbox"),N=R("BIMDataIconChevron"),G=R("BIMDataButton"),q=R("BIMDataIconFileIfcPolychrome"),X=R("BIMDataCheckbox"),me=R("BIMDataRadio"),ce=R("BIMDataIcon"),xe=R("BIMDataPaginatedList"),Re=Qi("click-away");return P(),F("div",{ref_key:"templateRef",ref:s,class:Me(["bimdata-multi-model-loader",{"bimdata-multi-model-loader--window-positioning":t.windowPositioning}])},[r.value?(P(),F("div",{key:0,class:"bimdata-multi-model-loader__preview",style:Ee(C.value)},[x("img",{src:r.value},null,8,SDi)],4)):ye("",!0),D(er,{name:"fade",mode:"out-in"},{default:H(()=>[c.value?(P(),F("div",TDi,[It(T.$slots,"left",{},void 0,!0),x("div",{class:"bimdata-multi-model-loader__header",onClick:_[0]||(_[0]=ge=>c.value=!1)},[l.value||p.value.length>0?(P(),F("div",RDi,[D(O)])):(P(),F(lt,{key:1},[x("div",DDi,[x("img",{src:pt(IDi),alt:"file icon"},null,8,_Di)]),x("div",{class:Me(["bimdata-multi-model-loader__header__number bimdata-info-length",{"bimdata-multi-model-loader__header__number--empty":h.value.length===0}])},[x("span",null,Z(h.value.length),1)],2),x("div",LDi,[f.value.length===0?(P(),F("span",FDi,Z(T.$t("model.no_model")),1)):h.value.length===0?(P(),F("span",ODi,Z(T.$t("model.no_loaded_model")),1)):h.value.length===1?(P(),Y(j,{key:2,text:u.value[0].name,tooltip:c.value,width:"233px"},null,8,["text","tooltip"])):h.value.length>1?(P(),F("span",UDi,Z(T.$t("model.selected_models")),1)):ye("",!0)]),D(G,{color:"default",icon:"",radius:"",fill:"",width:"21px",height:"21px"},{default:H(()=>[D(N,{size:"xxxs"})]),_:1})],64))]),It(T.$slots,"right",{},void 0,!0)])):Lt((P(),F("div",NDi,[D(xe,{list:f.value,"per-page":10},{element:H(({element:ge})=>[x("div",{class:Me(["bimdata-multi-model-loader__main__model",{"bimdata-multi-model-loader__main__model--disabled":ge.status!=="C"}]),onMousemove:ee=>I(ge,ee),onMouseout:_[1]||(_[1]=ee=>I()),onClick:ee=>M(ge)},[D(q,{fill:"",color:"default",size:"xs"}),g.value?(P(),Y(X,{key:0,"model-value":w(ge),disabled:ge.status!=="C"},null,8,["model-value","disabled"])):(P(),Y(me,{key:1,"model-value":w(ge),disabled:ge.status!=="C"},null,8,["model-value","disabled"])),D(j,{class:Me({"bimdata-multi-model-loader__main__model__name":!0,"bimdata-multi-model-loader__main__model__name--disabled":ge.status!=="C"}),text:ge.name,width:S(ge)?"333px":"363px"},null,8,["class","text","width"]),S(ge)?(P(),Y(ce,{key:2,name:"versioning",fill:"",color:"default",size:"xs",margin:"0 0 0 6px"})):ye("",!0),A(ge.id)?(P(),Y(O,{key:3,class:"bimdata-multi-model-loader__main__model__spinner"})):(P(),Y(ce,{key:4,name:B(ge.status),size:"xs",class:Me({"fill-success":ge.status==="C","fill-high":ge.status==="E"})},null,8,["name","class"]))],42,jDi)]),_:1},8,["list"]),D(G,{class:"bimdata-multi-model-loader__main__validate",width:"93px",color:"primary",fill:"",radius:"",disabled:pt(v).size===0&&pt(y).size===0,onClick:E},{default:H(()=>[rt(Z(T.$t("global.validate")),1)]),_:1},8,["disabled"])])),[[Re,()=>c.value=!0]])]),_:3})],2)}}},zDi=V(HDi,[["__scopeId","data-v-44e6af66"]]),VDi={data(){return{shown:!1}},mounted(){setTimeout(()=>{this.shown=!0},500)}};function qDi(t,e,i,r,o,n){const s=R("BIMDataIllustration");return P(),F("div",{class:"bimdata__no-model",style:Ee({"--no-model--opacity":o.shown?1:0})},[D(s,{name:"emptyViewer",x:"90",y:"90"}),x("span",null,Z(t.$t("model.select_model")),1)],4)}const m7e=V(VDi,[["render",qDi],["__scopeId","data-v-5ffd9bc0"]]);window.BIMDataViewerVue=jY;class GDi{constructor(e={}){const{api:i={},ui:r}=e;this.uiCfg=r,i.apiUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `apiUrl` not set, use 'https://api.bimdata.io' by default."),i.apiUrl="https://api.bimdata.io"),i.archiveUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `archiveUrl` not set, use 'https://archive.bimdata.io' by default."),i.archiveUrl="https://archive.bimdata.io"),i.pdfBackendUrl||(console.info("[BIMData Viewer] INFO - Viewer config - `pdfBackendUrl` not set, use 'https://pdf-backend.bimdata.io' by default."),i.pdfBackendUrl="https://pdf-backend.bimdata.io"),i.ifcIds&&(console.warn("[BIMData Viewer] DEPRECATED - Viewer config - please use the `modelIds` property instead of `ifcIds`."),i.modelIds===void 0&&(i.modelIds=i.ifcIds)),i.modelIds||(i.modelIds=[]),i.offline?.dataFile&&(i.offline.data=i.offline.dataFile),this.$viewer=new YTi(e),i.offline?.enabled?this.$viewer.api.enableOfflineMode(i.offline.data,i.offline.options).then(()=>this.state.loadModels(i.modelIds)):(this.$viewer.globalContext.loadingProcessStart(),this.state.loadModels(i.modelIds).finally(()=>this.$viewer.globalContext.loadingProcessEnd())),this.vueApp=null}get state(){return this.$viewer.state}get api(){return this.$viewer.api}async mount(e,i="3d"){const{$viewer:r}=this;await r.api.ready;try{const d=await r.api.apiClient.collaborationApi.checkProjectAccess(r.api.cloudId,r.api.projectId);r.api.permissions=g7e(d)}catch{r.api.permissions=g7e()}const o=this.api.accessToken,{i18n:n}=r;n.registerTranslations(r.pluginManager.pluginTranslations),r.layout.apply(i);const s={i18n:n.i18nVuePlugin,data(){return{accessToken:o}},render(){return sn(vDi,{style:"height: 100%"})}},a=w8(s).use(n.i18nVuePlugin).use(NRi()).use(FRi({i18nPlugin:n.i18nVuePlugin})).use(pRi({apiClient:r.api.apiClient,i18nPlugin:n.i18nVuePlugin}));a.provide("$viewer",r),a.provide("BIMDATA_DESIGN_SYSTEM_DARK_THEME",qe(()=>r.darkTheme)),a.component("BIMDataModelLoader",A7e),a.component("BIMDataMultiModelLoader",zDi),a.component("BIMDataNoModelWindowPlaceHolder",m7e),a.component("BIMDataStoreySelector",SF),a.component("ModelsLoader",A7e),a.component("NoModelWindowPlaceHolder",m7e);const l=e instanceof HTMLElement?e:document.querySelector(e);l&&(l.style.height="100%");const c=a.mount(e);return c.$viewer=r,$Ti(c.$el,this.uiCfg?.style),typeof window<"u"&&(window.bimdataViewer=c),this.vueApp=a,c}destroy(){this.vueApp?.unmount()}setLocale(e){if(!r$.includes(e))throw new Error(`Viewer available locales are ${r$.join(", ")}.`);this.$viewer.i18n.locale=e}registerPlugin(e){this.$viewer.registerPlugin(e)}registerWindow(e){return this.$viewer.windowManager.registerWindow(e)}unregisterWindow(e){return this.$viewer.windowManager.unregisterWindow(e)}setAccessToken(e){this.api.accessToken=e}async loadModels(e){this.$viewer.globalContext.loadingProcessStart();const i=await this.state.loadModels(e);return this.$viewer.globalContext.loadingProcessEnd(),i}loadIfcs(e){return console.warn("[BIMData Viewer] DEPRECATED - Viewer - please use the loadModels method instead of loadIfcs."),this.loadModels(e)}}const v7e=(t={})=>new GDi(t);window.makeBIMDataViewer=v7e;const ja=typeof process=="object"&&process+""=="[object process]"&&!process.versions.nw&&!(process.versions.electron&&process.type&&process.type!=="browser"),xq=[.001,0,0,.001,0,0],kq=1.35,ec={ANY:1,DISPLAY:2,PRINT:4,ANNOTATIONS_FORMS:16,ANNOTATIONS_STORAGE:32,ANNOTATIONS_DISABLE:64,IS_EDITING:128,OPLIST:256},Yp={DISABLE:0,ENABLE:1,ENABLE_FORMS:2,ENABLE_STORAGE:3},Cy="pdfjs_internal_editor_",zi={DISABLE:-1,NONE:0,FREETEXT:3,HIGHLIGHT:9,STAMP:13,INK:15,POPUP:16,SIGNATURE:101,COMMENT:102},wr={RESIZE:1,CREATE:2,FREETEXT_SIZE:11,FREETEXT_COLOR:12,FREETEXT_OPACITY:13,INK_COLOR:21,INK_THICKNESS:22,INK_OPACITY:23,HIGHLIGHT_COLOR:31,HIGHLIGHT_THICKNESS:32,HIGHLIGHT_FREE:33,HIGHLIGHT_SHOW_ALL:34,DRAW_STEP:41},QDi={PRINT:4,MODIFY_CONTENTS:8,COPY:16,MODIFY_ANNOTATIONS:32,FILL_INTERACTIVE_FORMS:256,COPY_FOR_ACCESSIBILITY:512,ASSEMBLE:1024,PRINT_HIGH_QUALITY:2048},Mq={TRIANGLES:1,LATTICE:2},Ls={FILL:0,STROKE:1,FILL_STROKE:2,INVISIBLE:3,FILL_STROKE_MASK:3,ADD_TO_PATH_FLAG:4},vP={GRAYSCALE_1BPP:1,RGB_24BPP:2,RGBA_32BPP:3},Un={TEXT:1,LINK:2,FREETEXT:3,LINE:4,SQUARE:5,CIRCLE:6,POLYGON:7,POLYLINE:8,HIGHLIGHT:9,UNDERLINE:10,SQUIGGLY:11,STRIKEOUT:12,STAMP:13,CARET:14,INK:15,POPUP:16,FILEATTACHMENT:17,SOUND:18,MOVIE:19,WIDGET:20,SCREEN:21,PRINTERMARK:22,TRAPNET:23,WATERMARK:24,THREED:25,REDACT:26},W5={SOLID:1,DASHED:2,BEVELED:3,INSET:4,UNDERLINE:5},yP={ERRORS:0,WARNINGS:1,INFOS:5},xy={dependency:1,setLineWidth:2,setLineCap:3,setLineJoin:4,setMiterLimit:5,setDash:6,setRenderingIntent:7,setFlatness:8,setGState:9,save:10,restore:11,transform:12,moveTo:13,lineTo:14,curveTo:15,curveTo2:16,curveTo3:17,closePath:18,rectangle:19,stroke:20,closeStroke:21,fill:22,eoFill:23,fillStroke:24,eoFillStroke:25,closeFillStroke:26,closeEOFillStroke:27,endPath:28,clip:29,eoClip:30,beginText:31,endText:32,setCharSpacing:33,setWordSpacing:34,setHScale:35,setLeading:36,setFont:37,setTextRenderingMode:38,setTextRise:39,moveText:40,setLeadingMoveText:41,setTextMatrix:42,nextLine:43,showText:44,showSpacedText:45,nextLineShowText:46,nextLineSetSpacingShowText:47,setCharWidth:48,setCharWidthAndBounds:49,setStrokeColorSpace:50,setFillColorSpace:51,setStrokeColor:52,setStrokeColorN:53,setFillColor:54,setFillColorN:55,setStrokeGray:56,setFillGray:57,setStrokeRGBColor:58,setFillRGBColor:59,setStrokeCMYKColor:60,setFillCMYKColor:61,shadingFill:62,beginInlineImage:63,beginImageData:64,endInlineImage:65,paintXObject:66,markPoint:67,markPointProps:68,beginMarkedContent:69,beginMarkedContentProps:70,endMarkedContent:71,beginCompat:72,endCompat:73,paintFormXObjectBegin:74,paintFormXObjectEnd:75,beginGroup:76,endGroup:77,beginAnnotation:80,endAnnotation:81,paintImageMaskXObject:83,paintImageMaskXObjectGroup:84,paintImageXObject:85,paintInlineImageXObject:86,paintInlineImageXObjectGroup:87,paintImageXObjectRepeat:88,paintImageMaskXObjectRepeat:89,paintSolidColorImageMask:90,constructPath:91,setStrokeTransparent:92,setFillTransparent:93,rawFillPath:94},ky={moveTo:0,lineTo:1,curveTo:2,quadraticCurveTo:3,closePath:4},KDi={NEED_PASSWORD:1,INCORRECT_PASSWORD:2};let bP=yP.WARNINGS;function WDi(t){Number.isInteger(t)&&(bP=t)}function JDi(){return bP}function wP(t){bP>=yP.INFOS&&console.info(`Info: ${t}`)}function ji(t){bP>=yP.WARNINGS&&console.warn(`Warning: ${t}`)}function yo(t){throw new Error(t)}function Cr(t,e){t||yo(e)}function ZDi(t){switch(t?.protocol){case"http:":case"https:":case"ftp:":case"mailto:":case"tel:":return!0;default:return!1}}function y7e(t,e=null,i=null){if(!t)return null;if(i&&typeof t=="string"&&(i.addDefaultProtocol&&t.startsWith("www.")&&t.match(/\./g)?.length>=2&&(t=`http://${t}`),i.tryConvertEncoding))try{t=t_i(t)}catch{}const r=e?URL.parse(t,e):URL.parse(t);return ZDi(r)?r:null}function b7e(t,e,i=!1){const r=URL.parse(t);return r?(r.hash=e,r.href):i&&y7e(t,"http://example.com")?t.split("#",1)[0]+`${e?`#${e}`:""}`:""}function Wi(t,e,i,r=!1){return Object.defineProperty(t,e,{value:i,enumerable:!r,configurable:!0,writable:!1}),i}const og=(function(){function t(e,i){this.message=e,this.name=i}return t.prototype=new Error,t.constructor=t,t})();let w7e=class extends og{constructor(t,e){super(t,"PasswordException"),this.code=e}},Eq=class extends og{constructor(t,e){super(t,"UnknownErrorException"),this.details=e}},Bq=class extends og{constructor(t){super(t,"InvalidPDFException")}},CP=class extends og{constructor(t,e,i){super(t,"ResponseException"),this.status=e,this.missing=i}},XDi=class extends og{constructor(t){super(t,"FormatError")}},$p=class extends og{constructor(t){super(t,"AbortException")}};function C7e(t){(typeof t!="object"||t?.length===void 0)&&yo("Invalid argument for bytesToString");const e=t.length,i=8192;if(e<i)return String.fromCharCode.apply(null,t);const r=[];for(let o=0;o<e;o+=i){const n=Math.min(o+i,e),s=t.subarray(o,n);r.push(String.fromCharCode.apply(null,s))}return r.join("")}function My(t){typeof t!="string"&&yo("Invalid argument for stringToBytes");const e=t.length,i=new Uint8Array(e);for(let r=0;r<e;++r)i[r]=t.charCodeAt(r)&255;return i}function YDi(t){return String.fromCharCode(t>>24&255,t>>16&255,t>>8&255,t&255)}function $Di(){const t=new Uint8Array(4);return t[0]=1,new Uint32Array(t.buffer,0,1)[0]===1}function e_i(){try{return new Function(""),!0}catch{return!1}}class Fs{static get isLittleEndian(){return Wi(this,"isLittleEndian",$Di())}static get isEvalSupported(){return Wi(this,"isEvalSupported",e_i())}static get isOffscreenCanvasSupported(){return Wi(this,"isOffscreenCanvasSupported",typeof OffscreenCanvas<"u")}static get isImageDecoderSupported(){return Wi(this,"isImageDecoderSupported",typeof ImageDecoder<"u")}static get isFloat16ArraySupported(){return Wi(this,"isFloat16ArraySupported",typeof Float16Array<"u")}static get isSanitizerSupported(){return Wi(this,"isSanitizerSupported",typeof Sanitizer<"u")}static get platform(){const{platform:e,userAgent:i}=navigator;return Wi(this,"platform",{isAndroid:i.includes("Android"),isLinux:e.includes("Linux"),isMac:e.includes("Mac"),isWindows:e.includes("Win"),isFirefox:i.includes("Firefox")})}static get isCSSRoundSupported(){return Wi(this,"isCSSRoundSupported",globalThis.CSS?.supports?.("width: round(1.5px, 1px)"))}}const Pq=Array.from(Array(256).keys(),t=>t.toString(16).padStart(2,"0"));let si=class{static makeHexColor(t,e,i){return`#${Pq[t]}${Pq[e]}${Pq[i]}`}static domMatrixToTransform(t){return[t.a,t.b,t.c,t.d,t.e,t.f]}static scaleMinMax(t,e){let i;t[0]?(t[0]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[0],e[2]*=t[0],t[3]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[3],e[3]*=t[3]):(i=e[0],e[0]=e[1],e[1]=i,i=e[2],e[2]=e[3],e[3]=i,t[1]<0&&(i=e[1],e[1]=e[3],e[3]=i),e[1]*=t[1],e[3]*=t[1],t[2]<0&&(i=e[0],e[0]=e[2],e[2]=i),e[0]*=t[2],e[2]*=t[2]),e[0]+=t[4],e[1]+=t[5],e[2]+=t[4],e[3]+=t[5]}static transform(t,e){return[t[0]*e[0]+t[2]*e[1],t[1]*e[0]+t[3]*e[1],t[0]*e[2]+t[2]*e[3],t[1]*e[2]+t[3]*e[3],t[0]*e[4]+t[2]*e[5]+t[4],t[1]*e[4]+t[3]*e[5]+t[5]]}static multiplyByDOMMatrix(t,e){return[t[0]*e.a+t[2]*e.b,t[1]*e.a+t[3]*e.b,t[0]*e.c+t[2]*e.d,t[1]*e.c+t[3]*e.d,t[0]*e.e+t[2]*e.f+t[4],t[1]*e.e+t[3]*e.f+t[5]]}static applyTransform(t,e,i=0){const r=t[i],o=t[i+1];t[i]=r*e[0]+o*e[2]+e[4],t[i+1]=r*e[1]+o*e[3]+e[5]}static applyTransformToBezier(t,e,i=0){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5];for(let c=0;c<6;c+=2){const d=t[i+c],u=t[i+c+1];t[i+c]=d*r+u*n+a,t[i+c+1]=d*o+u*s+l}}static applyInverseTransform(t,e){const i=t[0],r=t[1],o=e[0]*e[3]-e[1]*e[2];t[0]=(i*e[3]-r*e[2]+e[2]*e[5]-e[4]*e[3])/o,t[1]=(-i*e[1]+r*e[0]+e[4]*e[1]-e[5]*e[0])/o}static axialAlignedBoundingBox(t,e,i){const r=e[0],o=e[1],n=e[2],s=e[3],a=e[4],l=e[5],c=t[0],d=t[1],u=t[2],h=t[3];let p=r*c+a,g=p,f=r*u+a,m=f,A=s*d+l,v=A,y=s*h+l,b=y;if(o!==0||n!==0){const w=o*c,C=o*u,M=n*d,E=n*h;p+=M,m+=M,f+=E,g+=E,A+=w,b+=w,y+=C,v+=C}i[0]=Math.min(i[0],p,f,g,m),i[1]=Math.min(i[1],A,y,v,b),i[2]=Math.max(i[2],p,f,g,m),i[3]=Math.max(i[3],A,y,v,b)}static inverseTransform(t){const e=t[0]*t[3]-t[1]*t[2];return[t[3]/e,-t[1]/e,-t[2]/e,t[0]/e,(t[2]*t[5]-t[4]*t[3])/e,(t[4]*t[1]-t[5]*t[0])/e]}static singularValueDecompose2dScale(t,e){const i=t[0],r=t[1],o=t[2],n=t[3],s=i**2+r**2,a=i*o+r*n,l=o**2+n**2,c=(s+l)/2,d=Math.sqrt(c**2-(s*l-a**2));e[0]=Math.sqrt(c+d||1),e[1]=Math.sqrt(c-d||1)}static normalizeRect(t){const e=t.slice(0);return t[0]>t[2]&&(e[0]=t[2],e[2]=t[0]),t[1]>t[3]&&(e[1]=t[3],e[3]=t[1]),e}static intersect(t,e){const i=Math.max(Math.min(t[0],t[2]),Math.min(e[0],e[2])),r=Math.min(Math.max(t[0],t[2]),Math.max(e[0],e[2]));if(i>r)return null;const o=Math.max(Math.min(t[1],t[3]),Math.min(e[1],e[3])),n=Math.min(Math.max(t[1],t[3]),Math.max(e[1],e[3]));return o>n?null:[i,o,r,n]}static pointBoundingBox(t,e,i){i[0]=Math.min(i[0],t),i[1]=Math.min(i[1],e),i[2]=Math.max(i[2],t),i[3]=Math.max(i[3],e)}static rectBoundingBox(t,e,i,r,o){o[0]=Math.min(o[0],t,i),o[1]=Math.min(o[1],e,r),o[2]=Math.max(o[2],t,i),o[3]=Math.max(o[3],e,r)}static#e(t,e,i,r,o,n,s,a,l,c){if(l<=0||l>=1)return;const d=1-l,u=l*l,h=u*l,p=d*(d*(d*t+3*l*e)+3*u*i)+h*r,g=d*(d*(d*o+3*l*n)+3*u*s)+h*a;c[0]=Math.min(c[0],p),c[1]=Math.min(c[1],g),c[2]=Math.max(c[2],p),c[3]=Math.max(c[3],g)}static#t(t,e,i,r,o,n,s,a,l,c,d,u){if(Math.abs(l)<1e-12){Math.abs(c)>=1e-12&&this.#e(t,e,i,r,o,n,s,a,-d/c,u);return}const h=c**2-4*d*l;if(h<0)return;const p=Math.sqrt(h),g=2*l;this.#e(t,e,i,r,o,n,s,a,(-c+p)/g,u),this.#e(t,e,i,r,o,n,s,a,(-c-p)/g,u)}static bezierBoundingBox(t,e,i,r,o,n,s,a,l){l[0]=Math.min(l[0],t,s),l[1]=Math.min(l[1],e,a),l[2]=Math.max(l[2],t,s),l[3]=Math.max(l[3],e,a),this.#t(t,i,o,s,e,r,n,a,3*(-t+3*(i-o)+s),6*(t-2*i+o),3*(i-t),l),this.#t(t,i,o,s,e,r,n,a,3*(-e+3*(r-n)+a),6*(e-2*r+n),3*(r-e),l)}};function t_i(t){return decodeURIComponent(escape(t))}let Iq=null,x7e=null;function i_i(t){return Iq||(Iq=/([\u00a0\u00b5\u037e\u0eb3\u2000-\u200a\u202f\u2126\ufb00-\ufb04\ufb06\ufb20-\ufb36\ufb38-\ufb3c\ufb3e\ufb40-\ufb41\ufb43-\ufb44\ufb46-\ufba1\ufba4-\ufba9\ufbae-\ufbb1\ufbd3-\ufbdc\ufbde-\ufbe7\ufbea-\ufbf8\ufbfc-\ufbfd\ufc00-\ufc5d\ufc64-\ufcf1\ufcf5-\ufd3d\ufd88\ufdf4\ufdfa-\ufdfb\ufe71\ufe77\ufe79\ufe7b\ufe7d]+)|(\ufb05+)/gu,x7e=new Map([["\uFB05","\u017Ft"]])),t.replaceAll(Iq,(e,i,r)=>i?i.normalize("NFKC"):x7e.get(r))}function k7e(){if(typeof crypto.randomUUID=="function")return crypto.randomUUID();const t=new Uint8Array(32);return crypto.getRandomValues(t),C7e(t)}const J5="pdfjs_internal_id_";function r_i(t,e,i){if(!Array.isArray(i)||i.length<2)return!1;const[r,o,...n]=i;if(!t(r)&&!Number.isInteger(r)||!e(o))return!1;const s=n.length;let a=!0;switch(o.name){case"XYZ":if(s<2||s>3)return!1;break;case"Fit":case"FitB":return s===0;case"FitH":case"FitBH":case"FitV":case"FitBV":if(s>1)return!1;break;case"FitR":if(s!==4)return!1;a=!1;break;default:return!1}for(const l of n)if(!(typeof l=="number"||a&&l===null))return!1;return!0}function Ha(t,e,i){return Math.min(Math.max(t,e),i)}function M7e(t){return Uint8Array.prototype.toBase64?t.toBase64():btoa(C7e(t))}function o_i(t){return Uint8Array.fromBase64?Uint8Array.fromBase64(t):My(atob(t))}typeof Promise.try!="function"&&(Promise.try=function(t,...e){return new Promise(i=>{i(t(...e))})}),typeof Math.sumPrecise!="function"&&(Math.sumPrecise=function(t){return t.reduce((e,i)=>e+i,0)});class qb{static textContent(e){const i=[],r={items:i,styles:Object.create(null)};function o(n){if(!n)return;let s=null;const a=n.name;if(a==="#text")s=n.value;else if(qb.shouldBuildText(a))n?.attributes?.textContent?s=n.attributes.textContent:n.value&&(s=n.value);else return;if(s!==null&&i.push({str:s}),!!n.children)for(const l of n.children)o(l)}return o(e),r}static shouldBuildText(e){return!(e==="textarea"||e==="input"||e==="option"||e==="select")}}class E7e{static setupStorage(e,i,r,o,n){const s=o.getValue(i,{value:null});switch(r.name){case"textarea":if(s.value!==null&&(e.textContent=s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})});break;case"input":if(r.attributes.type==="radio"||r.attributes.type==="checkbox"){if(s.value===r.attributes.xfaOn?e.setAttribute("checked",!0):s.value===r.attributes.xfaOff&&e.removeAttribute("checked"),n==="print")break;e.addEventListener("change",a=>{o.setValue(i,{value:a.target.checked?a.target.getAttribute("xfaOn"):a.target.getAttribute("xfaOff")})})}else{if(s.value!==null&&e.setAttribute("value",s.value),n==="print")break;e.addEventListener("input",a=>{o.setValue(i,{value:a.target.value})})}break;case"select":if(s.value!==null){e.setAttribute("value",s.value);for(const a of r.children)a.attributes.value===s.value?a.attributes.selected=!0:a.attributes.hasOwnProperty("selected")&&delete a.attributes.selected}e.addEventListener("input",a=>{const l=a.target.options,c=l.selectedIndex===-1?"":l[l.selectedIndex].value;o.setValue(i,{value:c})});break}}static setAttributes({html:e,element:i,storage:r=null,intent:o,linkService:n}){const{attributes:s}=i,a=e instanceof HTMLAnchorElement;s.type==="radio"&&(s.name=`${s.name}-${o}`);for(const[l,c]of Object.entries(s))if(c!=null)switch(l){case"class":c.length&&e.setAttribute(l,c.join(" "));break;case"dataId":break;case"id":e.setAttribute("data-element-id",c);break;case"style":Object.assign(e.style,c);break;case"textContent":e.textContent=c;break;default:(!a||l!=="href"&&l!=="newWindow")&&e.setAttribute(l,c)}a&&n.addLinkAttributes(e,s.href,s.newWindow),r&&s.dataId&&this.setupStorage(e,s.dataId,i,r)}static render(e){const i=e.annotationStorage,r=e.linkService,o=e.xfaHtml,n=e.intent||"display",s=document.createElement(o.name);o.attributes&&this.setAttributes({html:s,element:o,intent:n,linkService:r});const a=n!=="richText",l=e.div;if(l.append(s),e.viewport){const u=`matrix(${e.viewport.transform.join(",")})`;l.style.transform=u}a&&l.setAttribute("class","xfaLayer xfaFont");const c=[];if(o.children.length===0){if(o.value){const u=document.createTextNode(o.value);s.append(u),a&&qb.shouldBuildText(o.name)&&c.push(u)}return{textDivs:c}}const d=[[o,-1,s]];for(;d.length>0;){const[u,h,p]=d.at(-1);if(h+1===u.children.length){d.pop();continue}const g=u.children[++d.at(-1)[1]];if(g===null)continue;const{name:f}=g;if(f==="#text"){const A=document.createTextNode(g.value);c.push(A),p.append(A);continue}const m=g?.attributes?.xmlns?document.createElementNS(g.attributes.xmlns,f):document.createElement(f);if(p.append(m),g.attributes&&this.setAttributes({html:m,element:g,storage:i,intent:n,linkService:r}),g.children?.length>0)d.push([g,-1,m]);else if(g.value){const A=document.createTextNode(g.value);a&&qb.shouldBuildText(f)&&c.push(A),m.append(A)}}for(const u of l.querySelectorAll(".xfaNonInteractive input, .xfaNonInteractive textarea"))u.setAttribute("readOnly",!0);return{textDivs:c}}static update(e){const i=`matrix(${e.viewport.transform.join(",")})`;e.div.style.transform=i,e.div.hidden=!1}}const l1="http://www.w3.org/2000/svg";class Z5{static CSS=96;static PDF=72;static PDF_TO_CSS_UNITS=this.CSS/this.PDF}async function Ey(t,e="text"){if(By(t,document.baseURI)){const i=await fetch(t);if(!i.ok)throw new Error(i.statusText);switch(e){case"arraybuffer":return i.arrayBuffer();case"blob":return i.blob();case"json":return i.json()}return i.text()}return new Promise((i,r)=>{const o=new XMLHttpRequest;o.open("GET",t,!0),o.responseType=e,o.onreadystatechange=()=>{if(o.readyState===XMLHttpRequest.DONE){if(o.status===200||o.status===0){switch(e){case"arraybuffer":case"blob":case"json":i(o.response);return}i(o.responseText);return}r(new Error(o.statusText))}},o.send(null)})}class Gb{constructor({viewBox:e,userUnit:i,scale:r,rotation:o,offsetX:n=0,offsetY:s=0,dontFlip:a=!1}){this.viewBox=e,this.userUnit=i,this.scale=r,this.rotation=o,this.offsetX=n,this.offsetY=s,r*=i;const l=(e[2]+e[0])/2,c=(e[3]+e[1])/2;let d,u,h,p;switch(o%=360,o<0&&(o+=360),o){case 180:d=-1,u=0,h=0,p=1;break;case 90:d=0,u=1,h=1,p=0;break;case 270:d=0,u=-1,h=-1,p=0;break;case 0:d=1,u=0,h=0,p=-1;break;default:throw new Error("PageViewport: Invalid rotation, must be a multiple of 90 degrees.")}a&&(h=-h,p=-p);let g,f,m,A;d===0?(g=Math.abs(c-e[1])*r+n,f=Math.abs(l-e[0])*r+s,m=(e[3]-e[1])*r,A=(e[2]-e[0])*r):(g=Math.abs(l-e[0])*r+n,f=Math.abs(c-e[1])*r+s,m=(e[2]-e[0])*r,A=(e[3]-e[1])*r),this.transform=[d*r,u*r,h*r,p*r,g-d*r*l-h*r*c,f-u*r*l-p*r*c],this.width=m,this.height=A}get rawDims(){const e=this.viewBox;return Wi(this,"rawDims",{pageWidth:e[2]-e[0],pageHeight:e[3]-e[1],pageX:e[0],pageY:e[1]})}clone({scale:e=this.scale,rotation:i=this.rotation,offsetX:r=this.offsetX,offsetY:o=this.offsetY,dontFlip:n=!1}={}){return new Gb({viewBox:this.viewBox.slice(),userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}convertToViewportPoint(e,i){const r=[e,i];return si.applyTransform(r,this.transform),r}convertToViewportRectangle(e){const i=[e[0],e[1]];si.applyTransform(i,this.transform);const r=[e[2],e[3]];return si.applyTransform(r,this.transform),[i[0],i[1],r[0],r[1]]}convertToPdfPoint(e,i){const r=[e,i];return si.applyInverseTransform(r,this.transform),r}}class Sq extends og{constructor(e,i=0){super(e,"RenderingCancelledException"),this.extraDelay=i}}function xP(t){const e=t.length;let i=0;for(;i<e&&t[i].trim()==="";)i++;return t.substring(i,i+5).toLowerCase()==="data:"}function Tq(t){return typeof t=="string"&&/\.pdf$/i.test(t)}function n_i(t){return[t]=t.split(/[#?]/,1),t.substring(t.lastIndexOf("/")+1)}function s_i(t,e="document.pdf"){if(typeof t!="string")return e;if(xP(t))return ji('getPdfFilenameFromUrl: ignore "data:"-URL for performance reasons.'),e;const i=(s=>{try{return new URL(s)}catch{try{return new URL(decodeURIComponent(s))}catch{try{return new URL(s,"https://foo.bar")}catch{try{return new URL(decodeURIComponent(s),"https://foo.bar")}catch{return null}}}}})(t);if(!i)return e;const r=s=>{try{let a=decodeURIComponent(s);return a.includes("/")?(a=a.split("/").at(-1),a.test(/^\.pdf$/i)?a:s):a}catch{return s}},o=/\.pdf$/i,n=i.pathname.split("/").at(-1);if(o.test(n))return r(n);if(i.searchParams.size>0){const s=Array.from(i.searchParams.values()).reverse();for(const l of s)if(o.test(l))return r(l);const a=Array.from(i.searchParams.keys()).reverse();for(const l of a)if(o.test(l))return r(l)}if(i.hash){const s=/[^/?#=]+\.pdf\b(?!.*\.pdf\b)/i.exec(i.hash);if(s)return r(s[0])}return e}class B7e{started=Object.create(null);times=[];time(e){e in this.started&&ji(`Timer is already running for ${e}`),this.started[e]=Date.now()}timeEnd(e){e in this.started||ji(`Timer has not been started for ${e}`),this.times.push({name:e,start:this.started[e],end:Date.now()}),delete this.started[e]}toString(){const e=[];let i=0;for(const{name:r}of this.times)i=Math.max(r.length,i);for(const{name:r,start:o,end:n}of this.times)e.push(`${r.padEnd(i)} ${n-o}ms
5319
5319
  `);return e.join("")}}function By(t,e){const i=e?URL.parse(t,e):URL.parse(t);return i?.protocol==="http:"||i?.protocol==="https:"}function Fc(t){t.preventDefault()}function pn(t){t.preventDefault(),t.stopPropagation()}function a_i(t){console.log("Deprecated API usage: "+t)}class Rq{static#e;static toDateObject(e){if(e instanceof Date)return e;if(!e||typeof e!="string")return null;this.#e||=new RegExp("^D:(\\d{4})(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?(\\d{2})?([Z|+|-])?(\\d{2})?'?(\\d{2})?'?");const i=this.#e.exec(e);if(!i)return null;const r=parseInt(i[1],10);let o=parseInt(i[2],10);o=o>=1&&o<=12?o-1:0;let n=parseInt(i[3],10);n=n>=1&&n<=31?n:1;let s=parseInt(i[4],10);s=s>=0&&s<=23?s:0;let a=parseInt(i[5],10);a=a>=0&&a<=59?a:0;let l=parseInt(i[6],10);l=l>=0&&l<=59?l:0;const c=i[7]||"Z";let d=parseInt(i[8],10);d=d>=0&&d<=23?d:0;let u=parseInt(i[9],10)||0;return u=u>=0&&u<=59?u:0,c==="-"?(s+=d,a+=u):c==="+"&&(s-=d,a-=u),new Date(Date.UTC(r,o,n,s,a,l))}}function l_i(t,{scale:e=1,rotation:i=0}){const{width:r,height:o}=t.attributes.style,n=[0,0,parseInt(r),parseInt(o)];return new Gb({viewBox:n,userUnit:1,scale:e,rotation:i})}function Py(t){if(t.startsWith("#")){const e=parseInt(t.slice(1),16);return[(e&16711680)>>16,(e&65280)>>8,e&255]}return t.startsWith("rgb(")?t.slice(4,-1).split(",").map(e=>parseInt(e)):t.startsWith("rgba(")?t.slice(5,-1).split(",").map(e=>parseInt(e)).slice(0,3):(ji(`Not a valid color format: "${t}"`),[0,0,0])}function c_i(t){const e=document.createElement("span");e.style.visibility="hidden",e.style.colorScheme="only light",document.body.append(e);for(const i of t.keys()){e.style.color=i;const r=window.getComputedStyle(e).color;t.set(i,Py(r))}e.remove()}function en(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform();return[e,i,r,o,n,s]}function Ru(t){const{a:e,b:i,c:r,d:o,e:n,f:s}=t.getTransform().invertSelf();return[e,i,r,o,n,s]}function ng(t,e,i=!1,r=!0){if(e instanceof Gb){const{pageWidth:o,pageHeight:n}=e.rawDims,{style:s}=t,a=Fs.isCSSRoundSupported,l=`var(--total-scale-factor) * ${o}px`,c=`var(--total-scale-factor) * ${n}px`,d=a?`round(down, ${l}, var(--scale-round-x))`:`calc(${l})`,u=a?`round(down, ${c}, var(--scale-round-y))`:`calc(${c})`;!i||e.rotation%180===0?(s.width=d,s.height=u):(s.width=u,s.height=d)}r&&t.setAttribute("data-main-rotation",e.rotation)}class Wu{constructor(){const{pixelRatio:e}=Wu;this.sx=e,this.sy=e}get scaled(){return this.sx!==1||this.sy!==1}get symmetric(){return this.sx===this.sy}limitCanvas(e,i,r,o,n=-1){let s=1/0,a=1/0,l=1/0;r=Wu.capPixels(r,n),r>0&&(s=Math.sqrt(r/(e*i))),o!==-1&&(a=o/e,l=o/i);const c=Math.min(s,a,l);return this.sx>c||this.sy>c?(this.sx=c,this.sy=c,!0):!1}static get pixelRatio(){return globalThis.devicePixelRatio||1}static capPixels(e,i){if(i>=0){const r=Math.ceil(window.screen.availWidth*window.screen.availHeight*this.pixelRatio**2*(1+i/100));return e>0?Math.min(e,r):r}return e}}const Dq=["image/apng","image/avif","image/bmp","image/gif","image/jpeg","image/png","image/svg+xml","image/webp","image/x-icon"];class d_i{static get isDarkMode(){return Wi(this,"isDarkMode",!!window?.matchMedia?.("(prefers-color-scheme: dark)").matches)}}class u_i{static get commentForegroundColor(){const e=document.createElement("span");e.classList.add("comment","sidebar");const{style:i}=e;i.width=i.height="0",i.display="none",i.color="var(--comment-fg-color)",document.body.append(e);const{color:r}=window.getComputedStyle(e);return e.remove(),Wi(this,"commentForegroundColor",Py(r))}}function h_i(t,e,i,r){r=Math.min(Math.max(r??1,0),1);const o=255*(1-r);return t=Math.round(t*r+o),e=Math.round(e*r+o),i=Math.round(i*r+o),[t,e,i]}function P7e(t,e){const i=t[0]/255,r=t[1]/255,o=t[2]/255,n=Math.max(i,r,o),s=Math.min(i,r,o),a=(n+s)/2;if(n===s)e[0]=e[1]=0;else{const l=n-s;switch(e[1]=a<.5?l/(n+s):l/(2-n-s),n){case i:e[0]=((r-o)/l+(r<o?6:0))*60;break;case r:e[0]=((o-i)/l+2)*60;break;case o:e[0]=((i-r)/l+4)*60;break}}e[2]=a}function _q(t,e){const i=t[0],r=t[1],o=t[2],n=(1-Math.abs(2*o-1))*r,s=n*(1-Math.abs(i/60%2-1)),a=o-n/2;switch(Math.floor(i/60)){case 0:e[0]=n+a,e[1]=s+a,e[2]=a;break;case 1:e[0]=s+a,e[1]=n+a,e[2]=a;break;case 2:e[0]=a,e[1]=n+a,e[2]=s+a;break;case 3:e[0]=a,e[1]=s+a,e[2]=n+a;break;case 4:e[0]=s+a,e[1]=a,e[2]=n+a;break;case 5:case 6:e[0]=n+a,e[1]=a,e[2]=s+a;break}}function I7e(t){return t<=.03928?t/12.92:((t+.055)/1.055)**2.4}function S7e(t,e,i){_q(t,i),i.map(I7e);const r=.2126*i[0]+.7152*i[1]+.0722*i[2];_q(e,i),i.map(I7e);const o=.2126*i[0]+.7152*i[1]+.0722*i[2];return r>o?(r+.05)/(o+.05):(o+.05)/(r+.05)}const T7e=new Map;function p_i(t,e){const i=t[0]+t[1]*256+t[2]*65536+e[0]*16777216+e[1]*4294967296+e[2]*1099511627776;let r=T7e.get(i);if(r)return r;const o=new Float32Array(9),n=o.subarray(0,3),s=o.subarray(3,6);P7e(t,s);const a=o.subarray(6,9);P7e(e,a);const l=a[2]<.5,c=l?12:4.5;if(s[2]=l?Math.sqrt(s[2]):1-Math.sqrt(1-s[2]),S7e(s,a,n)<c){let d,u;l?(d=s[2],u=1):(d=0,u=s[2]);const h=.005;for(;u-d>h;){const p=s[2]=(d+u)/2;l===S7e(s,a,n)<c?d=p:u=p}s[2]=l?u:d}return _q(s,n),r=si.makeHexColor(Math.round(n[0]*255),Math.round(n[1]*255),Math.round(n[2]*255)),T7e.set(i,r),r}function R7e({html:t,dir:e,className:i},r){const o=document.createDocumentFragment();if(typeof t=="string"){const n=document.createElement("p");n.dir=e||"auto";const s=t.split(/(?:\r\n?|\n)/);for(let a=0,l=s.length;a<l;++a){const c=s[a];n.append(document.createTextNode(c)),a<l-1&&n.append(document.createElement("br"))}o.append(n)}else E7e.render({xfaHtml:t,div:o,intent:"richText"});o.firstChild.classList.add("richText",i),r.append(o)}function D7e(t){const e=new Path2D;if(!t)return e;for(let i=0,r=t.length;i<r;)switch(t[i++]){case ky.moveTo:e.moveTo(t[i++],t[i++]);break;case ky.lineTo:e.lineTo(t[i++],t[i++]);break;case ky.curveTo:e.bezierCurveTo(t[i++],t[i++],t[i++],t[i++],t[i++],t[i++]);break;case ky.quadraticCurveTo:e.quadraticCurveTo(t[i++],t[i++],t[i++],t[i++]);break;case ky.closePath:e.closePath();break;default:ji(`Unrecognized drawing path operator: ${t[i-1]}`);break}return e}class Qb{#e=null;#t=null;#r;#i=null;#o=null;#n=null;#s=null;#a=null;static#l=null;constructor(e){this.#r=e,Qb.#l||=Object.freeze({freetext:"pdfjs-editor-remove-freetext-button",highlight:"pdfjs-editor-remove-highlight-button",ink:"pdfjs-editor-remove-ink-button",stamp:"pdfjs-editor-remove-stamp-button",signature:"pdfjs-editor-remove-signature-button"})}render(){const e=this.#e=document.createElement("div");e.classList.add("editToolbar","hidden"),e.setAttribute("role","toolbar");const i=this.#r._uiManager._signal;i instanceof AbortSignal&&!i.aborted&&(e.addEventListener("contextmenu",Fc,{signal:i}),e.addEventListener("pointerdown",Qb.#c,{signal:i}));const r=this.#i=document.createElement("div");r.className="buttons",e.append(r);const o=this.#r.toolbarPosition;if(o){const{style:n}=e,s=this.#r._uiManager.direction==="ltr"?1-o[0]:o[0];n.insetInlineEnd=`${100*s}%`,n.top=`calc(${100*o[1]}% + var(--editor-toolbar-vert-offset))`}return e}get div(){return this.#e}static#c(e){e.stopPropagation()}#h(e){this.#r._focusEventsAllowed=!1,pn(e)}#u(e){this.#r._focusEventsAllowed=!0,pn(e)}#p(e){const i=this.#r._uiManager._signal;return!(i instanceof AbortSignal)||i.aborted?!1:(e.addEventListener("focusin",this.#h.bind(this),{capture:!0,signal:i}),e.addEventListener("focusout",this.#u.bind(this),{capture:!0,signal:i}),e.addEventListener("contextmenu",Fc,{signal:i}),!0)}hide(){this.#e.classList.add("hidden"),this.#t?.hideDropdown()}show(){this.#e.classList.remove("hidden"),this.#o?.shown(),this.#n?.shown()}addDeleteButton(){const{editorType:e,_uiManager:i}=this.#r,r=document.createElement("button");r.classList.add("basic","deleteButton"),r.tabIndex=0,r.setAttribute("data-l10n-id",Qb.#l[e]),this.#p(r)&&r.addEventListener("click",o=>{i.delete()},{signal:i._signal}),this.#i.append(r)}get#A(){const e=document.createElement("div");return e.className="divider",e}async addAltText(e){const i=await e.render();this.#p(i),this.#i.append(i,this.#A),this.#o=e}addComment(e,i=null){if(this.#n)return;const r=e.renderForToolbar();if(!r)return;this.#p(r);const o=this.#s=this.#A;i?(this.#i.insertBefore(r,i),this.#i.insertBefore(o,i)):this.#i.append(r,o),this.#n=e,e.toolbar=this}addColorPicker(e){if(this.#t)return;this.#t=e;const i=e.renderButton();this.#p(i),this.#i.append(i,this.#A)}async addEditSignatureButton(e){const i=this.#a=await e.renderEditButton(this.#r);this.#p(i),this.#i.append(i,this.#A)}removeButton(e){switch(e){case"comment":this.#n?.removeToolbarCommentButton(),this.#n=null,this.#s?.remove(),this.#s=null;break}}async addButton(e,i){switch(e){case"colorPicker":i&&this.addColorPicker(i);break;case"altText":i&&await this.addAltText(i);break;case"editSignature":i&&await this.addEditSignatureButton(i);break;case"delete":this.addDeleteButton();break;case"comment":i&&this.addComment(i);break}}async addButtonBefore(e,i,r){if(!i&&e==="comment")return;const o=this.#i.querySelector(r);o&&e==="comment"&&this.addComment(i,o)}updateEditSignatureButton(e){this.#a&&(this.#a.title=e)}remove(){this.#e.remove(),this.#t?.destroy(),this.#t=null}}class f_i{#e=null;#t=null;#r;constructor(e){this.#r=e}#i(){const e=this.#t=document.createElement("div");e.className="editToolbar",e.setAttribute("role","toolbar");const i=this.#r._signal;i instanceof AbortSignal&&!i.aborted&&e.addEventListener("contextmenu",Fc,{signal:i});const r=this.#e=document.createElement("div");return r.className="buttons",e.append(r),this.#r.hasCommentManager()&&this.#n("commentButton","pdfjs-comment-floating-button","pdfjs-comment-floating-button-label",()=>{this.#r.commentSelection("floating_button")}),this.#n("highlightButton","pdfjs-highlight-floating-button1","pdfjs-highlight-floating-button-label",()=>{this.#r.highlightSelection("floating_button")}),e}#o(e,i){let r=0,o=0;for(const n of e){const s=n.y+n.height;if(s<r)continue;const a=n.x+(i?n.width:0);if(s>r){o=a,r=s;continue}i?a>o&&(o=a):a<o&&(o=a)}return[i?1-o:o,r]}show(e,i,r){const[o,n]=this.#o(i,r),{style:s}=this.#t||=this.#i();e.append(this.#t),s.insetInlineEnd=`${100*o}%`,s.top=`calc(${100*n}% + var(--editor-toolbar-vert-offset))`}hide(){this.#t.remove()}#n(e,i,r,o){const n=document.createElement("button");n.classList.add("basic",e),n.tabIndex=0,n.setAttribute("data-l10n-id",i);const s=document.createElement("span");n.append(s),s.className="visuallyHidden",s.setAttribute("data-l10n-id",r);const a=this.#r._signal;a instanceof AbortSignal&&!a.aborted&&(n.addEventListener("contextmenu",Fc,{signal:a}),n.addEventListener("click",o,{signal:a})),this.#e.append(n)}}function _7e(t,e,i){for(const r of i)e.addEventListener(r,t[r].bind(t))}class Kr{static#e=NaN;static#t=null;static#r=NaN;static#i=null;static initializeAndAddPointerId(e){(Kr.#t||=new Set).add(e)}static setPointer(e,i){Kr.#e||=i,Kr.#i??=e}static setTimeStamp(e){Kr.#r=e}static isSamePointerId(e){return Kr.#e===e}static isSamePointerIdOrRemove(e){return Kr.#e===e?!0:(Kr.#t?.delete(e),!1)}static isSamePointerType(e){return Kr.#i===e}static isInitializedAndDifferentPointerType(e){return Kr.#i!==null&&!Kr.isSamePointerType(e)}static isSameTimeStamp(e){return Kr.#r===e}static isUsingMultiplePointers(){return Kr.#t?.size>=1}static clearPointerType(){Kr.#i=null}static clearPointerIds(){Kr.#e=NaN,Kr.#t=null}static clearTimeStamp(){Kr.#r=NaN}}class g_i{#e=0;get id(){return`${Cy}${this.#e++}`}}class WQ{#e=k7e();#t=0;#r=null;static get _isSVGFittingCanvas(){const e='data:image/svg+xml;charset=UTF-8,<svg viewBox="0 0 1 1" width="1" height="1" xmlns="http://www.w3.org/2000/svg"><rect width="1" height="1" style="fill:red;"/></svg>',i=new OffscreenCanvas(1,3).getContext("2d",{willReadFrequently:!0}),r=new Image;r.src=e;const o=r.decode().then(()=>(i.drawImage(r,0,0,1,1,0,0,1,3),new Uint32Array(i.getImageData(0,0,1,1).data.buffer)[0]===0));return Wi(this,"_isSVGFittingCanvas",o)}async#i(e,i){this.#r||=new Map;let r=this.#r.get(e);if(r===null)return null;if(r?.bitmap)return r.refCounter+=1,r;try{r||={bitmap:null,id:`image_${this.#e}_${this.#t++}`,refCounter:0,isSvg:!1};let o;if(typeof i=="string"?(r.url=i,o=await Ey(i,"blob")):i instanceof File?o=r.file=i:i instanceof Blob&&(o=i),o.type==="image/svg+xml"){const n=WQ._isSVGFittingCanvas,s=new FileReader,a=new Image,l=new Promise((c,d)=>{a.onload=()=>{r.bitmap=a,r.isSvg=!0,c()},s.onload=async()=>{const u=r.svgUrl=s.result;a.src=await n?`${u}#svgView(preserveAspectRatio(none))`:u},a.onerror=s.onerror=d});s.readAsDataURL(o),await l}else r.bitmap=await createImageBitmap(o);r.refCounter=1}catch(o){ji(o),r=null}return this.#r.set(e,r),r&&this.#r.set(r.id,r),r}async getFromFile(e){const{lastModified:i,name:r,size:o,type:n}=e;return this.#i(`${i}_${r}_${o}_${n}`,e)}async getFromUrl(e){return this.#i(e,e)}async getFromBlob(e,i){const r=await i;return this.#i(e,r)}async getFromId(e){this.#r||=new Map;const i=this.#r.get(e);if(!i)return null;if(i.bitmap)return i.refCounter+=1,i;if(i.file)return this.getFromFile(i.file);if(i.blobPromise){const{blobPromise:r}=i;return delete i.blobPromise,this.getFromBlob(i.id,r)}return this.getFromUrl(i.url)}getFromCanvas(e,i){this.#r||=new Map;let r=this.#r.get(e);if(r?.bitmap)return r.refCounter+=1,r;const o=new OffscreenCanvas(i.width,i.height);return o.getContext("2d").drawImage(i,0,0),r={bitmap:o.transferToImageBitmap(),id:`image_${this.#e}_${this.#t++}`,refCounter:1,isSvg:!1},this.#r.set(e,r),this.#r.set(r.id,r),r}getSvgUrl(e){const i=this.#r.get(e);return i?.isSvg?i.svgUrl:null}deleteId(e){this.#r||=new Map;const i=this.#r.get(e);if(!i||(i.refCounter-=1,i.refCounter!==0))return;const{bitmap:r}=i;if(!i.url&&!i.file){const o=new OffscreenCanvas(r.width,r.height);o.getContext("bitmaprenderer").transferFromImageBitmap(r),i.blobPromise=o.convertToBlob()}r.close?.(),i.bitmap=null}isValidId(e){return e.startsWith(`image_${this.#e}_`)}}class A_i{#e=[];#t=!1;#r;#i=-1;constructor(e=128){this.#r=e}add({cmd:e,undo:i,post:r,mustExec:o,type:n=NaN,overwriteIfSameType:s=!1,keepUndo:a=!1}){if(o&&e(),this.#t)return;const l={cmd:e,undo:i,post:r,type:n};if(this.#i===-1){this.#e.length>0&&(this.#e.length=0),this.#i=0,this.#e.push(l);return}if(s&&this.#e[this.#i].type===n){a&&(l.undo=this.#e[this.#i].undo),this.#e[this.#i]=l;return}const c=this.#i+1;c===this.#r?this.#e.splice(0,1):(this.#i=c,c<this.#e.length&&this.#e.splice(c)),this.#e.push(l)}undo(){if(this.#i===-1)return;this.#t=!0;const{undo:e,post:i}=this.#e[this.#i];e(),i?.(),this.#t=!1,this.#i-=1}redo(){if(this.#i<this.#e.length-1){this.#i+=1,this.#t=!0;const{cmd:e,post:i}=this.#e[this.#i];e(),i?.(),this.#t=!1}}hasSomethingToUndo(){return this.#i!==-1}hasSomethingToRedo(){return this.#i<this.#e.length-1}cleanType(e){if(this.#i!==-1){for(let i=this.#i;i>=0;i--)if(this.#e[i].type!==e){this.#e.splice(i+1,this.#i-i),this.#i=i;return}this.#e.length=0,this.#i=-1}}destroy(){this.#e=null}}class Iy{constructor(e){this.buffer=[],this.callbacks=new Map,this.allKeys=new Set;const{isMac:i}=Fs.platform;for(const[r,o,n={}]of e)for(const s of r){const a=s.startsWith("mac+");i&&a?(this.callbacks.set(s.slice(4),{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1))):!i&&!a&&(this.callbacks.set(s,{callback:o,options:n}),this.allKeys.add(s.split("+").at(-1)))}}#e(e){e.altKey&&this.buffer.push("alt"),e.ctrlKey&&this.buffer.push("ctrl"),e.metaKey&&this.buffer.push("meta"),e.shiftKey&&this.buffer.push("shift"),this.buffer.push(e.key);const i=this.buffer.join("+");return this.buffer.length=0,i}exec(e,i){if(!this.allKeys.has(i.key))return;const r=this.callbacks.get(this.#e(i));if(!r)return;const{callback:o,options:{bubbles:n=!1,args:s=[],checker:a=null}}=r;a&&!a(e,i)||(o.bind(e,...s,i)(),n||pn(i))}}class JQ{static _colorsMapping=new Map([["CanvasText",[0,0,0]],["Canvas",[255,255,255]]]);get _colors(){const e=new Map([["CanvasText",null],["Canvas",null]]);return c_i(e),Wi(this,"_colors",e)}convert(e){const i=Py(e);if(!window.matchMedia("(forced-colors: active)").matches)return i;for(const[r,o]of this._colors)if(o.every((n,s)=>n===i[s]))return JQ._colorsMapping.get(r);return i}getHexCode(e){const i=this._colors.get(e);return i?si.makeHexColor(...i):e}}class w0{#e=new AbortController;#t=null;#r=null;#i=new Map;#o=new Map;#n=null;#s=null;#a=null;#l=new A_i;#c=null;#h=null;#u=null;#p=0;#A=new Set;#g=null;#d=null;#f=new Set;_editorUndoBar=null;#m=!1;#y=!1;#v=!1;#M=null;#x=null;#w=null;#B=null;#b=!1;#k=null;#S=new g_i;#P=!1;#I=!1;#O=!1;#R=null;#_=null;#U=null;#L=null;#q=null;#E=zi.NONE;#C=new Set;#D=null;#N=null;#H=null;#K=null;#Q=null;#W={isEditing:!1,isEmpty:!0,hasSomethingToUndo:!1,hasSomethingToRedo:!1,hasSelectedEditor:!1,hasSelectedText:!1};#z=[0,0];#F=null;#G=null;#Y=null;#$=null;#j=null;static TRANSLATE_SMALL=1;static TRANSLATE_BIG=10;static get _keyboardManager(){const e=w0.prototype,i=s=>s.#G.contains(document.activeElement)&&document.activeElement.tagName!=="BUTTON"&&s.hasSomethingToControl(),r=(s,{target:a})=>{if(a instanceof HTMLInputElement){const{type:l}=a;return l!=="text"&&l!=="number"}return!0},o=this.TRANSLATE_SMALL,n=this.TRANSLATE_BIG;return Wi(this,"_keyboardManager",new Iy([[["ctrl+a","mac+meta+a"],e.selectAll,{checker:r}],[["ctrl+z","mac+meta+z"],e.undo,{checker:r}],[["ctrl+y","ctrl+shift+z","mac+meta+shift+z","ctrl+shift+Z","mac+meta+shift+Z"],e.redo,{checker:r}],[["Backspace","alt+Backspace","ctrl+Backspace","shift+Backspace","mac+Backspace","mac+alt+Backspace","mac+ctrl+Backspace","Delete","ctrl+Delete","shift+Delete","mac+Delete"],e.delete,{checker:r}],[["Enter","mac+Enter"],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&s.#G.contains(a)&&!s.isEnterHandled}],[[" ","mac+ "],e.addNewEditorFromKeyboard,{checker:(s,{target:a})=>!(a instanceof HTMLButtonElement)&&s.#G.contains(document.activeElement)}],[["Escape","mac+Escape"],e.unselectAll],[["ArrowLeft","mac+ArrowLeft"],e.translateSelectedEditors,{args:[-o,0],checker:i}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e.translateSelectedEditors,{args:[-n,0],checker:i}],[["ArrowRight","mac+ArrowRight"],e.translateSelectedEditors,{args:[o,0],checker:i}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e.translateSelectedEditors,{args:[n,0],checker:i}],[["ArrowUp","mac+ArrowUp"],e.translateSelectedEditors,{args:[0,-o],checker:i}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e.translateSelectedEditors,{args:[0,-n],checker:i}],[["ArrowDown","mac+ArrowDown"],e.translateSelectedEditors,{args:[0,o],checker:i}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e.translateSelectedEditors,{args:[0,n],checker:i}]]))}constructor(e,i,r,o,n,s,a,l,c,d,u,h,p,g,f,m){const A=this._signal=this.#e.signal;this.#G=e,this.#Y=i,this.#$=r,this.#n=o,this.#c=n,this.#N=s,this.#Q=l,this._eventBus=a,a._on("editingaction",this.onEditingAction.bind(this),{signal:A}),a._on("pagechanging",this.onPageChanging.bind(this),{signal:A}),a._on("scalechanging",this.onScaleChanging.bind(this),{signal:A}),a._on("rotationchanging",this.onRotationChanging.bind(this),{signal:A}),a._on("setpreference",this.onSetPreference.bind(this),{signal:A}),a._on("switchannotationeditorparams",v=>this.updateParams(v.type,v.value),{signal:A}),window.addEventListener("pointerdown",()=>{this.#I=!0},{capture:!0,signal:A}),window.addEventListener("pointerup",()=>{this.#I=!1},{capture:!0,signal:A}),this.#se(),this.#he(),this.#te(),this.#s=l.annotationStorage,this.#M=l.filterFactory,this.#H=c,this.#B=d||null,this.#m=u,this.#y=h,this.#v=p,this.#q=g||null,this.viewParameters={realScale:Z5.PDF_TO_CSS_UNITS,rotation:0},this.isShiftKeyDown=!1,this._editorUndoBar=f||null,this._supportsPinchToZoom=m!==!1,n?.setSidebarUiManager(this)}destroy(){this.#j?.resolve(),this.#j=null,this.#e?.abort(),this.#e=null,this._signal=null;for(const e of this.#o.values())e.destroy();this.#o.clear(),this.#i.clear(),this.#f.clear(),this.#L?.clear(),this.#t=null,this.#C.clear(),this.#l.destroy(),this.#n?.destroy(),this.#c?.destroy(),this.#N?.destroy(),this.#k?.hide(),this.#k=null,this.#U?.destroy(),this.#U=null,this.#r=null,this.#x&&(clearTimeout(this.#x),this.#x=null),this.#F&&(clearTimeout(this.#F),this.#F=null),this._editorUndoBar?.destroy(),this.#Q=null}combinedSignal(e){return AbortSignal.any([this._signal,e.signal])}get mlManager(){return this.#q}get useNewAltTextFlow(){return this.#y}get useNewAltTextWhenAddingImage(){return this.#v}get hcmFilter(){return Wi(this,"hcmFilter",this.#H?this.#M.addHCMFilter(this.#H.foreground,this.#H.background):"none")}get direction(){return Wi(this,"direction",getComputedStyle(this.#G).direction)}get _highlightColors(){return Wi(this,"_highlightColors",this.#B?new Map(this.#B.split(",").map(e=>(e=e.split("=").map(i=>i.trim()),e[1]=e[1].toUpperCase(),e))):null)}get highlightColors(){const{_highlightColors:e}=this;if(!e)return Wi(this,"highlightColors",null);const i=new Map,r=!!this.#H;for(const[o,n]of e){const s=o.endsWith("_HCM");if(r&&s){i.set(o.replace("_HCM",""),n);continue}!r&&!s&&i.set(o,n)}return Wi(this,"highlightColors",i)}get highlightColorNames(){return Wi(this,"highlightColorNames",this.highlightColors?new Map(Array.from(this.highlightColors,e=>e.reverse())):null)}getNonHCMColor(e){if(!this._highlightColors)return e;const i=this.highlightColorNames.get(e);return this._highlightColors.get(i)||e}getNonHCMColorName(e){return this.highlightColorNames.get(e)||e}setCurrentDrawingSession(e){e?(this.unselectAll(),this.disableUserSelect(!0)):this.disableUserSelect(!1),this.#u=e}setMainHighlightColorPicker(e){this.#U=e}editAltText(e,i=!1){this.#n?.editAltText(this,e,i)}hasCommentManager(){return!!this.#c}editComment(e,i,r,o){this.#c?.showDialog(this,e,i,r,o)}selectComment(e,i){this.#o.get(e)?.getEditorByUID(i)?.toggleComment(!0,!0)}updateComment(e){this.#c?.updateComment(e.getData())}updatePopupColor(e){this.#c?.updatePopupColor(e)}removeComment(e){this.#c?.removeComments([e.uid])}toggleComment(e,i,r=void 0){this.#c?.toggleCommentPopup(e,i,r)}makeCommentColor(e,i){return e&&this.#c?.makeCommentColor(e,i)||null}getCommentDialogElement(){return this.#c?.dialogElement||null}async waitForEditorsRendered(e){if(this.#o.has(e-1))return;const{resolve:i,promise:r}=Promise.withResolvers(),o=n=>{n.pageNumber===e&&(this._eventBus._off("editorsrendered",o),i())};this._eventBus.on("editorsrendered",o),await r}getSignature(e){this.#N?.getSignature({uiManager:this,editor:e})}get signatureManager(){return this.#N}switchToMode(e,i){this._eventBus.on("annotationeditormodechanged",i,{once:!0,signal:this._signal}),this._eventBus.dispatch("showannotationeditorui",{source:this,mode:e})}setPreference(e,i){this._eventBus.dispatch("setpreference",{source:this,name:e,value:i})}onSetPreference({name:e,value:i}){switch(e){case"enableNewAltTextWhenAddingImage":this.#v=i;break}}onPageChanging({pageNumber:e}){this.#p=e-1}focusMainContainer(){this.#G.focus()}findParent(e,i){for(const r of this.#o.values()){const{x:o,y:n,width:s,height:a}=r.div.getBoundingClientRect();if(e>=o&&e<=o+s&&i>=n&&i<=n+a)return r}return null}disableUserSelect(e=!1){this.#Y.classList.toggle("noUserSelect",e)}addShouldRescale(e){this.#f.add(e)}removeShouldRescale(e){this.#f.delete(e)}onScaleChanging({scale:e}){this.commitOrRemove(),this.viewParameters.realScale=e*Z5.PDF_TO_CSS_UNITS;for(const i of this.#f)i.onScaleChanging();this.#u?.onScaleChanging()}onRotationChanging({pagesRotation:e}){this.commitOrRemove(),this.viewParameters.rotation=e}#X({anchorNode:e}){return e.nodeType===Node.TEXT_NODE?e.parentElement:e}#ee(e){const{currentLayer:i}=this;if(i.hasTextLayer(e))return i;for(const r of this.#o.values())if(r.hasTextLayer(e))return r;return null}highlightSelection(e="",i=!1){const r=document.getSelection();if(!r||r.isCollapsed)return;const{anchorNode:o,anchorOffset:n,focusNode:s,focusOffset:a}=r,l=r.toString(),c=this.#X(r).closest(".textLayer"),d=this.getSelectionBoxes(c);if(!d)return;r.empty();const u=this.#ee(c),h=this.#E===zi.NONE,p=()=>{const g=u?.createAndAddNewEditor({x:0,y:0},!1,{methodOfCreation:e,boxes:d,anchorNode:o,anchorOffset:n,focusNode:s,focusOffset:a,text:l});h&&this.showAllEditors("highlight",!0,!0),i&&g?.editComment()};if(h){this.switchToMode(zi.HIGHLIGHT,p);return}p()}commentSelection(e=""){this.highlightSelection(e,!0)}#oe(){const e=document.getSelection();if(!e||e.isCollapsed)return;const i=this.#X(e).closest(".textLayer"),r=this.getSelectionBoxes(i);r&&(this.#k||=new f_i(this),this.#k.show(i,r,this.direction==="ltr"))}getAndRemoveDataFromAnnotationStorage(e){if(!this.#s)return null;const i=`${Cy}${e}`,r=this.#s.getRawValue(i);return r&&this.#s.remove(i),r}addToAnnotationStorage(e){!e.isEmpty()&&this.#s&&!this.#s.has(e.id)&&this.#s.setValue(e.id,e)}a11yAlert(e,i=null){const r=this.#$;r&&(r.setAttribute("data-l10n-id",e),i?r.setAttribute("data-l10n-args",JSON.stringify(i)):r.removeAttribute("data-l10n-args"))}#ne(){const e=document.getSelection();if(!e||e.isCollapsed){this.#D&&(this.#k?.hide(),this.#D=null,this.#T({hasSelectedText:!1}));return}const{anchorNode:i}=e;if(i===this.#D)return;const r=this.#X(e).closest(".textLayer");if(!r){this.#D&&(this.#k?.hide(),this.#D=null,this.#T({hasSelectedText:!1}));return}if(this.#k?.hide(),this.#D=i,this.#T({hasSelectedText:!0}),!(this.#E!==zi.HIGHLIGHT&&this.#E!==zi.NONE)&&(this.#E===zi.HIGHLIGHT&&this.showAllEditors("highlight",!0,!0),this.#b=this.isShiftKeyDown,!this.isShiftKeyDown)){const o=this.#E===zi.HIGHLIGHT?this.#ee(r):null;if(o?.toggleDrawing(),this.#I){const n=new AbortController,s=this.combinedSignal(n),a=l=>{l.type==="pointerup"&&l.button!==0||(n.abort(),o?.toggleDrawing(!0),l.type==="pointerup"&&this.#J("main_toolbar"))};window.addEventListener("pointerup",a,{signal:s}),window.addEventListener("blur",a,{signal:s})}else o?.toggleDrawing(!0),this.#J("main_toolbar")}}#J(e=""){this.#E===zi.HIGHLIGHT?this.highlightSelection(e):this.#m&&this.#oe()}#se(){document.addEventListener("selectionchange",this.#ne.bind(this),{signal:this._signal})}#ae(){if(this.#w)return;this.#w=new AbortController;const e=this.combinedSignal(this.#w);window.addEventListener("focus",this.focus.bind(this),{signal:e}),window.addEventListener("blur",this.blur.bind(this),{signal:e})}#le(){this.#w?.abort(),this.#w=null}blur(){if(this.isShiftKeyDown=!1,this.#b&&(this.#b=!1,this.#J("main_toolbar")),!this.hasSelection)return;const{activeElement:e}=document;for(const i of this.#C)if(i.div.contains(e)){this.#_=[i,e],i._focusEventsAllowed=!1;break}}focus(){if(!this.#_)return;const[e,i]=this.#_;this.#_=null,i.addEventListener("focusin",()=>{e._focusEventsAllowed=!0},{once:!0,signal:this._signal}),i.focus()}#te(){if(this.#R)return;this.#R=new AbortController;const e=this.combinedSignal(this.#R);window.addEventListener("keydown",this.keydown.bind(this),{signal:e}),window.addEventListener("keyup",this.keyup.bind(this),{signal:e})}#ce(){this.#R?.abort(),this.#R=null}#de(){if(this.#h)return;this.#h=new AbortController;const e=this.combinedSignal(this.#h);document.addEventListener("copy",this.copy.bind(this),{signal:e}),document.addEventListener("cut",this.cut.bind(this),{signal:e}),document.addEventListener("paste",this.paste.bind(this),{signal:e})}#ue(){this.#h?.abort(),this.#h=null}#he(){const e=this._signal;document.addEventListener("dragover",this.dragOver.bind(this),{signal:e}),document.addEventListener("drop",this.drop.bind(this),{signal:e})}addEditListeners(){this.#te(),this.setEditingState(!0)}removeEditListeners(){this.#ce(),this.setEditingState(!1)}dragOver(e){for(const{type:i}of e.dataTransfer.items)for(const r of this.#d)if(r.isHandlingMimeForPasting(i)){e.dataTransfer.dropEffect="copy",e.preventDefault();return}}drop(e){for(const i of e.dataTransfer.items)for(const r of this.#d)if(r.isHandlingMimeForPasting(i.type)){r.paste(i,this.currentLayer),e.preventDefault();return}}copy(e){if(e.preventDefault(),this.#t?.commitOrRemove(),!this.hasSelection)return;const i=[];for(const r of this.#C){const o=r.serialize(!0);o&&i.push(o)}i.length!==0&&e.clipboardData.setData("application/pdfjs",JSON.stringify(i))}cut(e){this.copy(e),this.delete()}async paste(e){e.preventDefault();const{clipboardData:i}=e;for(const n of i.items)for(const s of this.#d)if(s.isHandlingMimeForPasting(n.type)){s.paste(n,this.currentLayer);return}let r=i.getData("application/pdfjs");if(!r)return;try{r=JSON.parse(r)}catch(n){ji(`paste: "${n.message}".`);return}if(!Array.isArray(r))return;this.unselectAll();const o=this.currentLayer;try{const n=[];for(const l of r){const c=await o.deserialize(l);if(!c)return;n.push(c)}const s=()=>{for(const l of n)this.#ie(l);this.#re(n)},a=()=>{for(const l of n)l.remove()};this.addCommands({cmd:s,undo:a,mustExec:!0})}catch(n){ji(`paste: "${n.message}".`)}}keydown(e){!this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!0),this.#E!==zi.NONE&&!this.isEditorHandlingKeyboard&&w0._keyboardManager.exec(this,e)}keyup(e){this.isShiftKeyDown&&e.key==="Shift"&&(this.isShiftKeyDown=!1,this.#b&&(this.#b=!1,this.#J("main_toolbar")))}onEditingAction({name:e}){switch(e){case"undo":case"redo":case"delete":case"selectAll":this[e]();break;case"highlightSelection":this.highlightSelection("context_menu");break;case"commentSelection":this.commentSelection("context_menu");break}}#T(e){Object.entries(e).some(([i,r])=>this.#W[i]!==r)&&(this._eventBus.dispatch("annotationeditorstateschanged",{source:this,details:Object.assign(this.#W,e)}),this.#E===zi.HIGHLIGHT&&e.hasSelectedEditor===!1&&this.#V([[wr.HIGHLIGHT_FREE,!0]]))}#V(e){this._eventBus.dispatch("annotationeditorparamschanged",{source:this,details:e})}setEditingState(e){e?(this.#ae(),this.#de(),this.#T({isEditing:this.#E!==zi.NONE,isEmpty:this.#Z(),hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:this.#l.hasSomethingToRedo(),hasSelectedEditor:!1})):(this.#le(),this.#ue(),this.#T({isEditing:!1}),this.disableUserSelect(!1))}registerEditorTypes(e){if(!this.#d){this.#d=e;for(const i of this.#d)this.#V(i.defaultPropertiesToUpdate)}}getId(){return this.#S.id}get currentLayer(){return this.#o.get(this.#p)}getLayer(e){return this.#o.get(e)}get currentPageIndex(){return this.#p}addLayer(e){this.#o.set(e.pageIndex,e),this.#P?e.enable():e.disable()}removeLayer(e){this.#o.delete(e.pageIndex)}async updateMode(e,i=null,r=!1,o=!1,n=!1){if(this.#E!==e&&!(this.#j&&(await this.#j.promise,!this.#j))){if(this.#j=Promise.withResolvers(),this.#u?.commitOrRemove(),this.#E===zi.POPUP&&this.#c?.hideSidebar(),this.#c?.destroyPopup(),this.#E=e,e===zi.NONE){this.setEditingState(!1),this.#fe();for(const s of this.#i.values())s.hideStandaloneCommentButton();this._editorUndoBar?.hide(),this.toggleComment(null),this.#j.resolve();return}for(const s of this.#i.values())s.addStandaloneCommentButton();e===zi.SIGNATURE&&await this.#N?.loadSignatures(),this.setEditingState(!0),await this.#pe(),this.unselectAll();for(const s of this.#o.values())s.updateMode(e);if(e===zi.POPUP){this.#r||=await this.#Q.getAnnotationsByType(new Set(this.#d.map(l=>l._editorType)));const s=new Set,a=[];for(const l of this.#i.values()){const{annotationElementId:c,hasComment:d,deleted:u}=l;c&&s.add(c),d&&!u&&a.push(l.getData())}for(const l of this.#r){const{id:c,popupRef:d,contentsObj:u}=l;d&&u?.str&&!s.has(c)&&!this.#A.has(c)&&a.push(l)}this.#c?.showSidebar(a)}if(!i){r&&this.addNewEditorFromKeyboard(),this.#j.resolve();return}for(const s of this.#i.values())s.uid===i?(this.setSelected(s),n?s.editComment():o?s.enterInEditMode():s.focus()):s.unselect();this.#j.resolve()}}addNewEditorFromKeyboard(){this.currentLayer.canCreateNewEmptyEditor()&&this.currentLayer.addNewEditor()}updateToolbar(e){e.mode!==this.#E&&this._eventBus.dispatch("switchannotationeditormode",{source:this,...e})}updateParams(e,i){if(this.#d){switch(e){case wr.CREATE:this.currentLayer.addNewEditor(i);return;case wr.HIGHLIGHT_SHOW_ALL:this._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:{type:"highlight",action:"toggle_visibility"}}}),(this.#K||=new Map).set(e,i),this.showAllEditors("highlight",i);break}if(this.hasSelection)for(const r of this.#C)r.updateParams(e,i);else for(const r of this.#d)r.updateDefaultParams(e,i)}}showAllEditors(e,i,r=!1){for(const o of this.#i.values())o.editorType===e&&o.show(i);(this.#K?.get(wr.HIGHLIGHT_SHOW_ALL)??!0)!==i&&this.#V([[wr.HIGHLIGHT_SHOW_ALL,i]])}enableWaiting(e=!1){if(this.#O!==e){this.#O=e;for(const i of this.#o.values())e?i.disableClick():i.enableClick(),i.div.classList.toggle("waiting",e)}}async#pe(){if(!this.#P){this.#P=!0;const e=[];for(const i of this.#o.values())e.push(i.enable());await Promise.all(e);for(const i of this.#i.values())i.enable()}}#fe(){if(this.unselectAll(),this.#P){this.#P=!1;for(const e of this.#o.values())e.disable();for(const e of this.#i.values())e.disable()}}*getEditors(e){for(const i of this.#i.values())i.pageIndex===e&&(yield i)}getEditor(e){return this.#i.get(e)}addEditor(e){this.#i.set(e.id,e)}removeEditor(e){e.div.contains(document.activeElement)&&(this.#x&&clearTimeout(this.#x),this.#x=setTimeout(()=>{this.focusMainContainer(),this.#x=null},0)),this.#i.delete(e.id),e.annotationElementId&&this.#L?.delete(e.annotationElementId),this.unselect(e),(!e.annotationElementId||!this.#A.has(e.annotationElementId))&&this.#s?.remove(e.id)}addDeletedAnnotationElement(e){this.#A.add(e.annotationElementId),this.addChangedExistingAnnotation(e),e.deleted=!0}isDeletedAnnotationElement(e){return this.#A.has(e)}removeDeletedAnnotationElement(e){this.#A.delete(e.annotationElementId),this.removeChangedExistingAnnotation(e),e.deleted=!1}#ie(e){const i=this.#o.get(e.pageIndex);i?i.addOrRebuild(e):(this.addEditor(e),this.addToAnnotationStorage(e))}setActiveEditor(e){this.#t!==e&&(this.#t=e,e&&this.#V(e.propertiesToUpdate))}get#ge(){let e=null;for(e of this.#C);return e}updateUI(e){this.#ge===e&&this.#V(e.propertiesToUpdate)}updateUIForDefaultProperties(e){this.#V(e.defaultPropertiesToUpdate)}toggleSelected(e){if(this.#C.has(e)){this.#C.delete(e),e.unselect(),this.#T({hasSelectedEditor:this.hasSelection});return}this.#C.add(e),e.select(),this.#V(e.propertiesToUpdate),this.#T({hasSelectedEditor:!0})}setSelected(e){this.updateToolbar({mode:e.mode,editId:e.uid}),this.#u?.commitOrRemove();for(const i of this.#C)i!==e&&i.unselect();this.#C.clear(),this.#C.add(e),e.select(),this.#V(e.propertiesToUpdate),this.#T({hasSelectedEditor:!0})}isSelected(e){return this.#C.has(e)}get firstSelectedEditor(){return this.#C.values().next().value}unselect(e){e.unselect(),this.#C.delete(e),this.#T({hasSelectedEditor:this.hasSelection})}get hasSelection(){return this.#C.size!==0}get isEnterHandled(){return this.#C.size===1&&this.firstSelectedEditor.isEnterHandled}undo(){this.#l.undo(),this.#T({hasSomethingToUndo:this.#l.hasSomethingToUndo(),hasSomethingToRedo:!0,isEmpty:this.#Z()}),this._editorUndoBar?.hide()}redo(){this.#l.redo(),this.#T({hasSomethingToUndo:!0,hasSomethingToRedo:this.#l.hasSomethingToRedo(),isEmpty:this.#Z()})}addCommands(e){this.#l.add(e),this.#T({hasSomethingToUndo:!0,hasSomethingToRedo:!1,isEmpty:this.#Z()})}cleanUndoStack(e){this.#l.cleanType(e)}#Z(){if(this.#i.size===0)return!0;if(this.#i.size===1)for(const e of this.#i.values())return e.isEmpty();return!1}delete(){this.commitOrRemove();const e=this.currentLayer?.endDrawingSession(!0);if(!this.hasSelection&&!e)return;const i=e?[e]:[...this.#C],r=()=>{this._editorUndoBar?.show(o,i.length===1?i[0].editorType:i.length);for(const n of i)n.remove()},o=()=>{for(const n of i)this.#ie(n)};this.addCommands({cmd:r,undo:o,mustExec:!0})}commitOrRemove(){this.#t?.commitOrRemove()}hasSomethingToControl(){return this.#t||this.hasSelection}#re(e){for(const i of this.#C)i.unselect();this.#C.clear();for(const i of e)i.isEmpty()||(this.#C.add(i),i.select());this.#T({hasSelectedEditor:this.hasSelection})}selectAll(){for(const e of this.#C)e.commit();this.#re(this.#i.values())}unselectAll(){if(!(this.#t&&(this.#t.commitOrRemove(),this.#E!==zi.NONE))&&!this.#u?.commitOrRemove()&&this.hasSelection){for(const e of this.#C)e.unselect();this.#C.clear(),this.#T({hasSelectedEditor:!1})}}translateSelectedEditors(e,i,r=!1){if(r||this.commitOrRemove(),!this.hasSelection)return;this.#z[0]+=e,this.#z[1]+=i;const[o,n]=this.#z,s=[...this.#C],a=1e3;this.#F&&clearTimeout(this.#F),this.#F=setTimeout(()=>{this.#F=null,this.#z[0]=this.#z[1]=0,this.addCommands({cmd:()=>{for(const l of s)this.#i.has(l.id)&&(l.translateInPage(o,n),l.translationDone())},undo:()=>{for(const l of s)this.#i.has(l.id)&&(l.translateInPage(-o,-n),l.translationDone())},mustExec:!1})},a);for(const l of s)l.translateInPage(e,i),l.translationDone()}setUpDragSession(){if(this.hasSelection){this.disableUserSelect(!0),this.#g=new Map;for(const e of this.#C)this.#g.set(e,{savedX:e.x,savedY:e.y,savedPageIndex:e.pageIndex,newX:0,newY:0,newPageIndex:-1})}}endDragSession(){if(!this.#g)return!1;this.disableUserSelect(!1);const e=this.#g;this.#g=null;let i=!1;for(const[{x:o,y:n,pageIndex:s},a]of e)a.newX=o,a.newY=n,a.newPageIndex=s,i||=o!==a.savedX||n!==a.savedY||s!==a.savedPageIndex;if(!i)return!1;const r=(o,n,s,a)=>{if(this.#i.has(o.id)){const l=this.#o.get(a);l?o._setParentAndPosition(l,n,s):(o.pageIndex=a,o.x=n,o.y=s)}};return this.addCommands({cmd:()=>{for(const[o,{newX:n,newY:s,newPageIndex:a}]of e)r(o,n,s,a)},undo:()=>{for(const[o,{savedX:n,savedY:s,savedPageIndex:a}]of e)r(o,n,s,a)},mustExec:!0}),!0}dragSelectedEditors(e,i){if(this.#g)for(const r of this.#g.keys())r.drag(e,i)}rebuild(e){if(e.parent===null){const i=this.getLayer(e.pageIndex);i?(i.changeParent(e),i.addOrRebuild(e)):(this.addEditor(e),this.addToAnnotationStorage(e),e.rebuild())}else e.parent.addOrRebuild(e)}get isEditorHandlingKeyboard(){return this.getActive()?.shouldGetKeyboardEvents()||this.#C.size===1&&this.firstSelectedEditor.shouldGetKeyboardEvents()}isActive(e){return this.#t===e}getActive(){return this.#t}getMode(){return this.#E}isEditingMode(){return this.#E!==zi.NONE}get imageManager(){return Wi(this,"imageManager",new WQ)}getSelectionBoxes(e){if(!e)return null;const i=document.getSelection();for(let c=0,d=i.rangeCount;c<d;c++)if(!e.contains(i.getRangeAt(c).commonAncestorContainer))return null;const{x:r,y:o,width:n,height:s}=e.getBoundingClientRect();let a;switch(e.getAttribute("data-main-rotation")){case"90":a=(c,d,u,h)=>({x:(d-o)/s,y:1-(c+u-r)/n,width:h/s,height:u/n});break;case"180":a=(c,d,u,h)=>({x:1-(c+u-r)/n,y:1-(d+h-o)/s,width:u/n,height:h/s});break;case"270":a=(c,d,u,h)=>({x:1-(d+h-o)/s,y:(c-r)/n,width:h/s,height:u/n});break;default:a=(c,d,u,h)=>({x:(c-r)/n,y:(d-o)/s,width:u/n,height:h/s});break}const l=[];for(let c=0,d=i.rangeCount;c<d;c++){const u=i.getRangeAt(c);if(!u.collapsed)for(const{x:h,y:p,width:g,height:f}of u.getClientRects())g===0||f===0||l.push(a(h,p,g,f))}return l.length===0?null:l}addChangedExistingAnnotation({annotationElementId:e,id:i}){(this.#a||=new Map).set(e,i)}removeChangedExistingAnnotation({annotationElementId:e}){this.#a?.delete(e)}renderAnnotationElement(e){const i=this.#a?.get(e.data.id);if(!i)return;const r=this.#s.getRawValue(i);r&&(this.#E===zi.NONE&&!r.hasBeenModified||r.renderAnnotationElement(e))}setMissingCanvas(e,i,r){const o=this.#L?.get(e);o&&(o.setCanvas(i,r),this.#L.delete(e))}addMissingCanvas(e,i){(this.#L||=new Map).set(e,i)}}class Ju{#e=null;#t=!1;#r=null;#i=null;#o=null;#n=null;#s=!1;#a=null;#l=null;#c=null;#h=null;#u=!1;static#p=null;static _l10n=null;constructor(e){this.#l=e,this.#u=e._uiManager.useNewAltTextFlow,Ju.#p||=Object.freeze({added:"pdfjs-editor-new-alt-text-added-button","added-label":"pdfjs-editor-new-alt-text-added-button-label",missing:"pdfjs-editor-new-alt-text-missing-button","missing-label":"pdfjs-editor-new-alt-text-missing-button-label",review:"pdfjs-editor-new-alt-text-to-review-button","review-label":"pdfjs-editor-new-alt-text-to-review-button-label"})}static initialize(e){Ju._l10n??=e}async render(){const e=this.#r=document.createElement("button");e.className="altText",e.tabIndex="0";const i=this.#i=document.createElement("span");e.append(i),this.#u?(e.classList.add("new"),e.setAttribute("data-l10n-id",Ju.#p.missing),i.setAttribute("data-l10n-id",Ju.#p["missing-label"])):(e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button"),i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-button-label"));const r=this.#l._uiManager._signal;e.addEventListener("contextmenu",Fc,{signal:r}),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),this.#l._uiManager.editAltText(this.#l),this.#u&&this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_clicked",data:{label:this.#A}})};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(this.#s=!0,o(n))},{signal:r}),await this.#g(),e}get#A(){return this.#e&&"added"||this.#e===null&&this.guessedText&&"review"||"missing"}finish(){this.#r&&(this.#r.focus({focusVisible:this.#s}),this.#s=!1)}isEmpty(){return this.#u?this.#e===null:!this.#e&&!this.#t}hasData(){return this.#u?this.#e!==null||!!this.#c:this.isEmpty()}get guessedText(){return this.#c}async setGuessedText(e){this.#e===null&&(this.#c=e,this.#h=await Ju._l10n.get("pdfjs-editor-new-alt-text-generated-alt-text-with-disclaimer",{generatedAltText:e}),this.#g())}toggleAltTextBadge(e=!1){if(!this.#u||this.#e){this.#a?.remove(),this.#a=null;return}if(!this.#a){const i=this.#a=document.createElement("div");i.className="noAltTextBadge",this.#l.div.append(i)}this.#a.classList.toggle("hidden",!e)}serialize(e){let i=this.#e;return!e&&this.#c===i&&(i=this.#h),{altText:i,decorative:this.#t,guessedText:this.#c,textWithDisclaimer:this.#h}}get data(){return{altText:this.#e,decorative:this.#t}}set data({altText:e,decorative:i,guessedText:r,textWithDisclaimer:o,cancel:n=!1}){r&&(this.#c=r,this.#h=o),!(this.#e===e&&this.#t===i)&&(n||(this.#e=e,this.#t=i),this.#g())}toggle(e=!1){this.#r&&(!e&&this.#n&&(clearTimeout(this.#n),this.#n=null),this.#r.disabled=!e)}shown(){this.#l._reportTelemetry({action:"pdfjs.image.alt_text.image_status_label_displayed",data:{label:this.#A}})}destroy(){this.#r?.remove(),this.#r=null,this.#i=null,this.#o=null,this.#a?.remove(),this.#a=null}async#g(){const e=this.#r;if(!e)return;if(this.#u){if(e.classList.toggle("done",!!this.#e),e.setAttribute("data-l10n-id",Ju.#p[this.#A]),this.#i?.setAttribute("data-l10n-id",Ju.#p[`${this.#A}-label`]),!this.#e){this.#o?.remove();return}}else{if(!this.#e&&!this.#t){e.classList.remove("done"),this.#o?.remove();return}e.classList.add("done"),e.setAttribute("data-l10n-id","pdfjs-editor-alt-text-edit-button")}let i=this.#o;if(!i){this.#o=i=document.createElement("span"),i.className="tooltip",i.setAttribute("role","tooltip"),i.id=`alt-text-tooltip-${this.#l.id}`;const r=100,o=this.#l._uiManager._signal;o.addEventListener("abort",()=>{clearTimeout(this.#n),this.#n=null},{once:!0}),e.addEventListener("mouseenter",()=>{this.#n=setTimeout(()=>{this.#n=null,this.#o.classList.add("show"),this.#l._reportTelemetry({action:"alt_text_tooltip"})},r)},{signal:o}),e.addEventListener("mouseleave",()=>{this.#n&&(clearTimeout(this.#n),this.#n=null),this.#o?.classList.remove("show")},{signal:o})}this.#t?i.setAttribute("data-l10n-id","pdfjs-editor-alt-text-decorative-tooltip"):(i.removeAttribute("data-l10n-id"),i.textContent=this.#e),i.parentNode||e.append(i),this.#l.getElementForAltText()?.setAttribute("aria-describedby",i.id)}}class kP{#e=null;#t=null;#r=!1;#i=null;#o=null;#n=null;#s=null;#a=null;#l=!1;#c=null;constructor(e){this.#i=e}renderForToolbar(){const e=this.#t=document.createElement("button");return e.className="comment",this.#h(e,!1)}renderForStandalone(){const e=this.#e=document.createElement("button");e.className="annotationCommentButton";const i=this.#i.commentButtonPosition;if(i){const{style:r}=e;r.insetInlineEnd=`calc(${100*(this.#i._uiManager.direction==="ltr"?1-i[0]:i[0])}% - var(--comment-button-dim))`,r.top=`calc(${100*i[1]}% - var(--comment-button-dim))`;const o=this.#i.commentButtonColor;o&&(r.backgroundColor=o)}return this.#h(e,!0)}focusButton(){setTimeout(()=>{(this.#e??this.#t)?.focus()},0)}onUpdatedColor(){if(!this.#e)return;const e=this.#i.commentButtonColor;e&&(this.#e.style.backgroundColor=e),this.#i._uiManager.updatePopupColor(this.#i)}get commentButtonWidth(){return(this.#e?.getBoundingClientRect().width??0)/this.#i.parent.boundingClientRect.width}get commentPopupPositionInLayer(){if(this.#c)return this.#c;if(!this.#e)return null;const{x:e,y:i,height:r}=this.#e.getBoundingClientRect(),{x:o,y:n,width:s,height:a}=this.#i.parent.boundingClientRect;return[(e-o)/s,(i+r-n)/a]}set commentPopupPositionInLayer(e){this.#c=e}hasDefaultPopupPosition(){return this.#c===null}removeStandaloneCommentButton(){this.#e?.remove(),this.#e=null}removeToolbarCommentButton(){this.#t?.remove(),this.#t=null}setCommentButtonStates({selected:e,hasPopup:i}){this.#e&&(this.#e.classList.toggle("selected",e),this.#e.ariaExpanded=i)}#h(e,i){if(!this.#i._uiManager.hasCommentManager())return null;e.tabIndex="0",e.ariaHasPopup="dialog",i?(e.ariaControls="commentPopup",e.setAttribute("data-l10n-id","pdfjs-show-comment-button")):(e.ariaControlsElements=[this.#i._uiManager.getCommentDialogElement()],e.setAttribute("data-l10n-id","pdfjs-editor-add-comment-button"));const r=this.#i._uiManager._signal;if(!(r instanceof AbortSignal)||r.aborted)return e;e.addEventListener("contextmenu",Fc,{signal:r}),i&&(e.addEventListener("focusin",n=>{this.#i._focusEventsAllowed=!1,pn(n)},{capture:!0,signal:r}),e.addEventListener("focusout",n=>{this.#i._focusEventsAllowed=!0,pn(n)},{capture:!0,signal:r})),e.addEventListener("pointerdown",n=>n.stopPropagation(),{signal:r});const o=n=>{n.preventDefault(),e===this.#t?this.edit():this.#i.toggleComment(!0)};return e.addEventListener("click",o,{capture:!0,signal:r}),e.addEventListener("keydown",n=>{n.target===e&&n.key==="Enter"&&(this.#r=!0,o(n))},{signal:r}),e.addEventListener("pointerenter",()=>{this.#i.toggleComment(!1,!0)},{signal:r}),e.addEventListener("pointerleave",()=>{this.#i.toggleComment(!1,!1)},{signal:r}),e}edit(e){const i=this.commentPopupPositionInLayer;let r,o;if(i)[r,o]=i;else{[r,o]=this.#i.commentButtonPosition;const{width:d,height:u,x:h,y:p}=this.#i;r=h+r*d,o=p+o*u}const n=this.#i.parent.boundingClientRect,{x:s,y:a,width:l,height:c}=n;this.#i._uiManager.editComment(this.#i,s+r*l,a+o*c,{...e,parentDimensions:n})}finish(){this.#t&&(this.#t.focus({focusVisible:this.#r}),this.#r=!1)}isDeleted(){return this.#l||this.#s===""}isEmpty(){return this.#s===null}hasBeenEdited(){return this.isDeleted()||this.#s!==this.#o}serialize(){return this.data}get data(){return{text:this.#s,richText:this.#n,date:this.#a,deleted:this.isDeleted()}}set data(e){if(e!==this.#s&&(this.#n=null),e===null){this.#s="",this.#l=!0;return}this.#s=e,this.#a=new Date,this.#l=!1}setInitialText(e,i=null){this.#o=e,this.data=e,this.#a=null,this.#n=i}shown(){}destroy(){this.#t?.remove(),this.#t=null,this.#e?.remove(),this.#e=null,this.#s="",this.#n=null,this.#a=null,this.#i=null,this.#r=!1,this.#l=!1}}class ZI{#e;#t=!1;#r=null;#i;#o;#n;#s;#a=null;#l;#c=null;#h;#u=null;constructor({container:e,isPinchingDisabled:i=null,isPinchingStopped:r=null,onPinchStart:o=null,onPinching:n=null,onPinchEnd:s=null,signal:a}){this.#e=e,this.#r=r,this.#i=i,this.#o=o,this.#n=n,this.#s=s,this.#h=new AbortController,this.#l=AbortSignal.any([a,this.#h.signal]),e.addEventListener("touchstart",this.#p.bind(this),{passive:!1,signal:this.#l})}get MIN_TOUCH_DISTANCE_TO_PINCH(){return 35/Wu.pixelRatio}#p(e){if(this.#i?.())return;if(e.touches.length===1){if(this.#a)return;const o=this.#a=new AbortController,n=AbortSignal.any([this.#l,o.signal]),s=this.#e,a={capture:!0,signal:n,passive:!1},l=c=>{c.pointerType==="touch"&&(this.#a?.abort(),this.#a=null)};s.addEventListener("pointerdown",c=>{c.pointerType==="touch"&&(pn(c),l(c))},a),s.addEventListener("pointerup",l,a),s.addEventListener("pointercancel",l,a);return}if(!this.#u){this.#u=new AbortController;const o=AbortSignal.any([this.#l,this.#u.signal]),n=this.#e,s={signal:o,capture:!1,passive:!1};n.addEventListener("touchmove",this.#A.bind(this),s);const a=this.#g.bind(this);n.addEventListener("touchend",a,s),n.addEventListener("touchcancel",a,s),s.capture=!0,n.addEventListener("pointerdown",pn,s),n.addEventListener("pointermove",pn,s),n.addEventListener("pointercancel",pn,s),n.addEventListener("pointerup",pn,s),this.#o?.()}if(pn(e),e.touches.length!==2||this.#r?.()){this.#c=null;return}let[i,r]=e.touches;i.identifier>r.identifier&&([i,r]=[r,i]),this.#c={touch0X:i.screenX,touch0Y:i.screenY,touch1X:r.screenX,touch1Y:r.screenY}}#A(e){if(!this.#c||e.touches.length!==2)return;pn(e);let[i,r]=e.touches;i.identifier>r.identifier&&([i,r]=[r,i]);const{screenX:o,screenY:n}=i,{screenX:s,screenY:a}=r,l=this.#c,{touch0X:c,touch0Y:d,touch1X:u,touch1Y:h}=l,p=u-c,g=h-d,f=s-o,m=a-n,A=Math.hypot(f,m)||1,v=Math.hypot(p,g)||1;if(!this.#t&&Math.abs(v-A)<=ZI.MIN_TOUCH_DISTANCE_TO_PINCH)return;if(l.touch0X=o,l.touch0Y=n,l.touch1X=s,l.touch1Y=a,!this.#t){this.#t=!0;return}const y=[(o+s)/2,(n+a)/2];this.#n?.(y,v,A)}#g(e){e.touches.length>=2||(this.#u&&(this.#u.abort(),this.#u=null,this.#s?.()),this.#c&&(pn(e),this.#c=null,this.#t=!1))}destroy(){this.#h?.abort(),this.#h=null,this.#a?.abort(),this.#a=null}}class vi{#e=null;#t=null;#r=null;#i=null;#o=null;#n=!1;#s=null;#a="";#l=null;#c=null;#h=null;#u=null;#p=null;#A="";#g=!1;#d=null;#f=!1;#m=!1;#y=!1;#v=null;#M=0;#x=0;#w=null;#B=null;isSelected=!1;_isCopy=!1;_editToolbar=null;_initialOptions=Object.create(null);_initialData=null;_isVisible=!0;_uiManager=null;_focusEventsAllowed=!0;static _l10n=null;static _l10nResizer=null;#b=!1;#k=vi._zIndex++;static _borderLineWidth=-1;static _colorManager=new JQ;static _zIndex=1;static _telemetryTimeout=1e3;static get _resizerKeyboardManager(){const e=vi.prototype._resizeWithKeyboard,i=w0.TRANSLATE_SMALL,r=w0.TRANSLATE_BIG;return Wi(this,"_resizerKeyboardManager",new Iy([[["ArrowLeft","mac+ArrowLeft"],e,{args:[-i,0]}],[["ctrl+ArrowLeft","mac+shift+ArrowLeft"],e,{args:[-r,0]}],[["ArrowRight","mac+ArrowRight"],e,{args:[i,0]}],[["ctrl+ArrowRight","mac+shift+ArrowRight"],e,{args:[r,0]}],[["ArrowUp","mac+ArrowUp"],e,{args:[0,-i]}],[["ctrl+ArrowUp","mac+shift+ArrowUp"],e,{args:[0,-r]}],[["ArrowDown","mac+ArrowDown"],e,{args:[0,i]}],[["ctrl+ArrowDown","mac+shift+ArrowDown"],e,{args:[0,r]}],[["Escape","mac+Escape"],vi.prototype._stopResizingWithKeyboard]]))}constructor(e){this.parent=e.parent,this.id=e.id,this.width=this.height=null,this.pageIndex=e.parent.pageIndex,this.name=e.name,this.div=null,this._uiManager=e.uiManager,this.annotationElementId=null,this._willKeepAspectRatio=!1,this._initialOptions.isCentered=e.isCentered,this._structTreeParentId=null,this.annotationElementId=e.annotationElementId||null,this.creationDate=e.creationDate||new Date,this.modificationDate=e.modificationDate||null,this.canAddComment=!0;const{rotation:i,rawDims:{pageWidth:r,pageHeight:o,pageX:n,pageY:s}}=this.parent.viewport;this.rotation=i,this.pageRotation=(360+i-this._uiManager.viewParameters.rotation)%360,this.pageDimensions=[r,o],this.pageTranslation=[n,s];const[a,l]=this.parentDimensions;this.x=e.x/a,this.y=e.y/l,this.isAttachedToDOM=!1,this.deleted=!1}get editorType(){return Object.getPrototypeOf(this).constructor._type}get mode(){return Object.getPrototypeOf(this).constructor._editorType}static get isDrawer(){return!1}static get _defaultLineColor(){return Wi(this,"_defaultLineColor",this._colorManager.getHexCode("CanvasText"))}static deleteAnnotationElement(e){const i=new m_i({id:e.parent.getNextId(),parent:e.parent,uiManager:e._uiManager});i.annotationElementId=e.annotationElementId,i.deleted=!0,i._uiManager.addToAnnotationStorage(i)}static initialize(e,i){if(vi._l10n??=e,vi._l10nResizer||=Object.freeze({topLeft:"pdfjs-editor-resizer-top-left",topMiddle:"pdfjs-editor-resizer-top-middle",topRight:"pdfjs-editor-resizer-top-right",middleRight:"pdfjs-editor-resizer-middle-right",bottomRight:"pdfjs-editor-resizer-bottom-right",bottomMiddle:"pdfjs-editor-resizer-bottom-middle",bottomLeft:"pdfjs-editor-resizer-bottom-left",middleLeft:"pdfjs-editor-resizer-middle-left"}),vi._borderLineWidth!==-1)return;const r=getComputedStyle(document.documentElement);vi._borderLineWidth=parseFloat(r.getPropertyValue("--outline-width"))||0}static updateDefaultParams(e,i){}static get defaultPropertiesToUpdate(){return[]}static isHandlingMimeForPasting(e){return!1}static paste(e,i){yo("Not implemented")}get propertiesToUpdate(){return[]}get _isDraggable(){return this.#b}set _isDraggable(e){this.#b=e,this.div?.classList.toggle("draggable",e)}get uid(){return this.annotationElementId||this.id}get isEnterHandled(){return!0}center(){const[e,i]=this.pageDimensions;switch(this.parentRotation){case 90:this.x-=this.height*i/(e*2),this.y+=this.width*e/(i*2);break;case 180:this.x+=this.width/2,this.y+=this.height/2;break;case 270:this.x+=this.height*i/(e*2),this.y-=this.width*e/(i*2);break;default:this.x-=this.width/2,this.y-=this.height/2;break}this.fixAndSetPosition()}addCommands(e){this._uiManager.addCommands(e)}get currentLayer(){return this._uiManager.currentLayer}setInBackground(){this.div.style.zIndex=0}setInForeground(){this.div.style.zIndex=this.#k}setParent(e){e!==null?(this.pageIndex=e.pageIndex,this.pageDimensions=e.pageDimensions):(this.#F(),this.#u?.remove(),this.#u=null),this.parent=e}focusin(e){this._focusEventsAllowed&&(this.#g?this.#g=!1:this.parent.setSelected(this))}focusout(e){!this._focusEventsAllowed||!this.isAttachedToDOM||e.relatedTarget?.closest(`#${this.id}`)||(e.preventDefault(),this.parent?.isMultipleSelection||this.commitOrRemove())}commitOrRemove(){this.isEmpty()?this.remove():this.commit()}commit(){this.isInEditMode()&&this.addToAnnotationStorage()}addToAnnotationStorage(){this._uiManager.addToAnnotationStorage(this)}setAt(e,i,r,o){const[n,s]=this.parentDimensions;[r,o]=this.screenToPageTranslation(r,o),this.x=(e+r)/n,this.y=(i+o)/s,this.fixAndSetPosition()}_moveAfterPaste(e,i){const[r,o]=this.parentDimensions;this.setAt(e*r,i*o,this.width*r,this.height*o),this._onTranslated()}#S([e,i],r,o){[r,o]=this.screenToPageTranslation(r,o),this.x+=r/e,this.y+=o/i,this._onTranslating(this.x,this.y),this.fixAndSetPosition()}translate(e,i){this.#S(this.parentDimensions,e,i)}translateInPage(e,i){this.#d||=[this.x,this.y,this.width,this.height],this.#S(this.pageDimensions,e,i),this.div.scrollIntoView({block:"nearest"})}translationDone(){this._onTranslated(this.x,this.y)}drag(e,i){this.#d||=[this.x,this.y,this.width,this.height];const{div:r,parentDimensions:[o,n]}=this;if(this.x+=e/o,this.y+=i/n,this.parent&&(this.x<0||this.x>1||this.y<0||this.y>1)){const{x:u,y:h}=this.div.getBoundingClientRect();this.parent.findNewParent(this,u,h)&&(this.x-=Math.floor(this.x),this.y-=Math.floor(this.y))}let{x:s,y:a}=this;const[l,c]=this.getBaseTranslation();s+=l,a+=c;const{style:d}=r;d.left=`${(100*s).toFixed(2)}%`,d.top=`${(100*a).toFixed(2)}%`,this._onTranslating(s,a),r.scrollIntoView({block:"nearest"})}_onTranslating(e,i){}_onTranslated(e,i){}get _hasBeenMoved(){return!!this.#d&&(this.#d[0]!==this.x||this.#d[1]!==this.y)}get _hasBeenResized(){return!!this.#d&&(this.#d[2]!==this.width||this.#d[3]!==this.height)}getBaseTranslation(){const[e,i]=this.parentDimensions,{_borderLineWidth:r}=vi,o=r/e,n=r/i;switch(this.rotation){case 90:return[-o,n];case 180:return[o,n];case 270:return[o,-n];default:return[-o,-n]}}get _mustFixPosition(){return!0}fixAndSetPosition(e=this.rotation){const{div:{style:i},pageDimensions:[r,o]}=this;let{x:n,y:s,width:a,height:l}=this;if(a*=r,l*=o,n*=r,s*=o,this._mustFixPosition)switch(e){case 0:n=Ha(n,0,r-a),s=Ha(s,0,o-l);break;case 90:n=Ha(n,0,r-l),s=Ha(s,a,o);break;case 180:n=Ha(n,a,r),s=Ha(s,l,o);break;case 270:n=Ha(n,l,r),s=Ha(s,0,o-a);break}this.x=n/=r,this.y=s/=o;const[c,d]=this.getBaseTranslation();n+=c,s+=d,i.left=`${(100*n).toFixed(2)}%`,i.top=`${(100*s).toFixed(2)}%`,this.moveInDOM()}static#P(e,i,r){switch(r){case 90:return[i,-e];case 180:return[-e,-i];case 270:return[-i,e];default:return[e,i]}}screenToPageTranslation(e,i){return vi.#P(e,i,this.parentRotation)}pageTranslationToScreen(e,i){return vi.#P(e,i,360-this.parentRotation)}#I(e){switch(e){case 90:{const[i,r]=this.pageDimensions;return[0,-i/r,r/i,0]}case 180:return[-1,0,0,-1];case 270:{const[i,r]=this.pageDimensions;return[0,i/r,-r/i,0]}default:return[1,0,0,1]}}get parentScale(){return this._uiManager.viewParameters.realScale}get parentRotation(){return(this._uiManager.viewParameters.rotation+this.pageRotation)%360}get parentDimensions(){const{parentScale:e,pageDimensions:[i,r]}=this;return[i*e,r*e]}setDims(){const{div:{style:e},width:i,height:r}=this;e.width=`${(100*i).toFixed(2)}%`,e.height=`${(100*r).toFixed(2)}%`}getInitialTranslation(){return[0,0]}#O(){if(this.#l)return;this.#l=document.createElement("div"),this.#l.classList.add("resizers");const e=this._willKeepAspectRatio?["topLeft","topRight","bottomRight","bottomLeft"]:["topLeft","topMiddle","topRight","middleRight","bottomRight","bottomMiddle","bottomLeft","middleLeft"],i=this._uiManager._signal;for(const r of e){const o=document.createElement("div");this.#l.append(o),o.classList.add("resizer",r),o.setAttribute("data-resizer-name",r),o.addEventListener("pointerdown",this.#R.bind(this,r),{signal:i}),o.addEventListener("contextmenu",Fc,{signal:i}),o.tabIndex=-1}this.div.prepend(this.#l)}#R(e,i){i.preventDefault();const{isMac:r}=Fs.platform;if(i.button!==0||i.ctrlKey&&r)return;this.#r?.toggle(!1);const o=this._isDraggable;this._isDraggable=!1,this.#c=[i.screenX,i.screenY];const n=new AbortController,s=this._uiManager.combinedSignal(n);this.parent.togglePointerEvents(!1),window.addEventListener("pointermove",this.#L.bind(this,e),{passive:!0,capture:!0,signal:s}),window.addEventListener("touchmove",pn,{passive:!1,signal:s}),window.addEventListener("contextmenu",Fc,{signal:s}),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const a=this.parent.div.style.cursor,l=this.div.style.cursor;this.div.style.cursor=this.parent.div.style.cursor=window.getComputedStyle(i.target).cursor;const c=()=>{n.abort(),this.parent.togglePointerEvents(!0),this.#r?.toggle(!0),this._isDraggable=o,this.parent.div.style.cursor=a,this.div.style.cursor=l,this.#U()};window.addEventListener("pointerup",c,{signal:s}),window.addEventListener("blur",c,{signal:s})}#_(e,i,r,o){this.width=r,this.height=o,this.x=e,this.y=i,this.setDims(),this.fixAndSetPosition(),this._onResized()}_onResized(){}#U(){if(!this.#h)return;const{savedX:e,savedY:i,savedWidth:r,savedHeight:o}=this.#h;this.#h=null;const n=this.x,s=this.y,a=this.width,l=this.height;n===e&&s===i&&a===r&&l===o||this.addCommands({cmd:this.#_.bind(this,n,s,a,l),undo:this.#_.bind(this,e,i,r,o),mustExec:!0})}static _round(e){return Math.round(e*1e4)/1e4}#L(e,i){const[r,o]=this.parentDimensions,n=this.x,s=this.y,a=this.width,l=this.height,c=vi.MIN_SIZE/r,d=vi.MIN_SIZE/o,u=this.#I(this.rotation),h=(N,G)=>[u[0]*N+u[2]*G,u[1]*N+u[3]*G],p=this.#I(360-this.rotation),g=(N,G)=>[p[0]*N+p[2]*G,p[1]*N+p[3]*G];let f,m,A=!1,v=!1;switch(e){case"topLeft":A=!0,f=(N,G)=>[0,0],m=(N,G)=>[N,G];break;case"topMiddle":f=(N,G)=>[N/2,0],m=(N,G)=>[N/2,G];break;case"topRight":A=!0,f=(N,G)=>[N,0],m=(N,G)=>[0,G];break;case"middleRight":v=!0,f=(N,G)=>[N,G/2],m=(N,G)=>[0,G/2];break;case"bottomRight":A=!0,f=(N,G)=>[N,G],m=(N,G)=>[0,0];break;case"bottomMiddle":f=(N,G)=>[N/2,G],m=(N,G)=>[N/2,0];break;case"bottomLeft":A=!0,f=(N,G)=>[0,G],m=(N,G)=>[N,0];break;case"middleLeft":v=!0,f=(N,G)=>[0,G/2],m=(N,G)=>[N,G/2];break}const y=f(a,l),b=m(a,l);let w=h(...b);const C=vi._round(n+w[0]),M=vi._round(s+w[1]);let E=1,B=1,S,I;if(i.fromKeyboard)({deltaX:S,deltaY:I}=i);else{const{screenX:N,screenY:G}=i,[q,X]=this.#c;[S,I]=this.screenToPageTranslation(N-q,G-X),this.#c[0]=N,this.#c[1]=G}if([S,I]=g(S/r,I/o),A){const N=Math.hypot(a,l);E=B=Math.max(Math.min(Math.hypot(b[0]-y[0]-S,b[1]-y[1]-I)/N,1/a,1/l),c/a,d/l)}else v?E=Ha(Math.abs(b[0]-y[0]-S),c,1)/a:B=Ha(Math.abs(b[1]-y[1]-I),d,1)/l;const T=vi._round(a*E),_=vi._round(l*B);w=h(...m(T,_));const O=C-w[0],j=M-w[1];this.#d||=[this.x,this.y,this.width,this.height],this.width=T,this.height=_,this.x=O,this.y=j,this.setDims(),this.fixAndSetPosition(),this._onResizing()}_onResizing(){}altTextFinish(){this.#r?.finish()}get toolbarButtons(){return null}async addEditToolbar(){if(this._editToolbar||this.#m)return this._editToolbar;this._editToolbar=new Qb(this),this.div.append(this._editToolbar.render());const{toolbarButtons:e}=this;if(e)for(const[i,r]of e)await this._editToolbar.addButton(i,r);return this.hasComment||this._editToolbar.addButton("comment",this.addCommentButton()),this._editToolbar.addButton("delete"),this._editToolbar}addCommentButtonInToolbar(){this._editToolbar?.addButtonBefore("comment",this.addCommentButton(),".deleteButton")}removeCommentButtonFromToolbar(){this._editToolbar?.removeButton("comment")}removeEditToolbar(){this._editToolbar?.remove(),this._editToolbar=null,this.#r?.destroy()}addContainer(e){const i=this._editToolbar?.div;i?i.before(e):this.div.append(e)}getClientDimensions(){return this.div.getBoundingClientRect()}createAltText(){return this.#r||(Ju.initialize(vi._l10n),this.#r=new Ju(this),this.#e&&(this.#r.data=this.#e,this.#e=null)),this.#r}get altTextData(){return this.#r?.data}set altTextData(e){this.#r&&(this.#r.data=e)}get guessedAltText(){return this.#r?.guessedText}async setGuessedAltText(e){await this.#r?.setGuessedText(e)}serializeAltText(e){return this.#r?.serialize(e)}hasAltText(){return!!this.#r&&!this.#r.isEmpty()}hasAltTextData(){return this.#r?.hasData()??!1}focusCommentButton(){this.#i?.focusButton()}addCommentButton(){return this.canAddComment?this.#i||=new kP(this):null}addStandaloneCommentButton(){if(this._uiManager.hasCommentManager()){if(this.#o){this._uiManager.isEditingMode()&&this.#o.classList.remove("hidden");return}this.hasComment&&(this.#o=this.#i.renderForStandalone(),this.div.append(this.#o))}}removeStandaloneCommentButton(){this.#i.removeStandaloneCommentButton(),this.#o=null}hideStandaloneCommentButton(){this.#o?.classList.add("hidden")}get comment(){const{data:{richText:e,text:i,date:r,deleted:o}}=this.#i;return{text:i,richText:e,date:r,deleted:o,color:this.getNonHCMColor(),opacity:this.opacity??1}}set comment(e){this.#i||=new kP(this),this.#i.data=e,this.hasComment?(this.removeCommentButtonFromToolbar(),this.addStandaloneCommentButton(),this._uiManager.updateComment(this)):(this.addCommentButtonInToolbar(),this.removeStandaloneCommentButton(),this._uiManager.removeComment(this))}setCommentData({comment:e,popupRef:i,richText:r}){if(!i||(this.#i||=new kP(this),this.#i.setInitialText(e,r),!this.annotationElementId))return;const o=this._uiManager.getAndRemoveDataFromAnnotationStorage(this.annotationElementId);o&&this.updateFromAnnotationLayer(o)}get hasEditedComment(){return this.#i?.hasBeenEdited()}get hasDeletedComment(){return this.#i?.isDeleted()}get hasComment(){return!!this.#i&&!this.#i.isEmpty()&&!this.#i.isDeleted()}async editComment(e){this.#i||=new kP(this),this.#i.edit(e)}toggleComment(e,i=void 0){this.hasComment&&this._uiManager.toggleComment(this,e,i)}setSelectedCommentButton(e){this.#i.setSelectedButton(e)}addComment(e){if(this.hasEditedComment){const[,,,i]=e.rect,[r]=this.pageDimensions,[o]=this.pageTranslation,n=o+r+1,s=i-100,a=n+180;e.popup={contents:this.comment.text,deleted:this.comment.deleted,rect:[n,s,a,i]}}}updateFromAnnotationLayer({popup:{contents:e,deleted:i}}){this.#i.data=i?null:e}get parentBoundingClientRect(){return this.parent.boundingClientRect}render(){const e=this.div=document.createElement("div");e.setAttribute("data-editor-rotation",(360-this.rotation)%360),e.className=this.name,e.setAttribute("id",this.id),e.tabIndex=this.#n?-1:0,e.setAttribute("role","application"),this.defaultL10nId&&e.setAttribute("data-l10n-id",this.defaultL10nId),this._isVisible||e.classList.add("hidden"),this.setInForeground(),this.#H();const[i,r]=this.parentDimensions;this.parentRotation%180!==0&&(e.style.maxWidth=`${(100*r/i).toFixed(2)}%`,e.style.maxHeight=`${(100*i/r).toFixed(2)}%`);const[o,n]=this.getInitialTranslation();return this.translate(o,n),_7e(this,e,["keydown","pointerdown","dblclick"]),this.isResizable&&this._uiManager._supportsPinchToZoom&&(this.#B||=new ZI({container:e,isPinchingDisabled:()=>!this.isSelected,onPinchStart:this.#q.bind(this),onPinching:this.#E.bind(this),onPinchEnd:this.#C.bind(this),signal:this._uiManager._signal})),this.addStandaloneCommentButton(),this._uiManager._editorUndoBar?.hide(),e}#q(){this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height},this.#r?.toggle(!1),this.parent.togglePointerEvents(!1)}#E(e,i,r){let o=.7*(r/i)+1-.7;if(o===1)return;const n=this.#I(this.rotation),s=(w,C)=>[n[0]*w+n[2]*C,n[1]*w+n[3]*C],[a,l]=this.parentDimensions,c=this.x,d=this.y,u=this.width,h=this.height,p=vi.MIN_SIZE/a,g=vi.MIN_SIZE/l;o=Math.max(Math.min(o,1/u,1/h),p/u,g/h);const f=vi._round(u*o),m=vi._round(h*o);if(f===u&&m===h)return;this.#d||=[c,d,u,h];const A=s(u/2,h/2),v=vi._round(c+A[0]),y=vi._round(d+A[1]),b=s(f/2,m/2);this.x=v-b[0],this.y=y-b[1],this.width=f,this.height=m,this.setDims(),this.fixAndSetPosition(),this._onResizing()}#C(){this.#r?.toggle(!0),this.parent.togglePointerEvents(!0),this.#U()}pointerdown(e){const{isMac:i}=Fs.platform;if(e.button!==0||e.ctrlKey&&i){e.preventDefault();return}if(this.#g=!0,this._isDraggable){this.#N(e);return}this.#D(e)}#D(e){const{isMac:i}=Fs.platform;e.ctrlKey&&!i||e.shiftKey||e.metaKey&&i?this.parent.toggleSelected(this):this.parent.setSelected(this)}#N(e){const{isSelected:i}=this;this._uiManager.setUpDragSession();let r=!1;const o=new AbortController,n=this._uiManager.combinedSignal(o),s={capture:!0,passive:!1,signal:n},a=c=>{o.abort(),this.#s=null,this.#g=!1,this._uiManager.endDragSession()||this.#D(c),r&&this._onStopDragging()};i&&(this.#M=e.clientX,this.#x=e.clientY,this.#s=e.pointerId,this.#a=e.pointerType,window.addEventListener("pointermove",c=>{r||(r=!0,this._uiManager.toggleComment(this,!0,!1),this._onStartDragging());const{clientX:d,clientY:u,pointerId:h}=c;if(h!==this.#s){pn(c);return}const[p,g]=this.screenToPageTranslation(d-this.#M,u-this.#x);this.#M=d,this.#x=u,this._uiManager.dragSelectedEditors(p,g)},s),window.addEventListener("touchmove",pn,s),window.addEventListener("pointerdown",c=>{c.pointerType===this.#a&&(this.#B||c.isPrimary)&&a(c),pn(c)},s));const l=c=>{if(!this.#s||this.#s===c.pointerId){a(c);return}pn(c)};window.addEventListener("pointerup",l,{signal:n}),window.addEventListener("blur",l,{signal:n})}_onStartDragging(){}_onStopDragging(){}moveInDOM(){this.#v&&clearTimeout(this.#v),this.#v=setTimeout(()=>{this.#v=null,this.parent?.moveEditorInDOM(this)},0)}_setParentAndPosition(e,i,r){e.changeParent(this),this.x=i,this.y=r,this.fixAndSetPosition(),this._onTranslated()}getRect(e,i,r=this.rotation){const o=this.parentScale,[n,s]=this.pageDimensions,[a,l]=this.pageTranslation,c=e/o,d=i/o,u=this.x*n,h=this.y*s,p=this.width*n,g=this.height*s;switch(r){case 0:return[u+c+a,s-h-d-g+l,u+c+p+a,s-h-d+l];case 90:return[u+d+a,s-h+c+l,u+d+g+a,s-h+c+p+l];case 180:return[u-c-p+a,s-h+d+l,u-c+a,s-h+d+g+l];case 270:return[u-d-g+a,s-h-c-p+l,u-d+a,s-h-c+l];default:throw new Error("Invalid rotation")}}getRectInCurrentCoords(e,i){const[r,o,n,s]=e,a=n-r,l=s-o;switch(this.rotation){case 0:return[r,i-s,a,l];case 90:return[r,i-o,l,a];case 180:return[n,i-o,a,l];case 270:return[n,i-s,l,a];default:throw new Error("Invalid rotation")}}getPDFRect(){return this.getRect(0,0)}getNonHCMColor(){return this.color&&vi._colorManager.convert(this._uiManager.getNonHCMColor(this.color))}onUpdatedColor(){this.#i?.onUpdatedColor()}getData(){const{comment:{text:e,color:i,date:r,opacity:o,deleted:n,richText:s},uid:a,pageIndex:l,creationDate:c,modificationDate:d}=this;return{id:a,pageIndex:l,rect:this.getPDFRect(),richText:s,contentsObj:{str:e},creationDate:c,modificationDate:r||d,popupRef:!n,color:i,opacity:o}}onceAdded(e){}isEmpty(){return!1}enableEditMode(){return this.isInEditMode()?!1:(this.parent.setEditingState(!1),this.#m=!0,!0)}disableEditMode(){return this.isInEditMode()?(this.parent.setEditingState(!0),this.#m=!1,!0):!1}isInEditMode(){return this.#m}shouldGetKeyboardEvents(){return this.#y}needsToBeRebuilt(){return this.div&&!this.isAttachedToDOM}get isOnScreen(){const{top:e,left:i,bottom:r,right:o}=this.getClientDimensions(),{innerHeight:n,innerWidth:s}=window;return i<s&&o>0&&e<n&&r>0}#H(){if(this.#p||!this.div)return;this.#p=new AbortController;const e=this._uiManager.combinedSignal(this.#p);this.div.addEventListener("focusin",this.focusin.bind(this),{signal:e}),this.div.addEventListener("focusout",this.focusout.bind(this),{signal:e})}rebuild(){this.#H()}rotate(e){}resize(){}serializeDeleted(){return{id:this.annotationElementId,deleted:!0,pageIndex:this.pageIndex,popupRef:this._initialData?.popupRef||""}}serialize(e=!1,i=null){return{annotationType:this.mode,pageIndex:this.pageIndex,rect:this.getPDFRect(),rotation:this.rotation,structTreeParentId:this._structTreeParentId,popupRef:this._initialData?.popupRef||""}}static async deserialize(e,i,r){const o=new this.prototype.constructor({parent:i,id:i.getNextId(),uiManager:r,annotationElementId:e.annotationElementId,creationDate:e.creationDate,modificationDate:e.modificationDate});o.rotation=e.rotation,o.#e=e.accessibilityData,o._isCopy=e.isCopy||!1;const[n,s]=o.pageDimensions,[a,l,c,d]=o.getRectInCurrentCoords(e.rect,s);return o.x=a/n,o.y=l/s,o.width=c/n,o.height=d/s,o}get hasBeenModified(){return!!this.annotationElementId&&(this.deleted||this.serialize()!==null)}remove(){if(this.#p?.abort(),this.#p=null,this.isEmpty()||this.commit(),this.parent?this.parent.remove(this):this._uiManager.removeEditor(this),this.hideCommentPopup(),this.#v&&(clearTimeout(this.#v),this.#v=null),this.#F(),this.removeEditToolbar(),this.#w){for(const e of this.#w.values())clearTimeout(e);this.#w=null}this.parent=null,this.#B?.destroy(),this.#B=null,this.#u?.remove(),this.#u=null}get isResizable(){return!1}makeResizable(){this.isResizable&&(this.#O(),this.#l.classList.remove("hidden"))}get toolbarPosition(){return null}get commentButtonPosition(){return this._uiManager.direction==="ltr"?[1,0]:[0,0]}get commentButtonPositionInPage(){const{commentButtonPosition:[e,i]}=this,[r,o,n,s]=this.getPDFRect();return[vi._round(r+(n-r)*e),vi._round(o+(s-o)*(1-i))]}get commentButtonColor(){return this._uiManager.makeCommentColor(this.getNonHCMColor(),this.opacity)}get commentPopupPosition(){return this.#i.commentPopupPositionInLayer}set commentPopupPosition(e){this.#i.commentPopupPositionInLayer=e}hasDefaultPopupPosition(){return this.#i.hasDefaultPopupPosition()}get commentButtonWidth(){return this.#i.commentButtonWidth}get elementBeforePopup(){return this.div}setCommentButtonStates(e){this.#i?.setCommentButtonStates(e)}keydown(e){if(!this.isResizable||e.target!==this.div||e.key!=="Enter")return;this._uiManager.setSelected(this),this.#h={savedX:this.x,savedY:this.y,savedWidth:this.width,savedHeight:this.height};const i=this.#l.children;if(!this.#t){this.#t=Array.from(i);const s=this.#K.bind(this),a=this.#Q.bind(this),l=this._uiManager._signal;for(const c of this.#t){const d=c.getAttribute("data-resizer-name");c.setAttribute("role","spinbutton"),c.addEventListener("keydown",s,{signal:l}),c.addEventListener("blur",a,{signal:l}),c.addEventListener("focus",this.#W.bind(this,d),{signal:l}),c.setAttribute("data-l10n-id",vi._l10nResizer[d])}}const r=this.#t[0];let o=0;for(const s of i){if(s===r)break;o++}const n=(360-this.rotation+this.parentRotation)%360/90*(this.#t.length/4);if(n!==o){if(n<o)for(let a=0;a<o-n;a++)this.#l.append(this.#l.firstChild);else if(n>o)for(let a=0;a<n-o;a++)this.#l.firstChild.before(this.#l.lastChild);let s=0;for(const a of i){const l=this.#t[s++].getAttribute("data-resizer-name");a.setAttribute("data-l10n-id",vi._l10nResizer[l])}}this.#z(0),this.#y=!0,this.#l.firstChild.focus({focusVisible:!0}),e.preventDefault(),e.stopImmediatePropagation()}#K(e){vi._resizerKeyboardManager.exec(this,e)}#Q(e){this.#y&&e.relatedTarget?.parentNode!==this.#l&&this.#F()}#W(e){this.#A=this.#y?e:""}#z(e){if(this.#t)for(const i of this.#t)i.tabIndex=e}_resizeWithKeyboard(e,i){this.#y&&this.#L(this.#A,{deltaX:e,deltaY:i,fromKeyboard:!0})}#F(){this.#y=!1,this.#z(-1),this.#U()}_stopResizingWithKeyboard(){this.#F(),this.div.focus()}select(){if(this.isSelected&&this._editToolbar){this._editToolbar.show();return}if(this.isSelected=!0,this.makeResizable(),this.div?.classList.add("selectedEditor"),!this._editToolbar){this.addEditToolbar().then(()=>{this.div?.classList.contains("selectedEditor")&&this._editToolbar?.show()});return}this._editToolbar?.show(),this.#r?.toggleAltTextBadge(!1)}focus(){this.div&&!this.div.contains(document.activeElement)&&setTimeout(()=>this.div?.focus({preventScroll:!0}),0)}unselect(){this.isSelected&&(this.isSelected=!1,this.#l?.classList.add("hidden"),this.div?.classList.remove("selectedEditor"),this.div?.contains(document.activeElement)&&this._uiManager.currentLayer.div.focus({preventScroll:!0}),this._editToolbar?.hide(),this.#r?.toggleAltTextBadge(!0),this.hideCommentPopup())}hideCommentPopup(){this.hasComment&&this._uiManager.toggleComment(null)}updateParams(e,i){}disableEditing(){}enableEditing(){}get canChangeContent(){return!1}enterInEditMode(){this.canChangeContent&&(this.enableEditMode(),this.div.focus())}dblclick(e){e.target.nodeName!=="BUTTON"&&(this.enterInEditMode(),this.parent.updateToolbar({mode:this.constructor._editorType,editId:this.uid}))}getElementForAltText(){return this.div}get contentDiv(){return this.div}get isEditing(){return this.#f}set isEditing(e){this.#f=e,this.parent&&(e?(this.parent.setSelected(this),this.parent.setActiveEditor(this)):this.parent.setActiveEditor(null))}static get MIN_SIZE(){return 16}static canCreateNewEmptyEditor(){return!0}get telemetryInitialData(){return{action:"added"}}get telemetryFinalData(){return null}_reportTelemetry(e,i=!1){if(i){this.#w||=new Map;const{action:r}=e;let o=this.#w.get(r);o&&clearTimeout(o),o=setTimeout(()=>{this._reportTelemetry(e),this.#w.delete(r),this.#w.size===0&&(this.#w=null)},vi._telemetryTimeout),this.#w.set(r,o);return}e.type||=this.editorType,this._uiManager._eventBus.dispatch("reporttelemetry",{source:this,details:{type:"editing",data:e}})}show(e=this._isVisible){this.div.classList.toggle("hidden",!e),this._isVisible=e}enable(){this.div&&(this.div.tabIndex=0),this.#n=!1}disable(){this.div&&(this.div.tabIndex=-1),this.#n=!0}updateFakeAnnotationElement(e){if(!this.#u&&!this.deleted){this.#u=e.addFakeAnnotation(this);return}if(this.deleted){this.#u.remove(),this.#u=null;return}(this.hasEditedComment||this._hasBeenMoved||this._hasBeenResized)&&this.#u.updateEdited({rect:this.getPDFRect(),popup:this.comment})}renderAnnotationElement(e){if(this.deleted)return e.hide(),null;let i=e.container.querySelector(".annotationContent");if(!i)i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),e.container.prepend(i);else if(i.nodeName==="CANVAS"){const r=i;i=document.createElement("div"),i.classList.add("annotationContent",this.editorType),r.before(i)}return i}resetAnnotationElement(e){const{firstChild:i}=e.container;i?.nodeName==="DIV"&&i.classList.contains("annotationContent")&&i.remove()}}class m_i extends vi{constructor(e){super(e),this.annotationElementId=e.annotationElementId,this.deleted=!0}serialize(){return this.serializeDeleted()}}const L7e=3285377520,Oc=4294901760,Du=65535;let F7e=class{constructor(t){this.h1=t?t&4294967295:L7e,this.h2=t?t&4294967295:L7e}update(t){let e,i;if(typeof t=="string"){e=new Uint8Array(t.length*2),i=0;for(let g=0,f=t.length;g<f;g++){const m=t.charCodeAt(g);m<=255?e[i++]=m:(e[i++]=m>>>8,e[i++]=m&255)}}else if(ArrayBuffer.isView(t))e=t.slice(),i=e.byteLength;else throw new Error("Invalid data format, must be a string or TypedArray.");const r=i>>2,o=i-r*4,n=new Uint32Array(e.buffer,0,r);let s=0,a=0,l=this.h1,c=this.h2;const d=3432918353,u=461845907,h=d&Du,p=u&Du;for(let g=0;g<r;g++)g&1?(s=n[g],s=s*d&Oc|s*h&Du,s=s<<15|s>>>17,s=s*u&Oc|s*p&Du,l^=s,l=l<<13|l>>>19,l=l*5+3864292196):(a=n[g],a=a*d&Oc|a*h&Du,a=a<<15|a>>>17,a=a*u&Oc|a*p&Du,c^=a,c=c<<13|c>>>19,c=c*5+3864292196);switch(s=0,o){case 3:s^=e[r*4+2]<<16;case 2:s^=e[r*4+1]<<8;case 1:s^=e[r*4],s=s*d&Oc|s*h&Du,s=s<<15|s>>>17,s=s*u&Oc|s*p&Du,r&1?l^=s:c^=s}this.h1=l,this.h2=c}hexdigest(){let t=this.h1,e=this.h2;return t^=e>>>1,t=t*3981806797&Oc|t*36045&Du,e=e*4283543511&Oc|((e<<16|t>>>16)*2950163797&Oc)>>>16,t^=e>>>1,t=t*444984403&Oc|t*60499&Du,e=e*3301882366&Oc|((e<<16|t>>>16)*3120437893&Oc)>>>16,t^=e>>>1,(t>>>0).toString(16).padStart(8,"0")+(e>>>0).toString(16).padStart(8,"0")}};const Lq=Object.freeze({map:null,hash:"",transfer:void 0});class Fq{#e=!1;#t=null;#r=null;#i=new Map;constructor(){this.onSetModified=null,this.onResetModified=null,this.onAnnotationEditor=null}getValue(e,i){const r=this.#i.get(e);return r===void 0?i:Object.assign(i,r)}getRawValue(e){return this.#i.get(e)}remove(e){const i=this.#i.get(e);if(i!==void 0&&(i instanceof vi&&this.#r.delete(i.annotationElementId),this.#i.delete(e),this.#i.size===0&&this.resetModified(),typeof this.onAnnotationEditor=="function")){for(const r of this.#i.values())if(r instanceof vi)return;this.onAnnotationEditor(null)}}setValue(e,i){const r=this.#i.get(e);let o=!1;if(r!==void 0)for(const[n,s]of Object.entries(i))r[n]!==s&&(o=!0,r[n]=s);else o=!0,this.#i.set(e,i);o&&this.#o(),i instanceof vi&&((this.#r||=new Map).set(i.annotationElementId,i),typeof this.onAnnotationEditor=="function"&&this.onAnnotationEditor(i.constructor._type))}has(e){return this.#i.has(e)}get size(){return this.#i.size}#o(){this.#e||(this.#e=!0,typeof this.onSetModified=="function"&&this.onSetModified())}resetModified(){this.#e&&(this.#e=!1,typeof this.onResetModified=="function"&&this.onResetModified())}get print(){return new O7e(this)}get serializable(){if(this.#i.size===0)return Lq;const e=new Map,i=new F7e,r=[],o=Object.create(null);let n=!1;for(const[s,a]of this.#i){const l=a instanceof vi?a.serialize(!1,o):a;l&&(e.set(s,l),i.update(`${s}:${JSON.stringify(l)}`),n||=!!l.bitmap)}if(n)for(const s of e.values())s.bitmap&&r.push(s.bitmap);return e.size>0?{map:e,hash:i.hexdigest(),transfer:r}:Lq}get editorStats(){let e=null;const i=new Map;let r=0,o=0;for(const n of this.#i.values()){if(!(n instanceof vi)){n.popup&&(n.popup.deleted?o+=1:r+=1);continue}n.isCommentDeleted?o+=1:n.hasEditedComment&&(r+=1);const s=n.telemetryFinalData;if(!s)continue;const{type:a}=s;i.has(a)||i.set(a,Object.getPrototypeOf(n).constructor),e||=Object.create(null);const l=e[a]||=new Map;for(const[c,d]of Object.entries(s)){if(c==="type")continue;let u=l.get(c);u||(u=new Map,l.set(c,u));const h=u.get(d)??0;u.set(d,h+1)}}if((o>0||r>0)&&(e||=Object.create(null),e.comments={deleted:o,edited:r}),!e)return null;for(const[n,s]of i)e[n]=s.computeTelemetryFinalData(e[n]);return e}resetModifiedIds(){this.#t=null}updateEditor(e,i){const r=this.#r?.get(e);return r?(r.updateFromAnnotationLayer(i),!0):!1}getEditor(e){return this.#r?.get(e)||null}get modifiedIds(){if(this.#t)return this.#t;const e=[];if(this.#r)for(const i of this.#r.values())i.serialize()&&e.push(i.annotationElementId);return this.#t={ids:new Set(e),hash:e.join(",")}}[Symbol.iterator](){return this.#i.entries()}}class O7e extends Fq{#e;constructor(e){super();const{map:i,hash:r,transfer:o}=e.serializable,n=structuredClone(i,o?{transfer:o}:null);this.#e={map:n,hash:r,transfer:o}}get print(){yo("Should not call PrintAnnotationStorage.print")}get serializable(){return this.#e}get modifiedIds(){return Wi(this,"modifiedIds",{ids:new Set,hash:""})}}class v_i{#e=new Set;constructor({ownerDocument:e=globalThis.document,styleElement:i=null}){this._document=e,this.nativeFontFaces=new Set,this.styleElement=null,this.loadingRequests=[],this.loadTestFontId=0}addNativeFontFace(e){this.nativeFontFaces.add(e),this._document.fonts.add(e)}removeNativeFontFace(e){this.nativeFontFaces.delete(e),this._document.fonts.delete(e)}insertRule(e){this.styleElement||(this.styleElement=this._document.createElement("style"),this._document.documentElement.getElementsByTagName("head")[0].append(this.styleElement));const i=this.styleElement.sheet;i.insertRule(e,i.cssRules.length)}clear(){for(const e of this.nativeFontFaces)this._document.fonts.delete(e);this.nativeFontFaces.clear(),this.#e.clear(),this.styleElement&&(this.styleElement.remove(),this.styleElement=null)}async loadSystemFont({systemFontInfo:e,disableFontFace:i,_inspectFont:r}){if(!(!e||this.#e.has(e.loadedName))){if(Cr(!i,"loadSystemFont shouldn't be called when `disableFontFace` is set."),this.isFontLoadingAPISupported){const{loadedName:o,src:n,style:s}=e,a=new FontFace(o,n,s);this.addNativeFontFace(a);try{await a.load(),this.#e.add(o),r?.(e)}catch{ji(`Cannot load system font: ${e.baseFontName}, installing it could help to improve PDF rendering.`),this.removeNativeFontFace(a)}return}yo("Not implemented: loadSystemFont without the Font Loading API.")}}async bind(e){if(e.attached||e.missingFile&&!e.systemFontInfo)return;if(e.attached=!0,e.systemFontInfo){await this.loadSystemFont(e);return}if(this.isFontLoadingAPISupported){const r=e.createNativeFontFace();if(r){this.addNativeFontFace(r);try{await r.loaded}catch(o){throw ji(`Failed to load font '${r.family}': '${o}'.`),e.disableFontFace=!0,o}}return}const i=e.createFontFaceRule();if(i){if(this.insertRule(i),this.isSyncFontLoadingSupported)return;await new Promise(r=>{const o=this._queueLoadingCallback(r);this._prepareFontLoadEvent(e,o)})}}get isFontLoadingAPISupported(){const e=!!this._document?.fonts;return Wi(this,"isFontLoadingAPISupported",e)}get isSyncFontLoadingSupported(){return Wi(this,"isSyncFontLoadingSupported",ja||Fs.platform.isFirefox)}_queueLoadingCallback(e){function i(){for(Cr(!o.done,"completeRequest() cannot be called twice."),o.done=!0;r.length>0&&r[0].done;){const n=r.shift();setTimeout(n.callback,0)}}const{loadingRequests:r}=this,o={done:!1,complete:i,callback:e};return r.push(o),o}get _loadTestFont(){const e=atob("T1RUTwALAIAAAwAwQ0ZGIDHtZg4AAAOYAAAAgUZGVE1lkzZwAAAEHAAAABxHREVGABQAFQAABDgAAAAeT1MvMlYNYwkAAAEgAAAAYGNtYXABDQLUAAACNAAAAUJoZWFk/xVFDQAAALwAAAA2aGhlYQdkA+oAAAD0AAAAJGhtdHgD6AAAAAAEWAAAAAZtYXhwAAJQAAAAARgAAAAGbmFtZVjmdH4AAAGAAAAAsXBvc3T/hgAzAAADeAAAACAAAQAAAAEAALZRFsRfDzz1AAsD6AAAAADOBOTLAAAAAM4KHDwAAAAAA+gDIQAAAAgAAgAAAAAAAAABAAADIQAAAFoD6AAAAAAD6AABAAAAAAAAAAAAAAAAAAAAAQAAUAAAAgAAAAQD6AH0AAUAAAKKArwAAACMAooCvAAAAeAAMQECAAACAAYJAAAAAAAAAAAAAQAAAAAAAAAAAAAAAFBmRWQAwAAuAC4DIP84AFoDIQAAAAAAAQAAAAAAAAAAACAAIAABAAAADgCuAAEAAAAAAAAAAQAAAAEAAAAAAAEAAQAAAAEAAAAAAAIAAQAAAAEAAAAAAAMAAQAAAAEAAAAAAAQAAQAAAAEAAAAAAAUAAQAAAAEAAAAAAAYAAQAAAAMAAQQJAAAAAgABAAMAAQQJAAEAAgABAAMAAQQJAAIAAgABAAMAAQQJAAMAAgABAAMAAQQJAAQAAgABAAMAAQQJAAUAAgABAAMAAQQJAAYAAgABWABYAAAAAAAAAwAAAAMAAAAcAAEAAAAAADwAAwABAAAAHAAEACAAAAAEAAQAAQAAAC7//wAAAC7////TAAEAAAAAAAABBgAAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAMAAAAAAAD/gwAyAAAAAQAAAAAAAAAAAAAAAAAAAAABAAQEAAEBAQJYAAEBASH4DwD4GwHEAvgcA/gXBIwMAYuL+nz5tQXkD5j3CBLnEQACAQEBIVhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYAAABAQAADwACAQEEE/t3Dov6fAH6fAT+fPp8+nwHDosMCvm1Cvm1DAz6fBQAAAAAAAABAAAAAMmJbzEAAAAAzgTjFQAAAADOBOQpAAEAAAAAAAAADAAUAAQAAAABAAAAAgABAAAAAAAAAAAD6AAAAAAAAA==");return Wi(this,"_loadTestFont",e)}_prepareFontLoadEvent(e,i){function r(y,b){return y.charCodeAt(b)<<24|y.charCodeAt(b+1)<<16|y.charCodeAt(b+2)<<8|y.charCodeAt(b+3)&255}function o(y,b,w,C){const M=y.substring(0,b),E=y.substring(b+w);return M+C+E}let n,s;const a=this._document.createElement("canvas");a.width=1,a.height=1;const l=a.getContext("2d");let c=0;function d(y,b){if(++c>30){ji("Load test font never loaded."),b();return}if(l.font="30px "+y,l.fillText(".",0,20),l.getImageData(0,0,1,1).data[3]>0){b();return}setTimeout(d.bind(null,y,b))}const u=`lt${Date.now()}${this.loadTestFontId++}`;let h=this._loadTestFont;h=o(h,976,u.length,u);const p=16,g=1482184792;let f=r(h,p);for(n=0,s=u.length-3;n<s;n+=4)f=f-g+r(u,n)|0;n<u.length&&(f=f-g+r(u+"XXX",n)|0),h=o(h,p,4,YDi(f));const m=`url(data:font/opentype;base64,${btoa(h)});`,A=`@font-face {font-family:"${u}";src:${m}}`;this.insertRule(A);const v=this._document.createElement("div");v.style.visibility="hidden",v.style.width=v.style.height="10px",v.style.position="absolute",v.style.top=v.style.left="0px";for(const y of[e.loadedName,u]){const b=this._document.createElement("span");b.textContent="Hi",b.style.fontFamily=y,v.append(b)}this._document.body.append(v),d(u,()=>{v.remove(),i.complete()})}}class y_i{#e;constructor(e,i=null,r,o){this.compiledGlyphs=Object.create(null),this.#e=e,this._inspectFont=i,r&&Object.assign(this,r),o&&(this.charProcOperatorList=o)}createNativeFontFace(){if(!this.data||this.disableFontFace)return null;let e;if(!this.cssFontInfo)e=new FontFace(this.loadedName,this.data,{});else{const i={weight:this.cssFontInfo.fontWeight};this.cssFontInfo.italicAngle&&(i.style=`oblique ${this.cssFontInfo.italicAngle}deg`),e=new FontFace(this.cssFontInfo.fontFamily,this.data,i)}return this._inspectFont?.(this),e}createFontFaceRule(){if(!this.data||this.disableFontFace)return null;const e=`url(data:${this.mimetype};base64,${M7e(this.data)});`;let i;if(!this.cssFontInfo)i=`@font-face {font-family:"${this.loadedName}";src:${e}}`;else{let r=`font-weight: ${this.cssFontInfo.fontWeight};`;this.cssFontInfo.italicAngle&&(r+=`font-style: oblique ${this.cssFontInfo.italicAngle}deg;`),i=`@font-face {font-family:"${this.cssFontInfo.fontFamily}";${r}src:${e}}`}return this._inspectFont?.(this,e),i}getPathGenerator(e,i){if(this.compiledGlyphs[i]!==void 0)return this.compiledGlyphs[i];const r=this.loadedName+"_path_"+i;let o;try{o=e.get(r)}catch(s){ji(`getPathGenerator - ignoring character: "${s}".`)}const n=D7e(o);return this.fontExtraProperties||e.delete(r),this.compiledGlyphs[i]=n}get black(){return this.#e.black}get bold(){return this.#e.bold}get disableFontFace(){return this.#e.disableFontFace??!1}get fontExtraProperties(){return this.#e.fontExtraProperties??!1}get isInvalidPDFjsFont(){return this.#e.isInvalidPDFjsFont}get isType3Font(){return this.#e.isType3Font}get italic(){return this.#e.italic}get missingFile(){return this.#e.missingFile}get remeasure(){return this.#e.remeasure}get vertical(){return this.#e.vertical}get ascent(){return this.#e.ascent}get defaultWidth(){return this.#e.defaultWidth}get descent(){return this.#e.descent}get bbox(){return this.#e.bbox}get fontMatrix(){return this.#e.fontMatrix}get fallbackName(){return this.#e.fallbackName}get loadedName(){return this.#e.loadedName}get mimetype(){return this.#e.mimetype}get name(){return this.#e.name}get data(){return this.#e.data}clearData(){this.#e.clearData()}get cssFontInfo(){return this.#e.cssFontInfo}get systemFontInfo(){return this.#e.systemFontInfo}get defaultVMetrics(){return this.#e.defaultVMetrics}}let U7e=class VI{#e;#t;#r;static strings=["fontFamily","fontWeight","italicAngle"];static write(e){const i=new TextEncoder,r={};let o=0;for(const c of VI.strings){const d=i.encode(e[c]);r[c]=d,o+=4+d.length}const n=new ArrayBuffer(o),s=new Uint8Array(n),a=new DataView(n);let l=0;for(const c of VI.strings){const d=r[c],u=d.length;a.setUint32(l,u),s.set(d,l+4),l+=4+u}return Cr(l===n.byteLength,"CssFontInfo.write: Buffer overflow"),n}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#r=new TextDecoder}#i(e){Cr(e<VI.strings.length,"Invalid string index");let i=0;for(let o=0;o<e;o++)i+=this.#t.getUint32(i)+4;const r=this.#t.getUint32(i);return this.#r.decode(new Uint8Array(this.#e,i+4,r))}get fontFamily(){return this.#i(0)}get fontWeight(){return this.#i(1)}get italicAngle(){return this.#i(2)}},N7e=class qI{#e;#t;#r;static strings=["css","loadedName","baseFontName","src"];static write(e){const i=new TextEncoder,r={};let o=0;for(const h of qI.strings){const p=i.encode(e[h]);r[h]=p,o+=4+p.length}o+=4;let n,s,a=1+o;e.style&&(n=i.encode(e.style.style),s=i.encode(e.style.weight),a+=4+n.length+4+s.length);const l=new ArrayBuffer(a),c=new Uint8Array(l),d=new DataView(l);let u=0;d.setUint8(u++,e.guessFallback?1:0),d.setUint32(u,0),u+=4,o=0;for(const h of qI.strings){const p=r[h],g=p.length;o+=4+g,d.setUint32(u,g),c.set(p,u+4),u+=4+g}return d.setUint32(u-o-4,o),e.style&&(d.setUint32(u,n.length),c.set(n,u+4),u+=4+n.length,d.setUint32(u,s.length),c.set(s,u+4),u+=4+s.length),Cr(u<=l.byteLength,"SubstitionInfo.write: Buffer overflow"),l.transferToFixedLength(u)}constructor(e){this.#e=e,this.#t=new DataView(this.#e),this.#r=new TextDecoder}get guessFallback(){return this.#t.getUint8(0)!==0}#i(e){Cr(e<qI.strings.length,"Invalid string index");let i=5;for(let o=0;o<e;o++)i+=this.#t.getUint32(i)+4;const r=this.#t.getUint32(i);return this.#r.decode(new Uint8Array(this.#e,i+4,r))}get css(){return this.#i(0)}get loadedName(){return this.#i(1)}get baseFontName(){return this.#i(2)}get src(){return this.#i(3)}get style(){let e=1;e+=4+this.#t.getUint32(e);const i=this.#t.getUint32(e),r=this.#r.decode(new Uint8Array(this.#e,e+4,i));e+=4+i;const o=this.#t.getUint32(e),n=this.#r.decode(new Uint8Array(this.#e,e+4,o));return{style:r,weight:n}}},b_i=class wo{static bools=["black","bold","disableFontFace","fontExtraProperties","isInvalidPDFjsFont","isType3Font","italic","missingFile","remeasure","vertical"];static numbers=["ascent","defaultWidth","descent"];static strings=["fallbackName","loadedName","mimetype","name"];static#e=Math.ceil(this.bools.length*2/8);static#t=this.#e+this.numbers.length*8;static#r=this.#t+1+8;static#i=this.#r+1+48;static#o=this.#i+1+6;#n;#s;#a;constructor({data:e,extra:i}){this.#n=e,this.#s=new TextDecoder,this.#a=new DataView(this.#n),i&&Object.assign(this,i)}#l(e){Cr(e<wo.bools.length,"Invalid boolean index");const i=Math.floor(e/4),r=e*2%8,o=this.#a.getUint8(i)>>r&3;return o===0?void 0:o===2}get black(){return this.#l(0)}get bold(){return this.#l(1)}get disableFontFace(){return this.#l(2)}get fontExtraProperties(){return this.#l(3)}get isInvalidPDFjsFont(){return this.#l(4)}get isType3Font(){return this.#l(5)}get italic(){return this.#l(6)}get missingFile(){return this.#l(7)}get remeasure(){return this.#l(8)}get vertical(){return this.#l(9)}#c(e){return Cr(e<wo.numbers.length,"Invalid number index"),this.#a.getFloat64(wo.#e+e*8)}get ascent(){return this.#c(0)}get defaultWidth(){return this.#c(1)}get descent(){return this.#c(2)}get bbox(){let e=wo.#t;if(this.#a.getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<4;r++)i.push(this.#a.getInt16(e,!0)),e+=2;return i}get fontMatrix(){let e=wo.#r;if(this.#a.getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<6;r++)i.push(this.#a.getFloat64(e,!0)),e+=8;return i}get defaultVMetrics(){let e=wo.#i;if(this.#a.getUint8(e)===0)return;e+=1;const i=[];for(let r=0;r<3;r++)i.push(this.#a.getInt16(e,!0)),e+=2;return i}#h(e){Cr(e<wo.strings.length,"Invalid string index");let i=wo.#o+4;for(let n=0;n<e;n++)i+=this.#a.getUint32(i)+4;const r=this.#a.getUint32(i),o=new Uint8Array(r);return o.set(new Uint8Array(this.#n,i+4,r)),this.#s.decode(o)}get fallbackName(){return this.#h(0)}get loadedName(){return this.#h(1)}get mimetype(){return this.#h(2)}get name(){return this.#h(3)}get data(){let e=wo.#o;const i=this.#a.getUint32(e);e+=4+i;const r=this.#a.getUint32(e);e+=4+r;const o=this.#a.getUint32(e);e+=4+o;const n=this.#a.getUint32(e);if(n!==0)return new Uint8Array(this.#n,e+4,n)}clearData(){let e=wo.#o;const i=this.#a.getUint32(e);e+=4+i;const r=this.#a.getUint32(e);e+=4+r;const o=this.#a.getUint32(e);e+=4+o;const n=this.#a.getUint32(e);new Uint8Array(this.#n,e+4,n).fill(0),this.#a.setUint32(e,0)}get cssFontInfo(){let e=wo.#o;const i=this.#a.getUint32(e);e+=4+i;const r=this.#a.getUint32(e);e+=4+r;const o=this.#a.getUint32(e);if(o===0)return null;const n=new Uint8Array(o);return n.set(new Uint8Array(this.#n,e+4,o)),new U7e(n.buffer)}get systemFontInfo(){let e=wo.#o;const i=this.#a.getUint32(e);e+=4+i;const r=this.#a.getUint32(e);if(r===0)return null;const o=new Uint8Array(r);return o.set(new Uint8Array(this.#n,e+4,r)),new N7e(o.buffer)}static write(e){const i=e.systemFontInfo?N7e.write(e.systemFontInfo):null,r=e.cssFontInfo?U7e.write(e.cssFontInfo):null,o=new TextEncoder,n={};let s=0;for(const f of wo.strings)n[f]=o.encode(e[f]),s+=4+n[f].length;const a=wo.#o+4+s+4+(i?i.byteLength:0)+4+(r?r.byteLength:0)+4+(e.data?e.data.length:0),l=new ArrayBuffer(a),c=new Uint8Array(l),d=new DataView(l);let u=0;const h=wo.bools.length;let p=0,g=0;for(let f=0;f<h;f++){const m=e[wo.bools[f]];p|=(m===void 0?0:m?2:1)<<g,g+=2,(g===8||f===h-1)&&(d.setUint8(u++,p),p=0,g=0)}Cr(u===wo.#e,"FontInfo.write: Boolean properties offset mismatch");for(const f of wo.numbers)d.setFloat64(u,e[f]),u+=8;if(Cr(u===wo.#t,"FontInfo.write: Number properties offset mismatch"),e.bbox){d.setUint8(u++,4);for(const f of e.bbox)d.setInt16(u,f,!0),u+=2}else d.setUint8(u++,0),u+=8;if(Cr(u===wo.#r,"FontInfo.write: BBox properties offset mismatch"),e.fontMatrix){d.setUint8(u++,6);for(const f of e.fontMatrix)d.setFloat64(u,f,!0),u+=8}else d.setUint8(u++,0),u+=48;if(Cr(u===wo.#i,"FontInfo.write: FontMatrix properties offset mismatch"),e.defaultVMetrics){d.setUint8(u++,1);for(const f of e.defaultVMetrics)d.setInt16(u,f,!0),u+=2}else d.setUint8(u++,0),u+=6;Cr(u===wo.#o,"FontInfo.write: DefaultVMetrics properties offset mismatch"),d.setUint32(wo.#o,0),u+=4;for(const f of wo.strings){const m=n[f],A=m.length;d.setUint32(u,A),c.set(m,u+4),u+=4+A}if(d.setUint32(wo.#o,u-wo.#o-4),!i)d.setUint32(u,0),u+=4;else{const f=i.byteLength;d.setUint32(u,f),Cr(u+4+f<=l.byteLength,"FontInfo.write: Buffer overflow at systemFontInfo"),c.set(new Uint8Array(i),u+4),u+=4+f}if(!r)d.setUint32(u,0),u+=4;else{const f=r.byteLength;d.setUint32(u,f),Cr(u+4+f<=l.byteLength,"FontInfo.write: Buffer overflow at cssFontInfo"),c.set(new Uint8Array(r),u+4),u+=4+f}return e.data===void 0?(d.setUint32(u,0),u+=4):(d.setUint32(u,e.data.length),c.set(e.data,u+4),u+=4+e.data.length),Cr(u<=l.byteLength,"FontInfo.write: Buffer overflow"),l.transferToFixedLength(u)}},w_i=class Qs{static#e=0;static#t=1;static#r=2;static#i=3;static#o=4;static#n=8;static#s=12;static#a=16;constructor(e){this.buffer=e,this.view=new DataView(e),this.data=new Uint8Array(e)}static write(e){let i,r=null,o=[],n=[],s=[],a=[],l=null,c=null;switch(e[0]){case"RadialAxial":i=e[1]==="axial"?1:2,r=e[2],s=e[3],i===1?o.push(...e[4],...e[5]):o.push(e[4][0],e[4][1],e[6],e[5][0],e[5][1],e[7]);break;case"Mesh":i=3,l=e[1],o=e[2],n=e[3],a=e[4]||[],r=e[6],c=e[7];break;default:throw new Error(`Unsupported pattern type: ${e[0]}`)}const d=Math.floor(o.length/2),u=Math.floor(n.length/3),h=s.length,p=a.length;let g=0;for(const b of a)g+=1,g=Math.ceil(g/4)*4,g+=4+b.coords.length*4,g+=4+b.colors.length*4,b.verticesPerRow!==void 0&&(g+=4);const f=20+d*8+u*3+h*8+(r?16:0)+(c?3:0)+g,m=new ArrayBuffer(f),A=new DataView(m),v=new Uint8Array(m);A.setUint8(Qs.#e,i),A.setUint8(Qs.#t,r?1:0),A.setUint8(Qs.#r,c?1:0),A.setUint8(Qs.#i,l),A.setUint32(Qs.#o,d,!0),A.setUint32(Qs.#n,u,!0),A.setUint32(Qs.#s,h,!0),A.setUint32(Qs.#a,p,!0);let y=20;new Float32Array(m,y,d*2).set(o),y+=d*8,v.set(n,y),y+=u*3;for(const[b,w]of s)A.setFloat32(y,b,!0),y+=4,A.setUint32(y,parseInt(w.slice(1),16),!0),y+=4;if(r)for(const b of r)A.setFloat32(y,b,!0),y+=4;c&&(v.set(c,y),y+=3);for(let b=0;b<a.length;b++){const w=a[b];A.setUint8(y,w.type),y+=1,y=Math.ceil(y/4)*4,A.setUint32(y,w.coords.length,!0),y+=4,new Int32Array(m,y,w.coords.length).set(w.coords),y+=w.coords.length*4,A.setUint32(y,w.colors.length,!0),y+=4,new Int32Array(m,y,w.colors.length).set(w.colors),y+=w.colors.length*4,w.verticesPerRow!==void 0&&(A.setUint32(y,w.verticesPerRow,!0),y+=4)}return m}getIR(){const e=this.view,i=this.data[Qs.#e],r=!!this.data[Qs.#t],o=!!this.data[Qs.#r],n=e.getUint32(Qs.#o,!0),s=e.getUint32(Qs.#n,!0),a=e.getUint32(Qs.#s,!0),l=e.getUint32(Qs.#a,!0);let c=20;const d=new Float32Array(this.buffer,c,n*2);c+=n*8;const u=new Uint8Array(this.buffer,c,s*3);c+=s*3;const h=[];for(let m=0;m<a;++m){const A=e.getFloat32(c,!0);c+=4;const v=e.getUint32(c,!0);c+=4,h.push([A,`#${v.toString(16).padStart(6,"0")}`])}let p=null;if(r){p=[];for(let m=0;m<4;++m)p.push(e.getFloat32(c,!0)),c+=4}let g=null;o&&(g=new Uint8Array(this.buffer,c,3),c+=3);const f=[];for(let m=0;m<l;++m){const A=e.getUint8(c);c+=1,c=Math.ceil(c/4)*4;const v=e.getUint32(c,!0);c+=4;const y=new Int32Array(this.buffer,c,v);c+=v*4;const b=e.getUint32(c,!0);c+=4;const w=new Int32Array(this.buffer,c,b);c+=b*4;const C={type:A,coords:y,colors:w};A===Mq.LATTICE&&(C.verticesPerRow=e.getUint32(c,!0),c+=4),f.push(C)}if(i===1)return["RadialAxial","axial",p,h,Array.from(d.slice(0,2)),Array.from(d.slice(2,4)),null,null];if(i===2)return["RadialAxial","radial",p,h,[d[0],d[1]],[d[3],d[4]],d[2],d[5]];if(i===3){const m=this.data[Qs.#i];let A=null;if(d.length>0){let v=d[0],y=d[0],b=d[1],w=d[1];for(let C=0;C<d.length;C+=2){const M=d[C],E=d[C+1];v=v>M?M:v,b=b>E?E:b,y=y<M?M:y,w=w<E?E:w}A=[v,b,y,w]}return["Mesh",m,d,u,f,A,p,g]}throw new Error(`Unsupported pattern kind: ${i}`)}};function C_i(t){if(t instanceof URL)return t.href;if(typeof t=="string"){if(ja)return t;const e=URL.parse(t,window.location);if(e)return e.href}throw new Error("Invalid PDF url data: either string or URL-object is expected in the url property.")}function x_i(t){if(ja&&typeof Buffer<"u"&&t instanceof Buffer)throw new Error("Please provide binary data as `Uint8Array`, rather than `Buffer`.");if(t instanceof Uint8Array&&t.byteLength===t.buffer.byteLength)return t;if(typeof t=="string")return My(t);if(t instanceof ArrayBuffer||ArrayBuffer.isView(t)||typeof t=="object"&&!isNaN(t?.length))return new Uint8Array(t);throw new Error("Invalid PDF binary data: either TypedArray, string, or array-like object is expected in the data property.")}function MP(t){if(typeof t!="string")return null;if(t.endsWith("/"))return t;throw new Error(`Invalid factory url: "${t}" must include trailing slash.`)}const Oq=t=>typeof t=="object"&&Number.isInteger(t?.num)&&t.num>=0&&Number.isInteger(t?.gen)&&t.gen>=0,k_i=t=>typeof t=="object"&&typeof t?.name=="string",M_i=r_i.bind(null,Oq,k_i);class E_i{#e=new Map;#t=Promise.resolve();postMessage(e,i){const r={data:structuredClone(e,i?{transfer:i}:null)};this.#t.then(()=>{for(const[o]of this.#e)o.call(this,r)})}addEventListener(e,i,r=null){let o=null;if(r?.signal instanceof AbortSignal){const{signal:n}=r;if(n.aborted){ji("LoopbackPort - cannot use an `aborted` signal.");return}const s=()=>this.removeEventListener(e,i);o=()=>n.removeEventListener("abort",s),n.addEventListener("abort",s)}this.#e.set(i,o)}removeEventListener(e,i){this.#e.get(i)?.(),this.#e.delete(i)}terminate(){for(const[,e]of this.#e)e?.();this.#e.clear()}}const EP={DATA:1,ERROR:2},Nn={CANCEL:1,CANCEL_COMPLETE:2,CLOSE:3,ENQUEUE:4,ERROR:5,PULL:6,PULL_COMPLETE:7,START_COMPLETE:8};function j7e(){}function yl(t){if(t instanceof $p||t instanceof Bq||t instanceof w7e||t instanceof CP||t instanceof Eq)return t;switch(t instanceof Error||typeof t=="object"&&t!==null||yo('wrapReason: Expected "reason" to be a (possibly cloned) Error.'),t.name){case"AbortException":return new $p(t.message);case"InvalidPDFException":return new Bq(t.message);case"PasswordException":return new w7e(t.message,t.code);case"ResponseException":return new CP(t.message,t.status,t.missing);case"UnknownErrorException":return new Eq(t.message,t.details)}return new Eq(t.message,t.toString())}let Sy=class{#e=new AbortController;constructor(t,e,i){this.sourceName=t,this.targetName=e,this.comObj=i,this.callbackId=1,this.streamId=1,this.streamSinks=Object.create(null),this.streamControllers=Object.create(null),this.callbackCapabilities=Object.create(null),this.actionHandler=Object.create(null),i.addEventListener("message",this.#t.bind(this),{signal:this.#e.signal})}#t({data:t}){if(t.targetName!==this.sourceName)return;if(t.stream){this.#i(t);return}if(t.callback){const i=t.callbackId,r=this.callbackCapabilities[i];if(!r)throw new Error(`Cannot resolve callback ${i}`);if(delete this.callbackCapabilities[i],t.callback===EP.DATA)r.resolve(t.data);else if(t.callback===EP.ERROR)r.reject(yl(t.reason));else throw new Error("Unexpected callback case");return}const e=this.actionHandler[t.action];if(!e)throw new Error(`Unknown action from worker: ${t.action}`);if(t.callbackId){const i=this.sourceName,r=t.sourceName,o=this.comObj;Promise.try(e,t.data).then(function(n){o.postMessage({sourceName:i,targetName:r,callback:EP.DATA,callbackId:t.callbackId,data:n})},function(n){o.postMessage({sourceName:i,targetName:r,callback:EP.ERROR,callbackId:t.callbackId,reason:yl(n)})});return}if(t.streamId){this.#r(t);return}e(t.data)}on(t,e){const i=this.actionHandler;if(i[t])throw new Error(`There is already an actionName called "${t}"`);i[t]=e}send(t,e,i){this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,data:e},i)}sendWithPromise(t,e,i){const r=this.callbackId++,o=Promise.withResolvers();this.callbackCapabilities[r]=o;try{this.comObj.postMessage({sourceName:this.sourceName,targetName:this.targetName,action:t,callbackId:r,data:e},i)}catch(n){o.reject(n)}return o.promise}sendWithStream(t,e,i,r){const o=this.streamId++,n=this.sourceName,s=this.targetName,a=this.comObj;return new ReadableStream({start:l=>{const c=Promise.withResolvers();return this.streamControllers[o]={controller:l,startCall:c,pullCall:null,cancelCall:null,isClosed:!1},a.postMessage({sourceName:n,targetName:s,action:t,streamId:o,data:e,desiredSize:l.desiredSize},r),c.promise},pull:l=>{const c=Promise.withResolvers();return this.streamControllers[o].pullCall=c,a.postMessage({sourceName:n,targetName:s,stream:Nn.PULL,streamId:o,desiredSize:l.desiredSize}),c.promise},cancel:l=>{Cr(l instanceof Error,"cancel must have a valid reason");const c=Promise.withResolvers();return this.streamControllers[o].cancelCall=c,this.streamControllers[o].isClosed=!0,a.postMessage({sourceName:n,targetName:s,stream:Nn.CANCEL,streamId:o,reason:yl(l)}),c.promise}},i)}#r(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this,s=this.actionHandler[t.action],a={enqueue(l,c=1,d){if(this.isCancelled)return;const u=this.desiredSize;this.desiredSize-=c,u>0&&this.desiredSize<=0&&(this.sinkCapability=Promise.withResolvers(),this.ready=this.sinkCapability.promise),o.postMessage({sourceName:i,targetName:r,stream:Nn.ENQUEUE,streamId:e,chunk:l},d)},close(){this.isCancelled||(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:Nn.CLOSE,streamId:e}),delete n.streamSinks[e])},error(l){Cr(l instanceof Error,"error must have a valid reason"),!this.isCancelled&&(this.isCancelled=!0,o.postMessage({sourceName:i,targetName:r,stream:Nn.ERROR,streamId:e,reason:yl(l)}))},sinkCapability:Promise.withResolvers(),onPull:null,onCancel:null,isCancelled:!1,desiredSize:t.desiredSize,ready:null};a.sinkCapability.resolve(),a.ready=a.sinkCapability.promise,this.streamSinks[e]=a,Promise.try(s,t.data,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Nn.START_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:Nn.START_COMPLETE,streamId:e,reason:yl(l)})})}#i(t){const e=t.streamId,i=this.sourceName,r=t.sourceName,o=this.comObj,n=this.streamControllers[e],s=this.streamSinks[e];switch(t.stream){case Nn.START_COMPLETE:t.success?n.startCall.resolve():n.startCall.reject(yl(t.reason));break;case Nn.PULL_COMPLETE:t.success?n.pullCall.resolve():n.pullCall.reject(yl(t.reason));break;case Nn.PULL:if(!s){o.postMessage({sourceName:i,targetName:r,stream:Nn.PULL_COMPLETE,streamId:e,success:!0});break}s.desiredSize<=0&&t.desiredSize>0&&s.sinkCapability.resolve(),s.desiredSize=t.desiredSize,Promise.try(s.onPull||j7e).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Nn.PULL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:Nn.PULL_COMPLETE,streamId:e,reason:yl(l)})});break;case Nn.ENQUEUE:if(Cr(n,"enqueue should have stream controller"),n.isClosed)break;n.controller.enqueue(t.chunk);break;case Nn.CLOSE:if(Cr(n,"close should have stream controller"),n.isClosed)break;n.isClosed=!0,n.controller.close(),this.#o(n,e);break;case Nn.ERROR:Cr(n,"error should have stream controller"),n.controller.error(yl(t.reason)),this.#o(n,e);break;case Nn.CANCEL_COMPLETE:t.success?n.cancelCall.resolve():n.cancelCall.reject(yl(t.reason)),this.#o(n,e);break;case Nn.CANCEL:if(!s)break;const a=yl(t.reason);Promise.try(s.onCancel||j7e,a).then(function(){o.postMessage({sourceName:i,targetName:r,stream:Nn.CANCEL_COMPLETE,streamId:e,success:!0})},function(l){o.postMessage({sourceName:i,targetName:r,stream:Nn.CANCEL_COMPLETE,streamId:e,reason:yl(l)})}),s.sinkCapability.reject(a),s.isCancelled=!0,delete this.streamSinks[e];break;default:throw new Error("Unexpected stream case")}}async#o(t,e){await Promise.allSettled([t.startCall?.promise,t.pullCall?.promise,t.cancelCall?.promise]),delete this.streamControllers[e]}destroy(){this.#e?.abort(),this.#e=null}};class H7e{#e=!1;constructor({enableHWA:e=!1}){this.#e=e}create(e,i){if(e<=0||i<=0)throw new Error("Invalid canvas size");const r=this._createCanvas(e,i);return{canvas:r,context:r.getContext("2d",{willReadFrequently:!this.#e})}}reset(e,i,r){if(!e.canvas)throw new Error("Canvas is not specified");if(i<=0||r<=0)throw new Error("Invalid canvas size");e.canvas.width=i,e.canvas.height=r}destroy(e){if(!e.canvas)throw new Error("Canvas is not specified");e.canvas.width=0,e.canvas.height=0,e.canvas=null,e.context=null}_createCanvas(e,i){yo("Abstract method `_createCanvas` called.")}}class B_i extends H7e{constructor({ownerDocument:e=globalThis.document,enableHWA:i=!1}){super({enableHWA:i}),this._document=e}_createCanvas(e,i){const r=this._document.createElement("canvas");return r.width=e,r.height=i,r}}class z7e{constructor({baseUrl:e=null,isCompressed:i=!0}){this.baseUrl=e,this.isCompressed=i}async fetch({name:e}){if(!this.baseUrl)throw new Error("Ensure that the `cMapUrl` and `cMapPacked` API parameters are provided.");if(!e)throw new Error("CMap name must be specified.");const i=this.baseUrl+e+(this.isCompressed?".bcmap":"");return this._fetch(i).then(r=>({cMapData:r,isCompressed:this.isCompressed})).catch(r=>{throw new Error(`Unable to load ${this.isCompressed?"binary ":""}CMap at: ${i}`)})}async _fetch(e){yo("Abstract method `_fetch` called.")}}class V7e extends z7e{async _fetch(e){const i=await Ey(e,this.isCompressed?"arraybuffer":"text");return i instanceof ArrayBuffer?new Uint8Array(i):My(i)}}class q7e{addFilter(e){return"none"}addHCMFilter(e,i){return"none"}addAlphaFilter(e){return"none"}addLuminosityFilter(e){return"none"}addHighlightHCMFilter(e,i,r,o,n){return"none"}destroy(e=!1){}}class P_i extends q7e{#e;#t;#r;#i;#o;#n;#s=0;constructor({docId:e,ownerDocument:i=globalThis.document}){super(),this.#i=e,this.#o=i}get#a(){return this.#t||=new Map}get#l(){return this.#n||=new Map}get#c(){if(!this.#r){const e=this.#o.createElement("div"),{style:i}=e;i.visibility="hidden",i.contain="strict",i.width=i.height=0,i.position="absolute",i.top=i.left=0,i.zIndex=-1;const r=this.#o.createElementNS(l1,"svg");r.setAttribute("width",0),r.setAttribute("height",0),this.#r=this.#o.createElementNS(l1,"defs"),e.append(r),r.append(this.#r),this.#o.body.append(e)}return this.#r}#h(e){if(e.length===1){const l=e[0],c=new Array(256);for(let u=0;u<256;u++)c[u]=l[u]/255;const d=c.join(",");return[d,d,d]}const[i,r,o]=e,n=new Array(256),s=new Array(256),a=new Array(256);for(let l=0;l<256;l++)n[l]=i[l]/255,s[l]=r[l]/255,a[l]=o[l]/255;return[n.join(","),s.join(","),a.join(",")]}#u(e){if(this.#e===void 0){this.#e="";const i=this.#o.URL;i!==this.#o.baseURI&&(xP(i)?ji('#createUrl: ignore "data:"-URL for performance reasons.'):this.#e=b7e(i,""))}return`url(${this.#e}#${e})`}addFilter(e){if(!e)return"none";let i=this.#a.get(e);if(i)return i;const[r,o,n]=this.#h(e),s=e.length===1?r:`${r}${o}${n}`;if(i=this.#a.get(s),i)return this.#a.set(e,i),i;const a=`g_${this.#i}_transfer_map_${this.#s++}`,l=this.#u(a);this.#a.set(e,l),this.#a.set(s,l);const c=this.#g(a);return this.#f(r,o,n,c),l}addHCMFilter(e,i){const r=`${e}-${i}`,o="base";let n=this.#l.get(o);if(n?.key===r||(n?(n.filter?.remove(),n.key=r,n.url="none",n.filter=null):(n={key:r,url:"none",filter:null},this.#l.set(o,n)),!e||!i))return n.url;const s=this.#y(e);e=si.makeHexColor(...s);const a=this.#y(i);if(i=si.makeHexColor(...a),this.#c.style.color="",e==="#000000"&&i==="#ffffff"||e===i)return n.url;const l=new Array(256);for(let p=0;p<=255;p++){const g=p/255;l[p]=g<=.03928?g/12.92:((g+.055)/1.055)**2.4}const c=l.join(","),d=`g_${this.#i}_hcm_filter`,u=n.filter=this.#g(d);this.#f(c,c,c,u),this.#A(u);const h=(p,g)=>{const f=s[p]/255,m=a[p]/255,A=new Array(g+1);for(let v=0;v<=g;v++)A[v]=f+v/g*(m-f);return A.join(",")};return this.#f(h(0,5),h(1,5),h(2,5),u),n.url=this.#u(d),n.url}addAlphaFilter(e){let i=this.#a.get(e);if(i)return i;const[r]=this.#h([e]),o=`alpha_${r}`;if(i=this.#a.get(o),i)return this.#a.set(e,i),i;const n=`g_${this.#i}_alpha_map_${this.#s++}`,s=this.#u(n);this.#a.set(e,s),this.#a.set(o,s);const a=this.#g(n);return this.#m(r,a),s}addLuminosityFilter(e){let i=this.#a.get(e||"luminosity");if(i)return i;let r,o;if(e?([r]=this.#h([e]),o=`luminosity_${r}`):o="luminosity",i=this.#a.get(o),i)return this.#a.set(e,i),i;const n=`g_${this.#i}_luminosity_map_${this.#s++}`,s=this.#u(n);this.#a.set(e,s),this.#a.set(o,s);const a=this.#g(n);return this.#p(a),e&&this.#m(r,a),s}addHighlightHCMFilter(e,i,r,o,n){const s=`${i}-${r}-${o}-${n}`;let a=this.#l.get(e);if(a?.key===s||(a?(a.filter?.remove(),a.key=s,a.url="none",a.filter=null):(a={key:s,url:"none",filter:null},this.#l.set(e,a)),!i||!r))return a.url;const[l,c]=[i,r].map(this.#y.bind(this));let d=Math.round(.2126*l[0]+.7152*l[1]+.0722*l[2]),u=Math.round(.2126*c[0]+.7152*c[1]+.0722*c[2]),[h,p]=[o,n].map(this.#y.bind(this));u<d&&([d,u,h,p]=[u,d,p,h]),this.#c.style.color="";const g=(A,v,y)=>{const b=new Array(256),w=(u-d)/y,C=A/255,M=(v-A)/(255*y);let E=0;for(let B=0;B<=y;B++){const S=Math.round(d+B*w),I=C+B*M;for(let T=E;T<=S;T++)b[T]=I;E=S+1}for(let B=E;B<256;B++)b[B]=b[E-1];return b.join(",")},f=`g_${this.#i}_hcm_${e}_filter`,m=a.filter=this.#g(f);return this.#A(m),this.#f(g(h[0],p[0],5),g(h[1],p[1],5),g(h[2],p[2],5),m),a.url=this.#u(f),a.url}destroy(e=!1){e&&this.#n?.size||(this.#r?.parentNode.parentNode.remove(),this.#r=null,this.#t?.clear(),this.#t=null,this.#n?.clear(),this.#n=null,this.#s=0)}#p(e){const i=this.#o.createElementNS(l1,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.3 0.59 0.11 0 0"),e.append(i)}#A(e){const i=this.#o.createElementNS(l1,"feColorMatrix");i.setAttribute("type","matrix"),i.setAttribute("values","0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0.2126 0.7152 0.0722 0 0 0 0 0 1 0"),e.append(i)}#g(e){const i=this.#o.createElementNS(l1,"filter");return i.setAttribute("color-interpolation-filters","sRGB"),i.setAttribute("id",e),this.#c.append(i),i}#d(e,i,r){const o=this.#o.createElementNS(l1,i);o.setAttribute("type","discrete"),o.setAttribute("tableValues",r),e.append(o)}#f(e,i,r,o){const n=this.#o.createElementNS(l1,"feComponentTransfer");o.append(n),this.#d(n,"feFuncR",e),this.#d(n,"feFuncG",i),this.#d(n,"feFuncB",r)}#m(e,i){const r=this.#o.createElementNS(l1,"feComponentTransfer");i.append(r),this.#d(r,"feFuncA",e)}#y(e){return this.#c.style.color=e,Py(getComputedStyle(this.#c).getPropertyValue("color"))}}class G7e{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `standardFontDataUrl` API parameter is provided.");if(!e)throw new Error("Font filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load font data at: ${i}`)})}async _fetch(e){yo("Abstract method `_fetch` called.")}}class Q7e extends G7e{async _fetch(e){const i=await Ey(e,"arraybuffer");return new Uint8Array(i)}}class K7e{constructor({baseUrl:e=null}){this.baseUrl=e}async fetch({filename:e}){if(!this.baseUrl)throw new Error("Ensure that the `wasmUrl` API parameter is provided.");if(!e)throw new Error("Wasm filename must be specified.");const i=`${this.baseUrl}${e}`;return this._fetch(i).catch(r=>{throw new Error(`Unable to load wasm data at: ${i}`)})}async _fetch(e){yo("Abstract method `_fetch` called.")}}class W7e extends K7e{async _fetch(e){const i=await Ey(e,"arraybuffer");return new Uint8Array(i)}}ja&&ji("Please use the `legacy` build in Node.js environments.");async function Uq(t){const e=await process.getBuiltinModule("fs").promises.readFile(t);return new Uint8Array(e)}class I_i extends q7e{}class S_i extends H7e{_createCanvas(e,i){return process.getBuiltinModule("module").createRequire(import.meta.url)("@napi-rs/canvas").createCanvas(e,i)}}class T_i extends z7e{async _fetch(e){return Uq(e)}}class R_i extends G7e{async _fetch(e){return Uq(e)}}class D_i extends K7e{async _fetch(e){return Uq(e)}}const X5="__forcedDependency",{floor:J7e,ceil:Z7e}=Math;function BP(t,e,i,r,o,n){t[e*4+0]=Math.min(t[e*4+0],i),t[e*4+1]=Math.min(t[e*4+1],r),t[e*4+2]=Math.max(t[e*4+2],o),t[e*4+3]=Math.max(t[e*4+3],n)}const Nq=new Uint32Array(new Uint8Array([255,255,0,0]).buffer)[0];class __i{#e;#t;constructor(e,i){this.#e=e,this.#t=i}get length(){return this.#e.length}isEmpty(e){return this.#e[e]===Nq}minX(e){return this.#t[e*4+0]/256}minY(e){return this.#t[e*4+1]/256}maxX(e){return(this.#t[e*4+2]+1)/256}maxY(e){return(this.#t[e*4+3]+1)/256}}const PP=(t,e)=>{if(!t)return;let i=t.get(e);return i||(i={dependencies:new Set,isRenderingOperation:!1},t.set(e,i)),i};class L_i{#e={__proto__:null};#t={__proto__:null,transform:[],moveText:[],sameLineText:[],[X5]:[]};#r=new Map;#i=[];#o=[];#n=[[1,0,0,1,0,0]];#s=[-1/0,-1/0,1/0,1/0];#a=new Float64Array([1/0,1/0,-1/0,-1/0]);#l=-1;#c=new Set;#h=new Map;#u=new Map;#p;#A;#g;#d;#f;constructor(e,i,r=!1){this.#p=e.width,this.#A=e.height,this.#m(i),r&&(this.#f=new Map)}growOperationsCount(e){e>=this.#d.length&&this.#m(e,this.#d)}#m(e,i){const r=new ArrayBuffer(e*4);this.#g=new Uint8ClampedArray(r),this.#d=new Uint32Array(r),i&&i.length>0?(this.#d.set(i),this.#d.fill(Nq,i.length)):this.#d.fill(Nq)}save(e){return this.#e={__proto__:this.#e},this.#t={__proto__:this.#t,transform:{__proto__:this.#t.transform},moveText:{__proto__:this.#t.moveText},sameLineText:{__proto__:this.#t.sameLineText},[X5]:{__proto__:this.#t[X5]}},this.#s={__proto__:this.#s},this.#i.push(e),this}restore(e){const i=Object.getPrototypeOf(this.#e);if(i===null)return this;this.#e=i,this.#t=Object.getPrototypeOf(this.#t),this.#s=Object.getPrototypeOf(this.#s);const r=this.#i.pop();return r!==void 0&&(PP(this.#f,e)?.dependencies.add(r),this.#d[e]=this.#d[r]),this}recordOpenMarker(e){return this.#i.push(e),this}getOpenMarker(){return this.#i.length===0?null:this.#i.at(-1)}recordCloseMarker(e){const i=this.#i.pop();return i!==void 0&&(PP(this.#f,e)?.dependencies.add(i),this.#d[e]=this.#d[i]),this}beginMarkedContent(e){return this.#o.push(e),this}endMarkedContent(e){const i=this.#o.pop();return i!==void 0&&(PP(this.#f,e)?.dependencies.add(i),this.#d[e]=this.#d[i]),this}pushBaseTransform(e){return this.#n.push(si.multiplyByDOMMatrix(this.#n.at(-1),e.getTransform())),this}popBaseTransform(){return this.#n.length>1&&this.#n.pop(),this}recordSimpleData(e,i){return this.#e[e]=i,this}recordIncrementalData(e,i){return this.#t[e].push(i),this}resetIncrementalData(e,i){return this.#t[e].length=0,this}recordNamedData(e,i){return this.#r.set(e,i),this}recordSimpleDataFromNamed(e,i,r){this.#e[e]=this.#r.get(i)??r}recordFutureForcedDependency(e,i){return this.recordIncrementalData(X5,i),this}inheritSimpleDataAsFutureForcedDependencies(e){for(const i of e)i in this.#e&&this.recordFutureForcedDependency(i,this.#e[i]);return this}inheritPendingDependenciesAsFutureForcedDependencies(){for(const e of this.#c)this.recordFutureForcedDependency(X5,e);return this}resetBBox(e){return this.#l!==e&&(this.#l=e,this.#a[0]=1/0,this.#a[1]=1/0,this.#a[2]=-1/0,this.#a[3]=-1/0),this}recordClipBox(e,i,r,o,n,s){const a=si.multiplyByDOMMatrix(this.#n.at(-1),i.getTransform()),l=[1/0,1/0,-1/0,-1/0];si.axialAlignedBoundingBox([r,n,o,s],a,l);const c=si.intersect(this.#s,l);return c?(this.#s[0]=c[0],this.#s[1]=c[1],this.#s[2]=c[2],this.#s[3]=c[3]):(this.#s[0]=this.#s[1]=1/0,this.#s[2]=this.#s[3]=-1/0),this}recordBBox(e,i,r,o,n,s){const a=this.#s;if(a[0]===1/0)return this;const l=si.multiplyByDOMMatrix(this.#n.at(-1),i.getTransform());if(a[0]===-1/0)return si.axialAlignedBoundingBox([r,n,o,s],l,this.#a),this;const c=[1/0,1/0,-1/0,-1/0];return si.axialAlignedBoundingBox([r,n,o,s],l,c),this.#a[0]=Math.min(this.#a[0],Math.max(c[0],a[0])),this.#a[1]=Math.min(this.#a[1],Math.max(c[1],a[1])),this.#a[2]=Math.max(this.#a[2],Math.min(c[2],a[2])),this.#a[3]=Math.max(this.#a[3],Math.min(c[3],a[3])),this}recordCharacterBBox(e,i,r,o=1,n=0,s=0,a){const l=r.bbox;let c,d;if(l&&(c=l[2]!==l[0]&&l[3]!==l[1]&&this.#u.get(r),c!==!1&&(d=[0,0,0,0],si.axialAlignedBoundingBox(l,r.fontMatrix,d),(o!==1||n!==0||s!==0)&&si.scaleMinMax([o,0,0,-o,n,s],d),c)))return this.recordBBox(e,i,d[0],d[2],d[1],d[3]);if(!a)return this.recordFullPageBBox(e);const u=a();return l&&d&&c===void 0&&(c=d[0]<=n-u.actualBoundingBoxLeft&&d[2]>=n+u.actualBoundingBoxRight&&d[1]<=s-u.actualBoundingBoxAscent&&d[3]>=s+u.actualBoundingBoxDescent,this.#u.set(r,c),c)?this.recordBBox(e,i,d[0],d[2],d[1],d[3]):this.recordBBox(e,i,n-u.actualBoundingBoxLeft,n+u.actualBoundingBoxRight,s-u.actualBoundingBoxAscent,s+u.actualBoundingBoxDescent)}recordFullPageBBox(e){return this.#a[0]=Math.max(0,this.#s[0]),this.#a[1]=Math.max(0,this.#s[1]),this.#a[2]=Math.min(this.#p,this.#s[2]),this.#a[3]=Math.min(this.#A,this.#s[3]),this}getSimpleIndex(e){return this.#e[e]}recordDependencies(e,i){const r=this.#c,o=this.#e,n=this.#t;for(const s of i)s in this.#e?r.add(o[s]):s in n&&n[s].forEach(r.add,r);return this}recordNamedDependency(e,i){return this.#r.has(i)&&this.#c.add(this.#r.get(i)),this}recordOperation(e,i=!1){if(this.recordDependencies(e,[X5]),this.#f){const r=PP(this.#f,e),{dependencies:o}=r;this.#c.forEach(o.add,o),this.#i.forEach(o.add,o),this.#o.forEach(o.add,o),o.delete(e),r.isRenderingOperation=!0}if(this.#l===e){const r=J7e(this.#a[0]*256/this.#p),o=J7e(this.#a[1]*256/this.#A),n=Z7e(this.#a[2]*256/this.#p),s=Z7e(this.#a[3]*256/this.#A);BP(this.#g,e,r,o,n,s);for(const a of this.#c)a!==e&&BP(this.#g,a,r,o,n,s);for(const a of this.#i)a!==e&&BP(this.#g,a,r,o,n,s);for(const a of this.#o)a!==e&&BP(this.#g,a,r,o,n,s);i||(this.#c.clear(),this.#l=-1)}return this}recordShowTextOperation(e,i=!1){const r=Array.from(this.#c);this.recordOperation(e,i),this.recordIncrementalData("sameLineText",e);for(const o of r)this.recordIncrementalData("sameLineText",o);return this}bboxToClipBoxDropOperation(e,i=!1){return this.#l===e&&(this.#l=-1,this.#s[0]=Math.max(this.#s[0],this.#a[0]),this.#s[1]=Math.max(this.#s[1],this.#a[1]),this.#s[2]=Math.min(this.#s[2],this.#a[2]),this.#s[3]=Math.min(this.#s[3],this.#a[3]),i||this.#c.clear()),this}_takePendingDependencies(){const e=this.#c;return this.#c=new Set,e}_extractOperation(e){const i=this.#h.get(e);return this.#h.delete(e),i}_pushPendingDependencies(e){for(const i of e)this.#c.add(i)}take(){return this.#u.clear(),new __i(this.#d,this.#g)}takeDebugMetadata(){return this.#f}}class XI{#e;#t;#r;#i=0;#o=0;constructor(e,i,r){if(e instanceof XI&&e.#r===!!r)return e;this.#e=e,this.#t=i,this.#r=!!r}growOperationsCount(){throw new Error("Unreachable")}save(e){return this.#o++,this.#e.save(this.#t),this}restore(e){return this.#o>0&&(this.#e.restore(this.#t),this.#o--),this}recordOpenMarker(e){return this.#i++,this}getOpenMarker(){return this.#i>0?this.#t:this.#e.getOpenMarker()}recordCloseMarker(e){return this.#i--,this}beginMarkedContent(e){return this}endMarkedContent(e){return this}pushBaseTransform(e){return this.#e.pushBaseTransform(e),this}popBaseTransform(){return this.#e.popBaseTransform(),this}recordSimpleData(e,i){return this.#e.recordSimpleData(e,this.#t),this}recordIncrementalData(e,i){return this.#e.recordIncrementalData(e,this.#t),this}resetIncrementalData(e,i){return this.#e.resetIncrementalData(e,this.#t),this}recordNamedData(e,i){return this}recordSimpleDataFromNamed(e,i,r){return this.#e.recordSimpleDataFromNamed(e,i,this.#t),this}recordFutureForcedDependency(e,i){return this.#e.recordFutureForcedDependency(e,this.#t),this}inheritSimpleDataAsFutureForcedDependencies(e){return this.#e.inheritSimpleDataAsFutureForcedDependencies(e),this}inheritPendingDependenciesAsFutureForcedDependencies(){return this.#e.inheritPendingDependenciesAsFutureForcedDependencies(),this}resetBBox(e){return this.#r||this.#e.resetBBox(this.#t),this}recordClipBox(e,i,r,o,n,s){return this.#r||this.#e.recordClipBox(this.#t,i,r,o,n,s),this}recordBBox(e,i,r,o,n,s){return this.#r||this.#e.recordBBox(this.#t,i,r,o,n,s),this}recordCharacterBBox(e,i,r,o,n,s,a){return this.#r||this.#e.recordCharacterBBox(this.#t,i,r,o,n,s,a),this}recordFullPageBBox(e){return this.#r||this.#e.recordFullPageBBox(this.#t),this}getSimpleIndex(e){return this.#e.getSimpleIndex(e)}recordDependencies(e,i){return this.#e.recordDependencies(this.#t,i),this}recordNamedDependency(e,i){return this.#e.recordNamedDependency(this.#t,i),this}recordOperation(e){return this.#e.recordOperation(this.#t,!0),this}recordShowTextOperation(e){return this.#e.recordShowTextOperation(this.#t,!0),this}bboxToClipBoxDropOperation(e){return this.#r||this.#e.bboxToClipBoxDropOperation(this.#t,!0),this}take(){throw new Error("Unreachable")}takeDebugMetadata(){throw new Error("Unreachable")}}const Uc={stroke:["path","transform","filter","strokeColor","strokeAlpha","lineWidth","lineCap","lineJoin","miterLimit","dash"],fill:["path","transform","filter","fillColor","fillAlpha","globalCompositeOperation","SMask"],imageXObject:["transform","SMask","filter","fillAlpha","strokeAlpha","globalCompositeOperation"],rawFillPath:["filter","fillColor","fillAlpha"],showText:["transform","leading","charSpacing","wordSpacing","hScale","textRise","moveText","textMatrix","font","fontObj","filter","fillColor","textRenderingMode","SMask","fillAlpha","strokeAlpha","globalCompositeOperation","sameLineText"],transform:["transform"],transformAndFill:["transform","fillColor"]},Os={FILL:"Fill",STROKE:"Stroke",SHADING:"Shading"};function jq(t,e){if(!e)return;const i=e[2]-e[0],r=e[3]-e[1],o=new Path2D;o.rect(e[0],e[1],i,r),t.clip(o)}class Hq{isModifyingCurrentTransform(){return!1}getPattern(){yo("Abstract method `getPattern` called.")}}class F_i extends Hq{constructor(e){super(),this._type=e[1],this._bbox=e[2],this._colorStops=e[3],this._p0=e[4],this._p1=e[5],this._r0=e[6],this._r1=e[7],this.matrix=null}_createGradient(e){let i;this._type==="axial"?i=e.createLinearGradient(this._p0[0],this._p0[1],this._p1[0],this._p1[1]):this._type==="radial"&&(i=e.createRadialGradient(this._p0[0],this._p0[1],this._r0,this._p1[0],this._p1[1],this._r1));for(const r of this._colorStops)i.addColorStop(r[0],r[1]);return i}getPattern(e,i,r,o){let n;if(o===Os.STROKE||o===Os.FILL){const s=i.current.getClippedPathBoundingBox(o,en(e))||[0,0,0,0],a=Math.ceil(s[2]-s[0])||1,l=Math.ceil(s[3]-s[1])||1,c=i.cachedCanvases.getCanvas("pattern",a,l),d=c.context;d.clearRect(0,0,d.canvas.width,d.canvas.height),d.beginPath(),d.rect(0,0,d.canvas.width,d.canvas.height),d.translate(-s[0],-s[1]),r=si.transform(r,[1,0,0,1,s[0],s[1]]),d.transform(...i.baseTransform),this.matrix&&d.transform(...this.matrix),jq(d,this._bbox),d.fillStyle=this._createGradient(d),d.fill(),n=e.createPattern(c.canvas,"no-repeat");const u=new DOMMatrix(r);n.setTransform(u)}else jq(e,this._bbox),n=this._createGradient(e);return n}}function zq(t,e,i,r,o,n,s,a){const l=e.coords,c=e.colors,d=t.data,u=t.width*4;let h;l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h),l[r+1]>l[o+1]&&(h=r,r=o,o=h,h=s,s=a,a=h),l[i+1]>l[r+1]&&(h=i,i=r,r=h,h=n,n=s,s=h);const p=(l[i]+e.offsetX)*e.scaleX,g=(l[i+1]+e.offsetY)*e.scaleY,f=(l[r]+e.offsetX)*e.scaleX,m=(l[r+1]+e.offsetY)*e.scaleY,A=(l[o]+e.offsetX)*e.scaleX,v=(l[o+1]+e.offsetY)*e.scaleY;if(g>=v)return;const y=c[n],b=c[n+1],w=c[n+2],C=c[s],M=c[s+1],E=c[s+2],B=c[a],S=c[a+1],I=c[a+2],T=Math.round(g),_=Math.round(v);let O,j,N,G,q,X,me,ce;for(let xe=T;xe<=_;xe++){if(xe<m){const re=xe<g?0:(g-xe)/(g-m);O=p-(p-f)*re,j=y-(y-C)*re,N=b-(b-M)*re,G=w-(w-E)*re}else{let re;xe>v?re=1:m===v?re=0:re=(m-xe)/(m-v),O=f-(f-A)*re,j=C-(C-B)*re,N=M-(M-S)*re,G=E-(E-I)*re}let Re;xe<g?Re=0:xe>v?Re=1:Re=(g-xe)/(g-v),q=p-(p-A)*Re,X=y-(y-B)*Re,me=b-(b-S)*Re,ce=w-(w-I)*Re;const ge=Math.round(Math.min(O,q)),ee=Math.round(Math.max(O,q));let $=u*xe+ge*4;for(let re=ge;re<=ee;re++)Re=(O-re)/(O-q),Re<0?Re=0:Re>1&&(Re=1),d[$++]=j-(j-X)*Re|0,d[$++]=N-(N-me)*Re|0,d[$++]=G-(G-ce)*Re|0,d[$++]=255}}function O_i(t,e,i){const r=e.coords,o=e.colors;let n,s;switch(e.type){case Mq.LATTICE:const a=e.verticesPerRow,l=Math.floor(r.length/a)-1,c=a-1;for(n=0;n<l;n++){let d=n*a;for(let u=0;u<c;u++,d++)zq(t,i,r[d],r[d+1],r[d+a],o[d],o[d+1],o[d+a]),zq(t,i,r[d+a+1],r[d+1],r[d+a],o[d+a+1],o[d+1],o[d+a])}break;case Mq.TRIANGLES:for(n=0,s=r.length;n<s;n+=3)zq(t,i,r[n],r[n+1],r[n+2],o[n],o[n+1],o[n+2]);break;default:throw new Error("illegal figure")}}class U_i extends Hq{constructor(e){super(),this._coords=e[2],this._colors=e[3],this._figures=e[4],this._bounds=e[5],this._bbox=e[6],this._background=e[7],this.matrix=null}_createMeshCanvas(e,i,r){const o=Math.floor(this._bounds[0]),n=Math.floor(this._bounds[1]),s=Math.ceil(this._bounds[2])-o,a=Math.ceil(this._bounds[3])-n,l=Math.min(Math.ceil(Math.abs(s*e[0]*1.1)),3e3),c=Math.min(Math.ceil(Math.abs(a*e[1]*1.1)),3e3),d=s/l,u=a/c,h={coords:this._coords,colors:this._colors,offsetX:-o,offsetY:-n,scaleX:1/d,scaleY:1/u},p=l+4,g=c+4,f=r.getCanvas("mesh",p,g),m=f.context,A=m.createImageData(l,c);if(i){const v=A.data;for(let y=0,b=v.length;y<b;y+=4)v[y]=i[0],v[y+1]=i[1],v[y+2]=i[2],v[y+3]=255}for(const v of this._figures)O_i(A,v,h);return m.putImageData(A,2,2),{canvas:f.canvas,offsetX:o-2*d,offsetY:n-2*u,scaleX:d,scaleY:u}}isModifyingCurrentTransform(){return!0}getPattern(e,i,r,o){jq(e,this._bbox);const n=new Float32Array(2);if(o===Os.SHADING)si.singularValueDecompose2dScale(en(e),n);else if(this.matrix){si.singularValueDecompose2dScale(this.matrix,n);const[a,l]=n;si.singularValueDecompose2dScale(i.baseTransform,n),n[0]*=a,n[1]*=l}else si.singularValueDecompose2dScale(i.baseTransform,n);const s=this._createMeshCanvas(n,o===Os.SHADING?null:this._background,i.cachedCanvases);return o!==Os.SHADING&&(e.setTransform(...i.baseTransform),this.matrix&&e.transform(...this.matrix)),e.translate(s.offsetX,s.offsetY),e.scale(s.scaleX,s.scaleY),e.createPattern(s.canvas,"no-repeat")}}class N_i extends Hq{getPattern(){return"hotpink"}}function j_i(t){switch(t[0]){case"RadialAxial":return new F_i(t);case"Mesh":return new U_i(t);case"Dummy":return new N_i}throw new Error(`Unknown IR type: ${t[0]}`)}const X7e={COLORED:1,UNCOLORED:2};class ZQ{static MAX_PATTERN_SIZE=3e3;constructor(e,i,r,o){this.color=e[1],this.operatorList=e[2],this.matrix=e[3],this.bbox=e[4],this.xstep=e[5],this.ystep=e[6],this.paintType=e[7],this.tilingType=e[8],this.ctx=i,this.canvasGraphicsFactory=r,this.baseTransform=o}createPatternCanvas(e,i){const{bbox:r,operatorList:o,paintType:n,tilingType:s,color:a,canvasGraphicsFactory:l}=this;let{xstep:c,ystep:d}=this;c=Math.abs(c),d=Math.abs(d),wP("TilingType: "+s);const u=r[0],h=r[1],p=r[2],g=r[3],f=p-u,m=g-h,A=new Float32Array(2);si.singularValueDecompose2dScale(this.matrix,A);const[v,y]=A;si.singularValueDecompose2dScale(this.baseTransform,A);const b=v*A[0],w=y*A[1];let C=f,M=m,E=!1,B=!1;const S=Math.ceil(c*b),I=Math.ceil(d*w),T=Math.ceil(f*b),_=Math.ceil(m*w);S>=T?C=c:E=!0,I>=_?M=d:B=!0;const O=this.getSizeAndScale(C,this.ctx.canvas.width,b),j=this.getSizeAndScale(M,this.ctx.canvas.height,w),N=e.cachedCanvases.getCanvas("pattern",O.size,j.size),G=N.context,q=l.createCanvasGraphics(G,i);if(q.groupLevel=e.groupLevel,this.setFillAndStrokeStyleToContext(q,n,a),G.translate(-O.scale*u,-j.scale*h),q.transform(0,O.scale,0,0,j.scale,0,0),G.save(),q.dependencyTracker?.save(),this.clipBbox(q,u,h,p,g),q.baseTransform=en(q.ctx),q.executeOperatorList(o),q.endDrawing(),q.dependencyTracker?.restore(),G.restore(),E||B){const X=N.canvas;E&&(C=c),B&&(M=d);const me=this.getSizeAndScale(C,this.ctx.canvas.width,b),ce=this.getSizeAndScale(M,this.ctx.canvas.height,w),xe=me.size,Re=ce.size,ge=e.cachedCanvases.getCanvas("pattern-workaround",xe,Re),ee=ge.context,$=E?Math.floor(f/c):0,re=B?Math.floor(m/d):0;for(let ie=0;ie<=$;ie++)for(let fe=0;fe<=re;fe++)ee.drawImage(X,xe*ie,Re*fe,xe,Re,0,0,xe,Re);return{canvas:ge.canvas,scaleX:me.scale,scaleY:ce.scale,offsetX:u,offsetY:h}}return{canvas:N.canvas,scaleX:O.scale,scaleY:j.scale,offsetX:u,offsetY:h}}getSizeAndScale(e,i,r){const o=Math.max(ZQ.MAX_PATTERN_SIZE,i);let n=Math.ceil(e*r);return n>=o?n=o:r=n/e,{scale:r,size:n}}clipBbox(e,i,r,o,n){const s=o-i,a=n-r;e.ctx.rect(i,r,s,a),si.axialAlignedBoundingBox([i,r,o,n],en(e.ctx),e.current.minMax),e.clip(),e.endPath()}setFillAndStrokeStyleToContext(e,i,r){const o=e.ctx,n=e.current;switch(i){case X7e.COLORED:const{fillStyle:s,strokeStyle:a}=this.ctx;o.fillStyle=n.fillColor=s,o.strokeStyle=n.strokeColor=a;break;case X7e.UNCOLORED:o.fillStyle=o.strokeStyle=r,n.fillColor=n.strokeColor=r;break;default:throw new XDi(`Unsupported paint type: ${i}`)}}isModifyingCurrentTransform(){return!1}getPattern(e,i,r,o,n){let s=r;o!==Os.SHADING&&(s=si.transform(s,i.baseTransform),this.matrix&&(s=si.transform(s,this.matrix)));const a=this.createPatternCanvas(i,n);let l=new DOMMatrix(s);l=l.translate(a.offsetX,a.offsetY),l=l.scale(1/a.scaleX,1/a.scaleY);const c=e.createPattern(a.canvas,"repeat");return c.setTransform(l),c}}function H_i({src:t,srcPos:e=0,dest:i,width:r,height:o,nonBlackColor:n=4294967295,inverseDecode:s=!1}){const a=Fs.isLittleEndian?4278190080:255,[l,c]=s?[n,a]:[a,n],d=r>>3,u=r&7,h=t.length;i=new Uint32Array(i.buffer);let p=0;for(let g=0;g<o;g++){for(const m=e+d;e<m;e++){const A=e<h?t[e]:255;i[p++]=A&128?c:l,i[p++]=A&64?c:l,i[p++]=A&32?c:l,i[p++]=A&16?c:l,i[p++]=A&8?c:l,i[p++]=A&4?c:l,i[p++]=A&2?c:l,i[p++]=A&1?c:l}if(u===0)continue;const f=e<h?t[e++]:255;for(let m=0;m<u;m++)i[p++]=f&1<<7-m?c:l}return{srcPos:e,destPos:p}}const Y7e=16,$7e=100,z_i=15,eye=10,bl=16,Vq=new DOMMatrix,tc=new Float32Array(2),Y5=new Float32Array([1/0,1/0,-1/0,-1/0]);function V_i(t,e){if(t._removeMirroring)throw new Error("Context is already forwarding operations.");t.__originalSave=t.save,t.__originalRestore=t.restore,t.__originalRotate=t.rotate,t.__originalScale=t.scale,t.__originalTranslate=t.translate,t.__originalTransform=t.transform,t.__originalSetTransform=t.setTransform,t.__originalResetTransform=t.resetTransform,t.__originalClip=t.clip,t.__originalMoveTo=t.moveTo,t.__originalLineTo=t.lineTo,t.__originalBezierCurveTo=t.bezierCurveTo,t.__originalRect=t.rect,t.__originalClosePath=t.closePath,t.__originalBeginPath=t.beginPath,t._removeMirroring=()=>{t.save=t.__originalSave,t.restore=t.__originalRestore,t.rotate=t.__originalRotate,t.scale=t.__originalScale,t.translate=t.__originalTranslate,t.transform=t.__originalTransform,t.setTransform=t.__originalSetTransform,t.resetTransform=t.__originalResetTransform,t.clip=t.__originalClip,t.moveTo=t.__originalMoveTo,t.lineTo=t.__originalLineTo,t.bezierCurveTo=t.__originalBezierCurveTo,t.rect=t.__originalRect,t.closePath=t.__originalClosePath,t.beginPath=t.__originalBeginPath,delete t._removeMirroring},t.save=function(){e.save(),this.__originalSave()},t.restore=function(){e.restore(),this.__originalRestore()},t.translate=function(i,r){e.translate(i,r),this.__originalTranslate(i,r)},t.scale=function(i,r){e.scale(i,r),this.__originalScale(i,r)},t.transform=function(i,r,o,n,s,a){e.transform(i,r,o,n,s,a),this.__originalTransform(i,r,o,n,s,a)},t.setTransform=function(i,r,o,n,s,a){e.setTransform(i,r,o,n,s,a),this.__originalSetTransform(i,r,o,n,s,a)},t.resetTransform=function(){e.resetTransform(),this.__originalResetTransform()},t.rotate=function(i){e.rotate(i),this.__originalRotate(i)},t.clip=function(i){e.clip(i),this.__originalClip(i)},t.moveTo=function(i,r){e.moveTo(i,r),this.__originalMoveTo(i,r)},t.lineTo=function(i,r){e.lineTo(i,r),this.__originalLineTo(i,r)},t.bezierCurveTo=function(i,r,o,n,s,a){e.bezierCurveTo(i,r,o,n,s,a),this.__originalBezierCurveTo(i,r,o,n,s,a)},t.rect=function(i,r,o,n){e.rect(i,r,o,n),this.__originalRect(i,r,o,n)},t.closePath=function(){e.closePath(),this.__originalClosePath()},t.beginPath=function(){e.beginPath(),this.__originalBeginPath()}}class q_i{constructor(e){this.canvasFactory=e,this.cache=Object.create(null)}getCanvas(e,i,r){let o;return this.cache[e]!==void 0?(o=this.cache[e],this.canvasFactory.reset(o,i,r)):(o=this.canvasFactory.create(i,r),this.cache[e]=o),o}delete(e){delete this.cache[e]}clear(){for(const e in this.cache){const i=this.cache[e];this.canvasFactory.destroy(i),delete this.cache[e]}}}function IP(t,e,i,r,o,n,s,a,l,c){const[d,u,h,p,g,f]=en(t);if(u===0&&h===0){const v=s*d+g,y=Math.round(v),b=a*p+f,w=Math.round(b),C=(s+l)*d+g,M=Math.abs(Math.round(C)-y)||1,E=(a+c)*p+f,B=Math.abs(Math.round(E)-w)||1;return t.setTransform(Math.sign(d),0,0,Math.sign(p),y,w),t.drawImage(e,i,r,o,n,0,0,M,B),t.setTransform(d,u,h,p,g,f),[M,B]}if(d===0&&p===0){const v=a*h+g,y=Math.round(v),b=s*u+f,w=Math.round(b),C=(a+c)*h+g,M=Math.abs(Math.round(C)-y)||1,E=(s+l)*u+f,B=Math.abs(Math.round(E)-w)||1;return t.setTransform(0,Math.sign(u),Math.sign(h),0,y,w),t.drawImage(e,i,r,o,n,0,0,B,M),t.setTransform(d,u,h,p,g,f),[B,M]}t.drawImage(e,i,r,o,n,s,a,l,c);const m=Math.hypot(d,u),A=Math.hypot(h,p);return[m*l,A*c]}class tye{alphaIsShape=!1;fontSize=0;fontSizeScale=1;textMatrix=null;textMatrixScale=1;fontMatrix=xq;leading=0;x=0;y=0;lineX=0;lineY=0;charSpacing=0;wordSpacing=0;textHScale=1;textRenderingMode=Ls.FILL;textRise=0;fillColor="#000000";strokeColor="#000000";patternFill=!1;patternStroke=!1;fillAlpha=1;strokeAlpha=1;lineWidth=1;activeSMask=null;transferMaps="none";constructor(e,i,r){r?.(this),this.clipBox=new Float32Array([0,0,e,i]),this.minMax=Y5.slice()}clone(){const e=Object.create(this);return e.clipBox=this.clipBox.slice(),e.minMax=this.minMax.slice(),e}getPathBoundingBox(e=Os.FILL,i=null){const r=this.minMax.slice();if(e===Os.STROKE){i||yo("Stroke bounding box must include transform."),si.singularValueDecompose2dScale(i,tc);const o=tc[0]*this.lineWidth/2,n=tc[1]*this.lineWidth/2;r[0]-=o,r[1]-=n,r[2]+=o,r[3]+=n}return r}updateClipFromPath(){const e=si.intersect(this.clipBox,this.getPathBoundingBox());this.startNewPathAndClipBox(e||[0,0,0,0])}isEmptyClip(){return this.minMax[0]===1/0}startNewPathAndClipBox(e){this.clipBox.set(e,0),this.minMax.set(Y5,0)}getClippedPathBoundingBox(e=Os.FILL,i=null){return si.intersect(this.clipBox,this.getPathBoundingBox(e,i))}}function iye(t,e){if(e instanceof ImageData){t.putImageData(e,0,0);return}const i=e.height,r=e.width,o=i%bl,n=(i-o)/bl,s=o===0?n:n+1,a=t.createImageData(r,bl);let l=0,c;const d=e.data,u=a.data;let h,p,g,f;if(e.kind===vP.GRAYSCALE_1BPP){const m=d.byteLength,A=new Uint32Array(u.buffer,0,u.byteLength>>2),v=A.length,y=r+7>>3,b=4294967295,w=Fs.isLittleEndian?4278190080:255;for(h=0;h<s;h++){for(g=h<n?bl:o,c=0,p=0;p<g;p++){const C=m-l;let M=0;const E=C>y?r:C*8-7,B=E&-8;let S=0,I=0;for(;M<B;M+=8)I=d[l++],A[c++]=I&128?b:w,A[c++]=I&64?b:w,A[c++]=I&32?b:w,A[c++]=I&16?b:w,A[c++]=I&8?b:w,A[c++]=I&4?b:w,A[c++]=I&2?b:w,A[c++]=I&1?b:w;for(;M<E;M++)S===0&&(I=d[l++],S=128),A[c++]=I&S?b:w,S>>=1}for(;c<v;)A[c++]=0;t.putImageData(a,0,h*bl)}}else if(e.kind===vP.RGBA_32BPP){for(p=0,f=r*bl*4,h=0;h<n;h++)u.set(d.subarray(l,l+f)),l+=f,t.putImageData(a,0,p),p+=bl;h<s&&(f=r*o*4,u.set(d.subarray(l,l+f)),t.putImageData(a,0,p))}else if(e.kind===vP.RGB_24BPP)for(g=bl,f=r*g,h=0;h<s;h++){for(h>=n&&(g=o,f=r*g),c=0,p=f;p--;)u[c++]=d[l++],u[c++]=d[l++],u[c++]=d[l++],u[c++]=255;t.putImageData(a,0,h*bl)}else throw new Error(`bad image kind: ${e.kind}`)}function rye(t,e){if(e.bitmap){t.drawImage(e.bitmap,0,0);return}const i=e.height,r=e.width,o=i%bl,n=(i-o)/bl,s=o===0?n:n+1,a=t.createImageData(r,bl);let l=0;const c=e.data,d=a.data;for(let u=0;u<s;u++){const h=u<n?bl:o;({srcPos:l}=H_i({src:c,srcPos:l,dest:d,width:r,height:h,nonBlackColor:0})),t.putImageData(a,0,u*bl)}}function Ty(t,e){const i=["strokeStyle","fillStyle","fillRule","globalAlpha","lineWidth","lineCap","lineJoin","miterLimit","globalCompositeOperation","font","filter"];for(const r of i)t[r]!==void 0&&(e[r]=t[r]);t.setLineDash!==void 0&&(e.setLineDash(t.getLineDash()),e.lineDashOffset=t.lineDashOffset)}function SP(t){t.strokeStyle=t.fillStyle="#000000",t.fillRule="nonzero",t.globalAlpha=1,t.lineWidth=1,t.lineCap="butt",t.lineJoin="miter",t.miterLimit=10,t.globalCompositeOperation="source-over",t.font="10px sans-serif",t.setLineDash!==void 0&&(t.setLineDash([]),t.lineDashOffset=0);const{filter:e}=t;e!=="none"&&e!==""&&(t.filter="none")}function oye(t,e){if(e)return!0;si.singularValueDecompose2dScale(t,tc);const i=Math.fround(Wu.pixelRatio*Z5.PDF_TO_CSS_UNITS);return tc[0]<=i&&tc[1]<=i}const G_i=["butt","round","square"],Q_i=["miter","round","bevel"],K_i={},nye={};class R6{constructor(e,i,r,o,n,{optionalContentConfig:s,markedContentStack:a=null},l,c,d){this.ctx=e,this.current=new tye(this.ctx.canvas.width,this.ctx.canvas.height),this.stateStack=[],this.pendingClip=null,this.pendingEOFill=!1,this.res=null,this.xobjs=null,this.commonObjs=i,this.objs=r,this.canvasFactory=o,this.filterFactory=n,this.groupStack=[],this.baseTransform=null,this.baseTransformStack=[],this.groupLevel=0,this.smaskStack=[],this.smaskCounter=0,this.tempSMask=null,this.suspendedCtx=null,this.contentVisible=!0,this.markedContentStack=a||[],this.optionalContentConfig=s,this.cachedCanvases=new q_i(this.canvasFactory),this.cachedPatterns=new Map,this.annotationCanvasMap=l,this.viewportScale=1,this.outputScaleX=1,this.outputScaleY=1,this.pageColors=c,this._cachedScaleForStroking=[-1,0],this._cachedGetSinglePixelWidth=null,this._cachedBitmapsMap=new Map,this.dependencyTracker=d??null}getObject(e,i,r=null){return typeof i=="string"?(this.dependencyTracker?.recordNamedDependency(e,i),i.startsWith("g_")?this.commonObjs.get(i):this.objs.get(i)):r}beginDrawing({transform:e,viewport:i,transparency:r=!1,background:o=null}){const n=this.ctx.canvas.width,s=this.ctx.canvas.height,a=this.ctx.fillStyle;if(this.ctx.fillStyle=o||"#ffffff",this.ctx.fillRect(0,0,n,s),this.ctx.fillStyle=a,r){const l=this.cachedCanvases.getCanvas("transparent",n,s);this.compositeCtx=this.ctx,this.transparentCanvas=l.canvas,this.ctx=l.context,this.ctx.save(),this.ctx.transform(...en(this.compositeCtx))}this.ctx.save(),SP(this.ctx),e&&(this.ctx.transform(...e),this.outputScaleX=e[0],this.outputScaleY=e[0]),this.ctx.transform(...i.transform),this.viewportScale=i.scale,this.baseTransform=en(this.ctx)}executeOperatorList(e,i,r,o,n){const s=e.argsArray,a=e.fnArray;let l=i||0;const c=s.length;if(c===l)return l;const d=c-l>eye&&typeof r=="function",u=d?Date.now()+z_i:0;let h=0;const p=this.commonObjs,g=this.objs;let f,m;for(;;){if(o!==void 0&&l===o.nextBreakPoint)return o.breakIt(l,r),l;if(!n||n(l))if(f=a[l],m=s[l]??null,f!==xy.dependency)m===null?this[f](l):this[f](l,...m);else for(const A of m){this.dependencyTracker?.recordNamedData(A,l);const v=A.startsWith("g_")?p:g;if(!v.has(A))return v.get(A,r),l}if(l++,l===c)return l;if(d&&++h>eye){if(Date.now()>u)return r(),l;h=0}}}#e(){for(;this.stateStack.length||this.inSMaskMode;)this.restore();this.current.activeSMask=null,this.ctx.restore(),this.transparentCanvas&&(this.ctx=this.compositeCtx,this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.drawImage(this.transparentCanvas,0,0),this.ctx.restore(),this.transparentCanvas=null)}endDrawing(){this.#e(),this.cachedCanvases.clear(),this.cachedPatterns.clear();for(const e of this._cachedBitmapsMap.values()){for(const i of e.values())typeof HTMLCanvasElement<"u"&&i instanceof HTMLCanvasElement&&(i.width=i.height=0);e.clear()}this._cachedBitmapsMap.clear(),this.#t()}#t(){if(this.pageColors){const e=this.filterFactory.addHCMFilter(this.pageColors.foreground,this.pageColors.background);if(e!=="none"){const i=this.ctx.filter;this.ctx.filter=e,this.ctx.drawImage(this.ctx.canvas,0,0),this.ctx.filter=i}}}_scaleImage(e,i){const r=e.width??e.displayWidth,o=e.height??e.displayHeight;let n=Math.max(Math.hypot(i[0],i[1]),1),s=Math.max(Math.hypot(i[2],i[3]),1),a=r,l=o,c="prescale1",d,u;for(;n>2&&a>1||s>2&&l>1;){let h=a,p=l;n>2&&a>1&&(h=a>=16384?Math.floor(a/2)-1||1:Math.ceil(a/2),n/=a/h),s>2&&l>1&&(p=l>=16384?Math.floor(l/2)-1||1:Math.ceil(l)/2,s/=l/p),d=this.cachedCanvases.getCanvas(c,h,p),u=d.context,u.clearRect(0,0,h,p),u.drawImage(e,0,0,a,l,0,0,h,p),e=d.canvas,a=h,l=p,c=c==="prescale1"?"prescale2":"prescale1"}return{img:e,paintWidth:a,paintHeight:l}}_createMaskCanvas(e,i){const r=this.ctx,{width:o,height:n}=i,s=this.current.fillColor,a=this.current.patternFill,l=en(r);let c,d,u,h;if((i.bitmap||i.data)&&i.count>1){const S=i.bitmap||i.data.buffer;d=JSON.stringify(a?l:[l.slice(0,4),s]),c=this._cachedBitmapsMap.get(S),c||(c=new Map,this._cachedBitmapsMap.set(S,c));const I=c.get(d);if(I&&!a){const T=Math.round(Math.min(l[0],l[2])+l[4]),_=Math.round(Math.min(l[1],l[3])+l[5]);return this.dependencyTracker?.recordDependencies(e,Uc.transformAndFill),{canvas:I,offsetX:T,offsetY:_}}u=I}u||(h=this.cachedCanvases.getCanvas("maskCanvas",o,n),rye(h.context,i));let p=si.transform(l,[1/o,0,0,-1/n,0,0]);p=si.transform(p,[1,0,0,1,0,-n]);const g=Y5.slice();si.axialAlignedBoundingBox([0,0,o,n],p,g);const[f,m,A,v]=g,y=Math.round(A-f)||1,b=Math.round(v-m)||1,w=this.cachedCanvases.getCanvas("fillCanvas",y,b),C=w.context,M=f,E=m;C.translate(-M,-E),C.transform(...p),u||(u=this._scaleImage(h.canvas,Ru(C)),u=u.img,c&&a&&c.set(d,u)),C.imageSmoothingEnabled=oye(en(C),i.interpolate),IP(C,u,0,0,u.width,u.height,0,0,o,n),C.globalCompositeOperation="source-in";const B=si.transform(Ru(C),[1,0,0,1,-M,-E]);return C.fillStyle=a?s.getPattern(r,this,B,Os.FILL,e):s,C.fillRect(0,0,o,n),c&&!a&&(this.cachedCanvases.delete("fillCanvas"),c.set(d,w.canvas)),this.dependencyTracker?.recordDependencies(e,Uc.transformAndFill),{canvas:w.canvas,offsetX:Math.round(M),offsetY:Math.round(E)}}setLineWidth(e,i){this.dependencyTracker?.recordSimpleData("lineWidth",e),i!==this.current.lineWidth&&(this._cachedScaleForStroking[0]=-1),this.current.lineWidth=i,this.ctx.lineWidth=i}setLineCap(e,i){this.dependencyTracker?.recordSimpleData("lineCap",e),this.ctx.lineCap=G_i[i]}setLineJoin(e,i){this.dependencyTracker?.recordSimpleData("lineJoin",e),this.ctx.lineJoin=Q_i[i]}setMiterLimit(e,i){this.dependencyTracker?.recordSimpleData("miterLimit",e),this.ctx.miterLimit=i}setDash(e,i,r){this.dependencyTracker?.recordSimpleData("dash",e);const o=this.ctx;o.setLineDash!==void 0&&(o.setLineDash(i),o.lineDashOffset=r)}setRenderingIntent(e,i){}setFlatness(e,i){}setGState(e,i){for(const[r,o]of i)switch(r){case"LW":this.setLineWidth(e,o);break;case"LC":this.setLineCap(e,o);break;case"LJ":this.setLineJoin(e,o);break;case"ML":this.setMiterLimit(e,o);break;case"D":this.setDash(e,o[0],o[1]);break;case"RI":this.setRenderingIntent(e,o);break;case"FL":this.setFlatness(e,o);break;case"Font":this.setFont(e,o[0],o[1]);break;case"CA":this.dependencyTracker?.recordSimpleData("strokeAlpha",e),this.current.strokeAlpha=o;break;case"ca":this.dependencyTracker?.recordSimpleData("fillAlpha",e),this.ctx.globalAlpha=this.current.fillAlpha=o;break;case"BM":this.dependencyTracker?.recordSimpleData("globalCompositeOperation",e),this.ctx.globalCompositeOperation=o;break;case"SMask":this.dependencyTracker?.recordSimpleData("SMask",e),this.current.activeSMask=o?this.tempSMask:null,this.tempSMask=null,this.checkSMaskState();break;case"TR":this.dependencyTracker?.recordSimpleData("filter",e),this.ctx.filter=this.current.transferMaps=this.filterFactory.addFilter(o);break}}get inSMaskMode(){return!!this.suspendedCtx}checkSMaskState(){const e=this.inSMaskMode;this.current.activeSMask&&!e?this.beginSMaskMode():!this.current.activeSMask&&e&&this.endSMaskMode()}beginSMaskMode(e){if(this.inSMaskMode)throw new Error("beginSMaskMode called while already in smask mode");const i=this.ctx.canvas.width,r=this.ctx.canvas.height,o="smaskGroupAt"+this.groupLevel,n=this.cachedCanvases.getCanvas(o,i,r);this.suspendedCtx=this.ctx;const s=this.ctx=n.context;s.setTransform(this.suspendedCtx.getTransform()),Ty(this.suspendedCtx,s),V_i(s,this.suspendedCtx),this.setGState(e,[["BM","source-over"]])}endSMaskMode(){if(!this.inSMaskMode)throw new Error("endSMaskMode called while not in smask mode");this.ctx._removeMirroring(),Ty(this.ctx,this.suspendedCtx),this.ctx=this.suspendedCtx,this.suspendedCtx=null}compose(e){if(!this.current.activeSMask)return;e?(e[0]=Math.floor(e[0]),e[1]=Math.floor(e[1]),e[2]=Math.ceil(e[2]),e[3]=Math.ceil(e[3])):e=[0,0,this.ctx.canvas.width,this.ctx.canvas.height];const i=this.current.activeSMask,r=this.suspendedCtx;this.composeSMask(r,i,this.ctx,e),this.ctx.save(),this.ctx.setTransform(1,0,0,1,0,0),this.ctx.clearRect(0,0,this.ctx.canvas.width,this.ctx.canvas.height),this.ctx.restore()}composeSMask(e,i,r,o){const n=o[0],s=o[1],a=o[2]-n,l=o[3]-s;a===0||l===0||(this.genericComposeSMask(i.context,r,a,l,i.subtype,i.backdrop,i.transferMap,n,s,i.offsetX,i.offsetY),e.save(),e.globalAlpha=1,e.globalCompositeOperation="source-over",e.setTransform(1,0,0,1,0,0),e.drawImage(r.canvas,0,0),e.restore())}genericComposeSMask(e,i,r,o,n,s,a,l,c,d,u){let h=e.canvas,p=l-d,g=c-u;if(s)if(p<0||g<0||p+r>h.width||g+o>h.height){const m=this.cachedCanvases.getCanvas("maskExtension",r,o),A=m.context;A.drawImage(h,-p,-g),A.globalCompositeOperation="destination-atop",A.fillStyle=s,A.fillRect(0,0,r,o),A.globalCompositeOperation="source-over",h=m.canvas,p=g=0}else{e.save(),e.globalAlpha=1,e.setTransform(1,0,0,1,0,0);const m=new Path2D;m.rect(p,g,r,o),e.clip(m),e.globalCompositeOperation="destination-atop",e.fillStyle=s,e.fillRect(p,g,r,o),e.restore()}i.save(),i.globalAlpha=1,i.setTransform(1,0,0,1,0,0),n==="Alpha"&&a?i.filter=this.filterFactory.addAlphaFilter(a):n==="Luminosity"&&(i.filter=this.filterFactory.addLuminosityFilter(a));const f=new Path2D;f.rect(l,c,r,o),i.clip(f),i.globalCompositeOperation="destination-in",i.drawImage(h,p,g,r,o,l,c,r,o),i.restore()}save(e){this.inSMaskMode&&Ty(this.ctx,this.suspendedCtx),this.ctx.save();const i=this.current;this.stateStack.push(i),this.current=i.clone(),this.dependencyTracker?.save(e)}restore(e){if(this.dependencyTracker?.restore(e),this.stateStack.length===0){this.inSMaskMode&&this.endSMaskMode();return}this.current=this.stateStack.pop(),this.ctx.restore(),this.inSMaskMode&&Ty(this.suspendedCtx,this.ctx),this.checkSMaskState(),this.pendingClip=null,this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}transform(e,i,r,o,n,s,a){this.dependencyTracker?.recordIncrementalData("transform",e),this.ctx.transform(i,r,o,n,s,a),this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null}constructPath(e,i,r,o){let[n]=r;if(!o){n||=r[0]=new Path2D,this[i](e,n);return}if(this.dependencyTracker!==null){const s=i===xy.stroke?this.current.lineWidth/2:0;this.dependencyTracker.resetBBox(e).recordBBox(e,this.ctx,o[0]-s,o[2]+s,o[1]-s,o[3]+s).recordDependencies(e,["transform"])}n instanceof Path2D||(n=r[0]=D7e(n)),si.axialAlignedBoundingBox(o,en(this.ctx),this.current.minMax),this[i](e,n),this._pathStartIdx=e}closePath(e){this.ctx.closePath()}stroke(e,i,r=!0){const o=this.ctx,n=this.current.strokeColor;if(o.globalAlpha=this.current.strokeAlpha,this.contentVisible)if(typeof n=="object"&&n?.getPattern){const s=n.isModifyingCurrentTransform()?o.getTransform():null;if(o.save(),o.strokeStyle=n.getPattern(o,this,Ru(o),Os.STROKE,e),s){const a=new Path2D;a.addPath(i,o.getTransform().invertSelf().multiplySelf(s)),i=a}this.rescaleAndStroke(i,!1),o.restore()}else this.rescaleAndStroke(i,!0);this.dependencyTracker?.recordDependencies(e,Uc.stroke),r&&this.consumePath(e,i,this.current.getClippedPathBoundingBox(Os.STROKE,en(this.ctx))),o.globalAlpha=this.current.fillAlpha}closeStroke(e,i){this.stroke(e,i)}fill(e,i,r=!0){const o=this.ctx,n=this.current.fillColor,s=this.current.patternFill;let a=!1;if(s){const c=n.isModifyingCurrentTransform()?o.getTransform():null;if(this.dependencyTracker?.save(e),o.save(),o.fillStyle=n.getPattern(o,this,Ru(o),Os.FILL,e),c){const d=new Path2D;d.addPath(i,o.getTransform().invertSelf().multiplySelf(c)),i=d}a=!0}const l=this.current.getClippedPathBoundingBox();this.contentVisible&&l!==null&&(this.pendingEOFill?(o.fill(i,"evenodd"),this.pendingEOFill=!1):o.fill(i)),this.dependencyTracker?.recordDependencies(e,Uc.fill),a&&(o.restore(),this.dependencyTracker?.restore(e)),r&&this.consumePath(e,i,l)}eoFill(e,i){this.pendingEOFill=!0,this.fill(e,i)}fillStroke(e,i){this.fill(e,i,!1),this.stroke(e,i,!1),this.consumePath(e,i)}eoFillStroke(e,i){this.pendingEOFill=!0,this.fillStroke(e,i)}closeFillStroke(e,i){this.fillStroke(e,i)}closeEOFillStroke(e,i){this.pendingEOFill=!0,this.fillStroke(e,i)}endPath(e,i){this.consumePath(e,i)}rawFillPath(e,i){this.ctx.fill(i),this.dependencyTracker?.recordDependencies(e,Uc.rawFillPath).recordOperation(e)}clip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=K_i}eoClip(e){this.dependencyTracker?.recordFutureForcedDependency("clipMode",e),this.pendingClip=nye}beginText(e){this.current.textMatrix=null,this.current.textMatrixScale=1,this.current.x=this.current.lineX=0,this.current.y=this.current.lineY=0,this.dependencyTracker?.recordOpenMarker(e).resetIncrementalData("sameLineText").resetIncrementalData("moveText",e)}endText(e){const i=this.pendingTextPaths,r=this.ctx;if(this.dependencyTracker){const{dependencyTracker:o}=this;i!==void 0&&o.recordFutureForcedDependency("textClip",o.getOpenMarker()).recordFutureForcedDependency("textClip",e),o.recordCloseMarker(e)}if(i!==void 0){const o=new Path2D,n=r.getTransform().invertSelf();for(const{transform:s,x:a,y:l,fontSize:c,path:d}of i)d&&o.addPath(d,new DOMMatrix(s).preMultiplySelf(n).translate(a,l).scale(c,-c));r.clip(o)}delete this.pendingTextPaths}setCharSpacing(e,i){this.dependencyTracker?.recordSimpleData("charSpacing",e),this.current.charSpacing=i}setWordSpacing(e,i){this.dependencyTracker?.recordSimpleData("wordSpacing",e),this.current.wordSpacing=i}setHScale(e,i){this.dependencyTracker?.recordSimpleData("hScale",e),this.current.textHScale=i/100}setLeading(e,i){this.dependencyTracker?.recordSimpleData("leading",e),this.current.leading=-i}setFont(e,i,r){this.dependencyTracker?.recordSimpleData("font",e).recordSimpleDataFromNamed("fontObj",i,e);const o=this.commonObjs.get(i),n=this.current;if(!o)throw new Error(`Can't find font for ${i}`);if(n.fontMatrix=o.fontMatrix||xq,(n.fontMatrix[0]===0||n.fontMatrix[3]===0)&&ji("Invalid font matrix for font "+i),r<0?(r=-r,n.fontDirection=-1):n.fontDirection=1,this.current.font=o,this.current.fontSize=r,o.isType3Font)return;const s=o.loadedName||"sans-serif",a=o.systemFontInfo?.css||`"${s}", ${o.fallbackName}`;let l="normal";o.black?l="900":o.bold&&(l="bold");const c=o.italic?"italic":"normal";let d=r;r<Y7e?d=Y7e:r>$7e&&(d=$7e),this.current.fontSizeScale=r/d,this.ctx.font=`${c} ${l} ${d}px ${a}`}setTextRenderingMode(e,i){this.dependencyTracker?.recordSimpleData("textRenderingMode",e),this.current.textRenderingMode=i}setTextRise(e,i){this.dependencyTracker?.recordSimpleData("textRise",e),this.current.textRise=i}moveText(e,i,r){this.dependencyTracker?.resetIncrementalData("sameLineText").recordIncrementalData("moveText",e),this.current.x=this.current.lineX+=i,this.current.y=this.current.lineY+=r}setLeadingMoveText(e,i,r){this.setLeading(e,-r),this.moveText(e,i,r)}setTextMatrix(e,i){this.dependencyTracker?.resetIncrementalData("sameLineText").recordSimpleData("textMatrix",e);const{current:r}=this;r.textMatrix=i,r.textMatrixScale=Math.hypot(i[0],i[1]),r.x=r.lineX=0,r.y=r.lineY=0}nextLine(e){this.moveText(e,0,this.current.leading),this.dependencyTracker?.recordIncrementalData("moveText",this.dependencyTracker.getSimpleIndex("leading")??e)}#r(e,i,r){const o=new Path2D;return o.addPath(e,new DOMMatrix(r).invertSelf().multiplySelf(i)),o}paintChar(e,i,r,o,n,s){const a=this.ctx,l=this.current,c=l.font,d=l.textRenderingMode,u=l.fontSize/l.fontSizeScale,h=d&Ls.FILL_STROKE_MASK,p=!!(d&Ls.ADD_TO_PATH_FLAG),g=l.patternFill&&!c.missingFile,f=l.patternStroke&&!c.missingFile;let m;if((c.disableFontFace||p||g||f)&&!c.missingFile&&(m=c.getPathGenerator(this.commonObjs,i)),m&&(c.disableFontFace||g||f)){a.save(),a.translate(r,o),a.scale(u,-u),this.dependencyTracker?.recordCharacterBBox(e,a,c);let A;if(h===Ls.FILL||h===Ls.FILL_STROKE)if(n){A=a.getTransform(),a.setTransform(...n);const v=this.#r(m,A,n);a.fill(v)}else a.fill(m);if(h===Ls.STROKE||h===Ls.FILL_STROKE)if(s){A||=a.getTransform(),a.setTransform(...s);const{a:v,b:y,c:b,d:w}=A,C=si.inverseTransform(s),M=si.transform([v,y,b,w,0,0],C);si.singularValueDecompose2dScale(M,tc),a.lineWidth*=Math.max(tc[0],tc[1])/u,a.stroke(this.#r(m,A,s))}else a.lineWidth/=u,a.stroke(m);a.restore()}else(h===Ls.FILL||h===Ls.FILL_STROKE)&&(a.fillText(i,r,o),this.dependencyTracker?.recordCharacterBBox(e,a,c,u,r,o,()=>a.measureText(i))),(h===Ls.STROKE||h===Ls.FILL_STROKE)&&(this.dependencyTracker&&this.dependencyTracker?.recordCharacterBBox(e,a,c,u,r,o,()=>a.measureText(i)).recordDependencies(e,Uc.stroke),a.strokeText(i,r,o));p&&((this.pendingTextPaths||=[]).push({transform:en(a),x:r,y:o,fontSize:u,path:m}),this.dependencyTracker?.recordCharacterBBox(e,a,c,u,r,o))}get isFontSubpixelAAEnabled(){const{context:e}=this.cachedCanvases.getCanvas("isFontSubpixelAAEnabled",10,10);e.scale(1.5,1),e.fillText("I",0,10);const i=e.getImageData(0,0,10,10).data;let r=!1;for(let o=3;o<i.length;o+=4)if(i[o]>0&&i[o]<255){r=!0;break}return Wi(this,"isFontSubpixelAAEnabled",r)}showText(e,i){this.dependencyTracker&&(this.dependencyTracker.recordDependencies(e,Uc.showText).resetBBox(e),this.current.textRenderingMode&Ls.ADD_TO_PATH_FLAG&&this.dependencyTracker.recordFutureForcedDependency("textClip",e).inheritPendingDependenciesAsFutureForcedDependencies());const r=this.current,o=r.font;if(o.isType3Font){this.showType3Text(e,i),this.dependencyTracker?.recordShowTextOperation(e);return}const n=r.fontSize;if(n===0){this.dependencyTracker?.recordOperation(e);return}const s=this.ctx,a=r.fontSizeScale,l=r.charSpacing,c=r.wordSpacing,d=r.fontDirection,u=r.textHScale*d,h=i.length,p=o.vertical,g=p?1:-1,f=o.defaultVMetrics,m=n*r.fontMatrix[0],A=r.textRenderingMode===Ls.FILL&&!o.disableFontFace&&!r.patternFill;s.save(),r.textMatrix&&s.transform(...r.textMatrix),s.translate(r.x,r.y+r.textRise),d>0?s.scale(u,-1):s.scale(u,1);let v,y;if(r.patternFill){s.save();const E=r.fillColor.getPattern(s,this,Ru(s),Os.FILL,e);v=en(s),s.restore(),s.fillStyle=E}if(r.patternStroke){s.save();const E=r.strokeColor.getPattern(s,this,Ru(s),Os.STROKE,e);y=en(s),s.restore(),s.strokeStyle=E}let b=r.lineWidth;const w=r.textMatrixScale;if(w===0||b===0){const E=r.textRenderingMode&Ls.FILL_STROKE_MASK;(E===Ls.STROKE||E===Ls.FILL_STROKE)&&(b=this.getSinglePixelWidth())}else b/=w;if(a!==1&&(s.scale(a,a),b/=a),s.lineWidth=b,o.isInvalidPDFjsFont){const E=[];let B=0;for(const I of i)E.push(I.unicode),B+=I.width;const S=E.join("");if(s.fillText(S,0,0),this.dependencyTracker!==null){const I=s.measureText(S);this.dependencyTracker.recordBBox(e,this.ctx,-I.actualBoundingBoxLeft,I.actualBoundingBoxRight,-I.actualBoundingBoxAscent,I.actualBoundingBoxDescent).recordShowTextOperation(e)}r.x+=B*m*u,s.restore(),this.compose();return}let C=0,M;for(M=0;M<h;++M){const E=i[M];if(typeof E=="number"){C+=g*E*n/1e3;continue}let B=!1;const S=(E.isSpace?c:0)+l,I=E.fontChar,T=E.accent;let _,O,j=E.width;if(p){const q=E.vmetric||f,X=-(E.vmetric?q[1]:j*.5)*m,me=q[2]*m;j=q?-q[0]:j,_=X/a,O=(C+me)/a}else _=C/a,O=0;let N;if(o.remeasure&&j>0){N=s.measureText(I);const q=N.width*1e3/n*a;if(j<q&&this.isFontSubpixelAAEnabled){const X=j/q;B=!0,s.save(),s.scale(X,1),_/=X}else j!==q&&(_+=(j-q)/2e3*n/a)}if(this.contentVisible&&(E.isInFont||o.missingFile)){if(A&&!T)s.fillText(I,_,O),this.dependencyTracker?.recordCharacterBBox(e,s,N?{bbox:null}:o,n/a,_,O,()=>N??s.measureText(I));else if(this.paintChar(e,I,_,O,v,y),T){const q=_+n*T.offset.x/a,X=O-n*T.offset.y/a;this.paintChar(e,T.fontChar,q,X,v,y)}}const G=p?j*m-S*d:j*m+S*d;C+=G,B&&s.restore()}p?r.y-=C:r.x+=C*u,s.restore(),this.compose(),this.dependencyTracker?.recordShowTextOperation(e)}showType3Text(e,i){const r=this.ctx,o=this.current,n=o.font,s=o.fontSize,a=o.fontDirection,l=n.vertical?1:-1,c=o.charSpacing,d=o.wordSpacing,u=o.textHScale*a,h=o.fontMatrix||xq,p=i.length,g=o.textRenderingMode===Ls.INVISIBLE;let f,m,A,v;if(g||s===0)return;this._cachedScaleForStroking[0]=-1,this._cachedGetSinglePixelWidth=null,r.save(),o.textMatrix&&r.transform(...o.textMatrix),r.translate(o.x,o.y+o.textRise),r.scale(u,a);const y=this.dependencyTracker;for(this.dependencyTracker=y?new XI(y,e):null,f=0;f<p;++f){if(m=i[f],typeof m=="number"){v=l*m*s/1e3,this.ctx.translate(v,0),o.x+=v*u;continue}const b=(m.isSpace?d:0)+c,w=n.charProcOperatorList[m.operatorListId];w?this.contentVisible&&(this.save(),r.scale(s,s),r.transform(...h),this.executeOperatorList(w),this.restore()):ji(`Type3 character "${m.operatorListId}" is not available.`);const C=[m.width,0];si.applyTransform(C,h),A=C[0]*s+b,r.translate(A,0),o.x+=A*u}r.restore(),y&&(this.dependencyTracker=y)}setCharWidth(e,i,r){}setCharWidthAndBounds(e,i,r,o,n,s,a){const l=new Path2D;l.rect(o,n,s-o,a-n),this.ctx.clip(l),this.dependencyTracker?.recordBBox(e,this.ctx,o,s,n,a).recordClipBox(e,this.ctx,o,s,n,a),this.endPath(e)}getColorN_Pattern(e,i){let r;if(i[0]==="TilingPattern"){const o=this.baseTransform||en(this.ctx),n={createCanvasGraphics:(s,a)=>new R6(s,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:this.optionalContentConfig,markedContentStack:this.markedContentStack},void 0,void 0,this.dependencyTracker?new XI(this.dependencyTracker,a,!0):null)};r=new ZQ(i,this.ctx,n,o)}else r=this._getPattern(e,i[1],i[2]);return r}setStrokeColorN(e,...i){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.current.strokeColor=this.getColorN_Pattern(e,i),this.current.patternStroke=!0}setFillColorN(e,...i){this.dependencyTracker?.recordSimpleData("fillColor",e),this.current.fillColor=this.getColorN_Pattern(e,i),this.current.patternFill=!0}setStrokeRGBColor(e,i){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor=i,this.current.patternStroke=!1}setStrokeTransparent(e){this.dependencyTracker?.recordSimpleData("strokeColor",e),this.ctx.strokeStyle=this.current.strokeColor="transparent",this.current.patternStroke=!1}setFillRGBColor(e,i){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor=i,this.current.patternFill=!1}setFillTransparent(e){this.dependencyTracker?.recordSimpleData("fillColor",e),this.ctx.fillStyle=this.current.fillColor="transparent",this.current.patternFill=!1}_getPattern(e,i,r=null){let o;return this.cachedPatterns.has(i)?o=this.cachedPatterns.get(i):(o=j_i(this.getObject(e,i)),this.cachedPatterns.set(i,o)),r&&(o.matrix=r),o}shadingFill(e,i){if(!this.contentVisible)return;const r=this.ctx;this.save(e);const o=this._getPattern(e,i);r.fillStyle=o.getPattern(r,this,Ru(r),Os.SHADING,e);const n=Ru(r);if(n){const{width:s,height:a}=r.canvas,l=Y5.slice();si.axialAlignedBoundingBox([0,0,s,a],n,l);const[c,d,u,h]=l;this.ctx.fillRect(c,d,u-c,h-d)}else this.ctx.fillRect(-1e10,-1e10,2e10,2e10);this.dependencyTracker?.resetBBox(e).recordFullPageBBox(e).recordDependencies(e,Uc.transform).recordDependencies(e,Uc.fill).recordOperation(e),this.compose(this.current.getClippedPathBoundingBox()),this.restore(e)}beginInlineImage(){yo("Should not call beginInlineImage")}beginImageData(){yo("Should not call beginImageData")}paintFormXObjectBegin(e,i,r){if(this.contentVisible&&(this.save(e),this.baseTransformStack.push(this.baseTransform),i&&this.transform(e,...i),this.baseTransform=en(this.ctx),r)){si.axialAlignedBoundingBox(r,this.baseTransform,this.current.minMax);const[o,n,s,a]=r,l=new Path2D;l.rect(o,n,s-o,a-n),this.ctx.clip(l),this.dependencyTracker?.recordClipBox(e,this.ctx,o,s,n,a),this.endPath(e)}}paintFormXObjectEnd(e){this.contentVisible&&(this.restore(e),this.baseTransform=this.baseTransformStack.pop())}beginGroup(e,i){if(!this.contentVisible)return;this.save(e),this.inSMaskMode&&(this.endSMaskMode(),this.current.activeSMask=null);const r=this.ctx;i.isolated||wP("TODO: Support non-isolated groups."),i.knockout&&ji("Knockout groups not supported.");const o=en(r);if(i.matrix&&r.transform(...i.matrix),!i.bbox)throw new Error("Bounding box is required.");let n=Y5.slice();si.axialAlignedBoundingBox(i.bbox,en(r),n);const s=[0,0,r.canvas.width,r.canvas.height];n=si.intersect(n,s)||[0,0,0,0];const a=Math.floor(n[0]),l=Math.floor(n[1]),c=Math.max(Math.ceil(n[2])-a,1),d=Math.max(Math.ceil(n[3])-l,1);this.current.startNewPathAndClipBox([0,0,c,d]);let u="groupAt"+this.groupLevel;i.smask&&(u+="_smask_"+this.smaskCounter++%2);const h=this.cachedCanvases.getCanvas(u,c,d),p=h.context;p.translate(-a,-l),p.transform(...o);let g=new Path2D;const[f,m,A,v]=i.bbox;if(g.rect(f,m,A-f,v-m),i.matrix){const y=new Path2D;y.addPath(g,new DOMMatrix(i.matrix)),g=y}p.clip(g),i.smask&&this.smaskStack.push({canvas:h.canvas,context:p,offsetX:a,offsetY:l,subtype:i.smask.subtype,backdrop:i.smask.backdrop,transferMap:i.smask.transferMap||null,startTransformInverse:null}),(!i.smask||this.dependencyTracker)&&(r.setTransform(1,0,0,1,0,0),r.translate(a,l),r.save()),Ty(r,p),this.ctx=p,this.dependencyTracker?.inheritSimpleDataAsFutureForcedDependencies(["fillAlpha","strokeAlpha","globalCompositeOperation"]).pushBaseTransform(r),this.setGState(e,[["BM","source-over"],["ca",1],["CA",1]]),this.groupStack.push(r),this.groupLevel++}endGroup(e,i){if(!this.contentVisible)return;this.groupLevel--;const r=this.ctx,o=this.groupStack.pop();if(this.ctx=o,this.ctx.imageSmoothingEnabled=!1,this.dependencyTracker?.popBaseTransform(),i.smask)this.tempSMask=this.smaskStack.pop(),this.restore(e),this.dependencyTracker&&this.ctx.restore();else{this.ctx.restore();const n=en(this.ctx);this.restore(e),this.ctx.save(),this.ctx.setTransform(...n);const s=Y5.slice();si.axialAlignedBoundingBox([0,0,r.canvas.width,r.canvas.height],n,s),this.ctx.drawImage(r.canvas,0,0),this.ctx.restore(),this.compose(s)}}beginAnnotation(e,i,r,o,n,s){if(this.#e(),SP(this.ctx),this.ctx.save(),this.save(e),this.baseTransform&&this.ctx.setTransform(...this.baseTransform),r){const a=r[2]-r[0],l=r[3]-r[1];if(s&&this.annotationCanvasMap){o=o.slice(),o[4]-=r[0],o[5]-=r[1],r=r.slice(),r[0]=r[1]=0,r[2]=a,r[3]=l,si.singularValueDecompose2dScale(en(this.ctx),tc);const{viewportScale:c}=this,d=Math.ceil(a*this.outputScaleX*c),u=Math.ceil(l*this.outputScaleY*c);this.annotationCanvas=this.canvasFactory.create(d,u);const{canvas:h,context:p}=this.annotationCanvas;this.annotationCanvasMap.set(i,h),this.annotationCanvas.savedCtx=this.ctx,this.ctx=p,this.ctx.save(),this.ctx.setTransform(tc[0],0,0,-tc[1],0,l*tc[1]),SP(this.ctx)}else{SP(this.ctx),this.endPath(e);const c=new Path2D;c.rect(r[0],r[1],a,l),this.ctx.clip(c)}}this.current=new tye(this.ctx.canvas.width,this.ctx.canvas.height),this.transform(e,...o),this.transform(e,...n)}endAnnotation(e){this.annotationCanvas&&(this.ctx.restore(),this.#t(),this.ctx=this.annotationCanvas.savedCtx,delete this.annotationCanvas.savedCtx,delete this.annotationCanvas)}paintImageMaskXObject(e,i){if(!this.contentVisible)return;const r=i.count;i=this.getObject(e,i.data,i),i.count=r;const o=this.ctx,n=this._createMaskCanvas(e,i),s=n.canvas;o.save(),o.setTransform(1,0,0,1,0,0),o.drawImage(s,n.offsetX,n.offsetY),this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,n.offsetX,n.offsetX+s.width,n.offsetY,n.offsetY+s.height).recordOperation(e),o.restore(),this.compose()}paintImageMaskXObjectRepeat(e,i,r,o=0,n=0,s,a){if(!this.contentVisible)return;i=this.getObject(e,i.data,i);const l=this.ctx;l.save();const c=en(l);l.transform(r,o,n,s,0,0);const d=this._createMaskCanvas(e,i);l.setTransform(1,0,0,1,d.offsetX-c[4],d.offsetY-c[5]),this.dependencyTracker?.resetBBox(e);for(let u=0,h=a.length;u<h;u+=2){const p=si.transform(c,[r,o,n,s,a[u],a[u+1]]);l.drawImage(d.canvas,p[4],p[5]),this.dependencyTracker?.recordBBox(e,this.ctx,p[4],p[4]+d.canvas.width,p[5],p[5]+d.canvas.height)}l.restore(),this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageMaskXObjectGroup(e,i){if(!this.contentVisible)return;const r=this.ctx,o=this.current.fillColor,n=this.current.patternFill;this.dependencyTracker?.resetBBox(e).recordDependencies(e,Uc.transformAndFill);for(const s of i){const{data:a,width:l,height:c,transform:d}=s,u=this.cachedCanvases.getCanvas("maskCanvas",l,c),h=u.context;h.save();const p=this.getObject(e,a,s);rye(h,p),h.globalCompositeOperation="source-in",h.fillStyle=n?o.getPattern(h,this,Ru(r),Os.FILL,e):o,h.fillRect(0,0,l,c),h.restore(),r.save(),r.transform(...d),r.scale(1,-1),IP(r,u.canvas,0,0,l,c,0,-1,1,1),this.dependencyTracker?.recordBBox(e,r,0,l,0,c),r.restore()}this.compose(),this.dependencyTracker?.recordOperation(e)}paintImageXObject(e,i){if(!this.contentVisible)return;const r=this.getObject(e,i);if(!r){ji("Dependent image isn't ready yet");return}this.paintInlineImageXObject(e,r)}paintImageXObjectRepeat(e,i,r,o,n){if(!this.contentVisible)return;const s=this.getObject(e,i);if(!s){ji("Dependent image isn't ready yet");return}const a=s.width,l=s.height,c=[];for(let d=0,u=n.length;d<u;d+=2)c.push({transform:[r,0,0,o,n[d],n[d+1]],x:0,y:0,w:a,h:l});this.paintInlineImageXObjectGroup(e,s,c)}applyTransferMapsToCanvas(e){return this.current.transferMaps!=="none"&&(e.filter=this.current.transferMaps,e.drawImage(e.canvas,0,0),e.filter="none"),e.canvas}applyTransferMapsToBitmap(e){if(this.current.transferMaps==="none")return e.bitmap;const{bitmap:i,width:r,height:o}=e,n=this.cachedCanvases.getCanvas("inlineImage",r,o),s=n.context;return s.filter=this.current.transferMaps,s.drawImage(i,0,0),s.filter="none",n.canvas}paintInlineImageXObject(e,i){if(!this.contentVisible)return;const r=i.width,o=i.height,n=this.ctx;this.save(e);const{filter:s}=n;s!=="none"&&s!==""&&(n.filter="none"),n.scale(1/r,-1/o);let a;if(i.bitmap)a=this.applyTransferMapsToBitmap(i);else if(typeof HTMLElement=="function"&&i instanceof HTMLElement||!i.data)a=i;else{const c=this.cachedCanvases.getCanvas("inlineImage",r,o).context;iye(c,i),a=this.applyTransferMapsToCanvas(c)}const l=this._scaleImage(a,Ru(n));n.imageSmoothingEnabled=oye(en(n),i.interpolate),this.dependencyTracker?.resetBBox(e).recordBBox(e,n,0,r,-o,0).recordDependencies(e,Uc.imageXObject).recordOperation(e),IP(n,l.img,0,0,l.paintWidth,l.paintHeight,0,-o,r,o),this.compose(),this.restore(e)}paintInlineImageXObjectGroup(e,i,r){if(!this.contentVisible)return;const o=this.ctx;let n;if(i.bitmap)n=i.bitmap;else{const s=i.width,a=i.height,l=this.cachedCanvases.getCanvas("inlineImage",s,a).context;iye(l,i),n=this.applyTransferMapsToCanvas(l)}this.dependencyTracker?.resetBBox(e);for(const s of r)o.save(),o.transform(...s.transform),o.scale(1,-1),IP(o,n,s.x,s.y,s.w,s.h,0,-1,1,1),this.dependencyTracker?.recordBBox(e,o,0,1,-1,0),o.restore();this.dependencyTracker?.recordOperation(e),this.compose()}paintSolidColorImageMask(e){this.contentVisible&&(this.dependencyTracker?.resetBBox(e).recordBBox(e,this.ctx,0,1,0,1).recordDependencies(e,Uc.fill).recordOperation(e),this.ctx.fillRect(0,0,1,1),this.compose())}markPoint(e,i){}markPointProps(e,i,r){}beginMarkedContent(e,i){this.dependencyTracker?.beginMarkedContent(e),this.markedContentStack.push({visible:!0})}beginMarkedContentProps(e,i,r){this.dependencyTracker?.beginMarkedContent(e),i==="OC"?this.markedContentStack.push({visible:this.optionalContentConfig.isVisible(r)}):this.markedContentStack.push({visible:!0}),this.contentVisible=this.isContentVisible()}endMarkedContent(e){this.dependencyTracker?.endMarkedContent(e),this.markedContentStack.pop(),this.contentVisible=this.isContentVisible()}beginCompat(e){}endCompat(e){}consumePath(e,i,r){const o=this.current.isEmptyClip();this.pendingClip&&this.current.updateClipFromPath(),this.pendingClip||this.compose(r);const n=this.ctx;this.pendingClip?(o||(this.pendingClip===nye?n.clip(i,"evenodd"):n.clip(i)),this.pendingClip=null,this.dependencyTracker?.bboxToClipBoxDropOperation(e).recordFutureForcedDependency("clipPath",e)):this.dependencyTracker?.recordOperation(e),this.current.startNewPathAndClipBox(this.current.clipBox)}getSinglePixelWidth(){if(!this._cachedGetSinglePixelWidth){const e=en(this.ctx);if(e[1]===0&&e[2]===0)this._cachedGetSinglePixelWidth=1/Math.min(Math.abs(e[0]),Math.abs(e[3]));else{const i=Math.abs(e[0]*e[3]-e[2]*e[1]),r=Math.hypot(e[0],e[2]),o=Math.hypot(e[1],e[3]);this._cachedGetSinglePixelWidth=Math.max(r,o)/i}}return this._cachedGetSinglePixelWidth}getScaleForStroking(){if(this._cachedScaleForStroking[0]===-1){const{lineWidth:e}=this.current,{a:i,b:r,c:o,d:n}=this.ctx.getTransform();let s,a;if(r===0&&o===0){const l=Math.abs(i),c=Math.abs(n);if(l===c)if(e===0)s=a=1/l;else{const d=l*e;s=a=d<1?1/d:1}else if(e===0)s=1/l,a=1/c;else{const d=l*e,u=c*e;s=d<1?1/d:1,a=u<1?1/u:1}}else{const l=Math.abs(i*n-r*o),c=Math.hypot(i,r),d=Math.hypot(o,n);if(e===0)s=d/l,a=c/l;else{const u=e*l;s=d>u?d/u:1,a=c>u?c/u:1}}this._cachedScaleForStroking[0]=s,this._cachedScaleForStroking[1]=a}return this._cachedScaleForStroking}rescaleAndStroke(e,i){const{ctx:r,current:{lineWidth:o}}=this,[n,s]=this.getScaleForStroking();if(n===s){r.lineWidth=(o||1)*n,r.stroke(e);return}const a=r.getLineDash();i&&r.save(),r.scale(n,s),Vq.a=1/n,Vq.d=1/s;const l=new Path2D;if(l.addPath(e,Vq),a.length>0){const c=Math.max(n,s);r.setLineDash(a.map(d=>d/c)),r.lineDashOffset/=c}r.lineWidth=o||1,r.stroke(l),i&&r.restore()}isContentVisible(){for(let e=this.markedContentStack.length-1;e>=0;e--)if(!this.markedContentStack[e].visible)return!1;return!0}}for(const t in xy)R6.prototype[t]!==void 0&&(R6.prototype[xy[t]]=R6.prototype[t]);class $5{static#e=null;static#t="";static get workerPort(){return this.#e}static set workerPort(e){if(!(typeof Worker<"u"&&e instanceof Worker)&&e!==null)throw new Error("Invalid `workerPort` type.");this.#e=e}static get workerSrc(){return this.#t}static set workerSrc(e){if(typeof e!="string")throw new Error("Invalid `workerSrc` type.");this.#t=e}}class W_i{#e;#t;constructor({parsedData:e,rawData:i}){this.#e=e,this.#t=i}getRaw(){return this.#t}get(e){return this.#e.get(e)??null}[Symbol.iterator](){return this.#e.entries()}}const e6=Symbol("INTERNAL");class J_i{#e=!1;#t=!1;#r=!1;#i=!0;constructor(e,{name:i,intent:r,usage:o,rbGroups:n}){this.#e=!!(e&ec.DISPLAY),this.#t=!!(e&ec.PRINT),this.name=i,this.intent=r,this.usage=o,this.rbGroups=n}get visible(){if(this.#r)return this.#i;if(!this.#i)return!1;const{print:e,view:i}=this.usage;return this.#e?i?.viewState!=="OFF":this.#t?e?.printState!=="OFF":!0}_setVisible(e,i,r=!1){e!==e6&&yo("Internal method `_setVisible` called."),this.#r=r,this.#i=i}}class Z_i{#e=null;#t=new Map;#r=null;#i=null;constructor(e,i=ec.DISPLAY){if(this.renderingIntent=i,this.name=null,this.creator=null,e!==null){this.name=e.name,this.creator=e.creator,this.#i=e.order;for(const r of e.groups)this.#t.set(r.id,new J_i(i,r));if(e.baseState==="OFF")for(const r of this.#t.values())r._setVisible(e6,!1);for(const r of e.on)this.#t.get(r)._setVisible(e6,!0);for(const r of e.off)this.#t.get(r)._setVisible(e6,!1);this.#r=this.getHash()}}#o(e){const i=e.length;if(i<2)return!0;const r=e[0];for(let o=1;o<i;o++){const n=e[o];let s;if(Array.isArray(n))s=this.#o(n);else if(this.#t.has(n))s=this.#t.get(n).visible;else return ji(`Optional content group not found: ${n}`),!0;switch(r){case"And":if(!s)return!1;break;case"Or":if(s)return!0;break;case"Not":return!s;default:return!0}}return r==="And"}isVisible(e){if(this.#t.size===0)return!0;if(!e)return wP("Optional content group not defined."),!0;if(e.type==="OCG")return this.#t.has(e.id)?this.#t.get(e.id).visible:(ji(`Optional content group not found: ${e.id}`),!0);if(e.type==="OCMD"){if(e.expression)return this.#o(e.expression);if(!e.policy||e.policy==="AnyOn"){for(const i of e.ids){if(!this.#t.has(i))return ji(`Optional content group not found: ${i}`),!0;if(this.#t.get(i).visible)return!0}return!1}else if(e.policy==="AllOn"){for(const i of e.ids){if(!this.#t.has(i))return ji(`Optional content group not found: ${i}`),!0;if(!this.#t.get(i).visible)return!1}return!0}else if(e.policy==="AnyOff"){for(const i of e.ids){if(!this.#t.has(i))return ji(`Optional content group not found: ${i}`),!0;if(!this.#t.get(i).visible)return!0}return!1}else if(e.policy==="AllOff"){for(const i of e.ids){if(!this.#t.has(i))return ji(`Optional content group not found: ${i}`),!0;if(this.#t.get(i).visible)return!1}return!0}return ji(`Unknown optional content policy ${e.policy}.`),!0}return ji(`Unknown group type ${e.type}.`),!0}setVisibility(e,i=!0,r=!0){const o=this.#t.get(e);if(!o){ji(`Optional content group not found: ${e}`);return}if(r&&i&&o.rbGroups.length)for(const n of o.rbGroups)for(const s of n)s!==e&&this.#t.get(s)?._setVisible(e6,!1,!0);o._setVisible(e6,!!i,!0),this.#e=null}setOCGState({state:e,preserveRB:i}){let r;for(const o of e){switch(o){case"ON":case"OFF":case"Toggle":r=o;continue}const n=this.#t.get(o);if(n)switch(r){case"ON":this.setVisibility(o,!0,i);break;case"OFF":this.setVisibility(o,!1,i);break;case"Toggle":this.setVisibility(o,!n.visible,i);break}}this.#e=null}get hasInitialVisibility(){return this.#r===null||this.getHash()===this.#r}getOrder(){return this.#t.size?this.#i?this.#i.slice():[...this.#t.keys()]:null}getGroup(e){return this.#t.get(e)||null}getHash(){if(this.#e!==null)return this.#e;const e=new F7e;for(const[i,r]of this.#t)e.update(`${i}:${r.visible}`);return this.#e=e.hexdigest()}[Symbol.iterator](){return this.#t.entries()}}class X_i{constructor(e,{disableRange:i=!1,disableStream:r=!1}){Cr(e,'PDFDataTransportStream - missing required "pdfDataRangeTransport" argument.');const{length:o,initialData:n,progressiveDone:s,contentDispositionFilename:a}=e;if(this._queuedChunks=[],this._progressiveDone=s,this._contentDispositionFilename=a,n?.length>0){const l=n instanceof Uint8Array&&n.byteLength===n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer;this._queuedChunks.push(l)}this._pdfDataRangeTransport=e,this._isStreamingSupported=!r,this._isRangeSupported=!i,this._contentLength=o,this._fullRequestReader=null,this._rangeReaders=[],e.addRangeListener((l,c)=>{this._onReceiveData({begin:l,chunk:c})}),e.addProgressListener((l,c)=>{this._onProgress({loaded:l,total:c})}),e.addProgressiveReadListener(l=>{this._onReceiveData({chunk:l})}),e.addProgressiveDoneListener(()=>{this._onProgressiveDone()}),e.transportReady()}_onReceiveData({begin:e,chunk:i}){const r=i instanceof Uint8Array&&i.byteLength===i.buffer.byteLength?i.buffer:new Uint8Array(i).buffer;if(e===void 0)this._fullRequestReader?this._fullRequestReader._enqueue(r):this._queuedChunks.push(r);else{const o=this._rangeReaders.some(function(n){return n._begin!==e?!1:(n._enqueue(r),!0)});Cr(o,"_onReceiveData - no `PDFDataTransportStreamRangeReader` instance found.")}}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}_onProgress(e){e.total===void 0?this._rangeReaders[0]?.onProgress?.({loaded:e.loaded}):this._fullRequestReader?.onProgress?.({loaded:e.loaded,total:e.total})}_onProgressiveDone(){this._fullRequestReader?.progressiveDone(),this._progressiveDone=!0}_removeRangeReader(e){const i=this._rangeReaders.indexOf(e);i>=0&&this._rangeReaders.splice(i,1)}getFullReader(){Cr(!this._fullRequestReader,"PDFDataTransportStream.getFullReader can only be called once.");const e=this._queuedChunks;return this._queuedChunks=null,new Y_i(this,e,this._progressiveDone,this._contentDispositionFilename)}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new $_i(this,e,i);return this._pdfDataRangeTransport.requestDataRange(e,i),this._rangeReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const i of this._rangeReaders.slice(0))i.cancel(e);this._pdfDataRangeTransport.abort()}}class Y_i{constructor(e,i,r=!1,o=null){this._stream=e,this._done=r||!1,this._filename=Tq(o)?o:null,this._queuedChunks=i||[],this._loaded=0;for(const n of this._queuedChunks)this._loaded+=n.byteLength;this._requests=[],this._headersReady=Promise.resolve(),e._fullRequestReader=this,this.onProgress=null}_enqueue(e){this._done||(this._requests.length>0?this._requests.shift().resolve({value:e,done:!1}):this._queuedChunks.push(e),this._loaded+=e.byteLength)}get headersReady(){return this._headersReady}get filename(){return this._filename}get isRangeSupported(){return this._stream._isRangeSupported}get isStreamingSupported(){return this._stream._isStreamingSupported}get contentLength(){return this._stream._contentLength}async read(){if(this._queuedChunks.length>0)return{value:this._queuedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}progressiveDone(){this._done||(this._done=!0)}}class $_i{constructor(e,i,r){this._stream=e,this._begin=i,this._end=r,this._queuedChunk=null,this._requests=[],this._done=!1,this.onProgress=null}_enqueue(e){if(!this._done){if(this._requests.length===0)this._queuedChunk=e;else{this._requests.shift().resolve({value:e,done:!1});for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}this._done=!0,this._stream._removeRangeReader(this)}}get isStreamingSupported(){return!1}async read(){if(this._queuedChunk){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._stream._removeRangeReader(this)}}function eLi(t){let e=!0,i=r("filename\\*","i").exec(t);if(i){i=i[1];let d=a(i);return d=unescape(d),d=l(d),d=c(d),n(d)}if(i=s(t),i){const d=c(i);return n(d)}if(i=r("filename","i").exec(t),i){i=i[1];let d=a(i);return d=c(d),n(d)}function r(d,u){return new RegExp("(?:^|;)\\s*"+d+'\\s*=\\s*([^";\\s][^;\\s]*|"(?:[^"\\\\]|\\\\"?)+"?)',u)}function o(d,u){if(d){if(!/^[\x00-\xFF]+$/.test(u))return u;try{const h=new TextDecoder(d,{fatal:!0}),p=My(u);u=h.decode(p),e=!1}catch{}}return u}function n(d){return e&&/[\x80-\xff]/.test(d)&&(d=o("utf-8",d),e&&(d=o("iso-8859-1",d))),d}function s(d){const u=[];let h;const p=r("filename\\*((?!0\\d)\\d+)(\\*?)","ig");for(;(h=p.exec(d))!==null;){let[,f,m,A]=h;if(f=parseInt(f,10),f in u){if(f===0)break;continue}u[f]=[m,A]}const g=[];for(let f=0;f<u.length&&f in u;++f){let[m,A]=u[f];A=a(A),m&&(A=unescape(A),f===0&&(A=l(A))),g.push(A)}return g.join("")}function a(d){if(d.startsWith('"')){const u=d.slice(1).split('\\"');for(let h=0;h<u.length;++h){const p=u[h].indexOf('"');p!==-1&&(u[h]=u[h].slice(0,p),u.length=h+1),u[h]=u[h].replaceAll(/\\(.)/g,"$1")}d=u.join('"')}return d}function l(d){const u=d.indexOf("'");if(u===-1)return d;const h=d.slice(0,u),p=d.slice(u+1).replace(/^[^']*'/,"");return o(h,p)}function c(d){return!d.startsWith("=?")||/[\x00-\x19\x80-\xff]/.test(d)?d:d.replaceAll(/=\?([\w-]*)\?([QqBb])\?((?:[^?]|\?(?!=))*)\?=/g,function(u,h,p,g){if(p==="q"||p==="Q")return g=g.replaceAll("_"," "),g=g.replaceAll(/=([0-9a-fA-F]{2})/g,function(f,m){return String.fromCharCode(parseInt(m,16))}),o(h,g);try{g=atob(g)}catch{}return o(h,g)})}return""}function sye(t,e){const i=new Headers;if(!t||!e||typeof e!="object")return i;for(const r in e){const o=e[r];o!==void 0&&i.append(r,o)}return i}function TP(t){return URL.parse(t)?.origin??null}function aye({responseHeaders:t,isHttp:e,rangeChunkSize:i,disableRange:r}){const o={allowRangeRequests:!1,suggestedLength:void 0},n=parseInt(t.get("Content-Length"),10);return!Number.isInteger(n)||(o.suggestedLength=n,n<=2*i)||r||!e||t.get("Accept-Ranges")!=="bytes"||(t.get("Content-Encoding")||"identity")!=="identity"||(o.allowRangeRequests=!0),o}function lye(t){const e=t.get("Content-Disposition");if(e){let i=eLi(e);if(i.includes("%"))try{i=decodeURIComponent(i)}catch{}if(Tq(i))return i}return null}function Ry(t,e){return new CP(`Unexpected server response (${t}) while retrieving PDF "${e}".`,t,t===404||t===0&&e.startsWith("file:"))}function cye(t){return t===200||t===206}function dye(t,e,i){return{method:"GET",headers:t,signal:i.signal,mode:"cors",credentials:e?"include":"same-origin",redirect:"follow"}}function uye(t){return t instanceof Uint8Array?t.buffer:t instanceof ArrayBuffer?t:(ji(`getArrayBuffer - unexpected data format: ${t}`),new Uint8Array(t).buffer)}class tLi{_responseOrigin=null;constructor(e){this.source=e,this.isHttp=/^https?:/i.test(e.url),this.headers=sye(this.isHttp,e.httpHeaders),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Cr(!this._fullRequestReader,"PDFFetchStream.getFullReader can only be called once."),this._fullRequestReader=new iLi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new rLi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const i of this._rangeRequestReaders.slice(0))i.cancel(e)}}class iLi{constructor(e){this._stream=e,this._reader=null,this._loaded=0,this._filename=null;const i=e.source;this._withCredentials=i.withCredentials||!1,this._contentLength=i.length,this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._abortController=new AbortController,this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange;const r=new Headers(e.headers),o=i.url;fetch(o,dye(r,this._withCredentials,this._abortController)).then(n=>{if(e._responseOrigin=TP(n.url),!cye(n.status))throw Ry(n.status,o);this._reader=n.body.getReader(),this._headersCapability.resolve();const s=n.headers,{allowRangeRequests:a,suggestedLength:l}=aye({responseHeaders:s,isHttp:e.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});this._isRangeSupported=a,this._contentLength=l||this._contentLength,this._filename=lye(s),!this._isStreamingSupported&&this._isRangeSupported&&this.cancel(new $p("Streaming is disabled."))}).catch(this._headersCapability.reject),this.onProgress=null}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._headersCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:uye(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}class rLi{constructor(e,i,r){this._stream=e,this._reader=null,this._loaded=0;const o=e.source;this._withCredentials=o.withCredentials||!1,this._readCapability=Promise.withResolvers(),this._isStreamingSupported=!o.disableStream,this._abortController=new AbortController;const n=new Headers(e.headers);n.append("Range",`bytes=${i}-${r-1}`);const s=o.url;fetch(s,dye(n,this._withCredentials,this._abortController)).then(a=>{const l=TP(a.url);if(l!==e._responseOrigin)throw new Error(`Expected range response-origin "${l}" to match "${e._responseOrigin}".`);if(!cye(a.status))throw Ry(a.status,s);this._readCapability.resolve(),this._reader=a.body.getReader()}).catch(this._readCapability.reject),this.onProgress=null}get isStreamingSupported(){return this._isStreamingSupported}async read(){await this._readCapability.promise;const{value:e,done:i}=await this._reader.read();return i?{value:e,done:i}:(this._loaded+=e.byteLength,this.onProgress?.({loaded:this._loaded}),{value:uye(e),done:!1})}cancel(e){this._reader?.cancel(e),this._abortController.abort()}}const qq=200,Gq=206;function oLi(t){const e=t.response;return typeof e!="string"?e:My(e).buffer}class nLi{_responseOrigin=null;constructor({url:e,httpHeaders:i,withCredentials:r}){this.url=e,this.isHttp=/^https?:/i.test(e),this.headers=sye(this.isHttp,i),this.withCredentials=r||!1,this.currXhrId=0,this.pendingRequests=Object.create(null)}request(e){const i=new XMLHttpRequest,r=this.currXhrId++,o=this.pendingRequests[r]={xhr:i};i.open("GET",this.url),i.withCredentials=this.withCredentials;for(const[n,s]of this.headers)i.setRequestHeader(n,s);return this.isHttp&&"begin"in e&&"end"in e?(i.setRequestHeader("Range",`bytes=${e.begin}-${e.end-1}`),o.expectedStatus=Gq):o.expectedStatus=qq,i.responseType="arraybuffer",Cr(e.onError,"Expected `onError` callback to be provided."),i.onerror=()=>{e.onError(i.status)},i.onreadystatechange=this.onStateChange.bind(this,r),i.onprogress=this.onProgress.bind(this,r),o.onHeadersReceived=e.onHeadersReceived,o.onDone=e.onDone,o.onError=e.onError,o.onProgress=e.onProgress,i.send(null),r}onProgress(e,i){const r=this.pendingRequests[e];r&&r.onProgress?.(i)}onStateChange(e,i){const r=this.pendingRequests[e];if(!r)return;const o=r.xhr;if(o.readyState>=2&&r.onHeadersReceived&&(r.onHeadersReceived(),delete r.onHeadersReceived),o.readyState!==4||!(e in this.pendingRequests))return;if(delete this.pendingRequests[e],o.status===0&&this.isHttp){r.onError(o.status);return}const n=o.status||qq;if(!(n===qq&&r.expectedStatus===Gq)&&n!==r.expectedStatus){r.onError(o.status);return}const s=oLi(o);if(n===Gq){const a=o.getResponseHeader("Content-Range"),l=/bytes (\d+)-(\d+)\/(\d+)/.exec(a);l?r.onDone({begin:parseInt(l[1],10),chunk:s}):(ji('Missing or invalid "Content-Range" header.'),r.onError(0))}else s?r.onDone({begin:0,chunk:s}):r.onError(o.status)}getRequestXhr(e){return this.pendingRequests[e].xhr}isPendingRequest(e){return e in this.pendingRequests}abortRequest(e){const i=this.pendingRequests[e].xhr;delete this.pendingRequests[e],i.abort()}}class sLi{constructor(e){this._source=e,this._manager=new nLi(e),this._rangeChunkSize=e.rangeChunkSize,this._fullRequestReader=null,this._rangeRequestReaders=[]}_onRangeRequestReaderClosed(e){const i=this._rangeRequestReaders.indexOf(e);i>=0&&this._rangeRequestReaders.splice(i,1)}getFullReader(){return Cr(!this._fullRequestReader,"PDFNetworkStream.getFullReader can only be called once."),this._fullRequestReader=new aLi(this._manager,this._source),this._fullRequestReader}getRangeReader(e,i){const r=new lLi(this._manager,e,i);return r.onClosed=this._onRangeRequestReaderClosed.bind(this),this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const i of this._rangeRequestReaders.slice(0))i.cancel(e)}}class aLi{constructor(e,i){this._manager=e,this._url=i.url,this._fullRequestId=e.request({onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._headersCapability=Promise.withResolvers(),this._disableRange=i.disableRange||!1,this._contentLength=i.length,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!1,this._isRangeSupported=!1,this._cachedChunks=[],this._requests=[],this._done=!1,this._storedError=void 0,this._filename=null,this.onProgress=null}_onHeadersReceived(){const e=this._fullRequestId,i=this._manager.getRequestXhr(e);this._manager._responseOrigin=TP(i.responseURL);const r=i.getAllResponseHeaders(),o=new Headers(r?r.trimStart().replace(/[^\S ]+$/,"").split(/[\r\n]+/).map(a=>{const[l,...c]=a.split(": ");return[l,c.join(": ")]}):[]),{allowRangeRequests:n,suggestedLength:s}=aye({responseHeaders:o,isHttp:this._manager.isHttp,rangeChunkSize:this._rangeChunkSize,disableRange:this._disableRange});n&&(this._isRangeSupported=!0),this._contentLength=s||this._contentLength,this._filename=lye(o),this._isRangeSupported&&this._manager.abortRequest(e),this._headersCapability.resolve()}_onDone(e){if(e&&(this._requests.length>0?this._requests.shift().resolve({value:e.chunk,done:!1}):this._cachedChunks.push(e.chunk)),this._done=!0,!(this._cachedChunks.length>0)){for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0}}_onError(e){this._storedError=Ry(e,this._url),this._headersCapability.reject(this._storedError);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._cachedChunks.length=0}_onProgress(e){this.onProgress?.({loaded:e.loaded,total:e.lengthComputable?e.total:this._contentLength})}get filename(){return this._filename}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}get contentLength(){return this._contentLength}get headersReady(){return this._headersCapability.promise}async read(){if(await this._headersCapability.promise,this._storedError)throw this._storedError;if(this._cachedChunks.length>0)return{value:this._cachedChunks.shift(),done:!1};if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0,this._headersCapability.reject(e);for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._fullRequestId)&&this._manager.abortRequest(this._fullRequestId),this._fullRequestReader=null}}class lLi{constructor(e,i,r){this._manager=e,this._url=e.url,this._requestId=e.request({begin:i,end:r,onHeadersReceived:this._onHeadersReceived.bind(this),onDone:this._onDone.bind(this),onError:this._onError.bind(this),onProgress:this._onProgress.bind(this)}),this._requests=[],this._queuedChunk=null,this._done=!1,this._storedError=void 0,this.onProgress=null,this.onClosed=null}_onHeadersReceived(){const e=TP(this._manager.getRequestXhr(this._requestId)?.responseURL);e!==this._manager._responseOrigin&&(this._storedError=new Error(`Expected range response-origin "${e}" to match "${this._manager._responseOrigin}".`),this._onError(0))}_close(){this.onClosed?.(this)}_onDone(e){const i=e.chunk;this._requests.length>0?this._requests.shift().resolve({value:i,done:!1}):this._queuedChunk=i,this._done=!0;for(const r of this._requests)r.resolve({value:void 0,done:!0});this._requests.length=0,this._close()}_onError(e){this._storedError??=Ry(e,this._url);for(const i of this._requests)i.reject(this._storedError);this._requests.length=0,this._queuedChunk=null}_onProgress(e){this.isStreamingSupported||this.onProgress?.({loaded:e.loaded})}get isStreamingSupported(){return!1}async read(){if(this._storedError)throw this._storedError;if(this._queuedChunk!==null){const i=this._queuedChunk;return this._queuedChunk=null,{value:i,done:!1}}if(this._done)return{value:void 0,done:!0};const e=Promise.withResolvers();return this._requests.push(e),e.promise}cancel(e){this._done=!0;for(const i of this._requests)i.resolve({value:void 0,done:!0});this._requests.length=0,this._manager.isPendingRequest(this._requestId)&&this._manager.abortRequest(this._requestId),this._close()}}const cLi=/^[a-z][a-z0-9\-+.]+:/i;function dLi(t){if(cLi.test(t))return new URL(t);const e=process.getBuiltinModule("url");return new URL(e.pathToFileURL(t))}class uLi{constructor(e){this.source=e,this.url=dLi(e.url),Cr(this.url.protocol==="file:","PDFNodeStream only supports file:// URLs."),this._fullRequestReader=null,this._rangeRequestReaders=[]}get _progressiveDataLength(){return this._fullRequestReader?._loaded??0}getFullReader(){return Cr(!this._fullRequestReader,"PDFNodeStream.getFullReader can only be called once."),this._fullRequestReader=new hLi(this),this._fullRequestReader}getRangeReader(e,i){if(i<=this._progressiveDataLength)return null;const r=new pLi(this,e,i);return this._rangeRequestReaders.push(r),r}cancelAllRequests(e){this._fullRequestReader?.cancel(e);for(const i of this._rangeRequestReaders.slice(0))i.cancel(e)}}class hLi{constructor(e){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null;const i=e.source;this._contentLength=i.length,this._loaded=0,this._filename=null,this._disableRange=i.disableRange||!1,this._rangeChunkSize=i.rangeChunkSize,!this._rangeChunkSize&&!this._disableRange&&(this._disableRange=!0),this._isStreamingSupported=!i.disableStream,this._isRangeSupported=!i.disableRange,this._readableStream=null,this._readCapability=Promise.withResolvers(),this._headersCapability=Promise.withResolvers();const r=process.getBuiltinModule("fs");r.promises.lstat(this._url).then(o=>{this._contentLength=o.size,this._setReadableStream(r.createReadStream(this._url)),this._headersCapability.resolve()},o=>{o.code==="ENOENT"&&(o=Ry(0,this._url.href)),this._storedError=o,this._headersCapability.reject(o)})}get headersReady(){return this._headersCapability.promise}get filename(){return this._filename}get contentLength(){return this._contentLength}get isRangeSupported(){return this._isRangeSupported}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded,total:this._contentLength}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),!this._isStreamingSupported&&this._isRangeSupported&&this._error(new $p("streaming is disabled")),this._storedError&&this._readableStream.destroy(this._storedError)}}class pLi{constructor(e,i,r){this._url=e.url,this._done=!1,this._storedError=null,this.onProgress=null,this._loaded=0,this._readableStream=null,this._readCapability=Promise.withResolvers();const o=e.source;this._isStreamingSupported=!o.disableStream;const n=process.getBuiltinModule("fs");this._setReadableStream(n.createReadStream(this._url,{start:i,end:r-1}))}get isStreamingSupported(){return this._isStreamingSupported}async read(){if(await this._readCapability.promise,this._done)return{value:void 0,done:!0};if(this._storedError)throw this._storedError;const e=this._readableStream.read();return e===null?(this._readCapability=Promise.withResolvers(),this.read()):(this._loaded+=e.length,this.onProgress?.({loaded:this._loaded}),{value:new Uint8Array(e).buffer,done:!1})}cancel(e){if(!this._readableStream){this._error(e);return}this._readableStream.destroy(e)}_error(e){this._storedError=e,this._readCapability.resolve()}_setReadableStream(e){this._readableStream=e,e.on("readable",()=>{this._readCapability.resolve()}),e.on("end",()=>{e.destroy(),this._done=!0,this._readCapability.resolve()}),e.on("error",i=>{this._error(i)}),this._storedError&&this._readableStream.destroy(this._storedError)}}const Dy=Symbol("INITIAL_DATA");class hye{#e=Object.create(null);#t(e){return this.#e[e]||={...Promise.withResolvers(),data:Dy}}get(e,i=null){if(i){const o=this.#t(e);return o.promise.then(()=>i(o.data)),null}const r=this.#e[e];if(!r||r.data===Dy)throw new Error(`Requesting object that isn't resolved yet ${e}.`);return r.data}has(e){const i=this.#e[e];return!!i&&i.data!==Dy}delete(e){const i=this.#e[e];return!i||i.data===Dy?!1:(delete this.#e[e],!0)}resolve(e,i=null){const r=this.#t(e);r.data=i,r.resolve()}clear(){for(const e in this.#e){const{data:i}=this.#e[e];i?.bitmap?.close()}this.#e=Object.create(null)}*[Symbol.iterator](){for(const e in this.#e){const{data:i}=this.#e[e];i!==Dy&&(yield[e,i])}}}const fLi=1e5,pye=30;class el{#e=Promise.withResolvers();#t=null;#r=!1;#i=!!globalThis.FontInspector?.enabled;#o=null;#n=null;#s=0;#a=0;#l=null;#c=null;#h=0;#u=0;#p=Object.create(null);#A=[];#g=null;#d=[];#f=new WeakMap;#m=null;static#y=new Map;static#v=new Map;static#M=new WeakMap;static#x=null;static#w=new Set;constructor({textContentSource:e,container:i,viewport:r}){if(e instanceof ReadableStream)this.#g=e;else if(typeof e=="object")this.#g=new ReadableStream({start(l){l.enqueue(e),l.close()}});else throw new Error('No "textContentSource" parameter specified.');this.#t=this.#c=i,this.#u=r.scale*Wu.pixelRatio,this.#h=r.rotation,this.#n={div:null,properties:null,ctx:null};const{pageWidth:o,pageHeight:n,pageX:s,pageY:a}=r.rawDims;this.#m=[1,0,0,-1,-s,a+n],this.#a=o,this.#s=n,el.#I(),ng(i,r),this.#e.promise.finally(()=>{el.#w.delete(this),this.#n=null,this.#p=null}).catch(()=>{})}static get fontFamilyMap(){const{isWindows:e,isFirefox:i}=Fs.platform;return Wi(this,"fontFamilyMap",new Map([["sans-serif",`${e&&i?"Calibri, ":""}sans-serif`],["monospace",`${e&&i?"Lucida Console, ":""}monospace`]]))}render(){const e=()=>{this.#l.read().then(({value:i,done:r})=>{if(r){this.#e.resolve();return}this.#o??=i.lang,Object.assign(this.#p,i.styles),this.#B(i.items),e()},this.#e.reject)};return this.#l=this.#g.getReader(),el.#w.add(this),e(),this.#e.promise}update({viewport:e,onBefore:i=null}){const r=e.scale*Wu.pixelRatio,o=e.rotation;if(o!==this.#h&&(i?.(),this.#h=o,ng(this.#c,{rotation:o})),r!==this.#u){i?.(),this.#u=r;const n={div:null,properties:null,ctx:el.#S(this.#o)};for(const s of this.#d)n.properties=this.#f.get(s),n.div=s,this.#k(n)}}cancel(){const e=new $p("TextLayer task cancelled.");this.#l?.cancel(e).catch(()=>{}),this.#l=null,this.#e.reject(e)}get textDivs(){return this.#d}get textContentItemsStr(){return this.#A}#B(e){if(this.#r)return;this.#n.ctx??=el.#S(this.#o);const i=this.#d,r=this.#A;for(const o of e){if(i.length>fLi){ji("Ignoring additional textDivs for performance reasons."),this.#r=!0;return}if(o.str===void 0){if(o.type==="beginMarkedContentProps"||o.type==="beginMarkedContent"){const n=this.#t;this.#t=document.createElement("span"),this.#t.classList.add("markedContent"),o.id&&this.#t.setAttribute("id",`${o.id}`),n.append(this.#t)}else o.type==="endMarkedContent"&&(this.#t=this.#t.parentNode);continue}r.push(o.str),this.#b(o)}}#b(e){const i=document.createElement("span"),r={angle:0,canvasWidth:0,hasText:e.str!=="",hasEOL:e.hasEOL,fontSize:0};this.#d.push(i);const o=si.transform(this.#m,e.transform);let n=Math.atan2(o[1],o[0]);const s=this.#p[e.fontName];s.vertical&&(n+=Math.PI/2);let a=this.#i&&s.fontSubstitution||s.fontFamily;a=el.fontFamilyMap.get(a)||a;const l=Math.hypot(o[2],o[3]),c=l*el.#O(a,s,this.#o);let d,u;n===0?(d=o[4],u=o[5]-c):(d=o[4]+c*Math.sin(n),u=o[5]-c*Math.cos(n));const h="calc(var(--total-scale-factor) *",p=i.style;this.#t===this.#c?(p.left=`${(100*d/this.#a).toFixed(2)}%`,p.top=`${(100*u/this.#s).toFixed(2)}%`):(p.left=`${h}${d.toFixed(2)}px)`,p.top=`${h}${u.toFixed(2)}px)`),p.fontSize=`${h}${(el.#x*l).toFixed(2)}px)`,p.fontFamily=a,r.fontSize=l,i.setAttribute("role","presentation"),i.textContent=e.str,i.dir=e.dir,this.#i&&(i.dataset.fontName=s.fontSubstitutionLoadedName||e.fontName),n!==0&&(r.angle=n*(180/Math.PI));let g=!1;if(e.str.length>1)g=!0;else if(e.str!==" "&&e.transform[0]!==e.transform[3]){const f=Math.abs(e.transform[0]),m=Math.abs(e.transform[3]);f!==m&&Math.max(f,m)/Math.min(f,m)>1.5&&(g=!0)}if(g&&(r.canvasWidth=s.vertical?e.height:e.width),this.#f.set(i,r),this.#n.div=i,this.#n.properties=r,this.#k(this.#n),r.hasText&&this.#t.append(i),r.hasEOL){const f=document.createElement("br");f.setAttribute("role","presentation"),this.#t.append(f)}}#k(e){const{div:i,properties:r,ctx:o}=e,{style:n}=i;let s="";if(el.#x>1&&(s=`scale(${1/el.#x})`),r.canvasWidth!==0&&r.hasText){const{fontFamily:a}=n,{canvasWidth:l,fontSize:c}=r;el.#P(o,c*this.#u,a);const{width:d}=o.measureText(i.textContent);d>0&&(s=`scaleX(${l*this.#u/d}) ${s}`)}r.angle!==0&&(s=`rotate(${r.angle}deg) ${s}`),s.length>0&&(n.transform=s)}static cleanup(){if(!(this.#w.size>0)){this.#y.clear();for(const{canvas:e}of this.#v.values())e.remove();this.#v.clear()}}static#S(e=null){let i=this.#v.get(e||="");if(!i){const r=document.createElement("canvas");r.className="hiddenCanvasElement",r.lang=e,document.body.append(r),i=r.getContext("2d",{alpha:!1,willReadFrequently:!0}),this.#v.set(e,i),this.#M.set(i,{size:0,family:""})}return i}static#P(e,i,r){const o=this.#M.get(e);i===o.size&&r===o.family||(e.font=`${i}px ${r}`,o.size=i,o.family=r)}static#I(){if(this.#x!==null)return;const e=document.createElement("div");e.style.opacity=0,e.style.lineHeight=1,e.style.fontSize="1px",e.style.position="absolute",e.textContent="X",document.body.append(e),this.#x=e.getBoundingClientRect().height,e.remove()}static#O(e,i,r){const o=this.#y.get(e);if(o)return o;const n=this.#S(r);n.canvas.width=n.canvas.height=pye,this.#P(n,pye,e);const s=n.measureText(""),a=s.fontBoundingBoxAscent,l=Math.abs(s.fontBoundingBoxDescent);n.canvas.width=n.canvas.height=0;let c=.8;return a?c=a/(a+l):(Fs.platform.isFirefox&&ji("Enable the `dom.textMetrics.fontBoundingBox.enabled` preference in `about:config` to improve TextLayer rendering."),i.ascent?c=i.ascent:i.descent&&(c=1+i.descent)),this.#y.set(e,c),c}}const gLi=100;function fye(t={}){typeof t=="string"||t instanceof URL?t={url:t}:(t instanceof ArrayBuffer||ArrayBuffer.isView(t))&&(t={data:t});const e=new XQ,{docId:i}=e,r=t.url?C_i(t.url):null,o=t.data?x_i(t.data):null,n=t.httpHeaders||null,s=t.withCredentials===!0,a=t.password??null,l=t.range instanceof gye?t.range:null,c=Number.isInteger(t.rangeChunkSize)&&t.rangeChunkSize>0?t.rangeChunkSize:2**16;let d=t.worker instanceof Kq?t.worker:null;const u=t.verbosity,h=typeof t.docBaseUrl=="string"&&!xP(t.docBaseUrl)?t.docBaseUrl:null,p=MP(t.cMapUrl),g=t.cMapPacked!==!1,f=t.CMapReaderFactory||(ja?T_i:V7e),m=MP(t.iccUrl),A=MP(t.standardFontDataUrl),v=t.StandardFontDataFactory||(ja?R_i:Q7e),y=MP(t.wasmUrl),b=t.WasmFactory||(ja?D_i:W7e),w=t.stopAtErrors!==!0,C=Number.isInteger(t.maxImageSize)&&t.maxImageSize>-1?t.maxImageSize:-1,M=t.isEvalSupported!==!1,E=typeof t.isOffscreenCanvasSupported=="boolean"?t.isOffscreenCanvasSupported:!ja,B=typeof t.isImageDecoderSupported=="boolean"?t.isImageDecoderSupported:!ja&&(Fs.platform.isFirefox||!globalThis.chrome),S=Number.isInteger(t.canvasMaxAreaInBytes)?t.canvasMaxAreaInBytes:-1,I=typeof t.disableFontFace=="boolean"?t.disableFontFace:ja,T=t.fontExtraProperties===!0,_=t.enableXfa===!0,O=t.ownerDocument||globalThis.document,j=t.disableRange===!0,N=t.disableStream===!0,G=t.disableAutoFetch===!0,q=t.pdfBug===!0,X=t.CanvasFactory||(ja?S_i:B_i),me=t.FilterFactory||(ja?I_i:P_i),ce=t.enableHWA===!0,xe=t.useWasm!==!1,Re=l?l.length:t.length??NaN,ge=typeof t.useSystemFonts=="boolean"?t.useSystemFonts:!ja&&!I,ee=typeof t.useWorkerFetch=="boolean"?t.useWorkerFetch:!!(f===V7e&&v===Q7e&&b===W7e&&p&&A&&y&&By(p,document.baseURI)&&By(A,document.baseURI)&&By(y,document.baseURI)),$=null;WDi(u);const re={canvasFactory:new X({ownerDocument:O,enableHWA:ce}),filterFactory:new me({docId:i,ownerDocument:O}),cMapReaderFactory:ee?null:new f({baseUrl:p,isCompressed:g}),standardFontDataFactory:ee?null:new v({baseUrl:A}),wasmFactory:ee?null:new b({baseUrl:y})};d||(d=Kq.create({verbosity:u,port:$5.workerPort}),e._worker=d);const ie={docId:i,apiVersion:"5.4.394",data:o,password:a,disableAutoFetch:G,rangeChunkSize:c,length:Re,docBaseUrl:h,enableXfa:_,evaluatorOptions:{maxImageSize:C,disableFontFace:I,ignoreErrors:w,isEvalSupported:M,isOffscreenCanvasSupported:E,isImageDecoderSupported:B,canvasMaxAreaInBytes:S,fontExtraProperties:T,useSystemFonts:ge,useWasm:xe,useWorkerFetch:ee,cMapUrl:p,iccUrl:m,standardFontDataUrl:A,wasmUrl:y}},fe={ownerDocument:O,pdfBug:q,styleElement:$,loadingParams:{disableAutoFetch:G,enableXfa:_}};return d.promise.then(function(){if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const de=d.messageHandler.sendWithPromise("GetDocRequest",ie,o?[o.buffer]:null);let Ae;if(l)Ae=new X_i(l,{disableRange:j,disableStream:N});else if(!o){if(!r)throw new Error("getDocument - no `url` parameter provided.");const Ue=By(r)?tLi:ja?uLi:sLi;Ae=new Ue({url:r,length:Re,httpHeaders:n,withCredentials:s,rangeChunkSize:c,disableRange:j,disableStream:N})}return de.then(Ue=>{if(e.destroyed)throw new Error("Loading aborted");if(d.destroyed)throw new Error("Worker was destroyed");const z=new Sy(i,Ue,d.port),se=new vLi(z,e,Ae,fe,re,ce);e._transport=se,z.send("Ready",null)})}).catch(e._capability.reject),e}class XQ{static#e=0;_capability=Promise.withResolvers();_transport=null;_worker=null;docId=`d${XQ.#e++}`;destroyed=!1;onPassword=null;onProgress=null;get promise(){return this._capability.promise}async destroy(){this.destroyed=!0;try{this._worker?.port&&(this._worker._pendingDestroy=!0),await this._transport?.destroy()}catch(e){throw this._worker?.port&&delete this._worker._pendingDestroy,e}this._transport=null,this._worker?.destroy(),this._worker=null}async getData(){return this._transport.getData()}}class gye{#e=Promise.withResolvers();#t=[];#r=[];#i=[];#o=[];constructor(e,i,r=!1,o=null){this.length=e,this.initialData=i,this.progressiveDone=r,this.contentDispositionFilename=o}addRangeListener(e){this.#o.push(e)}addProgressListener(e){this.#i.push(e)}addProgressiveReadListener(e){this.#r.push(e)}addProgressiveDoneListener(e){this.#t.push(e)}onDataRange(e,i){for(const r of this.#o)r(e,i)}onDataProgress(e,i){this.#e.promise.then(()=>{for(const r of this.#i)r(e,i)})}onDataProgressiveRead(e){this.#e.promise.then(()=>{for(const i of this.#r)i(e)})}onDataProgressiveDone(){this.#e.promise.then(()=>{for(const e of this.#t)e()})}transportReady(){this.#e.resolve()}requestDataRange(e,i){yo("Abstract method PDFDataRangeTransport.requestDataRange")}abort(){}}class ALi{constructor(e,i){this._pdfInfo=e,this._transport=i}get annotationStorage(){return this._transport.annotationStorage}get canvasFactory(){return this._transport.canvasFactory}get filterFactory(){return this._transport.filterFactory}get numPages(){return this._pdfInfo.numPages}get fingerprints(){return this._pdfInfo.fingerprints}get isPureXfa(){return Wi(this,"isPureXfa",!!this._transport._htmlForXfa)}get allXfaHtml(){return this._transport._htmlForXfa}getPage(e){return this._transport.getPage(e)}getPageIndex(e){return this._transport.getPageIndex(e)}getDestinations(){return this._transport.getDestinations()}getDestination(e){return this._transport.getDestination(e)}getPageLabels(){return this._transport.getPageLabels()}getPageLayout(){return this._transport.getPageLayout()}getPageMode(){return this._transport.getPageMode()}getViewerPreferences(){return this._transport.getViewerPreferences()}getOpenAction(){return this._transport.getOpenAction()}getAttachments(){return this._transport.getAttachments()}getAnnotationsByType(e,i){return this._transport.getAnnotationsByType(e,i)}getJSActions(){return this._transport.getDocJSActions()}getOutline(){return this._transport.getOutline()}getOptionalContentConfig({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getOptionalContentConfig(i)}getPermissions(){return this._transport.getPermissions()}getMetadata(){return this._transport.getMetadata()}getMarkInfo(){return this._transport.getMarkInfo()}getData(){return this._transport.getData()}saveDocument(){return this._transport.saveDocument()}getDownloadInfo(){return this._transport.downloadInfoCapability.promise}cleanup(e=!1){return this._transport.startCleanup(e||this.isPureXfa)}destroy(){return this.loadingTask.destroy()}cachedPageNumber(e){return this._transport.cachedPageNumber(e)}get loadingParams(){return this._transport.loadingParams}get loadingTask(){return this._transport.loadingTask}getFieldObjects(){return this._transport.getFieldObjects()}hasJSActions(){return this._transport.hasJSActions()}getCalculationOrderIds(){return this._transport.getCalculationOrderIds()}}class mLi{#e=!1;constructor(e,i,r,o=!1){this._pageIndex=e,this._pageInfo=i,this._transport=r,this._stats=o?new B7e:null,this._pdfBug=o,this.commonObjs=r.commonObjs,this.objs=new hye,this._intentStates=new Map,this.destroyed=!1,this.recordedBBoxes=null}get pageNumber(){return this._pageIndex+1}get rotate(){return this._pageInfo.rotate}get ref(){return this._pageInfo.ref}get userUnit(){return this._pageInfo.userUnit}get view(){return this._pageInfo.view}getViewport({scale:e,rotation:i=this.rotate,offsetX:r=0,offsetY:o=0,dontFlip:n=!1}={}){return new Gb({viewBox:this.view,userUnit:this.userUnit,scale:e,rotation:i,offsetX:r,offsetY:o,dontFlip:n})}getAnnotations({intent:e="display"}={}){const{renderingIntent:i}=this._transport.getRenderingIntent(e);return this._transport.getAnnotations(this._pageIndex,i)}getJSActions(){return this._transport.getPageJSActions(this._pageIndex)}get filterFactory(){return this._transport.filterFactory}get isPureXfa(){return Wi(this,"isPureXfa",!!this._transport._htmlForXfa)}async getXfa(){return this._transport._htmlForXfa?.children[this._pageIndex]||null}render({canvasContext:e,canvas:i=e.canvas,viewport:r,intent:o="display",annotationMode:n=Yp.ENABLE,transform:s=null,background:a=null,optionalContentConfigPromise:l=null,annotationCanvasMap:c=null,pageColors:d=null,printAnnotationStorage:u=null,isEditing:h=!1,recordOperations:p=!1,operationsFilter:g=null}){this._stats?.time("Overall");const f=this._transport.getRenderingIntent(o,n,u,h),{renderingIntent:m,cacheKey:A}=f;this.#e=!1,l||=this._transport.getOptionalContentConfig(m);let v=this._intentStates.get(A);v||(v=Object.create(null),this._intentStates.set(A,v)),v.streamReaderCancelTimeout&&(clearTimeout(v.streamReaderCancelTimeout),v.streamReaderCancelTimeout=null);const y=!!(m&ec.PRINT);v.displayReadyCapability||(v.displayReadyCapability=Promise.withResolvers(),v.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(f));const b=!!(this._pdfBug&&globalThis.StepperManager?.enabled),w=!this.recordedBBoxes&&(p||b),C=B=>{if(v.renderTasks.delete(M),w){const S=M.gfx?.dependencyTracker.take();S&&(M.stepper&&M.stepper.setOperatorBBoxes(S,M.gfx.dependencyTracker.takeDebugMetadata()),p&&(this.recordedBBoxes=S))}y&&(this.#e=!0),this.#t(),B?(M.capability.reject(B),this._abortOperatorList({intentState:v,reason:B instanceof Error?B:new Error(B)})):M.capability.resolve(),this._stats&&(this._stats.timeEnd("Rendering"),this._stats.timeEnd("Overall"),globalThis.Stats?.enabled&&globalThis.Stats.add(this.pageNumber,this._stats))},M=new D6({callback:C,params:{canvas:i,canvasContext:e,dependencyTracker:w?new L_i(i,v.operatorList.length,b):null,viewport:r,transform:s,background:a},objs:this.objs,commonObjs:this.commonObjs,annotationCanvasMap:c,operatorList:v.operatorList,pageIndex:this._pageIndex,canvasFactory:this._transport.canvasFactory,filterFactory:this._transport.filterFactory,useRequestAnimationFrame:!y,pdfBug:this._pdfBug,pageColors:d,enableHWA:this._transport.enableHWA,operationsFilter:g});(v.renderTasks||=new Set).add(M);const E=M.task;return Promise.all([v.displayReadyCapability.promise,l]).then(([B,S])=>{if(this.destroyed){C();return}if(this._stats?.time("Rendering"),!(S.renderingIntent&m))throw new Error("Must use the same `intent`-argument when calling the `PDFPageProxy.render` and `PDFDocumentProxy.getOptionalContentConfig` methods.");M.initializeGraphics({transparency:B,optionalContentConfig:S}),M.operatorListChanged()}).catch(C),E}getOperatorList({intent:e="display",annotationMode:i=Yp.ENABLE,printAnnotationStorage:r=null,isEditing:o=!1}={}){function n(){a.operatorList.lastChunk&&(a.opListReadCapability.resolve(a.operatorList),a.renderTasks.delete(l))}const s=this._transport.getRenderingIntent(e,i,r,o,!0);let a=this._intentStates.get(s.cacheKey);a||(a=Object.create(null),this._intentStates.set(s.cacheKey,a));let l;return a.opListReadCapability||(l=Object.create(null),l.operatorListChanged=n,a.opListReadCapability=Promise.withResolvers(),(a.renderTasks||=new Set).add(l),a.operatorList={fnArray:[],argsArray:[],lastChunk:!1,separateAnnots:null},this._stats?.time("Page Request"),this._pumpOperatorList(s)),a.opListReadCapability.promise}streamTextContent({includeMarkedContent:e=!1,disableNormalization:i=!1}={}){return this._transport.messageHandler.sendWithStream("GetTextContent",{pageIndex:this._pageIndex,includeMarkedContent:e===!0,disableNormalization:i===!0},{highWaterMark:100,size(r){return r.items.length}})}getTextContent(e={}){if(this._transport._htmlForXfa)return this.getXfa().then(r=>qb.textContent(r));const i=this.streamTextContent(e);return new Promise(function(r,o){function n(){s.read().then(function({value:l,done:c}){if(c){r(a);return}a.lang??=l.lang,Object.assign(a.styles,l.styles),a.items.push(...l.items),n()},o)}const s=i.getReader(),a={items:[],styles:Object.create(null),lang:null};n()})}getStructTree(){return this._transport.getStructTree(this._pageIndex)}_destroy(){this.destroyed=!0;const e=[];for(const i of this._intentStates.values())if(this._abortOperatorList({intentState:i,reason:new Error("Page was destroyed."),force:!0}),!i.opListReadCapability)for(const r of i.renderTasks)e.push(r.completed),r.cancel();return this.objs.clear(),this.#e=!1,Promise.all(e)}cleanup(e=!1){this.#e=!0;const i=this.#t();return e&&i&&(this._stats&&=new B7e),i}#t(){if(!this.#e||this.destroyed)return!1;for(const{renderTasks:e,operatorList:i}of this._intentStates.values())if(e.size>0||!i.lastChunk)return!1;return this._intentStates.clear(),this.objs.clear(),this.#e=!1,!0}_startRenderPage(e,i){const r=this._intentStates.get(i);r&&(this._stats?.timeEnd("Page Request"),r.displayReadyCapability?.resolve(e))}_renderPageChunk(e,i){for(let r=0,o=e.length;r<o;r++)i.operatorList.fnArray.push(e.fnArray[r]),i.operatorList.argsArray.push(e.argsArray[r]);i.operatorList.lastChunk=e.lastChunk,i.operatorList.separateAnnots=e.separateAnnots;for(const r of i.renderTasks)r.operatorListChanged();e.lastChunk&&this.#t()}_pumpOperatorList({renderingIntent:e,cacheKey:i,annotationStorageSerializable:r,modifiedIds:o}){const{map:n,transfer:s}=r,a=this._transport.messageHandler.sendWithStream("GetOperatorList",{pageIndex:this._pageIndex,intent:e,cacheKey:i,annotationStorage:n,modifiedIds:o},s).getReader(),l=this._intentStates.get(i);l.streamReader=a;const c=()=>{a.read().then(({value:d,done:u})=>{if(u){l.streamReader=null;return}this._transport.destroyed||(this._renderPageChunk(d,l),c())},d=>{if(l.streamReader=null,!this._transport.destroyed){if(l.operatorList){l.operatorList.lastChunk=!0;for(const u of l.renderTasks)u.operatorListChanged();this.#t()}if(l.displayReadyCapability)l.displayReadyCapability.reject(d);else if(l.opListReadCapability)l.opListReadCapability.reject(d);else throw d}})};c()}_abortOperatorList({intentState:e,reason:i,force:r=!1}){if(e.streamReader){if(e.streamReaderCancelTimeout&&(clearTimeout(e.streamReaderCancelTimeout),e.streamReaderCancelTimeout=null),!r){if(e.renderTasks.size>0)return;if(i instanceof Sq){let o=gLi;i.extraDelay>0&&i.extraDelay<1e3&&(o+=i.extraDelay),e.streamReaderCancelTimeout=setTimeout(()=>{e.streamReaderCancelTimeout=null,this._abortOperatorList({intentState:e,reason:i,force:!0})},o);return}}if(e.streamReader.cancel(new $p(i.message)).catch(()=>{}),e.streamReader=null,!this._transport.destroyed){for(const[o,n]of this._intentStates)if(n===e){this._intentStates.delete(o);break}this.cleanup()}}}get stats(){return this._stats}}var sg,_u,e0,t6,Qq,i6,r6,Pd,RP,Aye,mye,_y,Ly,DP;const Zn=class _b{constructor({name:e=null,port:i=null,verbosity:r=JDi()}={}){if(th(this,Pd),th(this,sg,Promise.withResolvers()),th(this,_u,null),th(this,e0,null),th(this,t6,null),this.name=e,this.destroyed=!1,this.verbosity=r,i){if(Wo(_b,r6).has(i))throw new Error("Cannot use more than one PDFWorker per port.");Wo(_b,r6).set(i,this),ih(this,Pd,Aye).call(this,i)}else ih(this,Pd,mye).call(this)}get promise(){return Wo(this,sg).promise}get port(){return Wo(this,e0)}get messageHandler(){return Wo(this,_u)}destroy(){this.destroyed=!0,Wo(this,t6)?.terminate(),Sl(this,t6,null),Wo(_b,r6).delete(Wo(this,e0)),Sl(this,e0,null),Wo(this,_u)?.destroy(),Sl(this,_u,null)}static create(e){const i=Wo(this,r6).get(e?.port);if(i){if(i._pendingDestroy)throw new Error("PDFWorker.create - the worker is being destroyed.\nPlease remember to await `PDFDocumentLoadingTask.destroy()`-calls.");return i}return new _b(e)}static get workerSrc(){if($5.workerSrc)return $5.workerSrc;throw new Error('No "GlobalWorkerOptions.workerSrc" specified.')}static get _setupFakeWorkerGlobal(){return Wi(this,"_setupFakeWorkerGlobal",(async()=>Wo(this,Ly,DP)?Wo(this,Ly,DP):(await import(this.workerSrc)).WorkerMessageHandler)())}};sg=new WeakMap,_u=new WeakMap,e0=new WeakMap,t6=new WeakMap,Qq=new WeakMap,i6=new WeakMap,r6=new WeakMap,Pd=new WeakSet,RP=function(){Wo(this,sg).resolve(),Wo(this,_u).send("configure",{verbosity:this.verbosity})},Aye=function(t){Sl(this,e0,t),Sl(this,_u,new Sy("main","worker",t)),Wo(this,_u).on("ready",()=>{}),ih(this,Pd,RP).call(this)},mye=function(){if(Wo(Zn,i6)||Wo(Zn,Ly,DP)){ih(this,Pd,_y).call(this);return}let{workerSrc:t}=Zn;try{Zn._isSameOrigin(window.location,t)||(t=Zn._createCDNWrapper(new URL(t,window.location).href));const e=new Worker(t,{type:"module"}),i=new Sy("main","worker",e),r=()=>{o.abort(),i.destroy(),e.terminate(),this.destroyed?Wo(this,sg).reject(new Error("Worker was destroyed")):ih(this,Pd,_y).call(this)},o=new AbortController;e.addEventListener("error",()=>{Wo(this,t6)||r()},{signal:o.signal}),i.on("test",s=>{if(o.abort(),this.destroyed||!s){r();return}Sl(this,_u,i),Sl(this,e0,e),Sl(this,t6,e),ih(this,Pd,RP).call(this)}),i.on("ready",s=>{if(o.abort(),this.destroyed){r();return}try{n()}catch{ih(this,Pd,_y).call(this)}});const n=()=>{const s=new Uint8Array;i.send("test",s,[s.buffer])};n();return}catch{wP("The worker has been disabled.")}ih(this,Pd,_y).call(this)},_y=function(){Wo(Zn,i6)||(ji("Setting up fake worker."),Sl(Zn,i6,!0)),Zn._setupFakeWorkerGlobal.then(t=>{if(this.destroyed){Wo(this,sg).reject(new Error("Worker was destroyed"));return}const e=new E_i;Sl(this,e0,e);const i=`fake${fke(Zn,Qq)._++}`,r=new Sy(i+"_worker",i,e);t.setup(r,e),Sl(this,_u,new Sy(i,i+"_worker",e)),ih(this,Pd,RP).call(this)}).catch(t=>{Wo(this,sg).reject(new Error(`Setting up fake worker failed: "${t.message}".`))})},Ly=new WeakSet,DP=function(){try{return globalThis.pdfjsWorker?.WorkerMessageHandler||null}catch{return null}},th(Zn,Ly),th(Zn,Qq,0),th(Zn,i6,!1),th(Zn,r6,new WeakMap),ja&&(Sl(Zn,i6,!0),$5.workerSrc||="./pdf.worker.mjs"),Zn._isSameOrigin=(t,e)=>{const i=URL.parse(t);if(!i?.origin||i.origin==="null")return!1;const r=new URL(e,i);return i.origin===r.origin},Zn._createCDNWrapper=t=>{const e=`await import("${t}");`;return URL.createObjectURL(new Blob([e],{type:"text/javascript"}))},Zn.fromPort=t=>{if(a_i("`PDFWorker.fromPort` - please use `PDFWorker.create` instead."),!t?.port)throw new Error("PDFWorker.fromPort - invalid method signature.");return Zn.create(t)};let Kq=Zn;class vLi{#e=new Map;#t=new Map;#r=new Map;#i=new Map;#o=null;constructor(e,i,r,o,n,s){this.messageHandler=e,this.loadingTask=i,this.commonObjs=new hye,this.fontLoader=new v_i({ownerDocument:o.ownerDocument,styleElement:o.styleElement}),this.loadingParams=o.loadingParams,this._params=o,this.canvasFactory=n.canvasFactory,this.filterFactory=n.filterFactory,this.cMapReaderFactory=n.cMapReaderFactory,this.standardFontDataFactory=n.standardFontDataFactory,this.wasmFactory=n.wasmFactory,this.destroyed=!1,this.destroyCapability=null,this._networkStream=r,this._fullReader=null,this._lastProgress=null,this.downloadInfoCapability=Promise.withResolvers(),this.enableHWA=s,this.setupMessageHandler()}#n(e,i=null){const r=this.#e.get(e);if(r)return r;const o=this.messageHandler.sendWithPromise(e,i);return this.#e.set(e,o),o}get annotationStorage(){return Wi(this,"annotationStorage",new Fq)}getRenderingIntent(e,i=Yp.ENABLE,r=null,o=!1,n=!1){let s=ec.DISPLAY,a=Lq;switch(e){case"any":s=ec.ANY;break;case"display":break;case"print":s=ec.PRINT;break;default:ji(`getRenderingIntent - invalid intent: ${e}`)}const l=s&ec.PRINT&&r instanceof O7e?r:this.annotationStorage;switch(i){case Yp.DISABLE:s+=ec.ANNOTATIONS_DISABLE;break;case Yp.ENABLE:break;case Yp.ENABLE_FORMS:s+=ec.ANNOTATIONS_FORMS;break;case Yp.ENABLE_STORAGE:s+=ec.ANNOTATIONS_STORAGE,a=l.serializable;break;default:ji(`getRenderingIntent - invalid annotationMode: ${i}`)}o&&(s+=ec.IS_EDITING),n&&(s+=ec.OPLIST);const{ids:c,hash:d}=l.modifiedIds,u=[s,a.hash,d];return{renderingIntent:s,cacheKey:u.join("_"),annotationStorageSerializable:a,modifiedIds:c}}destroy(){if(this.destroyCapability)return this.destroyCapability.promise;this.destroyed=!0,this.destroyCapability=Promise.withResolvers(),this.#o?.reject(new Error("Worker was destroyed during onPassword callback"));const e=[];for(const r of this.#t.values())e.push(r._destroy());this.#t.clear(),this.#r.clear(),this.#i.clear(),this.hasOwnProperty("annotationStorage")&&this.annotationStorage.resetModified();const i=this.messageHandler.sendWithPromise("Terminate",null);return e.push(i),Promise.all(e).then(()=>{this.commonObjs.clear(),this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(),el.cleanup(),this._networkStream?.cancelAllRequests(new $p("Worker was terminated.")),this.messageHandler?.destroy(),this.messageHandler=null,this.destroyCapability.resolve()},this.destroyCapability.reject),this.destroyCapability.promise}setupMessageHandler(){const{messageHandler:e,loadingTask:i}=this;e.on("GetReader",(r,o)=>{Cr(this._networkStream,"GetReader - no `IPDFStream` instance available."),this._fullReader=this._networkStream.getFullReader(),this._fullReader.onProgress=n=>{this._lastProgress={loaded:n.loaded,total:n.total}},o.onPull=()=>{this._fullReader.read().then(function({value:n,done:s}){if(s){o.close();return}Cr(n instanceof ArrayBuffer,"GetReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(n),1,[n])}).catch(n=>{o.error(n)})},o.onCancel=n=>{this._fullReader.cancel(n),o.ready.catch(s=>{if(!this.destroyed)throw s})}}),e.on("ReaderHeadersReady",async r=>{await this._fullReader.headersReady;const{isStreamingSupported:o,isRangeSupported:n,contentLength:s}=this._fullReader;return(!o||!n)&&(this._lastProgress&&i.onProgress?.(this._lastProgress),this._fullReader.onProgress=a=>{i.onProgress?.({loaded:a.loaded,total:a.total})}),{isStreamingSupported:o,isRangeSupported:n,contentLength:s}}),e.on("GetRangeReader",(r,o)=>{Cr(this._networkStream,"GetRangeReader - no `IPDFStream` instance available.");const n=this._networkStream.getRangeReader(r.begin,r.end);if(!n){o.close();return}o.onPull=()=>{n.read().then(function({value:s,done:a}){if(a){o.close();return}Cr(s instanceof ArrayBuffer,"GetRangeReader - expected an ArrayBuffer."),o.enqueue(new Uint8Array(s),1,[s])}).catch(s=>{o.error(s)})},o.onCancel=s=>{n.cancel(s),o.ready.catch(a=>{if(!this.destroyed)throw a})}}),e.on("GetDoc",({pdfInfo:r})=>{this._numPages=r.numPages,this._htmlForXfa=r.htmlForXfa,delete r.htmlForXfa,i._capability.resolve(new ALi(r,this))}),e.on("DocException",r=>{i._capability.reject(yl(r))}),e.on("PasswordRequest",r=>{this.#o=Promise.withResolvers();try{if(!i.onPassword)throw yl(r);const o=n=>{n instanceof Error?this.#o.reject(n):this.#o.resolve({password:n})};i.onPassword(o,r.code)}catch(o){this.#o.reject(o)}return this.#o.promise}),e.on("DataLoaded",r=>{i.onProgress?.({loaded:r.length,total:r.length}),this.downloadInfoCapability.resolve(r)}),e.on("StartRenderPage",r=>{this.destroyed||this.#t.get(r.pageIndex)._startRenderPage(r.transparency,r.cacheKey)}),e.on("commonobj",([r,o,n])=>{if(this.destroyed||this.commonObjs.has(r))return null;switch(o){case"Font":if("error"in n){const u=n.error;ji(`Error during font loading: ${u}`),this.commonObjs.resolve(r,u);break}const s=new b_i(n),a=this._params.pdfBug&&globalThis.FontInspector?.enabled?(u,h)=>globalThis.FontInspector.fontAdded(u,h):null,l=new y_i(s,a,n.extra,n.charProcOperatorList);this.fontLoader.bind(l).catch(()=>e.sendWithPromise("FontFallback",{id:r})).finally(()=>{!l.fontExtraProperties&&l.data&&l.clearData(),this.commonObjs.resolve(r,l)});break;case"CopyLocalImage":const{imageRef:c}=n;Cr(c,"The imageRef must be defined.");for(const u of this.#t.values())for(const[,h]of u.objs)if(h?.ref===c)return h.dataLen?(this.commonObjs.resolve(r,structuredClone(h)),h.dataLen):null;break;case"FontPath":case"Image":this.commonObjs.resolve(r,n);break;case"Pattern":const d=new w_i(n);this.commonObjs.resolve(r,d.getIR());break;default:throw new Error(`Got unknown common object type ${o}`)}return null}),e.on("obj",([r,o,n,s])=>{if(this.destroyed)return;const a=this.#t.get(o);if(!a.objs.has(r)){if(a._intentStates.size===0){s?.bitmap?.close();return}switch(n){case"Image":case"Pattern":a.objs.resolve(r,s);break;default:throw new Error(`Got unknown object type ${n}`)}}}),e.on("DocProgress",r=>{this.destroyed||i.onProgress?.({loaded:r.loaded,total:r.total})}),e.on("FetchBinaryData",async r=>{if(this.destroyed)throw new Error("Worker was destroyed.");const o=this[r.type];if(!o)throw new Error(`${r.type} not initialized, see the \`useWorkerFetch\` parameter.`);return o.fetch(r)})}getData(){return this.messageHandler.sendWithPromise("GetData",null)}saveDocument(){this.annotationStorage.size<=0&&ji("saveDocument called while `annotationStorage` is empty, please use the getData-method instead.");const{map:e,transfer:i}=this.annotationStorage.serializable;return this.messageHandler.sendWithPromise("SaveDocument",{isPureXfa:!!this._htmlForXfa,numPages:this._numPages,annotationStorage:e,filename:this._fullReader?.filename??null},i).finally(()=>{this.annotationStorage.resetModified()})}getPage(e){if(!Number.isInteger(e)||e<=0||e>this._numPages)return Promise.reject(new Error("Invalid page request."));const i=e-1,r=this.#r.get(i);if(r)return r;const o=this.messageHandler.sendWithPromise("GetPage",{pageIndex:i}).then(n=>{if(this.destroyed)throw new Error("Transport destroyed");n.refStr&&this.#i.set(n.refStr,e);const s=new mLi(i,n,this,this._params.pdfBug);return this.#t.set(i,s),s});return this.#r.set(i,o),o}getPageIndex(e){return Oq(e)?this.messageHandler.sendWithPromise("GetPageIndex",{num:e.num,gen:e.gen}):Promise.reject(new Error("Invalid pageIndex request."))}getAnnotations(e,i){return this.messageHandler.sendWithPromise("GetAnnotations",{pageIndex:e,intent:i})}getFieldObjects(){return this.#n("GetFieldObjects")}hasJSActions(){return this.#n("HasJSActions")}getCalculationOrderIds(){return this.messageHandler.sendWithPromise("GetCalculationOrderIds",null)}getDestinations(){return this.messageHandler.sendWithPromise("GetDestinations",null)}getDestination(e){return typeof e!="string"?Promise.reject(new Error("Invalid destination request.")):this.messageHandler.sendWithPromise("GetDestination",{id:e})}getPageLabels(){return this.messageHandler.sendWithPromise("GetPageLabels",null)}getPageLayout(){return this.messageHandler.sendWithPromise("GetPageLayout",null)}getPageMode(){return this.messageHandler.sendWithPromise("GetPageMode",null)}getViewerPreferences(){return this.messageHandler.sendWithPromise("GetViewerPreferences",null)}getOpenAction(){return this.messageHandler.sendWithPromise("GetOpenAction",null)}getAttachments(){return this.messageHandler.sendWithPromise("GetAttachments",null)}getAnnotationsByType(e,i){return this.messageHandler.sendWithPromise("GetAnnotationsByType",{types:e,pageIndexesToSkip:i})}getDocJSActions(){return this.#n("GetDocJSActions")}getPageJSActions(e){return this.messageHandler.sendWithPromise("GetPageJSActions",{pageIndex:e})}getStructTree(e){return this.messageHandler.sendWithPromise("GetStructTree",{pageIndex:e})}getOutline(){return this.messageHandler.sendWithPromise("GetOutline",null)}getOptionalContentConfig(e){return this.#n("GetOptionalContentConfig").then(i=>new Z_i(i,e))}getPermissions(){return this.messageHandler.sendWithPromise("GetPermissions",null)}getMetadata(){const e="GetMetadata",i=this.#e.get(e);if(i)return i;const r=this.messageHandler.sendWithPromise(e,null).then(o=>({info:o[0],metadata:o[1]?new W_i(o[1]):null,contentDispositionFilename:this._fullReader?.filename??null,contentLength:this._fullReader?.contentLength??null}));return this.#e.set(e,r),r}getMarkInfo(){return this.messageHandler.sendWithPromise("GetMarkInfo",null)}async startCleanup(e=!1){if(!this.destroyed){await this.messageHandler.sendWithPromise("Cleanup",null);for(const i of this.#t.values())if(!i.cleanup())throw new Error(`startCleanup: Page ${i.pageNumber} is currently rendering.`);this.commonObjs.clear(),e||this.fontLoader.clear(),this.#e.clear(),this.filterFactory.destroy(!0),el.cleanup()}}cachedPageNumber(e){if(!Oq(e))return null;const i=e.gen===0?`${e.num}R`:`${e.num}R${e.gen}`;return this.#i.get(i)??null}}class yLi{#e=null;onContinue=null;onError=null;constructor(e){this.#e=e}get promise(){return this.#e.capability.promise}cancel(e=0){this.#e.cancel(null,e)}get separateAnnots(){const{separateAnnots:e}=this.#e.operatorList;if(!e)return!1;const{annotationCanvasMap:i}=this.#e;return e.form||e.canvas&&i?.size>0}}class D6{#e=null;static#t=new WeakSet;constructor({callback:e,params:i,objs:r,commonObjs:o,annotationCanvasMap:n,operatorList:s,pageIndex:a,canvasFactory:l,filterFactory:c,useRequestAnimationFrame:d=!1,pdfBug:u=!1,pageColors:h=null,enableHWA:p=!1,operationsFilter:g=null}){this.callback=e,this.params=i,this.objs=r,this.commonObjs=o,this.annotationCanvasMap=n,this.operatorListIdx=null,this.operatorList=s,this._pageIndex=a,this.canvasFactory=l,this.filterFactory=c,this._pdfBug=u,this.pageColors=h,this.running=!1,this.graphicsReadyCallback=null,this.graphicsReady=!1,this._useRequestAnimationFrame=d===!0&&typeof window<"u",this.cancelled=!1,this.capability=Promise.withResolvers(),this.task=new yLi(this),this._cancelBound=this.cancel.bind(this),this._continueBound=this._continue.bind(this),this._scheduleNextBound=this._scheduleNext.bind(this),this._nextBound=this._next.bind(this),this._canvas=i.canvas,this._canvasContext=i.canvas?null:i.canvasContext,this._enableHWA=p,this._dependencyTracker=i.dependencyTracker,this._operationsFilter=g}get completed(){return this.capability.promise.catch(function(){})}initializeGraphics({transparency:e=!1,optionalContentConfig:i}){if(this.cancelled)return;if(this._canvas){if(D6.#t.has(this._canvas))throw new Error("Cannot use the same canvas during multiple render() operations. Use different canvas or ensure previous operations were cancelled or completed.");D6.#t.add(this._canvas)}this._pdfBug&&globalThis.StepperManager?.enabled&&(this.stepper=globalThis.StepperManager.create(this._pageIndex),this.stepper.init(this.operatorList),this.stepper.nextBreakPoint=this.stepper.getNextBreakPoint());const{viewport:r,transform:o,background:n,dependencyTracker:s}=this.params,a=this._canvasContext||this._canvas.getContext("2d",{alpha:!1,willReadFrequently:!this._enableHWA});this.gfx=new R6(a,this.commonObjs,this.objs,this.canvasFactory,this.filterFactory,{optionalContentConfig:i},this.annotationCanvasMap,this.pageColors,s),this.gfx.beginDrawing({transform:o,viewport:r,transparency:e,background:n}),this.operatorListIdx=0,this.graphicsReady=!0,this.graphicsReadyCallback?.()}cancel(e=null,i=0){this.running=!1,this.cancelled=!0,this.gfx?.endDrawing(),this.#e&&(window.cancelAnimationFrame(this.#e),this.#e=null),D6.#t.delete(this._canvas),e||=new Sq(`Rendering cancelled, page ${this._pageIndex+1}`,i),this.callback(e),this.task.onError?.(e)}operatorListChanged(){if(!this.graphicsReady){this.graphicsReadyCallback||=this._continueBound;return}this.gfx.dependencyTracker?.growOperationsCount(this.operatorList.fnArray.length),this.stepper?.updateOperatorList(this.operatorList),!this.running&&this._continue()}_continue(){this.running=!0,!this.cancelled&&(this.task.onContinue?this.task.onContinue(this._scheduleNextBound):this._scheduleNext())}_scheduleNext(){this._useRequestAnimationFrame?this.#e=window.requestAnimationFrame(()=>{this.#e=null,this._nextBound().catch(this._cancelBound)}):Promise.resolve().then(this._nextBound).catch(this._cancelBound)}async _next(){this.cancelled||(this.operatorListIdx=this.gfx.executeOperatorList(this.operatorList,this.operatorListIdx,this._continueBound,this.stepper,this._operationsFilter),this.operatorListIdx===this.operatorList.argsArray.length&&(this.running=!1,this.operatorList.lastChunk&&(this.gfx.endDrawing(),D6.#t.delete(this._canvas),this.callback())))}}const bLi="5.4.394",wLi="2cc809ade";class Wc{#e=null;#t=null;#r;#i=null;#o=!1;#n=!1;#s=null;#a;#l=null;#c=null;static#h=null;static get _keyboardManager(){return Wi(this,"_keyboardManager",new Iy([[["Escape","mac+Escape"],Wc.prototype._hideDropdownFromKeyboard],[[" ","mac+ "],Wc.prototype._colorSelectFromKeyboard],[["ArrowDown","ArrowRight","mac+ArrowDown","mac+ArrowRight"],Wc.prototype._moveToNext],[["ArrowUp","ArrowLeft","mac+ArrowUp","mac+ArrowLeft"],Wc.prototype._moveToPrevious],[["Home","mac+Home"],Wc.prototype._moveToBeginning],[["End","mac+End"],Wc.prototype._moveToEnd]]))}constructor({editor:e=null,uiManager:i=null}){e?(this.#n=!1,this.#s=e):this.#n=!0,this.#c=e?._uiManager||i,this.#a=this.#c._eventBus,this.#r=e?.color?.toUpperCase()||this.#c?.highlightColors.values().next().value||"#FFFF98",Wc.#h||=Object.freeze({blue:"pdfjs-editor-colorpicker-blue",green:"pdfjs-editor-colorpicker-green",pink:"pdfjs-editor-colorpicker-pink",red:"pdfjs-editor-colorpicker-red",yellow:"pdfjs-editor-colorpicker-yellow"})}renderButton(){const e=this.#e=document.createElement("button");e.className="colorPicker",e.tabIndex="0",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-button"),e.ariaHasPopup="true",this.#s&&(e.ariaControls=`${this.#s.id}_colorpicker_dropdown`);const i=this.#c._signal;e.addEventListener("click",this.#g.bind(this),{signal:i}),e.addEventListener("keydown",this.#A.bind(this),{signal:i});const r=this.#t=document.createElement("span");return r.className="swatch",r.ariaHidden="true",r.style.backgroundColor=this.#r,e.append(r),e}renderMainDropdown(){const e=this.#i=this.#u();return e.ariaOrientation="horizontal",e.ariaLabelledBy="highlightColorPickerLabel",e}#u(){const e=document.createElement("div"),i=this.#c._signal;e.addEventListener("contextmenu",Fc,{signal:i}),e.className="dropdown",e.role="listbox",e.ariaMultiSelectable="false",e.ariaOrientation="vertical",e.setAttribute("data-l10n-id","pdfjs-editor-colorpicker-dropdown"),this.#s&&(e.id=`${this.#s.id}_colorpicker_dropdown`);for(const[r,o]of this.#c.highlightColors){const n=document.createElement("button");n.tabIndex="0",n.role="option",n.setAttribute("data-color",o),n.title=r,n.setAttribute("data-l10n-id",Wc.#h[r]);const s=document.createElement("span");n.append(s),s.className="swatch",s.style.backgroundColor=o,n.ariaSelected=o===this.#r,n.addEventListener("click",this.#p.bind(this,o),{signal:i}),e.append(n)}return e.addEventListener("keydown",this.#A.bind(this),{signal:i}),e}#p(e,i){i.stopPropagation(),this.#a.dispatch("switchannotationeditorparams",{source:this,type:wr.HIGHLIGHT_COLOR,value:e}),this.updateColor(e)}_colorSelectFromKeyboard(e){if(e.target===this.#e){this.#g(e);return}const i=e.target.getAttribute("data-color");i&&this.#p(i,e)}_moveToNext(e){if(!this.#f){this.#g(e);return}if(e.target===this.#e){this.#i.firstChild?.focus();return}e.target.nextSibling?.focus()}_moveToPrevious(e){if(e.target===this.#i?.firstChild||e.target===this.#e){this.#f&&this._hideDropdownFromKeyboard();return}this.#f||this.#g(e),e.target.previousSibling?.focus()}_moveToBeginning(e){if(!this.#f){this.#g(e);return}this.#i.firstChild?.focus()}_moveToEnd(e){if(!this.#f){this.#g(e);return}this.#i.lastChild?.focus()}#A(e){Wc._keyboardManager.exec(this,e)}#g(e){if(this.#f){this.hideDropdown();return}if(this.#o=e.detail===0,this.#l||(this.#l=new AbortController,window.addEventListener("pointerdown",this.#d.bind(this),{signal:this.#c.combinedSignal(this.#l)})),this.#e.ariaExpanded="true",this.#i){this.#i.classList.remove("hidden");return}const i=this.#i=this.#u();this.#e.append(i)}#d(e){this.#i?.contains(e.target)||this.hideDropdown()}hideDropdown(){this.#i?.classList.add("hidden"),this.#e.ariaExpanded="false",this.#l?.abort(),this.#l=null}get#f(){return this.#i&&!this.#i.classList.contains("hidden")}_hideDropdownFromKeyboard(){if(!this.#n){if(!this.#f){this.#s?.unselect();return}this.hideDropdown(),this.#e.focus({preventScroll:!0,focusVisible:this.#o})}}updateColor(e){if(this.#t&&(this.#t.style.backgroundColor=e),!this.#i)return;const i=this.#c.highlightColors.values();for(const r of this.#i.children)r.ariaSelected=i.next().value===e.toUpperCase()}destroy(){this.#e?.remove(),this.#e=null,this.#t=null,this.#i?.remove(),this.#i=null}}class tw{#e=null;#t=null;#r=null;static#i=null;constructor(e){this.#t=e,this.#r=e._uiManager,tw.#i||=Object.freeze({freetext:"pdfjs-editor-color-picker-free-text-input",ink:"pdfjs-editor-color-picker-ink-input"})}renderButton(){if(this.#e)return this.#e;const{editorType:e,colorType:i,color:r}=this.#t,o=this.#e=document.createElement("input");return o.type="color",o.value=r||"#000000",o.className="basicColorPicker",o.tabIndex=0,o.setAttribute("data-l10n-id",tw.#i[e]),o.addEventListener("input",()=>{this.#r.updateParams(i,o.value)},{signal:this.#r._signal}),o}update(e){this.#e&&(this.#e.value=e)}destroy(){this.#e?.remove(),this.#e=null}hideDropdown(){}}function vye(t){return Math.floor(Math.max(0,Math.min(1,t))*255).toString(16).padStart(2,"0")}function Fy(t){return Math.max(0,Math.min(255,255*t))}class yye{static CMYK_G([e,i,r,o]){return["G",1-Math.min(1,.3*e+.59*r+.11*i+o)]}static G_CMYK([e]){return["CMYK",0,0,0,1-e]}static G_RGB([e]){return["RGB",e,e,e]}static G_rgb([e]){return e=Fy(e),[e,e,e]}static G_HTML([e]){const i=vye(e);return`#${i}${i}${i}`}static RGB_G([e,i,r]){return["G",.3*e+.59*i+.11*r]}static RGB_rgb(e){return e.map(Fy)}static RGB_HTML(e){return`#${e.map(vye).join("")}`}static T_HTML(){return"#00000000"}static T_rgb(){return[null]}static CMYK_RGB([e,i,r,o]){return["RGB",1-Math.min(1,e+o),1-Math.min(1,r+o),1-Math.min(1,i+o)]}static CMYK_rgb([e,i,r,o]){return[Fy(1-Math.min(1,e+o)),Fy(1-Math.min(1,r+o)),Fy(1-Math.min(1,i+o))]}static CMYK_HTML(e){const i=this.CMYK_RGB(e).slice(1);return this.RGB_HTML(i)}static RGB_CMYK([e,i,r]){const o=1-e,n=1-i,s=1-r,a=Math.min(o,n,s);return["CMYK",o,n,s,a]}}class CLi{create(e,i,r=!1){if(e<=0||i<=0)throw new Error("Invalid SVG dimensions");const o=this._createSVG("svg:svg");return o.setAttribute("version","1.1"),r||(o.setAttribute("width",`${e}px`),o.setAttribute("height",`${i}px`)),o.setAttribute("preserveAspectRatio","none"),o.setAttribute("viewBox",`0 0 ${e} ${i}`),o}createElement(e){if(typeof e!="string")throw new Error("Invalid SVG element type");return this._createSVG(e)}_createSVG(e){yo("Abstract method `_createSVG` called.")}}class _P extends CLi{_createSVG(e){return document.createElementNS(l1,e)}}const xLi=9,ag=new WeakSet,kLi=new Date().getTimezoneOffset()*60*1e3;class Wq{static create(e){switch(e.data.annotationType){case Un.LINK:return new Jq(e);case Un.TEXT:return new ELi(e);case Un.WIDGET:switch(e.data.fieldType){case"Tx":return new BLi(e);case"Btn":return e.data.radioButton?new bye(e):e.data.checkBox?new ILi(e):new SLi(e);case"Ch":return new TLi(e);case"Sig":return new PLi(e)}return new lg(e);case Un.POPUP:return new Zq(e);case Un.FREETEXT:return new wye(e);case Un.LINE:return new DLi(e);case Un.SQUARE:return new _Li(e);case Un.CIRCLE:return new LLi(e);case Un.POLYLINE:return new Cye(e);case Un.CARET:return new OLi(e);case Un.INK:return new Xq(e);case Un.POLYGON:return new FLi(e);case Un.HIGHLIGHT:return new xye(e);case Un.UNDERLINE:return new ULi(e);case Un.SQUIGGLY:return new NLi(e);case Un.STRIKEOUT:return new jLi(e);case Un.STAMP:return new kye(e);case Un.FILEATTACHMENT:return new HLi(e);default:return new tn(e)}}}class tn{#e=null;#t=!1;#r=null;constructor(e,{isRenderable:i=!1,ignoreBorder:r=!1,createQuadrilaterals:o=!1}={}){this.isRenderable=i,this.data=e.data,this.layer=e.layer,this.linkService=e.linkService,this.downloadManager=e.downloadManager,this.imageResourcesPath=e.imageResourcesPath,this.renderForms=e.renderForms,this.svgFactory=e.svgFactory,this.annotationStorage=e.annotationStorage,this.enableComment=e.enableComment,this.enableScripting=e.enableScripting,this.hasJSActions=e.hasJSActions,this._fieldObjects=e.fieldObjects,this.parent=e.parent,this.hasOwnCommentButton=!1,i&&(this.contentElement=this.container=this._createContainer(r)),o&&this._createQuadrilaterals()}static _hasPopupData({contentsObj:e,richText:i}){return!!(e?.str||i?.str)}get _isEditable(){return this.data.isEditable}get hasPopupData(){return tn._hasPopupData(this.data)||this.enableComment&&!!this.commentText}get commentData(){const{data:e}=this,i=this.annotationStorage?.getEditor(e.id);return i?i.getData():e}get hasCommentButton(){return this.enableComment&&this.hasPopupElement}get commentButtonPosition(){const e=this.annotationStorage?.getEditor(this.data.id);if(e)return e.commentButtonPositionInPage;const{quadPoints:i,inkLists:r,rect:o}=this.data;let n=-1/0,s=-1/0;if(i?.length>=8){for(let a=0;a<i.length;a+=8)i[a+1]>s?(s=i[a+1],n=i[a+2]):i[a+1]===s&&(n=Math.max(n,i[a+2]));return[n,s]}if(r?.length>=1){for(const a of r)for(let l=0,c=a.length;l<c;l+=2)a[l+1]>s?(s=a[l+1],n=a[l]):a[l+1]===s&&(n=Math.max(n,a[l]));if(n!==1/0)return[n,s]}return o?[o[2],o[3]]:null}_normalizePoint(e){const{page:{view:i},viewport:{rawDims:{pageWidth:r,pageHeight:o,pageX:n,pageY:s}}}=this.parent;return e[1]=i[3]-e[1]+i[1],e[0]=100*(e[0]-n)/r,e[1]=100*(e[1]-s)/o,e}get commentText(){const{data:e}=this;return this.annotationStorage.getRawValue(`${Cy}${e.id}`)?.popup?.contents||e.contentsObj?.str||""}set commentText(e){const{data:i}=this,r={deleted:!e,contents:e||""};this.annotationStorage.updateEditor(i.id,{popup:r})||this.annotationStorage.setValue(`${Cy}${i.id}`,{id:i.id,annotationType:i.annotationType,pageIndex:this.parent.page._pageIndex,popup:r,popupRef:i.popupRef,modificationDate:new Date}),e||this.removePopup()}removePopup(){(this.#r?.popup||this.popup)?.remove(),this.#r=this.popup=null}updateEdited(e){if(!this.container)return;e.rect&&(this.#e||={rect:this.data.rect.slice(0)});const{rect:i,popup:r}=e;i&&this.#i(i);let o=this.#r?.popup||this.popup;!o&&r?.text&&(this._createPopup(r),o=this.#r.popup),o&&(o.updateEdited(e),r?.deleted&&(o.remove(),this.#r=null,this.popup=null))}resetEdited(){this.#e&&(this.#i(this.#e.rect),this.#r?.popup.resetEdited(),this.#e=null)}#i(e){const{container:{style:i},data:{rect:r,rotation:o},parent:{viewport:{rawDims:{pageWidth:n,pageHeight:s,pageX:a,pageY:l}}}}=this;r?.splice(0,4,...e),i.left=`${100*(e[0]-a)/n}%`,i.top=`${100*(s-e[3]+l)/s}%`,o===0?(i.width=`${100*(e[2]-e[0])/n}%`,i.height=`${100*(e[3]-e[1])/s}%`):this.setRotation(o)}_createContainer(e){const{data:i,parent:{page:r,viewport:o}}=this,n=document.createElement("section");n.setAttribute("data-annotation-id",i.id),!(this instanceof lg)&&!(this instanceof Jq)&&(n.tabIndex=0);const{style:s}=n;if(s.zIndex=this.parent.zIndex,this.parent.zIndex+=2,i.alternativeText&&(n.title=i.alternativeText),i.noRotate&&n.classList.add("norotate"),!i.rect||this instanceof Zq){const{rotation:f}=i;return!i.hasOwnCanvas&&f!==0&&this.setRotation(f,n),n}const{width:a,height:l}=this;if(!e&&i.borderStyle.width>0){s.borderWidth=`${i.borderStyle.width}px`;const f=i.borderStyle.horizontalCornerRadius,m=i.borderStyle.verticalCornerRadius;if(f>0||m>0){const v=`calc(${f}px * var(--total-scale-factor)) / calc(${m}px * var(--total-scale-factor))`;s.borderRadius=v}else if(this instanceof bye){const v=`calc(${a}px * var(--total-scale-factor)) / calc(${l}px * var(--total-scale-factor))`;s.borderRadius=v}switch(i.borderStyle.style){case W5.SOLID:s.borderStyle="solid";break;case W5.DASHED:s.borderStyle="dashed";break;case W5.BEVELED:ji("Unimplemented border style: beveled");break;case W5.INSET:ji("Unimplemented border style: inset");break;case W5.UNDERLINE:s.borderBottomStyle="solid";break}const A=i.borderColor||null;A?(this.#t=!0,s.borderColor=si.makeHexColor(A[0]|0,A[1]|0,A[2]|0)):s.borderWidth=0}const c=si.normalizeRect([i.rect[0],r.view[3]-i.rect[1]+r.view[1],i.rect[2],r.view[3]-i.rect[3]+r.view[1]]),{pageWidth:d,pageHeight:u,pageX:h,pageY:p}=o.rawDims;s.left=`${100*(c[0]-h)/d}%`,s.top=`${100*(c[1]-p)/u}%`;const{rotation:g}=i;return i.hasOwnCanvas||g===0?(s.width=`${100*a/d}%`,s.height=`${100*l/u}%`):this.setRotation(g,n),n}setRotation(e,i=this.container){if(!this.data.rect)return;const{pageWidth:r,pageHeight:o}=this.parent.viewport.rawDims;let{width:n,height:s}=this;e%180!==0&&([n,s]=[s,n]),i.style.width=`${100*n/r}%`,i.style.height=`${100*s/o}%`,i.setAttribute("data-main-rotation",(360-e)%360)}get _commonActions(){const e=(i,r,o)=>{const n=o.detail[i],s=n[0],a=n.slice(1);o.target.style[r]=yye[`${s}_HTML`](a),this.annotationStorage.setValue(this.data.id,{[r]:yye[`${s}_rgb`](a)})};return Wi(this,"_commonActions",{display:i=>{const{display:r}=i.detail,o=r%2===1;this.container.style.visibility=o?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noView:o,noPrint:r===1||r===2})},print:i=>{this.annotationStorage.setValue(this.data.id,{noPrint:!i.detail.print})},hidden:i=>{const{hidden:r}=i.detail;this.container.style.visibility=r?"hidden":"visible",this.annotationStorage.setValue(this.data.id,{noPrint:r,noView:r})},focus:i=>{setTimeout(()=>i.target.focus({preventScroll:!1}),0)},userName:i=>{i.target.title=i.detail.userName},readonly:i=>{i.target.disabled=i.detail.readonly},required:i=>{this._setRequired(i.target,i.detail.required)},bgColor:i=>{e("bgColor","backgroundColor",i)},fillColor:i=>{e("fillColor","backgroundColor",i)},fgColor:i=>{e("fgColor","color",i)},textColor:i=>{e("textColor","color",i)},borderColor:i=>{e("borderColor","borderColor",i)},strokeColor:i=>{e("strokeColor","borderColor",i)},rotation:i=>{const r=i.detail.rotation;this.setRotation(r),this.annotationStorage.setValue(this.data.id,{rotation:r})}})}_dispatchEventFromSandbox(e,i){const r=this._commonActions;for(const o of Object.keys(i.detail))(e[o]||r[o])?.(i)}_setDefaultPropertiesFromJS(e){if(!this.enableScripting)return;const i=this.annotationStorage.getRawValue(this.data.id);if(!i)return;const r=this._commonActions;for(const[o,n]of Object.entries(i)){const s=r[o];if(s){const a={detail:{[o]:n},target:e};s(a),delete i[o]}}}_createQuadrilaterals(){if(!this.container)return;const{quadPoints:e}=this.data;if(!e)return;const[i,r,o,n]=this.data.rect.map(f=>Math.fround(f));if(e.length===8){const[f,m,A,v]=e.subarray(2,6);if(o===f&&n===m&&i===A&&r===v)return}const{style:s}=this.container;let a;if(this.#t){const{borderColor:f,borderWidth:m}=s;s.borderWidth=0,a=["url('data:image/svg+xml;utf8,",'<svg xmlns="http://www.w3.org/2000/svg"',' preserveAspectRatio="none" viewBox="0 0 1 1">',`<g fill="transparent" stroke="${f}" stroke-width="${m}">`],this.container.classList.add("hasBorder")}const l=o-i,c=n-r,{svgFactory:d}=this,u=d.createElement("svg");u.classList.add("quadrilateralsContainer"),u.setAttribute("width",0),u.setAttribute("height",0),u.role="none";const h=d.createElement("defs");u.append(h);const p=d.createElement("clipPath"),g=`clippath_${this.data.id}`;p.setAttribute("id",g),p.setAttribute("clipPathUnits","objectBoundingBox"),h.append(p);for(let f=2,m=e.length;f<m;f+=8){const A=e[f],v=e[f+1],y=e[f+2],b=e[f+3],w=d.createElement("rect"),C=(y-i)/l,M=(n-v)/c,E=(A-y)/l,B=(v-b)/c;w.setAttribute("x",C),w.setAttribute("y",M),w.setAttribute("width",E),w.setAttribute("height",B),p.append(w),a?.push(`<rect vector-effect="non-scaling-stroke" x="${C}" y="${M}" width="${E}" height="${B}"/>`)}this.#t&&(a.push("</g></svg>')"),s.backgroundImage=a.join("")),this.container.append(u),this.container.style.clipPath=`url(#${g})`}_createPopup(e=null){const{data:i}=this;let r,o;e?(r={str:e.text},o=e.date):(r=i.contentsObj,o=i.modificationDate),this.#r=new Zq({data:{color:i.color,titleObj:i.titleObj,modificationDate:o,contentsObj:r,richText:i.richText,parentRect:i.rect,borderStyle:0,id:`popup_${i.id}`,rotation:i.rotation,noRotate:!0},linkService:this.linkService,parent:this.parent,elements:[this]})}get hasPopupElement(){return!!(this.#r||this.popup||this.data.popupRef)}get extraPopupElement(){return this.#r}render(){yo("Abstract method `AnnotationElement.render` called")}_getElementsByName(e,i=null){const r=[];if(this._fieldObjects){const o=this._fieldObjects[e];if(o)for(const{page:n,id:s,exportValues:a}of o){if(n===-1||s===i)continue;const l=typeof a=="string"?a:null,c=document.querySelector(`[data-element-id="${s}"]`);if(c&&!ag.has(c)){ji(`_getElementsByName - element not allowed: ${s}`);continue}r.push({id:s,exportValue:l,domElement:c})}return r}for(const o of document.getElementsByName(e)){const{exportValue:n}=o,s=o.getAttribute("data-element-id");s!==i&&ag.has(o)&&r.push({id:s,exportValue:n,domElement:o})}return r}show(){this.container&&(this.container.hidden=!1),this.popup?.maybeShow()}hide(){this.container&&(this.container.hidden=!0),this.popup?.forceHide()}getElementsToTriggerPopup(){return this.container}addHighlightArea(){const e=this.getElementsToTriggerPopup();if(Array.isArray(e))for(const i of e)i.classList.add("highlightArea");else e.classList.add("highlightArea")}_editOnDoubleClick(){if(!this._isEditable)return;const{annotationEditorType:e,data:{id:i}}=this;this.container.addEventListener("dblclick",()=>{this.linkService.eventBus?.dispatch("switchannotationeditormode",{source:this,mode:e,editId:i,mustEnterInEditMode:!0})})}get width(){return this.data.rect[2]-this.data.rect[0]}get height(){return this.data.rect[3]-this.data.rect[1]}}class MLi extends tn{constructor(e){super(e,{isRenderable:!0,ignoreBorder:!0}),this.editor=e.editor}render(){return this.container.className="editorAnnotation",this.container}createOrUpdatePopup(){const{editor:e}=this;e.hasComment&&this._createPopup(e.comment)}get hasCommentButton(){return this.enableComment&&this.editor.hasComment}get commentButtonPosition(){return this.editor.commentButtonPositionInPage}get commentText(){return this.editor.comment.text}set commentText(e){this.editor.comment=e,e||this.removePopup()}get commentData(){return this.editor.getData()}remove(){this.parent.removeAnnotation(this.data.id),this.container.remove(),this.container=null,this.removePopup()}}class Jq extends tn{constructor(e,i=null){super(e,{isRenderable:!0,ignoreBorder:!!i?.ignoreBorder,createQuadrilaterals:!0}),this.isTooltipOnly=e.data.isTooltipOnly}render(){const{data:e,linkService:i}=this,r=document.createElement("a");r.setAttribute("data-element-id",e.id);let o=!1;return e.url?(i.addLinkAttributes(r,e.url,e.newWindow),o=!0):e.action?(this._bindNamedAction(r,e.action,e.overlaidText),o=!0):e.attachment?(this.#t(r,e.attachment,e.overlaidText,e.attachmentDest),o=!0):e.setOCGState?(this.#r(r,e.setOCGState,e.overlaidText),o=!0):e.dest?(this._bindLink(r,e.dest,e.overlaidText),o=!0):(e.actions&&(e.actions.Action||e.actions["Mouse Up"]||e.actions["Mouse Down"])&&this.enableScripting&&this.hasJSActions&&(this._bindJSAction(r,e),o=!0),e.resetForm?(this._bindResetFormAction(r,e.resetForm),o=!0):this.isTooltipOnly&&!o&&(this._bindLink(r,""),o=!0)),this.container.classList.add("linkAnnotation"),o&&(this.contentElement=r,this.container.append(r)),this.container}#e(){this.container.setAttribute("data-internal-link","")}_bindLink(e,i,r=""){e.href=this.linkService.getDestinationHash(i),e.onclick=()=>(i&&this.linkService.goToDestination(i),!1),(i||i==="")&&this.#e(),r&&(e.title=r)}_bindNamedAction(e,i,r=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeNamedAction(i),!1),r&&(e.title=r),this.#e()}#t(e,i,r="",o=null){e.href=this.linkService.getAnchorUrl(""),i.description?e.title=i.description:r&&(e.title=r),e.onclick=()=>(this.downloadManager?.openOrDownloadData(i.content,i.filename,o),!1),this.#e()}#r(e,i,r=""){e.href=this.linkService.getAnchorUrl(""),e.onclick=()=>(this.linkService.executeSetOCGState(i),!1),r&&(e.title=r),this.#e()}_bindJSAction(e,i){e.href=this.linkService.getAnchorUrl("");const r=new Map([["Action","onclick"],["Mouse Up","onmouseup"],["Mouse Down","onmousedown"]]);for(const o of Object.keys(i.actions)){const n=r.get(o);n&&(e[n]=()=>(this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i.id,name:o}}),!1))}i.overlaidText&&(e.title=i.overlaidText),e.onclick||(e.onclick=()=>!1),this.#e()}_bindResetFormAction(e,i){const r=e.onclick;if(r||(e.href=this.linkService.getAnchorUrl("")),this.#e(),!this._fieldObjects){ji('_bindResetFormAction - "resetForm" action not supported, ensure that the `fieldObjects` parameter is provided.'),r||(e.onclick=()=>!1);return}e.onclick=()=>{r?.();const{fields:o,refs:n,include:s}=i,a=[];if(o.length!==0||n.length!==0){const d=new Set(n);for(const u of o){const h=this._fieldObjects[u]||[];for(const{id:p}of h)d.add(p)}for(const u of Object.values(this._fieldObjects))for(const h of u)d.has(h.id)===s&&a.push(h)}else for(const d of Object.values(this._fieldObjects))a.push(...d);const l=this.annotationStorage,c=[];for(const d of a){const{id:u}=d;switch(c.push(u),d.type){case"text":{const p=d.defaultValue||"";l.setValue(u,{value:p});break}case"checkbox":case"radiobutton":{const p=d.defaultValue===d.exportValues;l.setValue(u,{value:p});break}case"combobox":case"listbox":{const p=d.defaultValue||"";l.setValue(u,{value:p});break}default:continue}const h=document.querySelector(`[data-element-id="${u}"]`);if(h){if(!ag.has(h)){ji(`_bindResetFormAction - element not allowed: ${u}`);continue}}else continue;h.dispatchEvent(new Event("resetform"))}return this.enableScripting&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:"app",ids:c,name:"ResetForm"}}),!1}}}class ELi extends tn{constructor(e){super(e,{isRenderable:!0})}render(){this.container.classList.add("textAnnotation");const e=document.createElement("img");return e.src=this.imageResourcesPath+"annotation-"+this.data.name.toLowerCase()+".svg",e.setAttribute("data-l10n-id","pdfjs-text-annotation-type"),e.setAttribute("data-l10n-args",JSON.stringify({type:this.data.name})),!this.data.popupRef&&this.hasPopupData&&(this.hasOwnCommentButton=!0,this._createPopup()),this.container.append(e),this.container}}class lg extends tn{render(){return this.container}showElementAndHideCanvas(e){this.data.hasOwnCanvas&&(e.previousSibling?.nodeName==="CANVAS"&&(e.previousSibling.hidden=!0),e.hidden=!1)}_getKeyModifier(e){return Fs.platform.isMac?e.metaKey:e.ctrlKey}_setEventListener(e,i,r,o,n){r.includes("mouse")?e.addEventListener(r,s=>{this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s),shift:s.shiftKey,modifier:this._getKeyModifier(s)}})}):e.addEventListener(r,s=>{if(r==="blur"){if(!i.focused||!s.relatedTarget)return;i.focused=!1}else if(r==="focus"){if(i.focused)return;i.focused=!0}n&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:this.data.id,name:o,value:n(s)}})})}_setEventListeners(e,i,r,o){for(const[n,s]of r)(s==="Action"||this.data.actions?.[s])&&((s==="Focus"||s==="Blur")&&(i||={focused:!1}),this._setEventListener(e,i,n,s,o),s==="Focus"&&!this.data.actions?.Blur?this._setEventListener(e,i,"blur","Blur",null):s==="Blur"&&!this.data.actions?.Focus&&this._setEventListener(e,i,"focus","Focus",null))}_setBackgroundColor(e){const i=this.data.backgroundColor||null;e.style.backgroundColor=i===null?"transparent":si.makeHexColor(i[0],i[1],i[2])}_setTextStyle(e){const i=["left","center","right"],{fontColor:r}=this.data.defaultAppearanceData,o=this.data.defaultAppearanceData.fontSize||xLi,n=e.style;let s;const a=2,l=c=>Math.round(10*c)/10;if(this.data.multiLine){const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a),d=Math.round(c/(kq*o))||1,u=c/d;s=Math.min(o,l(u/kq))}else{const c=Math.abs(this.data.rect[3]-this.data.rect[1]-a);s=Math.min(o,l(c/kq))}n.fontSize=`calc(${s}px * var(--total-scale-factor))`,n.color=si.makeHexColor(r[0],r[1],r[2]),this.data.textAlignment!==null&&(n.textAlign=i[this.data.textAlignment])}_setRequired(e,i){i?e.setAttribute("required",!0):e.removeAttribute("required"),e.setAttribute("aria-required",i)}}class BLi extends lg{constructor(e){const i=e.renderForms||e.data.hasOwnCanvas||!e.data.hasAppearance&&!!e.data.fieldValue;super(e,{isRenderable:i})}setPropertyOnSiblings(e,i,r,o){const n=this.annotationStorage;for(const s of this._getElementsByName(e.name,e.id))s.domElement&&(s.domElement[i]=r),n.setValue(s.id,{[o]:r})}render(){const e=this.annotationStorage,i=this.data.id;this.container.classList.add("textWidgetAnnotation");let r=null;if(this.renderForms){const o=e.getValue(i,{value:this.data.fieldValue});let n=o.value||"";const s=e.getValue(i,{charLimit:this.data.maxLen}).charLimit;s&&n.length>s&&(n=n.slice(0,s));let a=o.formattedValue||this.data.textContent?.join(`
5320
5320
  `)||null;a&&this.data.comb&&(a=a.replaceAll(/\s+/g,""));const l={userValue:n,formattedValue:a,lastCommittedValue:null,commitKey:1,focused:!1};this.data.multiLine?(r=document.createElement("textarea"),r.textContent=a??n,this.data.doNotScroll&&(r.style.overflowY="hidden")):(r=document.createElement("input"),r.type=this.data.password?"password":"text",r.setAttribute("value",a??n),this.data.doNotScroll&&(r.style.overflowX="hidden")),this.data.hasOwnCanvas&&(r.hidden=!0),ag.add(r),this.contentElement=r,r.setAttribute("data-element-id",i),r.disabled=this.data.readOnly,r.name=this.data.fieldName,r.tabIndex=0;const{datetimeFormat:c,datetimeType:d,timeStep:u}=this.data,h=!!d&&this.enableScripting;c&&(r.title=c),this._setRequired(r,this.data.required),s&&(r.maxLength=s),r.addEventListener("input",g=>{e.setValue(i,{value:g.target.value}),this.setPropertyOnSiblings(r,"value",g.target.value,"value"),l.formattedValue=null}),r.addEventListener("resetform",g=>{const f=this.data.defaultFieldValue??"";r.value=l.userValue=f,l.formattedValue=null});let p=g=>{const{formattedValue:f}=l;f!=null&&(g.target.value=f),g.target.scrollLeft=0};if(this.enableScripting&&this.hasJSActions){r.addEventListener("focus",f=>{if(l.focused)return;const{target:m}=f;if(h&&(m.type=d,u&&(m.step=u)),l.userValue){const A=l.userValue;if(h)if(d==="time"){const v=new Date(A),y=[v.getHours(),v.getMinutes(),v.getSeconds()];m.value=y.map(b=>b.toString().padStart(2,"0")).join(":")}else m.value=new Date(A-kLi).toISOString().split(d==="date"?"T":".",1)[0];else m.value=A}l.lastCommittedValue=m.value,l.commitKey=1,this.data.actions?.Focus||(l.focused=!0)}),r.addEventListener("updatefromsandbox",f=>{this.showElementAndHideCanvas(f.target);const m={value(A){l.userValue=A.detail.value??"",h||e.setValue(i,{value:l.userValue.toString()}),A.target.value=l.userValue},formattedValue(A){const{formattedValue:v}=A.detail;l.formattedValue=v,v!=null&&A.target!==document.activeElement&&(A.target.value=v);const y={formattedValue:v};h&&(y.value=v),e.setValue(i,y)},selRange(A){A.target.setSelectionRange(...A.detail.selRange)},charLimit:A=>{const{charLimit:v}=A.detail,{target:y}=A;if(v===0){y.removeAttribute("maxLength");return}y.setAttribute("maxLength",v);let b=l.userValue;!b||b.length<=v||(b=b.slice(0,v),y.value=l.userValue=b,e.setValue(i,{value:b}),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:b,willCommit:!0,commitKey:1,selStart:y.selectionStart,selEnd:y.selectionEnd}}))}};this._dispatchEventFromSandbox(m,f)}),r.addEventListener("keydown",f=>{l.commitKey=1;let m=-1;if(f.key==="Escape"?m=0:f.key==="Enter"&&!this.data.multiLine?m=2:f.key==="Tab"&&(l.commitKey=3),m===-1)return;const{value:A}=f.target;l.lastCommittedValue!==A&&(l.lastCommittedValue=A,l.userValue=A,this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:A,willCommit:!0,commitKey:m,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}}))});const g=p;p=null,r.addEventListener("blur",f=>{if(!l.focused||!f.relatedTarget)return;this.data.actions?.Blur||(l.focused=!1);const{target:m}=f;let{value:A}=m;if(h){if(A&&d==="time"){const v=A.split(":").map(y=>parseInt(y,10));A=new Date(2e3,0,1,v[0],v[1],v[2]||0).valueOf(),m.step=""}else A.includes("T")||(A=`${A}T00:00`),A=new Date(A).valueOf();m.type="text"}l.userValue=A,l.lastCommittedValue!==A&&this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:A,willCommit:!0,commitKey:l.commitKey,selStart:f.target.selectionStart,selEnd:f.target.selectionEnd}}),g(f)}),this.data.actions?.Keystroke&&r.addEventListener("beforeinput",f=>{l.lastCommittedValue=null;const{data:m,target:A}=f,{value:v,selectionStart:y,selectionEnd:b}=A;let w=y,C=b;switch(f.inputType){case"deleteWordBackward":{const M=v.substring(0,y).match(/\w*[^\w]*$/);M&&(w-=M[0].length);break}case"deleteWordForward":{const M=v.substring(y).match(/^[^\w]*\w*/);M&&(C+=M[0].length);break}case"deleteContentBackward":y===b&&(w-=1);break;case"deleteContentForward":y===b&&(C+=1);break}f.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:v,change:m||"",willCommit:!1,selStart:w,selEnd:C}})}),this._setEventListeners(r,l,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],f=>f.target.value)}if(p&&r.addEventListener("blur",p),this.data.comb){const g=(this.data.rect[2]-this.data.rect[0])/s;r.classList.add("comb"),r.style.letterSpacing=`calc(${g}px * var(--total-scale-factor) - 1ch)`}}else r=document.createElement("div"),r.textContent=this.data.fieldValue,r.style.verticalAlign="middle",r.style.display="table-cell",this.data.hasOwnCanvas&&(r.hidden=!0);return this._setTextStyle(r),this._setBackgroundColor(r),this._setDefaultPropertiesFromJS(r),this.container.append(r),this.container}}class PLi extends lg{constructor(e){super(e,{isRenderable:!!e.data.hasOwnCanvas})}}class ILi extends lg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.exportValue===i.fieldValue}).value;typeof o=="string"&&(o=o!=="Off",e.setValue(r,{value:o})),this.container.classList.add("buttonWidgetAnnotation","checkBox");const n=document.createElement("input");return ag.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="checkbox",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.setAttribute("exportValue",i.exportValue),n.tabIndex=0,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r)){const d=l&&c.exportValue===i.exportValue;c.domElement&&(c.domElement.checked=d),e.setValue(c.id,{value:d})}e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue||"Off";s.target.checked=a===i.exportValue}),this.enableScripting&&this.hasJSActions&&(n.addEventListener("updatefromsandbox",s=>{const a={value(l){l.target.checked=l.detail.value!=="Off",e.setValue(r,{value:l.target.checked})}};this._dispatchEventFromSandbox(a,s)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],s=>s.target.checked)),this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class bye extends lg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("buttonWidgetAnnotation","radioButton");const e=this.annotationStorage,i=this.data,r=i.id;let o=e.getValue(r,{value:i.fieldValue===i.buttonValue}).value;if(typeof o=="string"&&(o=o!==i.buttonValue,e.setValue(r,{value:o})),o)for(const s of this._getElementsByName(i.fieldName,r))e.setValue(s.id,{value:!1});const n=document.createElement("input");if(ag.add(n),n.setAttribute("data-element-id",r),n.disabled=i.readOnly,this._setRequired(n,this.data.required),n.type="radio",n.name=i.fieldName,o&&n.setAttribute("checked",!0),n.tabIndex=0,n.addEventListener("change",s=>{const{name:a,checked:l}=s.target;for(const c of this._getElementsByName(a,r))e.setValue(c.id,{value:!1});e.setValue(r,{value:l})}),n.addEventListener("resetform",s=>{const a=i.defaultFieldValue;s.target.checked=a!=null&&a===i.buttonValue}),this.enableScripting&&this.hasJSActions){const s=i.buttonValue;n.addEventListener("updatefromsandbox",a=>{const l={value:c=>{const d=s===c.detail.value;for(const u of this._getElementsByName(c.target.name)){const h=d&&u.id===r;u.domElement&&(u.domElement.checked=h),e.setValue(u.id,{value:h})}}};this._dispatchEventFromSandbox(l,a)}),this._setEventListeners(n,null,[["change","Validate"],["change","Action"],["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"]],a=>a.target.checked)}return this._setBackgroundColor(n),this._setDefaultPropertiesFromJS(n),this.container.append(n),this.container}}class SLi extends Jq{constructor(e){super(e,{ignoreBorder:e.data.hasAppearance})}render(){const e=super.render();e.classList.add("buttonWidgetAnnotation","pushButton");const i=e.lastChild;return this.enableScripting&&this.hasJSActions&&i&&(this._setDefaultPropertiesFromJS(i),i.addEventListener("updatefromsandbox",r=>{this._dispatchEventFromSandbox({},r)})),e}}class TLi extends lg{constructor(e){super(e,{isRenderable:e.renderForms})}render(){this.container.classList.add("choiceWidgetAnnotation");const e=this.annotationStorage,i=this.data.id,r=e.getValue(i,{value:this.data.fieldValue}),o=document.createElement("select");ag.add(o),o.setAttribute("data-element-id",i),o.disabled=this.data.readOnly,this._setRequired(o,this.data.required),o.name=this.data.fieldName,o.tabIndex=0;let n=this.data.combo&&this.data.options.length>0;this.data.combo||(o.size=this.data.options.length,this.data.multiSelect&&(o.multiple=!0)),o.addEventListener("resetform",d=>{const u=this.data.defaultFieldValue;for(const h of o.options)h.selected=h.value===u});for(const d of this.data.options){const u=document.createElement("option");u.textContent=d.displayValue,u.value=d.exportValue,r.value.includes(d.exportValue)&&(u.setAttribute("selected",!0),n=!1),o.append(u)}let s=null;if(n){const d=document.createElement("option");d.value=" ",d.setAttribute("hidden",!0),d.setAttribute("selected",!0),o.prepend(d),s=()=>{d.remove(),o.removeEventListener("input",s),s=null},o.addEventListener("input",s)}const a=d=>{const u=d?"value":"textContent",{options:h,multiple:p}=o;return p?Array.prototype.filter.call(h,g=>g.selected).map(g=>g[u]):h.selectedIndex===-1?null:h[h.selectedIndex][u]};let l=a(!1);const c=d=>{const u=d.target.options;return Array.prototype.map.call(u,h=>({displayValue:h.textContent,exportValue:h.value}))};return this.enableScripting&&this.hasJSActions?(o.addEventListener("updatefromsandbox",d=>{const u={value(h){s?.();const p=h.detail.value,g=new Set(Array.isArray(p)?p:[p]);for(const f of o.options)f.selected=g.has(f.value);e.setValue(i,{value:a(!0)}),l=a(!1)},multipleSelection(h){o.multiple=!0},remove(h){const p=o.options,g=h.detail.remove;p[g].selected=!1,o.remove(g),p.length>0&&Array.prototype.findIndex.call(p,f=>f.selected)===-1&&(p[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},clear(h){for(;o.length!==0;)o.remove(0);e.setValue(i,{value:null,items:[]}),l=a(!1)},insert(h){const{index:p,displayValue:g,exportValue:f}=h.detail.insert,m=o.children[p],A=document.createElement("option");A.textContent=g,A.value=f,m?m.before(A):o.append(A),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},items(h){const{items:p}=h.detail;for(;o.length!==0;)o.remove(0);for(const g of p){const{displayValue:f,exportValue:m}=g,A=document.createElement("option");A.textContent=f,A.value=m,o.append(A)}o.options.length>0&&(o.options[0].selected=!0),e.setValue(i,{value:a(!0),items:c(h)}),l=a(!1)},indices(h){const p=new Set(h.detail.indices);for(const g of h.target.options)g.selected=p.has(g.index);e.setValue(i,{value:a(!0)}),l=a(!1)},editable(h){h.target.disabled=!h.detail.editable}};this._dispatchEventFromSandbox(u,d)}),o.addEventListener("input",d=>{const u=a(!0),h=a(!1);e.setValue(i,{value:u}),d.preventDefault(),this.linkService.eventBus?.dispatch("dispatcheventinsandbox",{source:this,detail:{id:i,name:"Keystroke",value:l,change:h,changeEx:u,willCommit:!1,commitKey:1,keyDown:!1}})}),this._setEventListeners(o,null,[["focus","Focus"],["blur","Blur"],["mousedown","Mouse Down"],["mouseenter","Mouse Enter"],["mouseleave","Mouse Exit"],["mouseup","Mouse Up"],["input","Action"],["input","Validate"]],d=>d.target.value)):o.addEventListener("input",function(d){e.setValue(i,{value:a(!0)})}),this.data.combo&&this._setTextStyle(o),this._setBackgroundColor(o),this._setDefaultPropertiesFromJS(o),this.container.append(o),this.container}}class Zq extends tn{constructor(e){const{data:i,elements:r,parent:o}=e,n=!!o._commentManager;if(super(e,{isRenderable:!n&&tn._hasPopupData(i)}),this.elements=r,n&&tn._hasPopupData(i)){const s=this.popup=this.#e();for(const a of r)a.popup=s}else this.popup=null}#e(){return new RLi({container:this.container,color:this.data.color,titleObj:this.data.titleObj,modificationDate:this.data.modificationDate||this.data.creationDate,contentsObj:this.data.contentsObj,richText:this.data.richText,rect:this.data.rect,parentRect:this.data.parentRect||null,parent:this.parent,elements:this.elements,open:this.data.open,commentManager:this.parent._commentManager})}render(){const{container:e}=this;e.classList.add("popupAnnotation"),e.role="comment";const i=this.popup=this.#e(),r=[];for(const o of this.elements)o.popup=i,o.container.ariaHasPopup="dialog",r.push(o.data.id),o.addHighlightArea();return this.container.setAttribute("aria-controls",r.map(o=>`${J5}${o}`).join(",")),this.container}}class RLi{#e=null;#t=this.#q.bind(this);#r=this.#N.bind(this);#i=this.#D.bind(this);#o=this.#C.bind(this);#n=null;#s=null;#a=null;#l=null;#c=null;#h=null;#u=null;#p=!1;#A=null;#g=null;#d=null;#f=null;#m=null;#y=null;#v=null;#M=null;#x=null;#w=null;#B=!1;#b=null;#k=null;constructor({container:e,color:i,elements:r,titleObj:o,modificationDate:n,contentsObj:s,richText:a,parent:l,rect:c,parentRect:d,open:u,commentManager:h=null}){this.#s=e,this.#x=o,this.#a=s,this.#M=a,this.#h=l,this.#n=i,this.#v=c,this.#u=d,this.#c=r,this.#e=h,this.#b=r[0],this.#l=Rq.toDateObject(n),this.trigger=r.flatMap(p=>p.getElementsToTriggerPopup()),h||(this.#S(),this.#s.hidden=!0,u&&this.#C())}#S(){if(this.#g)return;this.#g=new AbortController;const{signal:e}=this.#g;for(const i of this.trigger)i.addEventListener("click",this.#o,{signal:e}),i.addEventListener("pointerenter",this.#i,{signal:e}),i.addEventListener("pointerleave",this.#r,{signal:e}),i.classList.add("popupTriggerArea");for(const i of this.#c)i.container?.addEventListener("keydown",this.#t,{signal:e})}#P(){const e=this.#c.find(i=>i.hasCommentButton);e&&(this.#m=e._normalizePoint(e.commentButtonPosition))}renderCommentButton(){if(this.#f){this.#f.parentNode||this.#b.container.after(this.#f);return}if(this.#m||this.#P(),!this.#m)return;const{signal:e}=this.#g=new AbortController,i=this.#b.hasOwnCommentButton,r=()=>{this.#e.toggleCommentPopup(this,!0,void 0,!i)},o=()=>{this.#e.toggleCommentPopup(this,!1,!0,!i)},n=()=>{this.#e.toggleCommentPopup(this,!1,!1)};if(i){this.#f=this.#b.container;for(const s of this.trigger)s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.addEventListener("keydown",this.#t,{signal:e}),s.addEventListener("click",r,{signal:e}),s.addEventListener("pointerenter",o,{signal:e}),s.addEventListener("pointerleave",n,{signal:e}),s.classList.add("popupTriggerArea")}else{const s=this.#f=document.createElement("button");s.className="annotationCommentButton";const a=this.#b.container;s.style.zIndex=a.style.zIndex+1,s.tabIndex=0,s.ariaHasPopup="dialog",s.ariaControls="commentPopup",s.setAttribute("data-l10n-id","pdfjs-show-comment-button"),this.#O(),this.#I(),s.addEventListener("keydown",this.#t,{signal:e}),s.addEventListener("click",r,{signal:e}),s.addEventListener("pointerenter",o,{signal:e}),s.addEventListener("pointerleave",n,{signal:e}),a.after(s)}}#I(){if(this.#b.extraPopupElement&&!this.#b.editor)return;this.#f||this.renderCommentButton();const[e,i]=this.#m,{style:r}=this.#f;r.left=`calc(${e}%)`,r.top=`calc(${i}% - var(--comment-button-dim))`}#O(){this.#b.extraPopupElement||(this.#f||this.renderCommentButton(),this.#f.style.backgroundColor=this.commentButtonColor||"")}get commentButtonColor(){const{color:e,opacity:i}=this.#b.commentData;return e?this.#h._commentManager.makeCommentColor(e,i):null}focusCommentButton(){setTimeout(()=>{this.#f?.focus()},0)}getData(){const{richText:e,color:i,opacity:r,creationDate:o,modificationDate:n}=this.#b.commentData;return{contentsObj:{str:this.comment},richText:e,color:i,opacity:r,creationDate:o,modificationDate:n}}get elementBeforePopup(){return this.#f}get comment(){return this.#k||=this.#b.commentText,this.#k}set comment(e){e!==this.comment&&(this.#b.commentText=this.#k=e)}focus(){this.#b.container?.focus()}get parentBoundingClientRect(){return this.#b.layer.getBoundingClientRect()}setCommentButtonStates({selected:e,hasPopup:i}){this.#f&&(this.#f.classList.toggle("selected",e),this.#f.ariaExpanded=i)}setSelectedCommentButton(e){this.#f.classList.toggle("selected",e)}get commentPopupPosition(){if(this.#y)return this.#y;const{x:e,y:i,height:r}=this.#f.getBoundingClientRect(),{x:o,y:n,width:s,height:a}=this.#b.layer.getBoundingClientRect();return[(e-o)/s,(i+r-n)/a]}set commentPopupPosition(e){this.#y=e}hasDefaultPopupPosition(){return this.#y===null}get commentButtonPosition(){return this.#m}get commentButtonWidth(){return this.#f.getBoundingClientRect().width/this.parentBoundingClientRect.width}editComment(e){const[i,r]=this.#y||this.commentButtonPosition.map(c=>c/100),o=this.parentBoundingClientRect,{x:n,y:s,width:a,height:l}=o;this.#e.showDialog(null,this,n+i*a,s+r*l,{...e,parentDimensions:o})}render(){if(this.#A)return;const e=this.#A=document.createElement("div");if(e.className="popup",this.#n){const r=e.style.outlineColor=si.makeHexColor(...this.#n);e.style.backgroundColor=`color-mix(in srgb, ${r} 30%, white)`}const i=document.createElement("span");if(i.className="header",this.#x?.str){const r=document.createElement("span");r.className="title",i.append(r),{dir:r.dir,str:r.textContent}=this.#x}if(e.append(i),this.#l){const r=document.createElement("time");r.className="popupDate",r.setAttribute("data-l10n-id","pdfjs-annotation-date-time-string"),r.setAttribute("data-l10n-args",JSON.stringify({dateObj:this.#l.valueOf()})),r.dateTime=this.#l.toISOString(),i.append(r)}R7e({html:this.#R||this.#a.str,dir:this.#a?.dir,className:"popupContent"},e),this.#s.append(e)}get#R(){const e=this.#M,i=this.#a;return e?.str&&(!i?.str||i.str===e.str)&&this.#M.html||null}get#_(){return this.#R?.attributes?.style?.fontSize||0}get#U(){return this.#R?.attributes?.style?.color||null}#L(e){const i=[],r={str:e,html:{name:"div",attributes:{dir:"auto"},children:[{name:"p",children:i}]}},o={style:{color:this.#U,fontSize:this.#_?`calc(${this.#_}px * var(--total-scale-factor))`:""}};for(const n of e.split(`