Files
marco/release/assets/main-DM7YMuyX.js
Râu Cao 2b219fe0cf
All checks were successful
CI / Lint (push) Successful in 28s
CI / Test (push) Successful in 43s
1.17.0
2026-03-27 15:17:16 +04:00

3 lines
1.2 MiB
Raw Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
const t=Object.freeze(Object.defineProperty({__proto__:null,get default(){return rG}},Symbol.toStringTag,{value:"Module"}));!function(){const t=document.createElement("link").relList;if(!(t&&t.supports&&t.supports("modulepreload"))){for(const t of document.querySelectorAll('link[rel="modulepreload"]'))e(t);new MutationObserver(t=>{for(const n of t)if("childList"===n.type)for(const t of n.addedNodes)"LINK"===t.tagName&&"modulepreload"===t.rel&&e(t)}).observe(document,{childList:!0,subtree:!0})}function e(t){if(t.ep)return;t.ep=!0;const e=function(t){const e={};return t.integrity&&(e.integrity=t.integrity),t.referrerPolicy&&(e.referrerPolicy=t.referrerPolicy),"use-credentials"===t.crossOrigin?e.credentials="include":"anonymous"===t.crossOrigin?e.credentials="omit":e.credentials="same-origin",e}(t);fetch(t.href,e)}}();const e="object"==typeof self&&null!==self&&self.Object===Object&&"undefined"!=typeof Window&&self.constructor===Window&&"object"==typeof document&&null!==document&&self.document===document&&"object"==typeof location&&null!==location&&self.location===location&&"object"==typeof history&&null!==history&&self.history===history&&"object"==typeof navigator&&null!==navigator&&self.navigator===navigator&&"string"==typeof navigator.userAgent,n=e?self:null,i=e?self.location:null,r=e?self.history:null,s=e?self.navigator.userAgent:"Lynx (textmode)",o=!(!e||"object"!=typeof chrome||"object"==typeof opera),a=!!e&&/Firefox|FxiOS/.test(s),l=Object.freeze(Object.defineProperty({__proto__:null,hasDOM:e,history:r,isChrome:o,isFirefox:a,location:i,userAgent:s,window:n},Symbol.toStringTag,{value:"Module"}));function c(t){return t&&t.Object===Object?t:void 0}const h=c((u="object"==typeof global&&global)&&void 0===u.nodeType?u:void 0)||c("object"==typeof self&&self)||c("object"==typeof window&&window)||"undefined"!=typeof mainContext&&mainContext||new Function("return this")();var u;const d=function(t,e){return void 0===e?{imports:t,exports:t,lookup:t}:{imports:e.imports||t,exports:e.exports||t,lookup:e.lookup||t}}(h,h.Ember);function p(){return d.lookup}function f(t){d.lookup=t}const g={ENABLE_OPTIONAL_FEATURES:!1,EXTEND_PROTOTYPES:{Array:!1},LOG_STACKTRACE_ON_DEPRECATION:!0,LOG_VERSION:!0,RAISE_ON_DEPRECATION:!1,STRUCTURED_PROFILE:!1,_DEBUG_RENDER_TREE:!1,_ALL_DEPRECATIONS_ENABLED:!1,_OVERRIDE_DEPRECATION_VERSION:null,_DEFAULT_ASYNC_OBSERVERS:!1,_RERENDER_LOOP_LIMIT:1e3,EMBER_LOAD_HOOKS:{},FEATURES:{}};function m(){return g}(t=>{if("object"!=typeof t||null===t)return;for(let i in t){if(!Object.prototype.hasOwnProperty.call(t,i)||"EXTEND_PROTOTYPES"===i||"EMBER_LOAD_HOOKS"===i)continue;let e=g[i];g[i]=!0===e?!1!==t[i]:!1===e?!0===t[i]:t[i]}let{EMBER_LOAD_HOOKS:e}=t;if("object"==typeof e&&null!==e)for(let i in e){if(!Object.prototype.hasOwnProperty.call(e,i))continue;let t=e[i];Array.isArray(t)&&(g.EMBER_LOAD_HOOKS[i]=t.filter(t=>"function"==typeof t))}let{FEATURES:n}=t;if("object"==typeof n&&null!==n)for(let i in n)Object.prototype.hasOwnProperty.call(n,i)&&(g.FEATURES[i]=!0===n[i])})(h.EmberENV);let y=()=>{},v=()=>{},_=!1;function b(){return _}function w(t){_=Boolean(t)}let x=()=>{};const{toString:C}=Object.prototype,{toString:S}=Function.prototype,{isArray:k}=Array,{keys:E}=Object,{stringify:T}=JSON,L=100,M=/^[\w$]+$/;function R(t){return"number"==typeof t&&2===arguments.length?this:P(t,0)}function P(t,e,n){let i=!1;switch(typeof t){case"undefined":return"undefined";case"object":if(null===t)return"null";if(k(t)){i=!0;break}if(t.toString===C||void 0===t.toString)break;return t.toString();case"function":return t.toString===S?t.name?`[Function:${t.name}]`:"[Function]":t.toString();case"string":return T(t);default:return t.toString()}if(void 0===n)n=new WeakSet;else if(n.has(t))return"[Circular]";return n.add(t),i?function(t,e,n){if(e>4)return"[Array]";let i="[";for(let r=0;r<t.length;r++){if(i+=0===r?" ":", ",r>=L){i+=`... ${t.length-L} more items`;break}i+=P(t[r],e,n)}return i+=" ]",i}(t,e+1,n):function(t,e,n){if(e>4)return"[Object]";let i="{",r=E(t);for(let s=0;s<r.length;s++){if(i+=0===s?" ":", ",s>=L){i+=`... ${r.length-L} more keys`;break}let o=r[s];i+=`${I(String(o))}: ${P(t[o],e,n)}`}return i+=" }",i}(t,e+1,n)}function I(t){return M.test(t)?t:T(t)}function O(t){let e=t.lookup("renderer:-dom");if(!e)throw new Error("BUG: owner is missing renderer");return e.debugRenderTree.capture()}const A=()=>{};let z=A,F=A,j=A,D=A,N=A,B=A,U=A,q=A,V=function(){return arguments[arguments.length-1]};function $(){}const G=Object.freeze(Object.defineProperty({__proto__:null,_warnIfUsingStrippedFeatureFlags:void 0,assert:y,captureRenderTree:O,debug:j,debugFreeze:N,debugSeal:D,deprecate:$,deprecateFunc:V,getDebugFunction:q,info:z,inspect:R,isTesting:b,registerDeprecationHandler:v,registerWarnHandler:x,runInDebug:B,setDebugFunction:U,setTesting:w,warn:F},Symbol.toStringTag,{value:"Module"}));function W(t){let e=Object.create(null);e[t]=1;for(let n in e)if(n===t)return n;return t}function H(t){return null!==t&&("object"==typeof t||"function"==typeof t)}let Z=0;function K(){return++Z}const Y="ember",X=new WeakMap,J=new Map,Q=W(`__ember${Date.now()}`);function tt(t,e=Y){let n=e+K().toString();return H(t)&&X.set(t,n),n}function et(t){let e;if(H(t))e=X.get(t),void 0===e&&(e=`${Y}${K()}`,X.set(t,e));else if(e=J.get(t),void 0===e){let n=typeof t;e="string"===n?`st${K()}`:"number"===n?`nu${K()}`:"symbol"===n?`sy${K()}`:`(${t})`,J.set(t,e)}return e}const nt=void 0,it=/\.(_super|call\(this|apply\(this)/,rt=Function.prototype.toString,st=rt.call(function(){return this}).indexOf("return this")>-1?function(t){return it.test(rt.call(t))}:function(){return!0},ot=new WeakMap,at=Object.freeze(function(){});function lt(t){let e=ot.get(t);return void 0===e&&(e=st(t),ot.set(t,e)),e}ot.set(at,!1);class ct{listeners=void 0;observers=void 0}const ht=new WeakMap;function ut(t){let e=ht.get(t);return void 0===e&&(e=new ct,ht.set(t,e)),e}function dt(t){return ht.get(t)}function pt(t,e){ut(t).observers=e}function ft(t,e){ut(t).listeners=e}const gt=new WeakSet;function mt(t,e){return lt(t)?!gt.has(e)&&lt(e)?yt(t,yt(e,at)):yt(t,e):t}function yt(t,e){function n(){let n=this._super;this._super=e;let i=t.apply(this,arguments);return this._super=n,i}gt.add(n);let i=ht.get(t);return void 0!==i&&ht.set(n,i),n}function vt(t,e){let n=t;do{let t=Object.getOwnPropertyDescriptor(n,e);if(void 0!==t)return t;n=Object.getPrototypeOf(n)}while(null!==n);return null}let _t,bt,wt;const xt=[];function Ct(t){return-1!==xt.indexOf(t)}function St(t){return W(`__${t}${Q+Math.floor(Math.random()*Date.now()).toString()}__`)}const kt=Symbol,Et=Object.prototype.toString;function Tt(t){return null==t}function Lt(t){if("string"==typeof t)return t;if(null===t)return"null";if(void 0===t)return"undefined";if(Array.isArray(t)){let e="";for(let n=0;n<t.length;n++)n>0&&(e+=","),Tt(t[n])||(e+=Lt(t[n]));return e}return"function"==typeof t.toString?t.toString():Et.call(t)}let Mt,Rt,Pt,It,Ot,At,zt,Ft,jt,Dt,Nt=()=>{},Bt=new WeakMap;function Ut(t,e){return null===t?e:Array.isArray(t)?(t.push(e),t):[t,e]}function qt(t,e){Array.isArray(t)?t.forEach(e):null!==t&&e(t)}function Vt(t,e){if(Array.isArray(t)&&t.length>1){let n=t.indexOf(e);return t.splice(n,1),t}return null}function $t(t){let e=Bt.get(t);return void 0===e&&(e={parents:null,children:null,eagerDestructors:null,destructors:null,state:0},Bt.set(t,e)),e}function Gt(t,e){let n=$t(t),i=$t(e);return n.children=Ut(n.children,e),i.parents=Ut(i.parents,t),e}function Wt(t,e,n=!1){let i=$t(t),r=n?"eagerDestructors":"destructors";return i[r]=Ut(i[r],e),e}function Ht(t){let e=$t(t);if(e.state>=1)return;let{parents:n,children:i,eagerDestructors:r,destructors:s}=e;e.state=1,qt(i,Ht),qt(r,e=>{e(t)}),qt(s,e=>{Mt(t,e)}),Rt(()=>{qt(n,e=>{!function(t,e){let n=$t(e);0===n.state&&(n.children=Vt(n.children,t))}(t,e)}),e.state=2})}function Zt(t){let e=Bt.get(t);return void 0!==e&&null!==e.children}function Kt(t){let e=Bt.get(t);return void 0!==e&&e.state>=1}function Yt(t){let e=Bt.get(t);return void 0!==e&&e.state>=2}const Xt=Object.prototype;let Jt;const Qt=kt("undefined");var te=function(t){return t[t.ADD=0]="ADD",t[t.ONCE=1]="ONCE",t[t.REMOVE=2]="REMOVE",t}(te||{});let ee=1;class ne{_descriptors;_mixins;_isInit;_lazyChains;_values;_revisions;source;proto;_parent;_listeners;_listenersVersion=1;_inheritedEnd=-1;_flattenedVersion=0;constructor(t){this._parent=void 0,this._descriptors=void 0,this._mixins=void 0,this._lazyChains=void 0,this._values=void 0,this._revisions=void 0,this._isInit=!1,this.source=t,this.proto=void 0===t.constructor?void 0:t.constructor.prototype,this._listeners=void 0}get parent(){let t=this._parent;if(void 0===t){let e=ie(this.source);this._parent=t=null===e||e===Xt?null:ae(e)}return t}setInitializing(){this._isInit=!0}unsetInitializing(){this._isInit=!1}isInitializing(){return this._isInit}isPrototypeMeta(t){return this.proto===this.source&&this.source===t}_getOrCreateOwnMap(t){return this[t]||(this[t]=Object.create(null))}_getOrCreateOwnSet(t){return this[t]||(this[t]=new Set)}_findInheritedMap(t,e){let n=this;for(;null!==n;){let i=n[t];if(void 0!==i){let t=i.get(e);if(void 0!==t)return t}n=n.parent}}_hasInInheritedSet(t,e){let n=this;for(;null!==n;){let i=n[t];if(void 0!==i&&i.has(e))return!0;n=n.parent}return!1}valueFor(t){let e=this._values;return void 0!==e?e[t]:void 0}setValueFor(t,e){this._getOrCreateOwnMap("_values")[t]=e}revisionFor(t){let e=this._revisions;return void 0!==e?e[t]:void 0}setRevisionFor(t,e){this._getOrCreateOwnMap("_revisions")[t]=e}writableLazyChainsFor(t){let e=this._getOrCreateOwnMap("_lazyChains"),n=e[t];return void 0===n&&(n=e[t]=[]),n}readableLazyChainsFor(t){let e=this._lazyChains;if(void 0!==e)return e[t]}addMixin(t){this._getOrCreateOwnSet("_mixins").add(t)}hasMixin(t){return this._hasInInheritedSet("_mixins",t)}forEachMixins(t){let e,n=this;for(;null!==n;){let i=n._mixins;void 0!==i&&(e=void 0===e?new Set:e,i.forEach(n=>{e.has(n)||(e.add(n),t(n))})),n=n.parent}}writeDescriptors(t,e){(this._descriptors||(this._descriptors=new Map)).set(t,e)}peekDescriptors(t){let e=this._findInheritedMap("_descriptors",t);return e===Qt?void 0:e}removeDescriptors(t){this.writeDescriptors(t,Qt)}forEachDescriptors(t){let e,n=this;for(;null!==n;){let i=n._descriptors;void 0!==i&&(e=void 0===e?new Set:e,i.forEach((n,i)=>{e.has(i)||(e.add(i),n!==Qt&&t(i,n))})),n=n.parent}}addToListeners(t,e,n,i,r){this.pushListener(t,e,n,i?te.ONCE:te.ADD,r)}removeFromListeners(t,e,n){this.pushListener(t,e,n,te.REMOVE)}pushListener(t,e,n,i,r=!1){let s=this.writableListeners(),o=le(s,t,e,n);if(-1!==o&&o<this._inheritedEnd&&(s.splice(o,1),this._inheritedEnd--,o=-1),-1===o)s.push({event:t,target:e,method:n,kind:i,sync:r});else{let t=s[o];i===te.REMOVE&&t.kind!==te.REMOVE?s.splice(o,1):(t.kind=i,t.sync=r)}}writableListeners(){return this._flattenedVersion!==ee||this.source!==this.proto&&-1!==this._inheritedEnd||ee++,-1===this._inheritedEnd&&(this._inheritedEnd=0,this._listeners=[]),this._listeners}flattenedListeners(){if(this._flattenedVersion<ee){let t=this.parent;if(null!==t){let e=t.flattenedListeners();if(void 0!==e)if(void 0===this._listeners)this._listeners=e;else{let t=this._listeners;this._inheritedEnd>0&&(t.splice(0,this._inheritedEnd),this._inheritedEnd=0);for(let n of e)-1===le(t,n.event,n.target,n.method)&&(t.unshift(n),this._inheritedEnd++)}}this._flattenedVersion=ee}return this._listeners}matchingListeners(t){let e,n=this.flattenedListeners();if(void 0!==n)for(let i of n)i.event!==t||i.kind!==te.ADD&&i.kind!==te.ONCE||(void 0===e&&(e=[]),e.push(i.target,i.method,i.kind===te.ONCE));return e}observerEvents(){let t,e=this.flattenedListeners();if(void 0!==e)for(let n of e)n.kind!==te.ADD&&n.kind!==te.ONCE||-1===n.event.indexOf(":change")||(void 0===t&&(t=[]),t.push(n));return t}}const ie=Object.getPrototypeOf,re=new WeakMap;function se(t,e){re.set(t,e)}function oe(t){let e=re.get(t);if(void 0!==e)return e;let n=ie(t);for(;null!==n;){if(e=re.get(n),void 0!==e)return e.proto!==n&&(e.proto=n),e;n=ie(n)}return null}const ae=function(t){let e=oe(t);if(null!==e&&e.source===t)return e;let n=new ne(t);return se(t,n),n};function le(t,e,n,i){for(let r=t.length-1;r>=0;r--){let s=t[r];if(s.event===e&&s.target===n&&s.method===i)return r}return-1}let ce=1;const he=Symbol("TAG_COMPUTE");function ue(t){return t[he]()}function de(t,e){return e>=t[he]()}Reflect.set(globalThis,"COMPUTE_SYMBOL",he);const pe=Symbol("TAG_TYPE");class fe{static combine(t){switch(t.length){case 0:return _e;case 1:return t[0];default:{let e=new fe(2);return e.subtag=t,e}}}constructor(t){this.revision=1,this.lastChecked=1,this.lastValue=1,this.isUpdating=!1,this.subtag=null,this.subtagBufferCache=null,this[pe]=t}[he](){let{lastChecked:t}=this;if(this.isUpdating)this.lastChecked=++ce;else if(t!==ce){this.isUpdating=!0,this.lastChecked=ce;try{let{subtag:t,revision:e}=this;if(null!==t)if(Array.isArray(t))for(const n of t){let t=n[he]();e=Math.max(t,e)}else{let n=t[he]();n===this.subtagBufferCache?e=Math.max(e,this.lastValue):(this.subtagBufferCache=null,e=Math.max(e,n))}this.lastValue=e}finally{this.isUpdating=!1}}return this.lastValue}static updateTag(t,e){let n=t,i=e;i===_e?n.subtag=null:(n.subtagBufferCache=i[he](),n.subtag=i)}static dirtyTag(t,e){t.revision=++ce,Nt()}}const ge=fe.dirtyTag,me=fe.updateTag;function ye(){return new fe(0)}function ve(){return new fe(1)}const _e=new fe(3);function be(t){return t===_e}class we{[he](){return NaN}constructor(){this[pe]=100}}const xe=new we;class Ce{[he](){return ce}constructor(){this[pe]=101}}const Se=new Ce,ke=fe.combine;let Ee=ve(),Te=ve(),Le=ve();ue(Ee),ge(Ee),ue(Ee),me(Ee,ke([Te,Le])),ue(Ee),ge(Te),ue(Ee),ge(Le),ue(Ee),me(Ee,Le),ue(Ee),ge(Le),ue(Ee);class Me{add(t){t!==_e&&(this.tags.add(t),this.last=t)}combine(){let{tags:t}=this;return 0===t.size?_e:1===t.size?this.last:ke(Array.from(this.tags))}constructor(){this.tags=new Set,this.last=null}}let Re=null;const Pe=[];function Ie(){Pe.push(Re),Re=new Me}function Oe(){let t=Re;return Re=Pe.pop()||null,function(t){if(null==t)throw new Error("Expected value to be present");return t}(t).combine()}function Ae(){Pe.push(Re),Re=null}function ze(){Re=Pe.pop()||null}function Fe(){return null!==Re}function je(t){null!==Re&&Re.add(t)}const De=Symbol("FN"),Ne=Symbol("LAST_VALUE"),Be=Symbol("TAG"),Ue=Symbol("SNAPSHOT");function qe(t){return{[De]:t,[Ne]:void 0,[Be]:void 0,[Ue]:-1}}function Ve(t){let e=t[De],n=t[Be],i=t[Ue];if(void 0!==n&&de(n,i))je(n);else{Ie();try{t[Ne]=e()}finally{n=Oe(),t[Be]=n,t[Ue]=ue(n),je(n)}}return t[Ne]}function $e(t){return be(t[Be])}function Ge(t){let e;Ie();try{t()}finally{e=Oe()}return e}function We(t){Ae();try{return t()}finally{ze()}}const He=new Set([Symbol.iterator,"concat","entries","every","filter","find","findIndex","flat","flatMap","forEach","includes","indexOf","join","keys","lastIndexOf","map","reduce","reduceRight","slice","some","values"]),Ze=new Set(["fill","push","unshift"]);function Ke(t){if("symbol"==typeof t)return null;const e=Number(t);return isNaN(e)?null:e%1==0?e:null}class Ye{#t;constructor(t,e){this.#e=ve(),this.#n=new Map,this.#t=e;const n=t.slice(),i=this,r=new Map;let s=!1;return new Proxy(n,{get(t,e){const n=Ke(e);if(null!==n)return i.#i(n),je(i.#e),t[n];if("length"===e)return s?s=!1:je(i.#e),t[e];if(Ze.has(e)&&(s=!0),He.has(e)){let n=r.get(e);return void 0===n&&(n=(...n)=>(je(i.#e),t[e](...n)),r.set(e,n)),n}return t[e]},set(t,e,n){if(i.#t.equals(t[e],n))return!0;t[e]=n;const r=Ke(e);return null!==r?(i.#r(r),i.#s()):"length"===e&&i.#s(),!0},getPrototypeOf:()=>Ye.prototype})}#e;#n;#i(t){let e=this.#n.get(t);void 0===e&&(e=ve(),this.#n.set(t,e)),je(e)}#r(t){const e=this.#n.get(t);e&&ge(e)}#s(){ge(this.#e),this.#n.clear()}}Object.setPrototypeOf(Ye.prototype,Array.prototype);class Xe{#t;#e;#n;#o;#a(t){const e=this.#n;let n=e.get(t);return void 0===n&&(n=ve(),e.set(t,n)),n}#r(t){const e=this.#n.get(t);e&&ge(e)}constructor(t,e){this.#e=ve(),this.#n=new Map,this.#o=t instanceof Map?new Map(t.entries()):new Map(t),this.#t=e}get(t){return je(this.#a(t)),this.#o.get(t)}has(t){return je(this.#a(t)),this.#o.has(t)}entries(){return je(this.#e),this.#o.entries()}keys(){return je(this.#e),this.#o.keys()}values(){return je(this.#e),this.#o.values()}forEach(t){je(this.#e),this.#o.forEach(t)}get size(){return je(this.#e),this.#o.size}[Symbol.iterator](){let t=this.keys(),e=this;return{next(){let n=t.next(),i=n.value;return n.done?{value:[void 0,void 0],done:!0}:{value:[i,e.get(i)],done:!1}}}}get[Symbol.toStringTag](){return this.#o[Symbol.toStringTag]}set(t,e){let n=this.#o.get(t);return n&&this.#t.equals(n,e)||(this.#r(t),n||ge(this.#e),this.#o.set(t,e)),this}delete(t){return!this.#o.has(t)||(this.#r(t),ge(this.#e),this.#n.delete(t),this.#o.delete(t))}clear(){0!==this.#o.size&&(this.#n.forEach(t=>ge(t)),this.#n.clear(),ge(this.#e),this.#o.clear())}}Object.setPrototypeOf(Xe.prototype,Map.prototype);class Je{#t;#n;#e;#i(t){let e=this.#n.get(t);void 0===e&&(e=ve(),this.#n.set(t,e)),je(e)}#r(t){const e=this.#n.get(t);e&&ge(e)}#s(){ge(this.#e)}constructor(t,e){this.#n=new Map,this.#e=ve(),this.#t=e;const n=Object.getPrototypeOf(t),i=Object.getOwnPropertyDescriptors(t),r=Object.create(n);for(const o in i)Object.defineProperty(r,o,i[o]);const s=this;return new Proxy(r,{get:(t,e)=>(s.#i(e),t[e]),has:(t,e)=>(s.#i(e),e in t),ownKeys:t=>(je(s.#e),Reflect.ownKeys(t)),set:(t,e,n)=>(s.#t.equals(t[e],n)||(t[e]=n,s.#r(e),s.#s()),!0),deleteProperty:(t,e)=>(e in t&&(delete t[e],s.#r(e),s.#n.delete(e),s.#s()),!0),getPrototypeOf:()=>Je.prototype})}}class Qe{#t;#e;#n;#o;#a(t){const e=this.#n;let n=e.get(t);return void 0===n&&(n=ve(),e.set(t,n)),n}#r(t){const e=this.#n.get(t);e&&ge(e)}constructor(t,e){this.#e=ve(),this.#n=new Map,this.#o=new Set(t),this.#t=e}has(t){return je(this.#a(t)),this.#o.has(t)}entries(){return je(this.#e),this.#o.entries()}keys(){return je(this.#e),this.#o.keys()}values(){return je(this.#e),this.#o.values()}union(t){return je(this.#e),this.#o.union(t)}intersection(t){return je(this.#e),this.#o.intersection(t)}difference(t){return je(this.#e),this.#o.difference(t)}symmetricDifference(t){return je(this.#e),this.#o.symmetricDifference(t)}isSubsetOf(t){return je(this.#e),this.#o.isSubsetOf(t)}isSupersetOf(t){return je(this.#e),this.#o.isSupersetOf(t)}isDisjointFrom(t){return je(this.#e),this.#o.isDisjointFrom(t)}forEach(t){je(this.#e),this.#o.forEach(t)}get size(){return je(this.#e),this.#o.size}[Symbol.iterator](){return je(this.#e),this.#o[Symbol.iterator]()}get[Symbol.toStringTag](){return this.#o[Symbol.toStringTag]}add(t){if(this.#o.has(t)){if(this.#t.equals(t,t))return this}else ge(this.#e);return this.#r(t),this.#o.add(t),this}delete(t){return!this.#o.has(t)||(this.#r(t),ge(this.#e),this.#n.delete(t),this.#o.delete(t))}clear(){0!==this.#o.size&&(this.#n.forEach(t=>ge(t)),ge(this.#e),this.#n.clear(),this.#o.clear())}}Object.setPrototypeOf(Qe.prototype,Set.prototype);class tn{#t;#n;#o;#a(t){let e=this.#n.get(t);return void 0===e&&(e=ve(),this.#n.set(t,e)),e}#r(t){const e=this.#n.get(t);e&&ge(e)}constructor(t,e){this.#n=new WeakMap,this.#o=t instanceof WeakMap?t:new WeakMap(t),this.#t=e}get(t){return je(this.#a(t)),this.#o.get(t)}has(t){return je(this.#a(t)),this.#o.has(t)}set(t,e){let n=this.#o.get(t);return n&&this.#t.equals(n,e)||(this.#r(t),this.#o.set(t,e)),this}delete(t){return!this.#o.has(t)||(this.#r(t),this.#n.delete(t),this.#o.delete(t))}get[Symbol.toStringTag](){return this.#o[Symbol.toStringTag]}}Object.setPrototypeOf(tn.prototype,WeakMap.prototype);class en{#t;#n;#o;#a(t){let e=this.#n.get(t);return void 0===e&&(e=ve(),this.#n.set(t,e)),e}#r(t){const e=this.#n.get(t);e&&ge(e)}constructor(t,e){this.#n=new WeakMap,this.#t=e,this.#o=new WeakSet(t)}has(t){return je(this.#a(t)),this.#o.has(t)}add(t){return this.#o.has(t)&&this.#t.equals(t,t)||(this.#o.add(t),this.#r(t)),this}delete(t){return!this.#o.has(t)||(this.#r(t),this.#n.delete(t),this.#o.delete(t))}get[Symbol.toStringTag](){return this.#o[Symbol.toStringTag]}}Object.setPrototypeOf(en.prototype,WeakSet.prototype);const nn=new WeakMap;function rn(t,e,n){let i=void 0===n?nn.get(t):n;if(void 0===i)return;let r=i.get(e);void 0!==r&&ge(r,!0)}function sn(t){let e=nn.get(t);return void 0===e&&(e=new Map,nn.set(t,e)),e}function on(t,e,n){let i=void 0===n?sn(t):n,r=i.get(e);return void 0===r&&(r=ve(),i.set(e,r)),r}function an(t,e){let n=new WeakMap,i="function"==typeof e;return{getter:function(r){let s;return je(on(r,t)),i&&!n.has(r)?(s=e.call(r),n.set(r,s)):s=n.get(r),s},setter:function(e,i){rn(e,t),n.set(e,i)}}}const ln=Symbol("GLIMMER_VALIDATOR_REGISTRATION");if(Reflect.has(globalThis,ln))throw new Error("The `@glimmer/validator` library has been included twice in this application. It could be different versions of the package, or the same version included twice by mistake. `@glimmer/validator` depends on having a single copy of the package in use at any time in an application, even if they are the same version. You must dedupe your build to remove the duplicate packages in order to prevent this error.");Reflect.set(globalThis,ln,!0);const cn=Object.freeze(Object.defineProperty({__proto__:null,ALLOW_CYCLES:void 0,COMPUTE:he,CONSTANT:0,CONSTANT_TAG:_e,CURRENT_TAG:Se,CurrentTag:Ce,INITIAL:1,VOLATILE:NaN,VOLATILE_TAG:xe,VolatileTag:we,beginTrackFrame:Ie,beginUntrackFrame:Ae,bump:function(){ce++},combine:ke,consumeTag:je,createCache:qe,createTag:ye,createUpdatableTag:ve,debug:{},dirtyTag:ge,dirtyTagFor:rn,endTrackFrame:Oe,endUntrackFrame:ze,getValue:Ve,isConst:$e,isConstTag:be,isTracking:Fe,resetTracking:function(){for(;Pe.length>0;)Pe.pop();Re=null},tagFor:on,tagMetaFor:sn,track:Ge,trackedArray:function(t,e){return new Ye(t??[],{equals:e?.equals??Object.is,description:e?.description})},trackedData:an,trackedMap:function(t,e){return new Xe(t??[],{equals:e?.equals??Object.is,description:e?.description})},trackedObject:function(t,e){return new Je(t??{},{equals:e?.equals??Object.is,description:e?.description})},trackedSet:function(t,e){return new Qe(t??[],{equals:e?.equals??Object.is,description:e?.description})},trackedWeakMap:function(t,e){return new tn(t??[],{equals:e?.equals??Object.is,description:e?.description})},trackedWeakSet:function(t,e){return new en(t??[],{equals:e?.equals??Object.is,description:e?.description})},untrack:We,updateTag:me,validateTag:de,valueForTag:ue},Symbol.toStringTag,{value:"Module"})),hn=Object.freeze([]);function un(){return hn}const dn=un(),pn=un();function*fn(t){for(let e=t.length-1;e>=0;e--)yield t[e]}function*gn(t){let e=0;for(const n of t)yield[e++,n]}function mn(t){return!!t&&t.length>0}function yn(t){return 0===t.length?void 0:t[t.length-1]}function vn(){return Object.create(null)}function _n(t){return null!=t}function bn(t){return"function"==typeof t||"object"==typeof t&&null!==t}class wn{constructor(t=[]){this.current=null,this.stack=t}get size(){return this.stack.length}push(t){this.current=t,this.stack.push(t)}pop(){let t=this.stack.pop();return this.current=yn(this.stack)??null,void 0===t?null:t}nth(t){let e=this.stack.length;return e<t?null:this.stack[e-t]}isEmpty(){return 0===this.stack.length}snapshot(){return[...this.stack]}toArray(){return this.stack}}function xn(t){let e=t.firstChild;for(;e;){let n=e.nextSibling;t.removeChild(e),e=n}}const Cn=Object.assign,Sn=console,kn=console,En=Object.freeze(Object.defineProperty({__proto__:null,EMPTY_ARRAY:hn,EMPTY_NUMBER_ARRAY:pn,EMPTY_STRING_ARRAY:dn,LOCAL_LOGGER:Sn,LOGGER:kn,SERIALIZATION_FIRST_NODE_STRING:"%+b:0%",Stack:wn,assertNever:function(t,e="unexpected unreachable branch"){throw kn.log("unreachable",t),kn.log(`${e} :: ${JSON.stringify(t)} (${t})`),new Error("code reached unreachable")},assign:Cn,beginTestSteps:void 0,clearElement:xn,dict:vn,emptyArray:un,endTestSteps:void 0,entries:function(t){return Object.entries(t)},enumerate:gn,intern:function(t){let e={};e[t]=1;for(let n in e)if(n===t)return n;return t},isDict:_n,isEmptyArray:function(t){return t===hn},isIndexable:bn,isSerializationFirstNode:function(t){return"%+b:0%"===t.nodeValue},keys:function(t){return Object.keys(t)},logStep:void 0,reverse:fn,strip:function(t,...e){let n="";for(const[a,l]of gn(t))n+=`${l}${void 0!==e[a]?String(e[a]):""}`;let i=n.split("\n");for(;mn(i)&&/^\s*$/u.test(0===(r=i).length?void 0:r[0]);)i.shift();for(var r;mn(i)&&/^\s*$/u.test(yn(i));)i.pop();let s=1/0;for(let a of i){let t=/^\s*/u.exec(a)[0].length;s=Math.min(s,t)}let o=[];for(let a of i)o.push(a.slice(s));return o.join("\n")},values:function(t){return Object.values(t)},verifySteps:void 0,zipArrays:function*(t,e){for(let n=0;n<t.length;n++){const i=n<e.length?"retain":"pop";yield[i,n,t[n],e[n]]}for(let n=t.length;n<e.length;n++)yield["push",n,void 0,e[n]]},zipTuples:function*(t,e){for(let n=0;n<t.length;n++)yield[n,t[n],e[n]]}},Symbol.toStringTag,{value:"Module"})),Tn=Symbol("REFERENCE");class Ln{constructor(t){this.tag=null,this.lastRevision=1,this.children=null,this.compute=null,this.update=null,this[Tn]=t}}function Mn(t){const e=new Ln(2);return e.tag=_e,e.lastValue=t,e}const Rn=Mn(void 0),Pn=Mn(null),In=Mn(!0),On=Mn(!1);function An(t){const e=new Ln(0);return e.lastValue=t,e.tag=_e,e}function zn(t){const e=new Ln(2);return e.lastValue=t,e.tag=_e,e}function Fn(t,e=null){const n=new Ln(1);return n.compute=t,n.update=e,n}function jn(t){return Un(t)?Fn(()=>qn(t),null,t.debugLabel):t}function Dn(t){return 3===t[Tn]}function Nn(t){const e=Fn(()=>qn(t),e=>Vn(t,e));return e.debugLabel=t.debugLabel,e[Tn]=3,e}function Bn(t){return t.tag===_e}function Un(t){return null!==t.update}function qn(t){const e=t;let{tag:n}=e;if(n===_e)return e.lastValue;const{lastRevision:i}=e;let r;if(null!==n&&de(n,i))r=e.lastValue;else{const{compute:t}=e,i=Ge(()=>{r=e.lastValue=t()});n=e.tag=i,e.lastRevision=ue(i)}return je(n),r}function Vn(t,e){(0,t.update)(e)}function $n(t,e){const n=t,i=n[Tn];let r,s=n.children;if(null===s)s=n.children=new Map;else{const t=s.get(e);if(t)return t}if(2===i){const t=qn(n);r=_n(t)?zn(t[e]):Rn}else r=Fn(()=>{const t=qn(n);if(_n(t))return Ot(t,e)},t=>{const i=qn(n);if(_n(i))return At(i,e,t)});return s.set(e,r),r}function Gn(t,e){let n=t;for(const i of e)n=$n(n,i);return n}const Wn={},Hn=(t,e)=>e,Zn=(t,e)=>String(e),Kn=t=>null===t?Wn:t;class Yn{get weakMap(){return void 0===this._weakMap&&(this._weakMap=new WeakMap),this._weakMap}get primitiveMap(){return void 0===this._primitiveMap&&(this._primitiveMap=new Map),this._primitiveMap}set(t,e){bn(t)?this.weakMap.set(t,e):this.primitiveMap.set(t,e)}get(t){return bn(t)?this.weakMap.get(t):this.primitiveMap.get(t)}}const Xn=new Yn;function Jn(t){let e=new Yn;return(n,i)=>{let r=t(n,i),s=e.get(r)||0;return e.set(r,s+1),0===s?r:function(t,e){let n=Xn.get(t);void 0===n&&(n=[],Xn.set(t,n));let i=n[e];return void 0===i&&(i={value:t,count:e},n[e]=i),i}(r,s)}}function Qn(t,e){return Fn(()=>{let n=qn(t),i=function(t){switch(t){case"@key":return Jn(Hn);case"@index":return Jn(Zn);case"@identity":return Jn(Kn);default:return e=t,Jn(t=>zt(t,e))}var e}(e);if(Array.isArray(n))return new ni(n,i);let r=Pt(n);return null===r?new ni(hn,()=>null):new ei(r,i)})}function ti(t){let e=t,n=ye();return Fn(()=>(je(n),e),t=>{e!==t&&(e=t,ge(n))})}class ei{constructor(t,e){this.inner=t,this.keyFor=e}isEmpty(){return this.inner.isEmpty()}next(){let t=this.inner.next();return null!==t&&(t.key=this.keyFor(t.value,t.memo)),t}}let ni=class{constructor(t,e){this.iterator=t,this.keyFor=e,this.pos=0,0===t.length?this.current={kind:"empty"}:this.current={kind:"first",value:t[this.pos]}}isEmpty(){return"empty"===this.current.kind}next(){let t,e=this.current;if("first"===e.kind)this.current={kind:"progress"},t=e.value;else{if(this.pos>=this.iterator.length-1)return null;t=this.iterator[++this.pos]}let{keyFor:n}=this;return{key:n(t,this.pos),value:t,memo:this.pos}}};const ii=Object.freeze(Object.defineProperty({__proto__:null,FALSE_REFERENCE:On,NULL_REFERENCE:Pn,REFERENCE:Tn,TRUE_REFERENCE:In,UNDEFINED_REFERENCE:Rn,childRefFor:$n,childRefFromParts:Gn,createComputeRef:Fn,createConstRef:An,createDebugAliasRef:void 0,createInvokableRef:Nn,createIteratorItemRef:ti,createIteratorRef:Qn,createPrimitiveRef:Mn,createReadOnlyRef:jn,createUnboundRef:zn,isConstRef:Bn,isInvokableRef:Dn,isUpdatableRef:Un,updateRef:Vn,valueForRef:qn},Symbol.toStringTag,{value:"Module"})),ri={Empty:0,dynamicLayout:1,dynamicTag:2,prepareArgs:4,createArgs:8,attributeHook:16,elementHook:32,dynamicScope:64,createCaller:128,updateHook:256,createInstance:512,wrapped:1024,willDestroy:2048,hasSubOwner:4096},si=1024,oi=new WeakMap;function ai(t){return oi.get(t)}function li(t,e){oi.set(t,e)}function ci(t){if("symbol"==typeof t)return null;const e=Number(t);return isNaN(e)?null:e%1==0?e:null}class hi{constructor(t){this.named=t}get(t,e){const n=this.named[e];if(void 0!==n)return qn(n)}has(t,e){return e in this.named}ownKeys(){return Object.keys(this.named)}isExtensible(){return!1}getOwnPropertyDescriptor(t,e){return{enumerable:!0,configurable:!0}}}class ui{constructor(t){this.positional=t}get(t,e){let{positional:n}=this;if("length"===e)return n.length;const i=ci(e);return null!==i&&i<n.length?qn(n[i]):t[e]}isExtensible(){return!1}has(t,e){const n=ci(e);return null!==n&&n<this.positional.length}}const di=t=>{const{named:e,positional:n}=t,i=new hi(e),r=new ui(n),s=Object.create(null),o=new Proxy(s,i),a=new Proxy([],r);return li(o,(t,n)=>function(t,e){return Ge(()=>{e in t&&qn(t[e])})}(e,n)),li(a,(t,e)=>function(t,e){return Ge(()=>{"[]"===e&&t.forEach(qn);const n=ci(e);null!==n&&n<t.length&&qn(t[n])})}(n,e)),{named:o,positional:a}},pi=ri.Empty;function fi(t){return pi|gi(t,"dynamicLayout")|gi(t,"dynamicTag")|gi(t,"prepareArgs")|gi(t,"createArgs")|gi(t,"attributeHook")|gi(t,"elementHook")|gi(t,"dynamicScope")|gi(t,"createCaller")|gi(t,"updateHook")|gi(t,"createInstance")|gi(t,"wrapped")|gi(t,"willDestroy")|gi(t,"hasSubOwner")}function gi(t,e){return t[e]?ri[e]:pi}function mi(t,e,n){return!!(e&n)}function yi(t,e){return!!(t&e)}function vi(t,e={}){return{hasValue:Boolean(e.hasValue),hasDestroyable:Boolean(e.hasDestroyable),hasScheduledEffect:Boolean(e.hasScheduledEffect)}}function _i(t){return t.capabilities.hasValue}function bi(t){return t.capabilities.hasDestroyable}class wi{constructor(t){this.factory=t,this.helperManagerDelegates=new WeakMap,this.undefinedDelegate=null}getDelegateForOwner(t){let e=this.helperManagerDelegates.get(t);if(void 0===e){let{factory:n}=this;e=n(t),this.helperManagerDelegates.set(t,e)}return e}getDelegateFor(t){if(void 0===t){let{undefinedDelegate:t}=this;if(null===t){let{factory:e}=this;this.undefinedDelegate=t=e(void 0)}return t}return this.getDelegateForOwner(t)}getHelper(t){return(e,n)=>{let i=this.getDelegateFor(n);const r=di(e),s=i.createHelper(t,r);if(_i(i)){let t=Fn(()=>i.getValue(s),null);return bi(i)&&Gt(t,i.getDestroyable(s)),t}if(bi(i)){let t=An(void 0);return Gt(t,i.getDestroyable(s)),t}return Rn}}}class xi{createHelper(t,e){return{fn:t,args:e}}getValue({fn:t,args:e}){return Object.keys(e.named).length>0?t(...e.positional,e.named):t(...e.positional)}getDebugName(t){return t.name?`(helper function ${t.name})`:"(anonymous helper function)"}constructor(){this.capabilities={hasValue:!0,hasDestroyable:!1,hasScheduledEffect:!1}}}const Ci=new WeakMap,Si=new WeakMap,ki=new WeakMap,Ei=Object.getPrototypeOf;function Ti(t,e,n){return t.set(n,e),n}function Li(t,e){let n=e;for(;null!==n;){const e=t.get(n);if(void 0!==e)return e;n=Ei(n)}}function Mi(t,e){return Ti(Si,t,e)}function Ri(t){const e=Li(Si,t);return void 0===e?null:e}function Pi(t,e){return Ti(ki,t,e)}const Ii=new wi(()=>new xi);function Oi(t){let e=Li(ki,t);return void 0===e&&"function"==typeof t&&(e=Ii),e||null}function Ai(t,e){return Ti(Ci,t,e)}function zi(t){const e=Li(Ci,t);return void 0===e?null:e}function Fi(t){return void 0!==Li(Ci,t)}function ji(t){return function(t){return"function"==typeof t}(t)||void 0!==Li(ki,t)}const Di={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!0,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!0,updateHook:!0,createInstance:!0,wrapped:!1,willDestroy:!1,hasSubOwner:!1};function Ni(t,e={}){let n=Boolean(e.updateHook);return{asyncLifeCycleCallbacks:Boolean(e.asyncLifecycleCallbacks),destructor:Boolean(e.destructor),updateHook:n}}function Bi(t){return t.capabilities.asyncLifeCycleCallbacks}function Ui(t){return t.capabilities.updateHook}class qi{constructor(t){this.factory=t,this.componentManagerDelegates=new WeakMap}getDelegateFor(t){let{componentManagerDelegates:e}=this,n=e.get(t);if(void 0===n){let{factory:i}=this;n=i(t),e.set(t,n)}return n}create(t,e,n){let i=this.getDelegateFor(t),r=di(n.capture()),s=i.createComponent(e,r);return new Vi(s,i,r)}getDebugName(t){return"function"==typeof t?t.name:t.toString()}update(t){let{delegate:e}=t;if(Ui(e)){let{component:n,args:i}=t;e.updateComponent(n,i)}}didCreate({component:t,delegate:e}){Bi(e)&&e.didCreateComponent(t)}didUpdate({component:t,delegate:e}){(function(t){return Bi(t)&&Ui(t)})(e)&&e.didUpdateComponent(t)}didRenderLayout(){}didUpdateLayout(){}getSelf({component:t,delegate:e}){return An(e.getContext(t))}getDestroyable(t){const{delegate:e}=t;if(function(t){return t.capabilities.destructor}(e)){const{component:n}=t;return Wt(t,()=>e.destroyComponent(n)),t}return null}getCapabilities(){return Di}}class Vi{constructor(t,e,n){this.component=t,this.delegate=e,this.args=n}}function $i(t,e={}){return{disableAutoTracking:Boolean(e.disableAutoTracking)}}class Gi{constructor(t){this.factory=t,this.componentManagerDelegates=new WeakMap}getDelegateFor(t){let{componentManagerDelegates:e}=this,n=e.get(t);if(void 0===n){let{factory:i}=this;n=i(t),e.set(t,n)}return n}create(t,e,n,i){let r,s=this.getDelegateFor(t),o=di(i),a=s.createModifier(n,o);return r={tag:ve(),element:e,delegate:s,args:o,modifier:a},Wt(r,()=>s.destroyModifier(a,o)),r}getDebugName(t){return"function"==typeof t?t.name||t.toString():"<unknown>"}getDebugInstance({modifier:t}){return t}getTag({tag:t}){return t}install({element:t,args:e,modifier:n,delegate:i}){let{capabilities:r}=i;r.disableAutoTracking?We(()=>i.installModifier(n,t,e)):i.installModifier(n,t,e)}update({args:t,modifier:e,delegate:n}){let{capabilities:i}=n;i.disableAutoTracking?We(()=>n.updateModifier(e,t)):n.updateModifier(e,t)}getDestroyable(t){return t}}function Wi(t,e){return Ai(new qi(t),e)}function Hi(t,e){return Mi(new Gi(t),e)}function Zi(t,e){return Pi(new wi(t),e)}const Ki=new WeakMap,Yi=Reflect.getPrototypeOf;function Xi(t,e){return Ki.set(e,t),e}function Ji(t){let e=t;for(;null!==e;){let t=Ki.get(e);if(void 0!==t)return t;e=Yi(e)}}const Qi=Object.freeze(Object.defineProperty({__proto__:null,CustomComponentManager:qi,CustomHelperManager:wi,CustomModifierManager:Gi,capabilityFlagsFrom:fi,componentCapabilities:Ni,getComponentTemplate:Ji,getCustomTagFor:ai,getInternalComponentManager:zi,getInternalHelperManager:Oi,getInternalModifierManager:Ri,hasCapability:yi,hasDestroyable:bi,hasInternalComponentManager:Fi,hasInternalHelperManager:ji,hasInternalModifierManager:function(t){return void 0!==Li(Si,t)},hasValue:_i,helperCapabilities:vi,managerHasCapability:mi,modifierCapabilities:$i,setComponentManager:Wi,setComponentTemplate:Xi,setCustomTagFor:li,setHelperManager:Zi,setInternalComponentManager:Ai,setInternalHelperManager:Pi,setInternalModifierManager:Mi,setModifierManager:Hi},Symbol.toStringTag,{value:"Module"})),tr=new WeakSet;function er(t){return!!H(t)&&tr.has(t)}function nr(t){H(t)&&tr.add(t)}const ir=new WeakSet;function rr(t){return ir.has(t)}let sr=class{size=0;misses=0;hits=0;constructor(t,e,n=new Map){this.limit=t,this.func=e,this.store=n}get(t){return this.store.has(t)?(this.hits++,this.store.get(t)):(this.misses++,this.set(t,this.func(t)))}set(t,e){return this.limit>this.size&&(this.size++,this.store.set(t,e)),e}purge(){this.store.clear(),this.size=0,this.hits=0,this.misses=0}};const or="6.11.0-beta.1",ar=Object.freeze(Object.defineProperty({__proto__:null,default:or},Symbol.toStringTag,{value:"Module"})),lr=Symbol("OWNER");function cr(t){return t[lr]}function hr(t){return cr(t)}function ur(t,e){!function(t,e){t[lr]=e}(t,e)}function dr(t,e){return Array.isArray(t)?t[e]:t.objectAt(e)}const pr=kt("SELF_TAG");function fr(t,e,n=!1,i){let r=ai(t);return void 0!==r?r(t,e,n):on(t,e,i)}function gr(t){return H(t)?on(t,pr):_e}function mr(t,e){rn(t,e),rn(t,pr)}const yr=new WeakSet;function vr(t,e,n){let i=t.readableLazyChainsFor(e);if(void 0!==i){if(H(n))for(let[t,e]of i)me(t,br(n,e,sn(n),oe(n)));i.length=0}}function _r(t,e,n,i){let r=[];for(let s of e)wr(r,t,s,n,i);return ke(r)}function br(t,e,n,i){return ke(wr([],t,e,n,i))}function wr(t,e,n,i,r){let s,o,a=e,l=i,c=r,h=n.length,u=-1;for(;;){let e=u+1;if(u=n.indexOf(".",e),-1===u&&(u=h),s=n.slice(e,u),"@each"===s&&u!==h){e=u+1,u=n.indexOf(".",e);let i=a.length;if("number"!=typeof i||!Array.isArray(a)&&!("objectAt"in a))break;if(0===i){t.push(fr(a,"[]"));break}s=-1===u?n.slice(e):n.slice(e,u);for(let e=0;e<i;e++){let n=dr(a,e);n&&(t.push(fr(n,s,!0)),c=oe(n),o=null!==c?c.peekDescriptors(s):void 0,void 0!==o&&"string"==typeof o.altKey&&n[s])}t.push(fr(a,"[]",!0,l));break}let i=fr(a,s,!0,l);if(o=null!==c?c.peekDescriptors(s):void 0,t.push(i),u===h){yr.has(o)&&a[s];break}if(void 0===o)a=s in a||"function"!=typeof a.unknownProperty?a[s]:a.unknownProperty(s);else if(yr.has(o))a=a[s];else{let e=c.source===a?c:ae(a),r=e.revisionFor(s);if(void 0===r||!de(i,r)){let i=e.writableLazyChainsFor(s),r=n.substring(u+1),o=ve();i.push([o,r]),t.push(o);break}a=e.valueFor(s)}if(!H(a))break;l=sn(a),c=oe(a)}return t}function xr(t){let[e,n,i]=t;return 3===t.length&&("function"==typeof e||"object"==typeof e&&null!==e)&&"string"==typeof n&&("object"==typeof i&&null!==i||void 0===i)}function Cr(t){let e=function(){return t};return Or(e),e}class Sr{enumerable=!0;configurable=!0;_dependentKeys=void 0;_meta=void 0;setup(t,e,n,i){i.writeDescriptors(e,this)}teardown(t,e,n){n.removeDescriptors(e)}}function kr(t,e){return function(){return e.get(this,t)}}function Er(t,e){let n=function(n){return e.set(this,t,n)};return Tr.add(n),n}const Tr=new WeakSet;function Lr(t,e){let n=function(e,n,i,r){let s=3===arguments.length?ae(e):r;return t.setup(e,n,i,s),{enumerable:t.enumerable,configurable:t.configurable,get:kr(n,t),set:Er(n,t)}};return Or(n,t),Object.setPrototypeOf(n,e.prototype),n}const Mr=new WeakMap;function Rr(t,e,n){let i=void 0===n?oe(t):n;if(null!==i)return i.peekDescriptors(e)}function Pr(t){return Mr.get(t)}function Ir(t){return"function"==typeof t&&Mr.has(t)}function Or(t,e=!0){Mr.set(t,e)}const Ar=/\.@each$/;function zr(t,e){let n=t.indexOf("{");n<0?e(t.replace(Ar,".[]")):Fr("",t,n,e)}function Fr(t,e,n,i){let r,s,o=e.indexOf("}"),a=0,l=e.substring(n+1,o).split(","),c=e.substring(o+1);for(t+=e.substring(0,n),s=l.length;a<s;)r=c.indexOf("{"),r<0?i((t+l[a++]+c).replace(Ar,".[]")):Fr(t+l[a++],c,r,i)}function jr(t){return t+":change"}function Dr(t,e,n,i,r,s=!0){i||"function"!=typeof n||(i=n,n=null),ae(t).addToListeners(e,n,i,!0===r,s)}function Nr(t,e,n,i){let r,s;"object"==typeof n?(r=n,s=i):(r=null,s=n),ae(t).removeFromListeners(e,r,s)}function Br(t,e,n,i,r){if(void 0===i){let n=void 0===r?oe(t):r;i=null!==n?n.matchingListeners(e):void 0}if(void 0===i||0===i.length)return!1;for(let s=i.length-3;s>=0;s-=3){let r=i[s],o=i[s+1],a=i[s+2];if(!o)continue;a&&Nr(t,e,r,o),r||(r=t);let l=typeof o;"string"!==l&&"symbol"!==l||(o=r[o]),o.apply(r,n)}return!0}function Ur(t,e){let n=oe(t);if(null===n)return!1;let i=n.matchingListeners(e);return void 0!==i&&i.length>0}function qr(...t){let e=t.pop();return ft(e,t),e}const Vr=!g._DEFAULT_ASYNC_OBSERVERS,$r=new Map,Gr=new Map;function Wr(t,e,n,i,r=Vr){let s=jr(e);Dr(t,s,n,i,!1,r);let o=oe(t);null!==o&&(o.isPrototypeMeta(t)||o.isInitializing())||Zr(t,s,r)}function Hr(t,e,n,i,r=Vr){let s=jr(e),o=oe(t);null!==o&&(o.isPrototypeMeta(t)||o.isInitializing())||Xr(t,s,r),Nr(t,s,n,i)}function Zr(t,e,n=!1){let i=function(t,e){let n=!0===e?$r:Gr;return n.has(t)||(n.set(t,new Map),Wt(t,()=>function(t){$r.size>0&&$r.delete(t),Gr.size>0&&Gr.delete(t)}(t),!0)),n.get(t)}(t,n);if(i.has(e))i.get(e).count++;else{let n=e.substring(0,e.lastIndexOf(":")),r=br(t,n,sn(t),oe(t));i.set(e,{count:1,path:n,tag:r,lastRevision:ue(r),suspended:!1})}}let Kr=!1,Yr=[];function Xr(t,e,n=!1){if(!0===Kr)return void Yr.push([t,e,n]);let i=!0===n?$r:Gr,r=i.get(t);if(void 0!==r){let n=r.get(e);n.count--,0===n.count&&(r.delete(e),0===r.size&&i.delete(t))}}function Jr(t){Gr.has(t)&&Gr.get(t).forEach(e=>{e.tag=br(t,e.path,sn(t),oe(t)),e.lastRevision=ue(e.tag)}),$r.has(t)&&$r.get(t).forEach(e=>{e.tag=br(t,e.path,sn(t),oe(t)),e.lastRevision=ue(e.tag)})}let Qr=0;function ts(t){let e=ue(Se);Qr!==e&&(Qr=e,Gr.forEach((e,n)=>{let i=oe(n);e.forEach((e,r)=>{if(!de(e.tag,e.lastRevision)){let s=()=>{try{Br(n,r,[n,e.path],void 0,i)}finally{e.tag=br(n,e.path,sn(n),oe(n)),e.lastRevision=ue(e.tag)}};t?t("actions",s):s()}})}))}function es(){$r.forEach((t,e)=>{let n=oe(e);t.forEach((t,i)=>{if(!t.suspended&&!de(t.tag,t.lastRevision))try{t.suspended=!0,Br(e,i,[e,t.path],void 0,n)}finally{t.tag=br(e,t.path,sn(e),oe(e)),t.lastRevision=ue(t.tag),t.suspended=!1}})})}function ns(t,e,n){let i=$r.get(t);if(!i)return;let r=i.get(jr(e));r&&(r.suspended=n)}const is=Symbol("PROPERTY_DID_CHANGE");let rs=0;function ss(t,e,n,i){let r=void 0===n?oe(t):n;null!==r&&(r.isInitializing()||r.isPrototypeMeta(t))||(mr(t,e),rs<=0&&es(),is in t&&(4===arguments.length?t[is](e,i):t[is](e)))}function os(){rs++,Kr=!0}function as(){rs--,rs<=0&&(es(),function(){Kr=!1;for(let[t,e,n]of Yr)Xr(t,e,n);Yr=[]}())}function ls(t){os();try{t()}finally{as()}}function cs(){}class hs extends Sr{_readOnly=!1;_hasConfig=!1;_getter=void 0;_setter=void 0;constructor(t){super();let e=t[t.length-1];if("function"==typeof e||null!==e&&"object"==typeof e){this._hasConfig=!0;let e=t.pop();if("function"==typeof e)this._getter=e;else{const t=e;this._getter=t.get||cs,this._setter=t.set}}t.length>0&&this._property(...t)}setup(t,e,n,i){if(super.setup(t,e,n,i),!1===this._hasConfig){let{get:t,set:e}=n;void 0!==t&&(this._getter=t),void 0!==e&&(this._setter=function(n,i){let r=e.call(this,i);return void 0!==t&&void 0===r?t.call(this):r})}}_property(...t){let e=[];function n(t){e.push(t)}for(let i of t)zr(i,n);this._dependentKeys=e}get(t,e){let n,i=ae(t),r=sn(t),s=on(t,e,r),o=i.revisionFor(e);if(void 0!==o&&de(s,o))n=i.valueFor(e);else{let{_getter:o,_dependentKeys:a}=this;We(()=>{n=o.call(t,e)}),void 0!==a&&me(s,_r(t,a,r,i)),i.setValueFor(e,n),i.setRevisionFor(e,ue(s)),vr(i,e,n)}return je(s),Array.isArray(n)&&je(on(n,"[]")),n}set(t,e,n){this._readOnly&&this._throwReadOnlyError(t,e);let i,r=ae(t);r.isInitializing()&&void 0!==this._dependentKeys&&this._dependentKeys.length>0&&"function"==typeof t[is]&&t.isComponent&&Wr(t,e,()=>{t[is](e)},void 0,!0);try{os(),i=this._set(t,e,n,r),vr(r,e,i);let s=sn(t),o=on(t,e,s),{_dependentKeys:a}=this;void 0!==a&&me(o,_r(t,a,s,r)),r.setRevisionFor(e,ue(o))}finally{as()}return i}_throwReadOnlyError(t,e){throw new Error(`Cannot set read-only property "${e}" on object: ${R(t)}`)}_set(t,e,n,i){let r,s=void 0!==i.revisionFor(e),o=i.valueFor(e),{_setter:a}=this;ns(t,e,!0);try{r=a.call(t,e,n,o)}finally{ns(t,e,!1)}return s&&o===r||(i.setValueFor(e,r),ss(t,e,i,n)),r}teardown(t,e,n){void 0!==n.revisionFor(e)&&(n.setRevisionFor(e,void 0),n.setValueFor(e,void 0)),super.teardown(t,e,n)}}class us extends hs{get(t,e){let n,i=ae(t),r=sn(t),s=on(t,e,r),o=i.revisionFor(e);if(void 0!==o&&de(s,o))n=i.valueFor(e);else{let{_getter:r}=this,o=Ge(()=>{n=r.call(t,e)});me(s,o),i.setValueFor(e,n),i.setRevisionFor(e,ue(s)),vr(i,e,n)}return je(s),Array.isArray(n)&&je(on(n,"[]",r)),n}}class ds extends Function{readOnly(){return Pr(this)._readOnly=!0,this}meta(t){let e=Pr(this);return 0===arguments.length?e._meta||{}:(e._meta=t,this)}get _getter(){return Pr(this)._getter}set enumerable(t){Pr(this).enumerable=t}}function ps(...t){return xr(t)?Lr(new hs([]),ds)(t[0],t[1],t[2]):Lr(new hs(t),ds)}function fs(...t){return Lr(new us(t),ds)}function gs(t,e){return Boolean(Rr(t,e))}function ms(t,e,n,i,r){let s=void 0===r?ae(t):r,o=Rr(t,e,s),a=void 0!==o;a&&o.teardown(t,e,s),Ir(n)?ys(t,e,n,s):null==n?vs(t,e,i,a,!0):Object.defineProperty(t,e,n),s.isPrototypeMeta(t)||Jr(t)}function ys(t,e,n,i){let r;return r=n(t,e,void 0,i),Object.defineProperty(t,e,r),n}function vs(t,e,n,i,r=!0){return!0===i||!1===r?Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n}):t[e]=n,n}const _s=new sr(1e3,t=>t.indexOf("."));function bs(t){return"string"==typeof t&&-1!==_s.get(t)}const ws=kt("PROXY_CONTENT");function xs(t){return"object"==typeof t&&null!==t&&"function"==typeof t.unknownProperty}function Cs(t,e){return bs(e)?ks(t,e):Ss(t,e)}function Ss(t,e){if(null==t)return;let n;return"object"==typeof t||"function"==typeof t?(n=t[e],void 0===n&&"object"==typeof t&&!(e in t)&&xs(t)&&(n=t.unknownProperty(e)),Fe()&&(je(on(t,e)),(Array.isArray(n)||rr(n))&&je(on(n,"[]")))):n=t[e],n}function ks(t,e,n){let i="string"==typeof e?e.split("."):e;for(let r of i){if(null==t||t.isDestroyed)return;if(n&&("__proto__"===r||"constructor"===r))return;t=Ss(t,r)}return t}Ss("foo","a"),Ss("foo",1),Ss({},"a"),Ss({},1),Ss({unknownProperty(){}},"a"),Ss({unknownProperty(){}},1),Cs({},"foo"),Cs({},"foo.bar");let Es={};nr(Es),Ge(()=>Ss({},"a")),Ge(()=>Ss({},1)),Ge(()=>Ss({a:[]},"a")),Ge(()=>Ss({a:Es},"a"));class Ts{_registry;_coreLibIndex;constructor(){this._registry=[],this._coreLibIndex=0}_getLibraryByName(t){let e=this._registry;for(let n of e)if(n.name===t)return n}register(t,e,n){let i=this._registry.length;this._getLibraryByName(t)||(n&&(i=this._coreLibIndex++),this._registry.splice(i,0,{name:t,version:e}))}registerCoreLibrary(t,e){this.register(t,e,!0)}deRegister(t){let e,n=this._getLibraryByName(t);n&&(e=this._registry.indexOf(n),this._registry.splice(e,1))}}const Ls=new Ts;let Ms;function Rs(t,...e){let n,i;xr(e)?n=e:"string"==typeof e[0]&&(i=e[0]);let r=ps({get:function(e){return(hr(this)||this.container).lookup(`${t}:${i||e}`)},set(t,e){ms(this,t,null,e)}});return n?r(n[0],n[1],n[2]):r}function Ps(...t){if(!xr(t)){let e=t[0],n=e?e.initializer:void 0,i=e?e.value:void 0,r=function(t,e){return Is([t,e,{initializer:n||(()=>i)}])};return Or(r),r}return Is(t)}function Is([t,e,n]){let{getter:i,setter:r}=an(e,n?n.initializer:void 0);function s(){let t=i(this);return(Array.isArray(t)||rr(t))&&je(on(t,"[]")),t}function o(t){r(this,t),rn(this,pr)}let a={enumerable:!0,configurable:!0,isTracked:!0,get:s,set:o};return Tr.add(o),ae(t).writeDescriptors(e,new Os(s,o)),a}Ls.registerCoreLibrary("Ember",or);class Os{constructor(t,e){this._get=t,this._set=e,yr.add(this)}get(t){return this._get.call(t)}set(t,e,n){this._set.call(t,n)}}function As(t,e){let n=oe(t);return n?n.valueFor(e):void 0}function zs(t,e,n,i){return t.isDestroyed?n:bs(e)?function(t,e,n,i){let r=e.split("."),s=r.pop(),o=ks(t,r,!0);if(null!=o)return zs(o,s,n);if(!i)throw new Error(`Property set failed: object in path "${r.join(".")}" could not be found.`)}(t,e,n,i):Fs(t,e,n)}function Fs(t,e,n){let i,r=vt(t,e);return null!==r&&Tr.has(r.set)?(t[e]=n,n):(i=t[e],void 0!==i||"object"!=typeof t||e in t||"function"!=typeof t.setUnknownProperty?(t[e]=n,i!==n&&ss(t,e)):t.setUnknownProperty(e,n),n)}function js(t,e,n){return zs(t,e,n,!0)}function Ds(t){return Lr(new Bs(t),Ns)}class Ns extends Function{readOnly(){return Pr(this).readOnly(),this}oneWay(){return Pr(this).oneWay(),this}meta(t){let e=Pr(this);if(0===arguments.length)return e._meta||{};e._meta=t}}class Bs extends Sr{altKey;constructor(t){super(),this.altKey=t}setup(t,e,n,i){super.setup(t,e,n,i),yr.add(this)}get(t,e){let n,i=ae(t),r=sn(t),s=on(t,e,r);We(()=>{n=Cs(t,this.altKey)});let o=i.revisionFor(e);return void 0!==o&&de(s,o)||(me(s,br(t,this.altKey,r,i)),i.setRevisionFor(e,ue(s)),vr(i,e,n)),je(s),n}set(t,e,n){return zs(t,this.altKey,n)}readOnly(){this.set=Us}oneWay(){this.set=qs}}function Us(t,e){throw new Error(`Cannot set read-only property '${e}' on object: ${R(t)}`)}function qs(t,e,n){return ms(t,e,null),zs(t,e,n)}function Vs(t,e,n,i){return void 0===e?(e=0,n=i=-1):(void 0===n&&(n=-1),void 0===i&&(i=-1)),Br(t,"@array:before",[t,e,n,i]),t}function $s(t,e,n,i,r=!0){void 0===e?(e=0,n=i=-1):(void 0===n&&(n=-1),void 0===i&&(i=-1));let s=oe(t);if(r&&((i<0||n<0||i-n!==0)&&ss(t,"length",s),ss(t,"[]",s)),Br(t,"@array:change",[t,e,n,i]),null!==s){let r=-1===n?0:n,o=t.length-((-1===i?0:i)-r),a=e<0?o+e:e;void 0!==s.revisionFor("firstObject")&&0===a&&ss(t,"firstObject",s),void 0!==s.revisionFor("lastObject")&&o-1<a+r&&ss(t,"lastObject",s)}return t}const Gs=Object.freeze([]);function Ws(t,e,n,i=Gs){var r;null!=(r=t)&&"function"==typeof r.replace?t.replace(e,n,i):Zs(t,e,n,i)}const Hs=6e4;function Zs(t,e,n,i){if(Vs(t,e,n,i.length),i.length<=Hs)t.splice(e,n,...i);else{t.splice(e,n);for(let n=0;n<i.length;n+=Hs){let r=i.slice(n,n+Hs);t.splice(e+n,0,...r)}}$s(t,e,n,i.length)}function Ks(t,e,n,i){let{willChange:r,didChange:s}=n;return i(t,"@array:before",e,r),i(t,"@array:change",e,s),t._revalidate?.(),t}function Ys(t,e,n){return Ks(t,e,n,Dr)}function Xs(t,e,n){return Ks(t,e,n,Nr)}function Js(t,e){let n,i={},r=1;for(2===arguments.length&&Array.isArray(e)?(r=0,n=arguments[1]):n=Array.from(arguments);r<n.length;r++){let e=n[r];i[e]=Cs(t,e)}return i}function Qs(t,e){return null===e||"object"!=typeof e||ls(()=>{let n=Object.keys(e);for(let i of n)zs(t,i,e[i])}),e}const to=new WeakMap;function eo(t,e){H(t)&&to.set(t,e)}function no(t){return to.get(t)}const io=Object.prototype.hasOwnProperty;let ro=!1;const so={_set:0,_unprocessedNamespaces:!1,get unprocessedNamespaces(){return this._unprocessedNamespaces},set unprocessedNamespaces(t){this._set++,this._unprocessedNamespaces=t}};let oo=!1;const ao=[],lo=Object.create(null);function co(t){so.unprocessedNamespaces=!0,ao.push(t)}function ho(t){let e=no(t);delete lo[e],ao.splice(ao.indexOf(t),1),e in d.lookup&&t===d.lookup[e]&&(d.lookup[e]=void 0)}function uo(){if(!so.unprocessedNamespaces)return;let t=d.lookup,e=Object.keys(t);for(let n of e){if(!wo(n.charCodeAt(0)))continue;let e=xo(t,n);e&&eo(e,n)}}function po(t){return ro||go(),lo[t]}function fo(t){_o([t.toString()],t,new Set)}function go(){let t=so.unprocessedNamespaces;if(t&&(uo(),so.unprocessedNamespaces=!1),t||oo){let t=ao;for(let e of t)fo(e);oo=!1}}function mo(){return ro}function yo(t){ro=Boolean(t)}function vo(){oo=!0}function _o(t,e,n){let i=t.length,r=t.join(".");lo[r]=e,eo(e,r);for(let s in e){if(!io.call(e,s))continue;let r=e[s];if(t[i]=s,r&&void 0===no(r))eo(r,t.join("."));else if(r&&bo(r)){if(n.has(r))continue;n.add(r),_o(t,r,n)}}t.length=i}function bo(t){return null!=t&&"object"==typeof t&&t.isNamespace}function wo(t){return t>=65&&t<=90}function xo(t,e){try{let n=t[e];return(null!==n&&"object"==typeof n||"function"==typeof n)&&n.isNamespace&&n}catch(n){}}let Co;const So={get onerror(){return Co}};function ko(){return Co}const Eo=setTimeout,To=()=>{};function Lo(t){if("function"==typeof Promise){const e=Promise.resolve();return()=>e.then(t)}if("function"==typeof MutationObserver){let e=0,n=new MutationObserver(t),i=document.createTextNode("");return n.observe(i,{characterData:!0}),()=>(e=++e%2,i.data=""+e,e)}return()=>Eo(t,0)}function Mo(t){let e=To;return{setTimeout:(t,e)=>setTimeout(t,e),clearTimeout:t=>clearTimeout(t),now:()=>Date.now(),next:Lo(t),clearNext:e}}const Ro=/\d+/;function Po(t){let e=typeof t;return"number"===e&&t==t||"string"===e&&Ro.test(t)}function Io(t){return t.onError||t.onErrorTarget&&t.onErrorTarget[t.onErrorMethod]}function Oo(t,e,n){let i=-1;for(let r=0,s=n.length;r<s;r+=4)if(n[r]===t&&n[r+1]===e){i=r;break}return i}function Ao(t,e,n){let i=-1;for(let r=2,s=n.length;r<s;r+=6)if(n[r]===t&&n[r+1]===e){i=r-2;break}return i}function zo(t,e,n=0){let i=[];for(let r=0;r<t.length;r+=e){let e=t[r+3+n],s={target:t[r+0+n],method:t[r+1+n],args:t[r+2+n],stack:void 0!==e&&"stack"in e?e.stack:""};i.push(s)}return i}function Fo(t,e){let n,i,r=0,s=e.length-6;for(;r<s;)i=(s-r)/6,n=r+i-i%6,t>=e[n]?r=n+6:s=n;return t>=e[r]?r+6:r}class jo{constructor(t,e={},n={}){this._queueBeingFlushed=[],this.targetQueues=new Map,this.index=0,this._queue=[],this.name=t,this.options=e,this.globalOptions=n}stackFor(t){if(t<this._queue.length){let e=this._queue[3*t+4];return e?e.stack:null}}flush(t){let e,n,i,r,s,{before:o,after:a}=this.options;this.targetQueues.clear(),0===this._queueBeingFlushed.length&&(this._queueBeingFlushed=this._queue,this._queue=[]),void 0!==o&&o();let l=this._queueBeingFlushed;if(l.length>0){let t=Io(this.globalOptions);s=t?this.invokeWithOnError:this.invoke;for(let o=this.index;o<l.length;o+=4)if(this.index+=4,n=l[o+1],null!==n&&(e=l[o],i=l[o+2],r=l[o+3],s(e,n,i,t,r)),this.index!==this._queueBeingFlushed.length&&this.globalOptions.mustYield&&this.globalOptions.mustYield())return 1}void 0!==a&&a(),this._queueBeingFlushed.length=0,this.index=0,!1!==t&&this._queue.length>0&&this.flush(!0)}hasWork(){return this._queueBeingFlushed.length>0||this._queue.length>0}cancel({target:t,method:e}){let n=this._queue,i=this.targetQueues.get(t);void 0!==i&&i.delete(e);let r=Oo(t,e,n);return r>-1?(n[r+1]=null,!0):(n=this._queueBeingFlushed,r=Oo(t,e,n),r>-1&&(n[r+1]=null,!0))}push(t,e,n,i){return this._queue.push(t,e,n,i),{queue:this,target:t,method:e}}pushUnique(t,e,n,i){let r=this.targetQueues.get(t);void 0===r&&(r=new Map,this.targetQueues.set(t,r));let s=r.get(e);if(void 0===s){let s=this._queue.push(t,e,n,i)-4;r.set(e,s)}else{let t=this._queue;t[s+2]=n,t[s+3]=i}return{queue:this,target:t,method:e}}_getDebugInfo(t){if(t)return zo(this._queue,4)}invoke(t,e,n){void 0===n?e.call(t):e.apply(t,n)}invokeWithOnError(t,e,n,i,r){try{void 0===n?e.call(t):e.apply(t,n)}catch(IN){i(IN,r)}}}class Do{constructor(t=[],e){this.queues={},this.queueNameIndex=0,this.queueNames=t,t.reduce(function(t,n){return t[n]=new jo(n,e[n],e),t},this.queues)}schedule(t,e,n,i,r,s){let o=this.queues[t];if(void 0===o)throw new Error(`You attempted to schedule an action in a queue (${t}) that doesn't exist`);if(null==n)throw new Error(`You attempted to schedule an action in a queue (${t}) for a method that doesn't exist`);return this.queueNameIndex=0,r?o.pushUnique(e,n,i,s):o.push(e,n,i,s)}flush(t=!1){let e,n,i=this.queueNames.length;for(;this.queueNameIndex<i;)if(n=this.queueNames[this.queueNameIndex],e=this.queues[n],!1===e.hasWork()){if(this.queueNameIndex++,t&&this.queueNameIndex<i)return 1}else if(1===e.flush(!1))return 1}_getDebugInfo(t){if(t){let e,n,i={},r=this.queueNames.length,s=0;for(;s<r;)n=this.queueNames[s],e=this.queues[n],i[n]=e._getDebugInfo(t),s++;return i}}}function No(t){let e=t(),n=e.next();for(;!1===n.done;)n.value(),n=e.next()}const Bo=function(){},Uo=Object.freeze([]);function qo(){let t,e,n,i=arguments.length;if(0===i);else if(1===i)n=null,e=arguments[0];else{let r=2,s=arguments[0],o=arguments[1],a=typeof o;if("function"===a?(n=s,e=o):null!==s&&"string"===a&&o in s?(n=s,e=n[o]):"function"==typeof s&&(r=1,n=null,e=s),i>r){let e=i-r;t=new Array(e);for(let n=0;n<e;n++)t[n]=arguments[n+r]}}return[n,e,t]}function Vo(){let t,e,n,i,r;return 2===arguments.length?(e=arguments[0],r=arguments[1],t=null):([t,e,i]=qo(...arguments),void 0===i?r=0:(r=i.pop(),Po(r)||(n=!0===r,r=i.pop()))),r=parseInt(r,10),[t,e,i,r,n]}let $o=0,Go=0,Wo=0,Ho=0,Zo=0,Ko=0,Yo=0,Xo=0,Jo=0,Qo=0,ta=0,ea=0,na=0,ia=0,ra=0,sa=0,oa=0,aa=0,la=0,ca=0,ha=0;class ua{constructor(t,e){this.DEBUG=!1,this.currentInstance=null,this.instanceStack=[],this._eventCallbacks={end:[],begin:[]},this._timerTimeoutId=null,this._timers=[],this._autorun=!1,this._autorunStack=null,this.queueNames=t,this.options=e||{},"string"==typeof this.options.defaultQueue?this._defaultQueue=this.options.defaultQueue:this._defaultQueue=this.queueNames[0],this._onBegin=this.options.onBegin||Bo,this._onEnd=this.options.onEnd||Bo,this._boundRunExpiredTimers=this._runExpiredTimers.bind(this),this._boundAutorunEnd=()=>{la++,!1!==this._autorun&&(this._autorun=!1,this._autorunStack=null,this._end(!0))};let n=this.options._buildPlatform||Mo;this._platform=n(this._boundAutorunEnd)}get counters(){return{begin:Go,end:Wo,events:{begin:Ho,end:0},autoruns:{created:aa,completed:la},run:Zo,join:Ko,defer:Yo,schedule:Xo,scheduleIterable:Jo,deferOnce:Qo,scheduleOnce:ta,setTimeout:ea,later:na,throttle:ia,debounce:ra,cancelTimers:sa,cancel:oa,loops:{total:ca,nested:ha}}}get defaultQueue(){return this._defaultQueue}begin(){Go++;let t,e=this.options,n=this.currentInstance;return!1!==this._autorun?(t=n,this._cancelAutorun()):(null!==n&&(ha++,this.instanceStack.push(n)),ca++,t=this.currentInstance=new Do(this.queueNames,e),Ho++,this._trigger("begin",t,n)),this._onBegin(t,n),t}end(){Wo++,this._end(!1)}on(t,e){if("function"!=typeof e)throw new TypeError("Callback must be a function");let n=this._eventCallbacks[t];if(void 0===n)throw new TypeError(`Cannot on() event ${t} because it does not exist`);n.push(e)}off(t,e){let n=this._eventCallbacks[t];if(!t||void 0===n)throw new TypeError(`Cannot off() event ${t} because it does not exist`);let i=!1;if(e)for(let r=0;r<n.length;r++)n[r]===e&&(i=!0,n.splice(r,1),r--);if(!i)throw new TypeError("Cannot off() callback that does not exist")}run(){Zo++;let[t,e,n]=qo(...arguments);return this._run(t,e,n)}join(){Ko++;let[t,e,n]=qo(...arguments);return this._join(t,e,n)}defer(t,e,n,...i){return Yo++,this.schedule(t,e,n,...i)}schedule(t,...e){Xo++;let[n,i,r]=qo(...e),s=this.DEBUG?new Error:void 0;return this._ensureInstance().schedule(t,n,i,r,!1,s)}scheduleIterable(t,e){Jo++;let n=this.DEBUG?new Error:void 0;return this._ensureInstance().schedule(t,null,No,[e],!1,n)}deferOnce(t,e,n,...i){return Qo++,this.scheduleOnce(t,e,n,...i)}scheduleOnce(t,...e){ta++;let[n,i,r]=qo(...e),s=this.DEBUG?new Error:void 0;return this._ensureInstance().schedule(t,n,i,r,!0,s)}setTimeout(){return ea++,this.later(...arguments)}later(){na++;let[t,e,n,i]=function(){let[t,e,n]=qo(...arguments),i=0,r=void 0!==n?n.length:0;return r>0&&Po(n[r-1])&&(i=parseInt(n.pop(),10)),[t,e,n,i]}(...arguments);return this._later(t,e,n,i)}throttle(){ia++;let t,[e,n,i,r,s=!0]=Vo(...arguments),o=Ao(e,n,this._timers);if(-1===o)t=this._later(e,n,s?Uo:i,r),s&&this._join(e,n,i);else{t=this._timers[o+1];let e=o+4;this._timers[e]!==Uo&&(this._timers[e]=i)}return t}debounce(){ra++;let t,[e,n,i,r,s=!1]=Vo(...arguments),o=this._timers,a=Ao(e,n,o);if(-1===a)t=this._later(e,n,s?Uo:i,r),s&&this._join(e,n,i);else{let s=this._platform.now()+r,l=a+4;o[l]===Uo&&(i=Uo),t=o[a+1];let c=Fo(s,o);if(a+6===c)o[a]=s,o[l]=i;else{let r=this._timers[a+5];this._timers.splice(c,0,s,t,e,n,i,r),this._timers.splice(a,6)}0===a&&this._reinstallTimerTimeout()}return t}cancelTimers(){sa++,this._clearTimerTimeout(),this._timers=[],this._cancelAutorun()}hasTimers(){return this._timers.length>0||this._autorun}cancel(t){if(oa++,null==t)return!1;let e=typeof t;return"number"===e?this._cancelLaterTimer(t):!("object"!==e||!t.queue||!t.method)&&t.queue.cancel(t)}ensureInstance(){this._ensureInstance()}getDebugInfo(){if(this.DEBUG)return{autorun:this._autorunStack,counters:this.counters,timers:zo(this._timers,6,2),instanceStack:[this.currentInstance,...this.instanceStack].map(t=>t&&t._getDebugInfo(this.DEBUG))}}_end(t){let e=this.currentInstance,n=null;if(null===e)throw new Error("end called without begin");let i,r=!1;try{i=e.flush(t)}finally{if(!r)if(r=!0,1===i){const t=this.queueNames[e.queueNameIndex];this._scheduleAutorun(t)}else this.currentInstance=null,this.instanceStack.length>0&&(n=this.instanceStack.pop(),this.currentInstance=n),this._trigger("end",e,n),this._onEnd(e,n)}}_join(t,e,n){return null===this.currentInstance?this._run(t,e,n):void 0===t&&void 0===n?e():e.apply(t,n)}_run(t,e,n){let i=Io(this.options);if(this.begin(),i)try{return e.apply(t,n)}catch(IN){i(IN)}finally{this.end()}else try{return e.apply(t,n)}finally{this.end()}}_cancelAutorun(){this._autorun&&(this._platform.clearNext(),this._autorun=!1,this._autorunStack=null)}_later(t,e,n,i){let r=this.DEBUG?new Error:void 0,s=this._platform.now()+i,o=$o++;if(0===this._timers.length)this._timers.push(s,o,t,e,n,r),this._installTimerTimeout();else{let i=Fo(s,this._timers);this._timers.splice(i,0,s,o,t,e,n,r),this._reinstallTimerTimeout()}return o}_cancelLaterTimer(t){for(let e=1;e<this._timers.length;e+=6)if(this._timers[e]===t)return this._timers.splice(e-1,6),1===e&&this._reinstallTimerTimeout(),!0;return!1}_trigger(t,e,n){let i=this._eventCallbacks[t];if(void 0!==i)for(let r=0;r<i.length;r++)i[r](e,n)}_runExpiredTimers(){this._timerTimeoutId=null,this._timers.length>0&&(this.begin(),this._scheduleExpiredTimers(),this.end())}_scheduleExpiredTimers(){let t=this._timers,e=0,n=t.length,i=this._defaultQueue,r=this._platform.now();for(;e<n&&!(t[e]>r);e+=6){let n=t[e+4];if(n!==Uo){let r=t[e+2],s=t[e+3],o=t[e+5];this.currentInstance.schedule(i,r,s,n,!1,o)}}t.splice(0,e),this._installTimerTimeout()}_reinstallTimerTimeout(){this._clearTimerTimeout(),this._installTimerTimeout()}_clearTimerTimeout(){null!==this._timerTimeoutId&&(this._platform.clearTimeout(this._timerTimeoutId),this._timerTimeoutId=null)}_installTimerTimeout(){if(0===this._timers.length)return;let t=this._timers[0],e=this._platform.now(),n=Math.max(0,t-e);this._timerTimeoutId=this._platform.setTimeout(this._boundRunExpiredTimers,n)}_ensureInstance(){let t=this.currentInstance;return null===t&&(this._autorunStack=this.DEBUG?new Error:void 0,t=this.begin(),this._scheduleAutorun(this.queueNames[0])),t}_scheduleAutorun(t){aa++;const e=this._platform.next,n=this.options.flush;n?n(t,e):e(),this._autorun=!0}}ua.Queue=jo,ua.buildPlatform=Mo,ua.buildNext=Lo;let da=null;function pa(){return da}const fa=`${Math.random()}${Date.now()}`.replace(".",""),ga=["actions","routerTransitions","render","afterRender","destroy",fa],ma=new ua(ga,{defaultQueue:"actions",onBegin:function(t){da=t},onEnd:function(t,e){da=e,ts(ba)},onErrorTarget:So,onErrorMethod:"onerror",flush:function(t,e){"render"!==t&&t!==fa||ts(ba),e()}});function ya(...t){return ma.run(...t)}function va(t,e,...n){return ma.join(t,e,...n)}function _a(...t){return(...e)=>va(...t.concat(e))}function ba(...t){return ma.schedule(...t)}function wa(...t){return ma.later(...t)}function xa(...t){return ma.scheduleOnce("actions",...t)}function Ca(...t){return ma.scheduleOnce(...t)}function Sa(...t){return ma.later(...t,1)}function ka(t){return ma.cancel(t)}function Ea(...t){return ma.debounce(...t)}const Ta=Object.freeze(Object.defineProperty({__proto__:null,_backburner:ma,_cancelTimers:function(){ma.cancelTimers()},_getCurrentRunLoop:pa,_hasScheduledTimers:function(){return ma.hasTimers()},_queues:ga,_rsvpErrorQueue:fa,begin:function(){ma.begin()},bind:_a,cancel:ka,debounce:Ea,end:function(){ma.end()},join:va,later:wa,next:Sa,once:xa,run:ya,schedule:ba,scheduleOnce:Ca,throttle:function(...t){return ma.throttle(...t)}},Symbol.toStringTag,{value:"Module"})),La="@warp-drive/core",Ma=globalThis;Ma.__warpDrive_universalCache=Ma.__warpDrive_universalCache??{},Ma[La]=Ma[La]??{__version:"5.8.1"};const Ra=Ma[La],Pa=Ra.__warpDrive_ModuleScopedCaches??{};if(Ra.__warpDrive_hasOtherCopy)throw new Error("Multiple copies of WarpDrive detected, the application will malfunction.");function Ia(t,e){return e}function Oa(t){return Pa[`(transient) ${t}`]??null}Ra.__warpDrive_hasOtherCopy=!0;const Aa=new WeakMap;function za(t,e){Aa.set(t,e)}const Fa=Ia(0,Symbol("#[]"));function ja(t,e){return Oa("signalHooks").createSignal(t,e)}const Da={};function Na(t){return"object"==typeof t&&null!==t&&Object.getPrototypeOf(t)===Da}const Ba=Ia(0,Symbol("Signals"));function Ua(t){return t[Ba]||function(t){t[Ba]=new Map}(t),t[Ba]}function qa(t,e,n,i){const r={key:n,context:e,signal:ja(e,n),value:Na(i)?i.value.call(e):i,isStale:!1};return t.set(n,r),r}function Va(t,e){return t?.get(e)}function $a(t,e){return{enumerable:!0,configurable:!1,get(){const n=function(t,e,n,i){let r=Va(t,n);return r||(r=qa(t,e,n,i)),s=r.signal,Oa("signalHooks").consumeSignal(s),r;var s}(Ua(this),this,t,e);return n.isStale=!1,n.value},set(n){const i=function(t,e,n,i){let r=Va(t,n);return r||(r=qa(t,e,n,i)),r}(Ua(this),this,t,e);var r;i.value!==n&&(i.value=n,(r=i)&&(r.isStale=!0,function(t){Oa("signalHooks").notifySignal(t)}(r.signal)))}}}function Ga(t,e,n){Object.defineProperty(t,e,$a(e,n))}function Wa(t,e,n){const i=$a(e,n);i.enumerable=!1,Object.defineProperty(t,e,i)}function Ha(t,e,n){const i=n.get;return n.get=function(){const t=Ua(this);let n=t.get(e);return n||(n=function(t,e,n,i){{const r=function(t,e,n){return Oa("signalHooks").createMemo(t,e,n)}(e,n,i);return t.set(n,r),r}}(t,this,e,i.bind(this))),n()},n}const Za=new WeakMap;function Ka(t){return t instanceof DOMException&&"AbortError"===t.name}class Ya{_stream=null;_future;_triggered=!1;_trigger(){if(this._triggered)return;this._triggered=!0;const t=this._future.getStream();t.sizeHint&&(this._sizeHint=t.sizeHint),this.promise=t.then(t=>t?async function(t,e){const n=e,i=t.getReader();let r=0,s=null!==n._stream&&n._stream.readable.locked,o=s,a=n._stream?.writable.getWriter();const l=[];for(n._isPending=!1,n._isStarted=!0,n._startTime=performance.now();;){const{value:t,done:e}=await i.read();if(e)break;if(r+=t.byteLength,n._bytesLoaded=r,n._lastPacketTime=performance.now(),s=s||null!==n._stream&&n._stream.readable.locked,s){if(!o){o=!0,a=n._stream.writable.getWriter();for(const t of l)await a.ready,await a.write(t);l.length=0}await a.ready,await a.write(t)}else l.push(t)}o?(await a.ready,await a.close()):n._stream&&(await n._stream.readable.cancel("The Stream Has Already Ended"),n._stream=null);const c=performance.now();n._endTime=c,n._isComplete=!0,n._isStarted=!1}(t,this):(this._isPending=!1,void(this._isComplete=!0)),t=>{this._isPending=!1,this._isStarted=!1,Ka(t)&&(this._isCancelled=!0,this._isComplete=!0),this._isErrored=!0,this._error=t})}promise=null;get isPending(){return this._trigger(),this._isPending}get sizeHint(){return this._trigger(),this._sizeHint}get stream(){if(this._trigger(),!this._stream){if(this._isComplete||this._isCancelled||this._isErrored)return null;this._stream=new TransformStream}return this._stream.readable}get isStarted(){return this._trigger(),this._isStarted}get bytesLoaded(){return this._trigger(),this._bytesLoaded}get startTime(){return this._trigger(),this._startTime}get endTime(){return this._trigger(),this._endTime}get lastPacketTime(){return this._trigger(),this._lastPacketTime}get isComplete(){return this._trigger(),this._isComplete}get isCancelled(){return this._trigger(),this._isCancelled}get isErrored(){return this._trigger(),this._isErrored}get error(){return this._trigger(),this._error}get elapsedTime(){return(this.endTime||this.lastPacketTime)-this.startTime}get completedRatio(){return this.sizeHint?this.bytesLoaded/this.sizeHint:0}get remainingRatio(){return 1-this.completedRatio}get duration(){return this.endTime-this.startTime}get speed(){return this.bytesLoaded/(this.elapsedTime/1e3)}constructor(t){this._future=t}abort=()=>{this._future.abort()}}Wa(Ya.prototype,"_isPending",!0),Wa(Ya.prototype,"_isStarted",!1),Wa(Ya.prototype,"_isComplete",!1),Wa(Ya.prototype,"_isCancelled",!1),Wa(Ya.prototype,"_isErrored",!1),Wa(Ya.prototype,"_error",null),Wa(Ya.prototype,"_sizeHint",0),Wa(Ya.prototype,"_bytesLoaded",0),Wa(Ya.prototype,"_startTime",0),Wa(Ya.prototype,"_endTime",0),Wa(Ya.prototype,"_lastPacketTime",0);const Xa={};function Ja(t,e,n){const i=Object.assign({},e),r=Object.assign({},i.cacheOptions);return n?r.reload=!0:!1===n?(delete r.reload,r.backgroundReload=!0):(delete r.backgroundReload,delete r.reload),i.cacheOptions=r,t.request(i)}function Qa(t,e,n){let i={...Object.getOwnPropertyDescriptor(t,e)};for(let r of n)i=r(t,e,i)||i;void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(t):void 0,i.initializer=void 0),Object.defineProperty(t,e,i)}Ga(Xa,"reason",null),Ga(Xa,"value",null),Ga(Xa,"result",null),Ga(Xa,"error",null),Ga(Xa,"status","pending"),Ga(Xa,"isPending",!0),Ga(Xa,"isLoading",!0),Ga(Xa,"isSuccess",!1),Ga(Xa,"isError",!1),Ga(Xa,"request",null),Ga(Xa,"response",null),Object.defineProperty(Xa,"isCancelled",{get(){return this.isError&&Ka(this.reason)}}),Object.defineProperty(Xa,"loadingState",{get(){return this._loadingState||(this._loadingState=new Ya(this._request)),this._loadingState}});const tl=Symbol.dispose||Symbol.for("dispose");class el{_requester;constructor(t,e){this._args=e,this.store=t,this._subscribedTo=null,this._subscription=null,this._intervalStart=null,this._invalidated=!1,this._nextInterval=null,this._requester=null,this.isDestroyed=!1,this[tl]=il,this._installListeners(),this._beginPolling()}async _beginPolling(){try{this.isIdle||await this.request}catch{}finally{this.isDestroyed||this._scheduleInterval()}}get isIdle(){const{request:t,query:e}=this._args;return Boolean(!t&&!e)}static{Qa(this.prototype,"isIdle",[Ha])}get autorefreshTypes(){const{autorefresh:t}=this._args;let e;return e=!0===t?["online","invalid"]:"string"==typeof t?t.split(","):[],new Set(e)}static{Qa(this.prototype,"autorefreshTypes",[Ha])}async _scheduleInterval(){const{autorefreshThreshold:t}=this._args;if("undefined"!=typeof window&&"number"==typeof t&&t>0&&this.autorefreshTypes.has("interval")&&null===this._intervalStart){if(this._latestRequest){try{await this._latestRequest}catch{}if(this.isDestroyed)return}this._intervalStart=Date.now(),this._nextInterval=setTimeout(()=>{this._maybeUpdate()},t)}}_clearInterval(){this._nextInterval&&(clearTimeout(this._nextInterval),this._intervalStart=null)}_updateSubscriptions(){if(this.isIdle)return;const t=this._request.lid;if(this._subscribedTo===t)return;this._removeSubscriptions();const e=this._getRequester();this._requester=e,t&&nl(e)&&(this._subscribedTo=t,this._subscription=e.notifications.subscribe(t,(n,i)=>{if(!this._isUpdating)switch(i){case"invalidated":this.autorefreshTypes.has("invalid")&&(this._invalidated=!0,this._maybeUpdate());break;case"state":{const n=e.requestManager._deduped.get(t),i=n?.priority,r=this.reqState;i?i.blocking&&!r.isLoading?(this.isRefreshing=!1,this._maybeUpdate("policy",!0)):this.isRefreshing=!0:this.isRefreshing=!1}}}))}_removeSubscriptions(){const t=this._requester;this._subscription&&t&&nl(t)&&(t.notifications.unsubscribe(this._subscription),this._subscribedTo=null,this._subscription=null,this._requester=null)}_installListeners(){"undefined"!=typeof window&&(this.isOnline=window.navigator.onLine,this._unavailableStart=this.isOnline?null:Date.now(),this.isHidden="hidden"===document.visibilityState,this._onlineChanged=t=>{this.isOnline="online"===t.type,"offline"===t.type&&null===this._unavailableStart&&(this._unavailableStart=Date.now()),this._maybeUpdate()},this._backgroundChanged=()=>{const t="hidden"===document.visibilityState;this.isHidden=t,t&&null===this._unavailableStart&&(this._unavailableStart=Date.now()),this._maybeUpdate()},window.addEventListener("online",this._onlineChanged,{passive:!0,capture:!0}),window.addEventListener("offline",this._onlineChanged,{passive:!0,capture:!0}),document.addEventListener("visibilitychange",this._backgroundChanged,{passive:!0,capture:!0}))}_maybeUpdate(t,e){if(this.isIdle)return;const{reqState:n}=this;if(n.isPending)return;if(!Boolean(this.isOnline&&!this.isHidden&&(t||this.autorefreshTypes.size))){if(!e&&t&&"_invalidated"!==t)throw new Error("Reload not available: the network is not online or the tab is hidden");return}const{autorefreshTypes:i}=this;let r=this._invalidated||Boolean(t);if(!r&&i.has("online")){const{_unavailableStart:t}=this,{autorefreshThreshold:e}=this._args,n="number"==typeof e?e:3e4;r=Boolean(t&&Date.now()-t>n)}if(!r&&i.has("interval")){const{_intervalStart:t}=this,{autorefreshThreshold:e}=this._args;t&&"number"==typeof e&&e>0&&(r=Boolean(Date.now()-t>=e))}if(this._unavailableStart=null,this._invalidated=!1,r){this._clearInterval(),this._isUpdating=!0;const e=("_invalidated"===t?null:t)??this._args.autorefreshBehavior??"policy",i=this._getRequester();switch(n._request.requester||(n._request.requester=i),e){case"reload":this._latestRequest=n.reload();break;case"refresh":this._latestRequest=n.refresh();break;case"policy":this._latestRequest=n.refresh(!0)}"refresh"!==e&&(this._localRequest=this._latestRequest),this._scheduleInterval(),this._latestRequest.finally(()=>{this._isUpdating=!1})}}_getRequester(){return this._args.request?.requester?this._args.request.requester:this.store}retry=async()=>{this._maybeUpdate("reload"),await this._localRequest};refresh=async()=>{this._maybeUpdate("refresh"),await this._latestRequest};get errorFeatures(){return{isHidden:this.isHidden,isOnline:this.isOnline,retry:this.retry}}static{Qa(this.prototype,"errorFeatures",[Ha])}get contentFeatures(){const t={isHidden:this.isHidden,isOnline:this.isOnline,reload:this.retry,refresh:this.refresh,isRefreshing:this.isRefreshing,latestRequest:this._latestRequest};return t.isRefreshing&&(t.abort=()=>{this._latestRequest?.abort()}),t}static{Qa(this.prototype,"contentFeatures",[Ha])}get _request(){const{request:t,query:e}=this._args,{_localRequest:n,_originalRequest:i,_originalQuery:r}=this;return n&&t===i&&e===r?n:(this._originalQuery=e,this._originalRequest=t,t||this.store.request(e))}static{Qa(this.prototype,"_request",[Ha])}get request(){{const t=this._request;return this._updateSubscriptions(),t}}static{Qa(this.prototype,"request",[Ha])}get reqState(){return function(t){let e=Za.get(t);return e||(e=function(t){const e=(n=t,Aa.get(n));var n;const i=Object.create(Xa);return i._request=t,i.reload=()=>Ja(t.requester,i.request,!0),i.refresh=(e=!1)=>Ja(t.requester,i.request,!0===e&&null),e?e.isError?(i.error=e.result,i.reason=e.result,i.status="rejected",i.isError=!0,i.isPending=!1,i.isLoading=!1,i.request=e.result.request,i.response=e.result.response):(i.result=e.result.content,i.value=e.result.content,i.status="fulfilled",i.isSuccess=!0,i.isPending=!1,i.isLoading=!1,i.request=e.result.request,i.response=e.result.response):t.then(e=>{za(t,{isError:!1,result:e}),i.result=e.content,i.value=e.content,i.status="fulfilled",i.isSuccess=!0,i.isPending=!1,i.isLoading=!1,i.request=e.request,i.response=e.response},e=>{za(t,{isError:!0,result:e}),i.error=e,i.reason=e,i.status="rejected",i.isError=!0,i.isPending=!1,i.isLoading=!1,i.request=e.request,i.response=e.response}),i}(t),Za.set(t,e)),e}(this.request)}get result(){return this.reqState.result}}function nl(t){return"requestManager"in t}function il(){const t=this;t.isDestroyed=!0,t._removeSubscriptions(),"undefined"!=typeof window&&(t._clearInterval(),window.removeEventListener("online",t._onlineChanged,{passive:!0,capture:!0}),window.removeEventListener("offline",t._onlineChanged,{passive:!0,capture:!0}),document.removeEventListener("visibilitychange",t._backgroundChanged,{passive:!0,capture:!0}))}Ga(el.prototype,"isOnline",!0),Ga(el.prototype,"isHidden",!1),Ga(el.prototype,"isRefreshing",!1),Ga(el.prototype,"_localRequest",void 0),Ga(el.prototype,"_latestRequest",void 0);const rl={};Ga(rl,"reason",null),Ga(rl,"value",null),Ga(rl,"result",null),Ga(rl,"error",null),Ga(rl,"status","pending"),Ga(rl,"isPending",!0),Ga(rl,"isLoading",!0),Ga(rl,"isSuccess",!1),Ga(rl,"isError",!1);const sl=ge;var ol;ol=function(t){const e=t.wellknown.Array;return{createSignal:(t,n)=>n===e?[fr(t,n),fr(t,"length"),fr(t,"[]")]:fr(t,n),consumeSignal(t){if(Array.isArray(t))return je(t[0]),je(t[1]),void je(t[2]);je(t)},notifySignal(t){if(Array.isArray(t))return sl(t[0]),sl(t[1]),void sl(t[2]);sl(t)},createMemo:(t,e,n)=>{{const i=fr(t,e),r=qe(n);let s;const o=()=>{s=Ve(r)};return()=>{const t=Ge(o);return me(i,t),je(t),s}}},willSyncFlushWatchers:()=>!!ma.currentInstance&&!0!==ma._autorun,waitFor:async t=>t}},function(t,e){Pa["(transient) signalHooks"]=e}(0,ol({wellknown:{Array:Fa}}));const al=hr,ll=Object.freeze(Object.defineProperty({__proto__:null,getOwner:al,setOwner:ur},Symbol.toStringTag,{value:"Module"}));function cl(t){let e=Object.create(t);return e._dict=null,delete e._dict,e}const hl=g.EMBER_LOAD_HOOKS||{},ul={};let dl=ul;function pl(t,e){let n=ul[t];(hl[t]??=[]).push(e),n&&e(n)}function fl(t,e){if(ul[t]=e,n&&"function"==typeof CustomEvent){let i=new CustomEvent(t,{detail:e});n.dispatchEvent(i)}hl[t]?.forEach(t=>t(e))}class gl{static _leakTracking;owner;registry;cache;factoryManagerCache;validationCache;isDestroyed;isDestroying;constructor(t,e={}){this.registry=t,this.owner=e.owner||null,this.cache=cl(e.cache||null),this.factoryManagerCache=cl(e.factoryManagerCache||null),this.isDestroyed=!1,this.isDestroying=!1}lookup(t,e){if(this.isDestroyed)throw new Error(`Cannot call \`.lookup('${t}')\` after the owner has been destroyed`);return function(t,e,n={}){let i=e;if(!0===n.singleton||void 0===n.singleton&&ml(t,e)){let e=t.cache[i];if(void 0!==e)return e}return function(t,e,n,i){let r=vl(t,e,n);if(void 0!==r){if(function(t,e,{instantiate:n,singleton:i}){return!1!==i&&!1!==n&&(!0===i||ml(t,e))&&yl(t,e)}(t,n,i)){let n=t.cache[e]=r.create();return t.isDestroying&&"function"==typeof n.destroy&&n.destroy(),n}if(function(t,e,{instantiate:n,singleton:i}){return!1!==n&&(!1===i||!ml(t,e))&&yl(t,e)}(t,n,i))return r.create();if(function(t,e,{instantiate:n,singleton:i}){return!1!==i&&!n&&ml(t,e)&&!yl(t,e)}(t,n,i)||function(t,e,{instantiate:n,singleton:i}){return!(!1!==n||!1!==i&&ml(t,e)||yl(t,e))}(t,n,i))return r.class;throw new Error("Could not create factory")}}(t,i,e,n)}(this,this.registry.normalize(t),e)}destroy(){this.isDestroying=!0,_l(this)}finalizeDestroy(){bl(this),this.isDestroyed=!0}reset(t){this.isDestroyed||(void 0===t?(_l(this),bl(this)):function(t,e){let n=t.cache[e];delete t.factoryManagerCache[e],n&&(delete t.cache[e],n.destroy&&n.destroy())}(this,this.registry.normalize(t)))}ownerInjection(){let t={};return ur(t,this.owner),t}factoryFor(t){if(this.isDestroyed)throw new Error(`Cannot call \`.factoryFor('${t}')\` after the owner has been destroyed`);return vl(this,this.registry.normalize(t),t)}}function ml(t,e){return!1!==t.registry.getOption(e,"singleton")}function yl(t,e){return!1!==t.registry.getOption(e,"instantiate")}function vl(t,e,n){let i=t.factoryManagerCache[e];if(void 0!==i)return i;let r=t.registry.resolve(e);if(void 0===r)return;let s=new Sl(t,r,n,e);return t.factoryManagerCache[e]=s,s}function _l(t){let e=t.cache,n=Object.keys(e);for(let i of n){let t=e[i];t.destroy&&t.destroy()}}function bl(t){t.cache=cl(null),t.factoryManagerCache=cl(null)}const wl=Symbol("INIT_FACTORY");function xl(t){return t[wl]}function Cl(t,e){t[wl]=e}class Sl{container;owner;class;fullName;normalizedName;madeToString;injections;constructor(t,e,n,i){this.container=t,this.owner=t.owner,this.class=e,this.fullName=n,this.normalizedName=i,this.madeToString=void 0,this.injections=void 0}toString(){return void 0===this.madeToString&&(this.madeToString=this.container.registry.makeToString(this.class,this.fullName)),this.madeToString}create(t){let{container:e}=this;if(e.isDestroyed)throw new Error(`Cannot create new instances after the owner has been destroyed (you attempted to create ${this.fullName})`);let n=t?{...t}:{};return ur(n,e.owner),Cl(n,this),this.class.create(n)}}const kl=/^[^:]+:[^:]+$/;class El{_failSet;resolver;fallback;registrations;_normalizeCache;_options;_resolveCache;_typeOptions;constructor(t={}){this.fallback=t.fallback||null,this.resolver=t.resolver||null,this.registrations=cl(t.registrations||null),this._normalizeCache=cl(null),this._resolveCache=cl(null),this._failSet=new Set,this._options=cl(null),this._typeOptions=cl(null)}container(t){return new gl(this,t)}register(t,e,n={}){let i=this.normalize(t);this._failSet.delete(i),this.registrations[i]=e,this._options[i]=n}unregister(t){let e=this.normalize(t);delete this.registrations[e],delete this._resolveCache[e],delete this._options[e],this._failSet.delete(e)}resolve(t){let e=function(t,e){let n,i=e,r=t._resolveCache[i];return void 0!==r?r:t._failSet.has(i)?void 0:(t.resolver&&(n=t.resolver.resolve(i)),void 0===n&&(n=t.registrations[i]),void 0===n?t._failSet.add(i):t._resolveCache[i]=n,n)}(this,this.normalize(t));return void 0===e&&null!==this.fallback&&(e=this.fallback.resolve(t)),e}describe(t){return null!==this.resolver&&this.resolver.lookupDescription?this.resolver.lookupDescription(t):null!==this.fallback?this.fallback.describe(t):t}normalizeFullName(t){return null!==this.resolver&&this.resolver.normalize?this.resolver.normalize(t):null!==this.fallback?this.fallback.normalizeFullName(t):t}normalize(t){return this._normalizeCache[t]||(this._normalizeCache[t]=this.normalizeFullName(t))}makeToString(t,e){return null!==this.resolver&&this.resolver.makeToString?this.resolver.makeToString(t,e):null!==this.fallback?this.fallback.makeToString(t,e):"string"==typeof t?t:t.name??"(unknown class)"}has(t){return!!this.isValidFullName(t)&&function(t,e){return void 0!==t.resolve(e)}(this,this.normalize(t))}optionsForType(t,e){this._typeOptions[t]=e}getOptionsForType(t){let e=this._typeOptions[t];return void 0===e&&null!==this.fallback&&(e=this.fallback.getOptionsForType(t)),e}options(t,e){let n=this.normalize(t);this._options[n]=e}getOptions(t){let e=this.normalize(t),n=this._options[e];return void 0===n&&null!==this.fallback&&(n=this.fallback.getOptions(t)),n}getOption(t,e){let n=this._options[t];if(void 0!==n&&void 0!==n[e])return n[e];let i=t.split(":")[0];return n=this._typeOptions[i],n&&void 0!==n[e]?n[e]:null!==this.fallback?this.fallback.getOption(t,e):void 0}knownForType(t){let e,n,i=cl(null),r=Object.keys(this.registrations);for(let s of r)s.split(":")[0]===t&&(i[s]=!0);return null!==this.fallback&&(e=this.fallback.knownForType(t)),null!==this.resolver&&this.resolver.knownForType&&(n=this.resolver.knownForType(t)),Object.assign({},e,i,n)}isValidFullName(t){return kl.test(t)}}const Tl=cl(null),Ll=`${Math.random()}${Date.now()}`.replace(".","");function Ml([t]){let e=Tl[t];if(e)return e;let[n,i]=t.split(":");return Tl[t]=W(`${n}:${i}-${Ll}`)}const Rl=Array.prototype.concat;function Pl(t,e,n,i){let r=n[t]||i[t];return e[t]&&(r=r?Rl.call(r,e[t]):e[t]),r}function Il(t,e,n,i){if(!0===n)return e;let r=n._getter;if(void 0===r)return e;let s=i[t],o="function"==typeof s?Pr(s):s;if(void 0===o||!0===o)return e;let a=o._getter;if(void 0===a)return e;let l,c=mt(r,a),h=n._setter,u=o._setter;if(l=void 0!==u?void 0!==h?mt(h,u):u:h,c!==r||l!==h){let t=n._dependentKeys||[],e=new hs([...t,{get:c,set:l}]);return e._readOnly=n._readOnly,e._meta=n._meta,e.enumerable=n.enumerable,Lr(e,hs)}return e}function Ol(t,e,n,i){if(void 0!==i[t])return e;let r=n[t];return"function"==typeof r?mt(e,r):e}function Al(t){return t?Array.isArray(t)?t:[t]:[]}function zl(t,e,n){return Al(n[t]).concat(Al(e))}function Fl(t,e,n){let i=n[t];if(!i)return e;let r=Object.assign({},i),s=!1,o=Object.keys(e);for(let a of o){let t=e[a];"function"==typeof t?(s=!0,r[a]=Ol(a,t,i,{})):r[a]=t}return s&&(r._super=at),r}function jl(t,e,n,i,r,s,o){let a;for(let l=0;l<t.length;l++)if(a=t[l],ql.has(a)){if(e.hasMixin(a))continue;e.addMixin(a);let{properties:t,mixins:l}=a;void 0!==t?Dl(e,t,n,i,r,s,o):void 0!==l&&(jl(l,e,n,i,r,s,o),a instanceof Vl&&void 0!==a._without&&a._without.forEach(t=>{let e=s.indexOf(t);-1!==e&&s.splice(e,1)}))}else Dl(e,a,n,i,r,s,o)}function Dl(t,e,n,i,r,s,o){let a=Pl("concatenatedProperties",e,i,r),l=Pl("mergedProperties",e,i,r),c=Object.keys(e);for(let h of c){let c=e[h];if(void 0===c)continue;if(-1===s.indexOf(h)){s.push(h);let e=t.peekDescriptors(h);if(void 0===e){if(!Ir(c)){let t=i[h]=r[h];"function"==typeof t&&Nl(r,h,t,!1)}}else n[h]=e,o.push(h),e.teardown(r,h,t)}let u="function"==typeof c;if(u){let t=Pr(c);if(void 0!==t){n[h]=Il(h,c,t,n),i[h]=void 0;continue}}a&&a.indexOf(h)>=0||"concatenatedProperties"===h||"mergedProperties"===h?c=zl(h,c,i):l&&l.indexOf(h)>-1?c=Fl(h,c,i):u&&(c=Ol(h,c,i,n)),i[h]=c,n[h]=void 0}}function Nl(t,e,n,i){let r=dt(n);if(void 0===r)return;let{observers:s,listeners:o}=r;if(void 0!==s){let n=i?Wr:Hr;for(let i of s.paths)n(t,i,null,e,s.sync)}if(void 0!==o){let n=i?Dr:Nr;for(let i of o)n(t,i,null,e)}}function Bl(t,e,n=!1){let i=Object.create(null),r=Object.create(null),s=ae(t),o=[],a=[];t._super=at,jl(e,s,i,r,t,o,a);for(let l of o){let e=r[l],o=i[l];void 0!==e?("function"==typeof e&&Nl(t,l,e,!0),vs(t,l,e,-1!==a.indexOf(l),!n)):void 0!==o&&ys(t,l,o,s)}return s.isPrototypeMeta(t)||Jr(t),t}function Ul(t,...e){return Bl(t,e),t}const ql=new WeakSet;class Vl{mixins;properties;ownerConstructor;_without;constructor(t,e){ql.add(this),this.properties=function(t){if(void 0!==t)for(let e of Object.keys(t)){let n=Object.getOwnPropertyDescriptor(t,e);void 0===n.get&&void 0===n.set||Object.defineProperty(t,e,{value:Cr(n)})}return t}(e),this.mixins=$l(t),this.ownerConstructor=void 0,this._without=void 0}static create(...t){return vo(),new this(t,void 0)}static mixins(t){let e=oe(t),n=[];return null===e||e.forEachMixins(t=>{t.properties||n.push(t)}),n}reopen(...t){if(0===t.length)return this;if(this.properties){let t=new Vl(void 0,this.properties);this.properties=void 0,this.mixins=[t]}else this.mixins||(this.mixins=[]);return this.mixins=this.mixins.concat($l(t)),this}apply(t,e=!1){return Bl(t,[this],e)}applyPartial(t){return Bl(t,[this])}detect(t){if("object"!=typeof t||null===t)return!1;if(ql.has(t))return Gl(t,this);let e=oe(t);return null!==e&&e.hasMixin(this)}without(...t){let e=new Vl([this]);return e._without=t,e}keys(){return Wl(this)}toString(){return"(unknown mixin)"}}function $l(t){let e,n=t&&t.length||0;if(n>0){e=new Array(n);for(let i=0;i<n;i++){let n=t[i];ql.has(n)?e[i]=n:e[i]=new Vl(void 0,n)}}return e}function Gl(t,e,n=new Set){if(n.has(t))return!1;if(n.add(t),t===e)return!0;let i=t.mixins;return!!i&&i.some(t=>Gl(t,e,n))}function Wl(t,e=new Set,n=new Set){if(!n.has(t)){if(n.add(t),t.properties){let n=Object.keys(t.properties);for(let t of n)e.add(t)}else t.mixins&&t.mixins.forEach(t=>Wl(t,e,n));return e}}const Hl=Vl.create({__registry__:null,resolveRegistration(t){return this.__registry__.resolve(t)},register:Zl("register"),unregister:Zl("unregister"),hasRegistration:Zl("has"),registeredOption:Zl("getOption"),registerOptions:Zl("options"),registeredOptions:Zl("getOptions"),registerOptionsForType:Zl("optionsForType"),registeredOptionsForType:Zl("getOptionsForType")});function Zl(t){return function(...e){return this.__registry__[t](...e)}}const Kl=Vl.create({__container__:null,ownerInjection(){return this.__container__.ownerInjection()},lookup(t,e){return this.__container__.lookup(t,e)},destroy(){let t=this.__container__;t&&va(()=>{t.destroy(),ba("destroy",t,"finalizeDestroy")}),this._super()},factoryFor(t){return this.__container__.factoryFor(t)}}),Yl=Vl.create({compare:null}),Xl=Vl.create({mergedProperties:["actions"],send(t,...e){if(this.actions&&this.actions[t]&&!0!==this.actions[t].apply(this,e))return;let n=Cs(this,"target");n&&n.send(...arguments)}});function Jl(t){let e=Cs(t,"content");return me(gr(t),gr(e)),e}function Ql(t,e,n){let i=sn(t),r=on(t,e,i);if(e in t)return r;{let s=[r,on(t,"content",i)],o=Jl(t);return H(o)&&s.push(fr(o,e,n)),ke(s)}}const tc=Vl.create({content:null,init(){this._super(...arguments),nr(this),gr(this),li(this,Ql)},willDestroy(){this.set("content",null),this._super(...arguments)},isTruthy:ps("content",function(){return Boolean(Cs(this,"content"))}),unknownProperty(t){let e=Jl(this);return e?Cs(e,t):void 0},setUnknownProperty(t,e){let n=ae(this);return n.isInitializing()||n.isPrototypeMeta(this)?(ms(this,t,null,e),e):zs(Jl(this),t,e)}}),ec=Vl.create(),nc=Vl.create(ec),ic=Object.freeze(Object.defineProperty({__proto__:null,default:nc},Symbol.toStringTag,{value:"Module"})),rc=Vl.create({target:null,action:null,actionContext:null,actionContextObject:ps("actionContext",function(){let t=Cs(this,"actionContext");if("string"==typeof t){let e=Cs(this,t);return void 0===e&&(e=Cs(d.lookup,t)),e}return t}),triggerAction(t={}){let{action:e,target:n,actionContext:i}=t;e=e||Cs(this,"action"),n=n||function(t){let e=Cs(t,"target");if(e){if("string"==typeof e){let n=Cs(t,e);return void 0===n&&(n=Cs(d.lookup,e)),n}return e}return t._target?t._target:null}(this),void 0===i&&(i=Cs(this,"actionContextObject")||this);let r=Array.isArray(i)?i:[i];if(n&&e){let t;if(t=null!=(s=n)&&"object"==typeof s&&"function"==typeof s.send?n.send(e,...r):n[e](...r),!1!==t)return!0}var s;return!1}});function sc(t){let e=t._promiseCallbacks;return e||(e=t._promiseCallbacks={}),e}const oc={mixin(t){return t.on=this.on,t.off=this.off,t.trigger=this.trigger,t._promiseCallbacks=void 0,t},on(t,e){if("function"!=typeof e)throw new TypeError("Callback must be a function");let n=sc(this),i=n[t];i||(i=n[t]=[]),-1===i.indexOf(e)&&i.push(e)},off(t,e){let n=sc(this);if(!e)return void(n[t]=[]);let i=n[t],r=i.indexOf(e);-1!==r&&i.splice(r,1)},trigger(t,e,n){let i=sc(this)[t];if(i){let t;for(let r=0;r<i.length;r++)t=i[r],t(e,n)}}},ac={instrument:!1};function lc(t,e){if(2!==arguments.length)return ac[t];ac[t]=e}oc.mixin(ac);const cc=[];function hc(t,e,n){1===cc.push({name:t,payload:{key:e._guidKey,id:e._id,eventName:t,detail:e._result,childId:n&&n._id,label:e._label,timeStamp:Date.now(),error:ac["instrument-with-stack"]?new Error(e._label):null}})&&setTimeout(()=>{for(let t=0;t<cc.length;t++){let e=cc[t],n=e.payload;n.guid=n.key+n.id,n.childGuid=n.key+n.childId,n.error&&(n.stack=n.error.stack),ac.trigger(e.name,e.payload)}cc.length=0},50)}function uc(t,e){if(t&&"object"==typeof t&&t.constructor===this)return t;let n=new this(dc,e);return yc(n,t),n}function dc(){}const pc=void 0,fc=1,gc=2;function mc(t,e,n){e.constructor===t.constructor&&n===Sc&&t.constructor.resolve===uc?function(t,e){e._state===fc?_c(t,e._result):e._state===gc?(e._onError=null,bc(t,e._result)):wc(e,void 0,n=>{e===n?_c(t,n):yc(t,n)},e=>bc(t,e))}(t,e):"function"==typeof n?function(t,e,n){ac.async(t=>{let i=!1,r=function(n,r){try{n.call(r,n=>{i||(i=!0,e===n?_c(t,n):yc(t,n))},e=>{i||(i=!0,bc(t,e))})}catch(s){return s}}(n,e,t._label);!i&&r&&(i=!0,bc(t,r))},t)}(t,e,n):_c(t,e)}function yc(t,e){if(t===e)_c(t,e);else if(function(t){let e=typeof t;return null!==t&&("object"===e||"function"===e)}(e)){let n;try{n=e.then}catch(IN){return void bc(t,IN)}mc(t,e,n)}else _c(t,e)}function vc(t){t._onError&&t._onError(t._result),xc(t)}function _c(t,e){t._state===pc&&(t._result=e,t._state=fc,0===t._subscribers.length?ac.instrument&&hc("fulfilled",t):ac.async(xc,t))}function bc(t,e){t._state===pc&&(t._state=gc,t._result=e,ac.async(vc,t))}function wc(t,e,n,i){let r=t._subscribers,s=r.length;t._onError=null,r[s]=e,r[s+fc]=n,r[s+gc]=i,0===s&&t._state&&ac.async(xc,t)}function xc(t){let e=t._subscribers,n=t._state;if(ac.instrument&&hc(n===fc?"fulfilled":"rejected",t),0===e.length)return;let i,r,s=t._result;for(let o=0;o<e.length;o+=3)i=e[o],r=e[o+n],i?Cc(n,i,r,s):r(s);t._subscribers.length=0}function Cc(t,e,n,i){let r,s,o="function"==typeof n,a=!0;if(o)try{r=n(i)}catch(l){a=!1,s=l}else r=i;e._state!==pc||(r===e?bc(e,new TypeError("A promises callback cannot return that same promise.")):!1===a?bc(e,s):o?yc(e,r):t===fc?_c(e,r):t===gc&&bc(e,r))}function Sc(t,e,n){let i=this,r=i._state;if(r===fc&&!t||r===gc&&!e)return ac.instrument&&hc("chained",i,i),i;i._onError=null;let s=new i.constructor(dc,n),o=i._result;if(ac.instrument&&hc("chained",i,s),r===pc)wc(i,s,t,e);else{let n=r===fc?t:e;ac.async(()=>Cc(r,s,n,o))}return s}class kc{constructor(t,e,n,i){this._instanceConstructor=t,this.promise=new t(dc,i),this._abortOnReject=n,this._isUsingOwnPromise=t===Mc,this._isUsingOwnResolve=t.resolve===uc,this._init(...arguments)}_init(t,e){let n=e.length||0;this.length=n,this._remaining=n,this._result=new Array(n),this._enumerate(e)}_enumerate(t){let e=this.length,n=this.promise;for(let i=0;n._state===pc&&i<e;i++)this._eachEntry(t[i],i,!0);this._checkFullfillment()}_checkFullfillment(){if(0===this._remaining){let t=this._result;_c(this.promise,t),this._result=null}}_settleMaybeThenable(t,e,n){let i=this._instanceConstructor;if(this._isUsingOwnResolve){let s,o,a=!0;try{s=t.then}catch(r){a=!1,o=r}if(s===Sc&&t._state!==pc)t._onError=null,this._settledAt(t._state,e,t._result,n);else if("function"!=typeof s)this._settledAt(fc,e,t,n);else if(this._isUsingOwnPromise){let r=new i(dc);!1===a?bc(r,o):(mc(r,t,s),this._willSettleAt(r,e,n))}else this._willSettleAt(new i(e=>e(t)),e,n)}else this._willSettleAt(i.resolve(t),e,n)}_eachEntry(t,e,n){null!==t&&"object"==typeof t?this._settleMaybeThenable(t,e,n):this._setResultAt(fc,e,t,n)}_settledAt(t,e,n,i){let r=this.promise;r._state===pc&&(this._abortOnReject&&t===gc?bc(r,n):(this._setResultAt(t,e,n,i),this._checkFullfillment()))}_setResultAt(t,e,n,i){this._remaining--,this._result[e]=n}_willSettleAt(t,e,n){wc(t,void 0,t=>this._settledAt(fc,e,t,n),t=>this._settledAt(gc,e,t,n))}}function Ec(t,e,n){this._remaining--,this._result[e]=t===fc?{state:"fulfilled",value:n}:{state:"rejected",reason:n}}const Tc="rsvp_"+Date.now()+"-";let Lc=0,Mc=class t{constructor(e,n){this._id=Lc++,this._label=n,this._state=void 0,this._result=void 0,this._subscribers=[],ac.instrument&&hc("created",this),dc!==e&&("function"!=typeof e&&function(){throw new TypeError("You must pass a resolver function as the first argument to the promise constructor")}(),this instanceof t?function(t,e){let n=!1;try{e(e=>{n||(n=!0,yc(t,e))},e=>{n||(n=!0,bc(t,e))})}catch(i){bc(t,i)}}(this,e):function(){throw new TypeError("Failed to construct 'Promise': Please use the 'new' operator, this object constructor cannot be called as a function.")}())}_onError(t){ac.after(()=>{this._onError&&ac.trigger("error",t,this._label)})}catch(t,e){return this.then(void 0,t,e)}finally(t,e){let n=this,i=n.constructor;return"function"==typeof t?n.then(e=>i.resolve(t()).then(()=>e),e=>i.resolve(t()).then(()=>{throw e})):n.then(t,t)}};function Rc(t,e){return{then:(n,i)=>t.call(e,n,i)}}function Pc(t,e){let n=function(){let n=arguments.length,i=new Array(n+1),r=!1;for(let t=0;t<n;++t){let e=arguments[t];if(!r){if(null!==e&&"object"==typeof e)if(e.constructor===Mc)r=!0;else try{r=e.then}catch(IN){let e=new Mc(dc);return bc(e,IN),e}else r=!1;r&&!0!==r&&(e=Rc(r,e))}i[t]=e}let s=new Mc(dc);return i[n]=function(t,n){t?bc(s,t):void 0===e?yc(s,n):!0===e?yc(s,function(t){let e=t.length,n=new Array(e-1);for(let i=1;i<e;i++)n[i-1]=t[i];return n}(arguments)):Array.isArray(e)?yc(s,function(t,e){let n={},i=t.length,r=new Array(i);for(let s=0;s<i;s++)r[s]=t[s];for(let s=0;s<e.length;s++)n[e[s]]=r[s+1];return n}(arguments,e)):yc(s,n)},r?function(t,e,n,i){return Mc.all(e).then(e=>Ic(t,e,n,i))}(s,i,t,this):Ic(s,i,t,this)};return n.__proto__=t,n}function Ic(t,e,n,i){try{n.apply(i,e)}catch(IN){bc(t,IN)}return t}function Oc(t,e){return Mc.all(t,e)}Mc.cast=uc,Mc.all=function(t,e){return Array.isArray(t)?new kc(this,t,!0,e).promise:this.reject(new TypeError("Promise.all must be called with an array"),e)},Mc.race=function(t,e){let n=this,i=new n(dc,e);if(!Array.isArray(t))return bc(i,new TypeError("Promise.race must be called with an array")),i;for(let r=0;i._state===pc&&r<t.length;r++)wc(n.resolve(t[r]),void 0,t=>yc(i,t),t=>bc(i,t));return i},Mc.resolve=uc,Mc.reject=function(t,e){let n=new this(dc,e);return bc(n,t),n},Mc.prototype._guidKey=Tc,Mc.prototype.then=Sc;class Ac extends kc{constructor(t,e,n){super(t,e,!1,n)}}function zc(t,e){return Array.isArray(t)?new Ac(Mc,t,e).promise:Mc.reject(new TypeError("Promise.allSettled must be called with an array"),e)}function Fc(t,e){return Mc.race(t,e)}Ac.prototype._setResultAt=Ec;class jc extends kc{constructor(t,e,n=!0,i){super(t,e,n,i)}_init(t,e){this._result={},this._enumerate(e)}_enumerate(t){let e,n,i=Object.keys(t),r=i.length,s=this.promise;this._remaining=r;for(let o=0;s._state===pc&&o<r;o++)e=i[o],n=t[e],this._eachEntry(n,e,!0);this._checkFullfillment()}}function Dc(t,e){return Mc.resolve(t,e).then(function(t){if(null===t||"object"!=typeof t)throw new TypeError("Promise.hash must be called with an object");return new jc(Mc,t,e).promise})}class Nc extends jc{constructor(t,e,n){super(t,e,!1,n)}}function Bc(t,e){return Mc.resolve(t,e).then(function(t){if(null===t||"object"!=typeof t)throw new TypeError("hashSettled must be called with an object");return new Nc(Mc,t,!1,e).promise})}function Uc(t){throw setTimeout(()=>{throw t}),t}function qc(t){let e={resolve:void 0,reject:void 0};return e.promise=new Mc((t,n)=>{e.resolve=t,e.reject=n},t),e}Nc.prototype._setResultAt=Ec;class Vc extends kc{constructor(t,e,n,i){super(t,e,!0,i,n)}_init(t,e,n,i,r){let s=e.length||0;this.length=s,this._remaining=s,this._result=new Array(s),this._mapFn=r,this._enumerate(e)}_setResultAt(t,e,n,i){if(i)try{this._eachEntry(this._mapFn(n,e),e,!1)}catch(IN){this._settledAt(gc,e,IN,!1)}else this._remaining--,this._result[e]=n}}function $c(t,e,n){return"function"!=typeof e?Mc.reject(new TypeError("map expects a function as a second argument"),n):Mc.resolve(t,n).then(function(t){if(!Array.isArray(t))throw new TypeError("map must be called with an array");return new Vc(Mc,t,e,n).promise})}function Gc(t,e){return Mc.resolve(t,e)}function Wc(t,e){return Mc.reject(t,e)}const Hc={};class Zc extends Vc{_checkFullfillment(){if(0===this._remaining&&null!==this._result){let t=this._result.filter(t=>t!==Hc);_c(this.promise,t),this._result=null}}_setResultAt(t,e,n,i){if(i){this._result[e]=n;let t,i=!0;try{t=this._mapFn(n,e)}catch(IN){i=!1,this._settledAt(gc,e,IN,!1)}i&&this._eachEntry(t,e,!1)}else this._remaining--,n||(this._result[e]=Hc)}}function Kc(t,e,n){return"function"!=typeof e?Mc.reject(new TypeError("filter expects function as a second argument"),n):Mc.resolve(t,n).then(function(t){if(!Array.isArray(t))throw new TypeError("filter must be called with an array");return new Zc(Mc,t,e,n).promise})}let Yc,Xc=0;function Jc(t,e){sh[Xc]=t,sh[Xc+1]=e,Xc+=2,2===Xc&&ah()}const Qc="undefined"!=typeof window?window:void 0,th=Qc||{},eh=th.MutationObserver||th.WebKitMutationObserver,nh="undefined"==typeof self&&"undefined"!=typeof process&&"[object process]"==={}.toString.call(process),ih="undefined"!=typeof Uint8ClampedArray&&"undefined"!=typeof importScripts&&"undefined"!=typeof MessageChannel;function rh(){return()=>setTimeout(oh,1)}const sh=new Array(1e3);function oh(){for(let t=0;t<Xc;t+=2)(0,sh[t])(sh[t+1]),sh[t]=void 0,sh[t+1]=void 0;Xc=0}let ah;ah=nh?function(){let t=process.nextTick,e=process.versions.node.match(/^(?:(\d+)\.)?(?:(\d+)\.)?(\*|\d+)$/);return Array.isArray(e)&&"0"===e[1]&&"10"===e[2]&&(t=setImmediate),()=>t(oh)}():eh?function(){let t=0,e=new eh(oh),n=document.createTextNode("");return e.observe(n,{characterData:!0}),()=>n.data=t=++t%2}():ih?function(){let t=new MessageChannel;return t.port1.onmessage=oh,()=>t.port2.postMessage(0)}():void 0===Qc&&"function"==typeof window.require?function(){try{const t=Function("return this")().require("vertx");return Yc=t.runOnLoop||t.runOnContext,void 0!==Yc?function(){Yc(oh)}:rh()}catch(t){return rh()}}():rh(),ac.async=Jc,ac.after=t=>setTimeout(t,0);const lh=Gc,ch=(t,e)=>ac.async(t,e);function hh(){ac.on(...arguments)}function uh(){ac.off(...arguments)}if("undefined"!=typeof window&&"object"==typeof window.__PROMISE_INSTRUMENTATION__){let t=window.__PROMISE_INSTRUMENTATION__;lc("instrument",!0);for(let e in t)t.hasOwnProperty(e)&&hh(e,t[e])}const dh={asap:Jc,cast:lh,Promise:Mc,EventTarget:oc,all:Oc,allSettled:zc,race:Fc,hash:Dc,hashSettled:Bc,rethrow:Uc,defer:qc,denodeify:Pc,configure:lc,on:hh,off:uh,resolve:Gc,reject:Wc,map:$c,async:ch,filter:Kc},ph=Object.freeze(Object.defineProperty({__proto__:null,EventTarget:oc,Promise:Mc,all:Oc,allSettled:zc,asap:Jc,async:ch,cast:lh,configure:lc,default:dh,defer:qc,denodeify:Pc,filter:Kc,hash:Dc,hashSettled:Bc,map:$c,off:uh,on:hh,race:Fc,reject:Wc,resolve:Gc,rethrow:Uc},Symbol.toStringTag,{value:"Module"}));function fh(t){let e=function(t){if(!t)return;let e=t;return e.errorThrown?function(t){let e=t.errorThrown;return"string"==typeof e&&(e=new Error(e)),Object.defineProperty(e,"__reason_with_error_thrown__",{value:t,enumerable:!1}),e}(e):"UnrecognizedURLError"!==t.name&&"TransitionAborted"!==t.name?t:void 0}(t);if(e)throw e}lc("async",(t,e)=>{ma.schedule("actions",null,t,e)}),lc("after",t=>{ma.schedule(fa,null,t)}),hh("error",fh);const{isArray:gh}=Array;function mh(t){return null==t?[]:gh(t)?t:[t]}function yh(t){return"object"==typeof t&&null!==t&&"function"==typeof t.setUnknownProperty}const vh=Vl.prototype.reopen,_h=new WeakSet,bh=new WeakMap,wh=new Set;function xh(t){wh.has(t)||t.destroy()}function Ch(t,e){let n=ae(t);if(void 0!==e){let i=t.concatenatedProperties,r=t.mergedProperties,s=Object.keys(e);for(let o of s){let s=e[o],a=Rr(t,o,n),l=void 0!==a;if(!l){if(void 0!==i&&i.length>0&&i.includes(o)){let e=t[o];s=e?mh(e).concat(s):mh(s)}if(void 0!==r&&r.length>0&&r.includes(o)){let e=t[o];s=Object.assign({},e,s)}}l?a.set(t,o,s):yh(t)&&!(o in t)?t.setUnknownProperty(o,s):t[o]=s}}t.init(e),n.unsetInitializing();let i=n.observerEvents();if(void 0!==i)for(let r=0;r<i.length;r++)Zr(t,i[r].event,i[r].sync);Br(t,"init",void 0,void 0,n)}class Sh{[lr];constructor(t){let e;this[lr]=t,this.constructor.proto(),e=this;const n=e;Wt(e,xh,!0),Wt(e,()=>n.willDestroy()),ae(e).setInitializing()}reopen(...t){return Bl(this,t),this}init(t){}get isDestroyed(){return Yt(this)}set isDestroyed(t){}get isDestroying(){return Kt(this)}set isDestroying(t){}destroy(){wh.add(this);try{Ht(this)}finally{wh.delete(this)}return this}willDestroy(){}toString(){let t="object"==typeof this&&null!==this&&"function"==typeof this.toStringExtension?`:${this.toStringExtension()}`:"";return`<${xl(this)||"(unknown)"}:${et(this)}${t}>`}static extend(...t){let e=class extends(this){};return vh.apply(e.PrototypeMixin,t),e}static create(...t){let e,n=t[0];return void 0!==n?(e=new this(hr(n)),Cl(e,xl(n))):e=new this,t.length<=1?Ch(e,n):Ch(e,kh.apply(this,t)),e}static reopen(...t){return this.willReopen(),vh.apply(this.PrototypeMixin,t),this}static willReopen(){let t=this.prototype;_h.has(t)&&(_h.delete(t),bh.has(this)&&bh.set(this,Vl.create(this.PrototypeMixin)))}static reopenClass(...t){return Bl(this,t),this}static detect(t){if("function"!=typeof t)return!1;for(;t;){if(t===this)return!0;t=t.superclass}return!1}static detectInstance(t){return t instanceof this}static metaForProperty(t){return Rr(this.proto(),t)._meta||{}}static eachComputedProperty(t,e=this){this.proto();let n={};ae(this.prototype).forEachDescriptors((i,r)=>{if(r.enumerable){let s=r._meta||n;t.call(e,i,s)}})}static get PrototypeMixin(){let t=bh.get(this);return void 0===t&&(t=Vl.create(),t.ownerConstructor=this,bh.set(this,t)),t}static get superclass(){let t=Object.getPrototypeOf(this);return t!==Function.prototype?t:void 0}static proto(){let t=this.prototype;if(!_h.has(t)){_h.add(t);let e=this.superclass;e&&e.proto(),bh.has(this)&&this.PrototypeMixin.apply(t)}return t}static toString(){return`<${xl(this)||"(unknown)"}:constructor>`}static isClass=!0;static isMethod=!1;static _onLookup;static _lazyInjections}function kh(...t){let e={};for(let n of t){let t=Object.keys(n);for(let i=0,r=t.length;i<r;i++){let r=t[i],s=n[r];e[r]=s}}return e}const Eh=Object.freeze(Object.defineProperty({__proto__:null,default:Sh},Symbol.toStringTag,{value:"Module"})),Th=Vl.create({get(t){return Cs(this,t)},getProperties(...t){return Js(this,...t)},set(t,e){return zs(this,t,e)},setProperties(t){return Qs(this,t)},beginPropertyChanges(){return os(),this},endPropertyChanges(){return as(),this},notifyPropertyChange(t){return ss(this,t),this},addObserver(t,e,n,i){return Wr(this,t,e,n,i),this},removeObserver(t,e,n,i){return Hr(this,t,e,n,i),this},hasObserverFor(t){return Ur(this,`${t}:change`)},incrementProperty(t,e=1){return zs(this,t,(parseFloat(Cs(this,t))||0)+e)},decrementProperty(t,e=1){return zs(this,t,(Cs(this,t)||0)-e)},toggleProperty(t){return zs(this,t,!Cs(this,t))},cacheFor(t){let e=oe(this);return null!==e?e.valueFor(t):void 0}}),Lh=Object.freeze(Object.defineProperty({__proto__:null,default:Th},Symbol.toStringTag,{value:"Module"}));class Mh extends(Sh.extend(Th)){get _debugContainerKey(){let t=xl(this);return void 0!==t&&t.fullName}}const Rh=new WeakMap;function Ph(t,e,n){var i;if(null!=(i=t)&&void 0!==i.constructor&&"function"==typeof i.constructor.proto&&t.constructor.proto(),!Object.prototype.hasOwnProperty.call(t,"actions")){let e=t.actions;t.actions=e?Object.assign({},e):{}}return t.actions[e]=n,{get(){let t=Rh.get(this);void 0===t&&(t=new Map,Rh.set(this,t));let e=t.get(n);return void 0===e&&(e=n.bind(this),t.set(n,e)),e}}}function Ih(...t){let e;if(!xr(t)){e=t[0];let n=function(t,n){return Ph(t,n,e)};return Or(n),n}let[n,i,r]=t;return e=r?.value,Ph(n,i,e)}function Oh(...t){let e,n,i,r=t.pop();"function"==typeof r?(e=r,n=t,i=!g._DEFAULT_ASYNC_OBSERVERS):(e=r.fn,n=r.dependentKeys,i=r.sync);let s=[];for(let o of n)zr(o,t=>s.push(t));return pt(e,{paths:s,sync:i}),e}Or(Ih);const Ah=Object.freeze(Object.defineProperty({__proto__:null,action:Ih,computed:ps,default:Mh,defineProperty:ms,get:Cs,getProperties:Js,notifyPropertyChange:ss,observer:Oh,set:zs,setProperties:Qs,trySet:js},Symbol.toStringTag,{value:"Module"}));function zh(t){if(!(t instanceof MouseEvent))return!1;let e=t.shiftKey||t.metaKey||t.altKey||t.ctrlKey,n=t.which>1;return!e&&!n}function Fh(t){return'Binding style attributes may introduce cross-site scripting vulnerabilities; please ensure that values being bound are properly escaped. For more information, including how to disable this warning, see https://deprecations.emberjs.com/v1.x/#toc_binding-style-attributes. Style affected: "'+t+'"'}function jh(t){let e=t.lookup("-view-registry:main"),n=[];return Object.keys(e).forEach(t=>{let i=e[t];null===i.parentView&&n.push(i)}),n}function Dh(t){return""!==t.tagName&&t.elementId?t.elementId:et(t)}const Nh=new WeakMap,Bh=new WeakMap;function Uh(t){return Nh.get(t)||null}function qh(t){return Bh.get(t)||null}function Vh(t,e){Nh.set(t,e)}function $h(t,e){Bh.set(t,e)}function Gh(t){Nh.delete(t)}function Wh(t){Bh.delete(t)}const Hh=new WeakMap;function Zh(t){return function(t,e){let n=[],i=Hh.get(t);return void 0!==i&&i.forEach(t=>{let i=e[t];!i||i.isDestroying||i.isDestroyed||n.push(i)}),n}(t,hr(t).lookup("-view-registry:main"))}function Kh(t,e){let n=Hh.get(t);void 0===n&&(n=function(t){let e=new Set;return Hh.set(t,e),e}(t)),n.add(Dh(e))}function Yh(t){return t.renderer.getBounds(t)}function Xh(t){let e=Yh(t),n=document.createRange();return n.setStartBefore(e.firstNode),n.setEndAfter(e.lastNode),n}function Jh(t){return Xh(t).getClientRects()}function Qh(t){return Xh(t).getBoundingClientRect()}const tu="ember-application";class eu extends Mh{events={touchstart:"touchStart",touchmove:"touchMove",touchend:"touchEnd",touchcancel:"touchCancel",keydown:"keyDown",keyup:"keyUp",keypress:"keyPress",mousedown:"mouseDown",mouseup:"mouseUp",contextmenu:"contextMenu",click:"click",dblclick:"doubleClick",focusin:"focusIn",focusout:"focusOut",submit:"submit",input:"input",change:"change",dragstart:"dragStart",drag:"drag",dragenter:"dragEnter",dragleave:"dragLeave",dragover:"dragOver",drop:"drop",dragend:"dragEnd"};rootElement="body";_eventHandlers=Object.create(null);_didSetup=!1;finalEventNameMapping=null;_sanitizedRootElement=null;lazyEvents=new Map;_reverseEventNameMapping=null;setup(t,e){let n=this.finalEventNameMapping={...Cs(this,"events"),...t};this._reverseEventNameMapping=Object.keys(n).reduce((t,e)=>{let i=n[e];return i?{...t,[i]:e}:t},{});let i=this.lazyEvents;null!=e&&zs(this,"rootElement",e);let r=Cs(this,"rootElement"),s="string"!=typeof r?r:document.querySelector(r);s.classList.add(tu),this._sanitizedRootElement=s;for(let o in n)Object.prototype.hasOwnProperty.call(n,o)&&i.set(o,n[o]??null);this._didSetup=!0}setupHandlerForBrowserEvent(t){this.setupHandler(this._sanitizedRootElement,t,this.finalEventNameMapping[t]??null)}setupHandlerForEmberEvent(t){let e=this._reverseEventNameMapping?.[t];e&&this.setupHandler(this._sanitizedRootElement,e,t)}setupHandler(t,e,n){if(null===n||!this.lazyEvents.has(e))return;let i=(t,e)=>{let i=Uh(t),r=!0;return i&&(r=i.handleEvent(n,e)),r},r=this._eventHandlers[e]=t=>{let e=t.target;do{if(Uh(e)){if(!1===i(e,t)){t.preventDefault(),t.stopPropagation();break}if(!0===t.cancelBubble)break}e=e.parentNode}while(e instanceof Element)};t.addEventListener(e,r),this.lazyEvents.delete(e)}destroy(){if(!1===this._didSetup)return;let t=this._sanitizedRootElement;if(t){for(let e in this._eventHandlers)t.removeEventListener(e,this._eventHandlers[e]);return t.classList.remove(tu),this._super(...arguments)}}toString(){return"(EventDispatcher)"}}const nu=Vl.create({on(t,e,n){return Dr(this,t,e,n),this},one(t,e,n){return Dr(this,t,e,n,!0),this},trigger(t,...e){Br(this,t,e)},off(t,e,n){return Nr(this,t,e,n),this},has(t){return Ur(this,t)}}),iu=Object.freeze(Object.defineProperty({__proto__:null,default:nu,on:qr},Symbol.toStringTag,{value:"Module"}));let ru=class extends Mh{},su=[],ou={};const au=(()=>{let t="undefined"!=typeof window&&window.performance||{},e=t.now||t.mozNow||t.webkitNow||t.msNow||t.oNow;return e?e.bind(t):Date.now})();function lu(t,e,n,i){let r,s,o;if(arguments.length<=3&&function(t){return"function"==typeof t}(e)?(s=e,o=n):(r=e,s=n,o=i),0===su.length)return s.call(o);let a=r||{},l=uu(t,()=>a);return l===hu?s.call(o):function(t,e,n,i){try{return t.call(i)}catch(r){throw n.exception=r,r}finally{e()}}(s,l,a,o)}function cu(t,e,n){return n()}function hu(){}function uu(t,e,n){if(0===su.length)return hu;let i=ou[t];if(i||(i=function(t){let e=[];for(let n of su)n.regex.test(t)&&e.push(n.object);return ou[t]=e,e}(t)),0===i.length)return hu;let r,s=e(n),o=g.STRUCTURED_PROFILE;o&&(r=`${t}: ${s.object}`,console.time(r));let a=[],l=au();for(let h of i)a.push(h.before(t,l,s));const c=i;return function(){let e=au();for(let n=0;n<c.length;n++){let i=c[n];"function"==typeof i.after&&i.after(t,e,s,a[n])}o&&console.timeEnd(r)}}function du(t,e){let n=t.split("."),i=[];for(let o of n)"*"===o?i.push("[^\\.]*"):i.push(o);let r=i.join("\\.");r=`${r}(\\..*)?`;let s={pattern:t,regex:new RegExp(`^${r}$`),object:e};return su.push(s),ou={},s}function pu(t){let e=0;for(let n=0;n<su.length;n++)su[n]===t&&(e=n);su.splice(e,1),ou={}}function fu(){su.length=0,ou={}}const gu=Object.freeze(Object.defineProperty({__proto__:null,_instrumentStart:uu,flaggedInstrument:cu,instrument:lu,reset:fu,subscribe:du,subscribers:su,unsubscribe:pu},Symbol.toStringTag,{value:"Module"})),mu=Object.freeze({appendChild(){throw new Error("You can't use appendChild outside of the rendering process")},handleEvent:()=>!0,rerender(){},destroy(){}}),yu=Object.freeze({...mu}),vu=Object.freeze({...mu,rerender(t){t.renderer.rerender()},destroy(t){t.renderer.remove(t)},handleEvent:(t,e,n)=>!t.has(e)||cu(0,0,()=>va(t,t.trigger,e,n))}),_u=Object.freeze({...vu,enter(t){t.renderer.register(t)}}),bu=Object.freeze({...mu,appendChild(){throw new Error("You can't call appendChild on a view being destroyed")},rerender(){throw new Error("You can't call rerender on a view being destroyed")}}),wu=Object.freeze({preRender:yu,inDOM:_u,hasElement:vu,destroying:bu});var xu=Object.defineProperty;((t,e)=>{for(var n in e)xu(t,n,{get:e[n],enumerable:!0})})({},{c:()=>Mu,f:()=>Su,g:()=>ku,i:()=>Lu,m:()=>Eu,n:()=>Tu,p:()=>Ru});var Cu=new WeakMap;function Su(t,e,n,i){return ku(t.prototype,e,n,i)}function ku(t,e,n,i){let r={configurable:!0,enumerable:!0,writable:!0,initializer:null};i&&(r.initializer=i);for(let s of n)r=s(t,e,r)||r;void 0===r.initializer?Object.defineProperty(t,e,r):function(t,e,n){let i=Cu.get(t);i||(i=new Map,Cu.set(t,i)),i.set(e,n)}(t,e,r)}function Eu({prototype:t},e,n){return Tu(t,e,n)}function Tu(t,e,n){let i={...Object.getOwnPropertyDescriptor(t,e)};for(let r of n)i=r(t,e,i)||i;void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(t):void 0,i.initializer=void 0),Object.defineProperty(t,e,i)}function Lu(t,e){let n=function(t,e){let n=t.prototype;for(;n;){let t=Cu.get(n)?.get(e);if(t)return t;n=n.prototype}}(t.constructor,e);n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(t):void 0})}function Mu(t,e){return e.reduce((t,e)=>e(t)||t,t)}function Ru(t,e){for(let[n,i,r]of e)"field"===n?Pu(t,i,r):Tu(t,i,r);return t}function Pu(t,e,n){let i={configurable:!0,enumerable:!0,writable:!0,initializer:()=>Object.getOwnPropertyDescriptor(t,e)?.value};for(let r of n)i=r(t,e,i)||i;i.initializer&&(i.value=i.initializer.call(t),delete i.initializer),Object.defineProperty(t,e,i)}class Iu extends(ru.extend(nu,Xl)){isView=!0;_superTrigger;_superHas;init(t){super.init(t),this._superTrigger=this.trigger,this.trigger=this._trigger,this._superHas=this.has,this.has=this._has,this.parentView??=null,this._state="preRender",this._currentState=this._states.preRender}static{ku(this.prototype,"renderer",[Rs("renderer","-dom")])}#l=void Lu(this,"renderer");instrumentDetails(t){return t.object=this.toString(),t.containerKey=this._debugContainerKey,t.view=this,t}_trigger(t,...e){this._superTrigger(t,...e);let n=this[t];if("function"==typeof n)return n.apply(this,e)}_has(t){return"function"==typeof this[t]||this._superHas(t)}static isViewFactory=!0}Iu.prototype._states=wu;const Ou=Vl.create({send(t,...e){let n=this.actions&&this.actions[t];if(n&&!0!==n.apply(this,e))return;let i=Cs(this,"target");i&&i.send(...arguments)}}),Au={"[object Boolean]":"boolean","[object Number]":"number","[object String]":"string","[object Function]":"function","[object AsyncFunction]":"function","[object Array]":"array","[object Date]":"date","[object RegExp]":"regexp","[object Object]":"object","[object FileList]":"filelist"},{toString:zu}=Object.prototype;function Fu(t){if(null===t)return"null";if(void 0===t)return"undefined";let e=Au[zu.call(t)]||"object";return"function"===e?Sh.detect(t)&&(e="class"):"object"===e&&(t instanceof Error?e="error":t instanceof Sh?e="instance":t instanceof Date&&(e="date")),e}const ju={undefined:0,null:1,boolean:2,number:3,string:4,array:5,object:6,instance:7,function:8,class:9,date:10,regexp:11,filelist:12,error:13};function Du(t,e){return Math.sign(t-e)}function Nu(t,e){if(t===e)return 0;let n=Fu(t),i=Fu(e);if("instance"===n&&Bu(t)&&t.constructor.compare)return t.constructor.compare(t,e);if("instance"===i&&Bu(e)&&e.constructor.compare)return-1*e.constructor.compare(e,t);let r=Du(ju[n],ju[i]);if(0!==r)return r;switch(n){case"boolean":return Du(Number(t),Number(e));case"number":return Du(t,e);case"string":return Du(t.localeCompare(e),0);case"array":{let n=t.length,i=e.length,r=Math.min(n,i);for(let s=0;s<r;s++){let n=Nu(t[s],e[s]);if(0!==n)return n}return Du(n,i)}case"instance":return Bu(t)&&t.compare?t.compare(t,e):0;case"date":return Du(t.getTime(),e.getTime());default:return 0}}function Bu(t){return Yl.detect(t)}const Uu=Object.freeze([]),qu=t=>t;function Vu(t,e=qu){let n=sd(),i=new Set,r="function"==typeof e?e:t=>Cs(t,e);return t.forEach(t=>{let e=r(t);i.has(e)||(i.add(e),n.push(t))}),n}function $u(...t){let e=2===t.length,[n,i]=t;return e?t=>i===Cs(t,n):t=>Boolean(Cs(t,n))}function Gu(t,e,n){let i=t.length;for(let r=n;r<i;r++)if(e(dr(t,r),r,t))return r;return-1}function Wu(t,e,n=null){let i=Gu(t,e.bind(n),0);return-1===i?void 0:dr(t,i)}function Hu(t,e,n=null){return-1!==Gu(t,e.bind(n),0)}function Zu(t,e,n=null){let i=e.bind(n);return-1===Gu(t,(t,e,n)=>!i(t,e,n),0)}function Ku(t,e,n=0,i){let r=t.length;return n<0&&(n+=r),Gu(t,i&&e!=e?t=>t!=t:t=>t===e,n)}function Yu(t,e,n){return Ws(t,e,n??1,Uu),t}function Xu(t,e,n){return Ws(t,e,0,[n]),n}function Ju(t){if(!t||t.setInterval)return!1;if(Array.isArray(t)||ed.detect(t))return!0;let e=Fu(t);if("array"===e)return!0;let n=t.length;return"number"==typeof n&&n==n&&"object"===e}function Qu(t){let e=ps(t);return e.enumerable=!1,e}function td(t){return this.map(e=>Cs(e,t))}const ed=Vl.create(ec,{init(){this._super(...arguments),ir.add(this)},objectsAt(t){return t.map(t=>dr(this,t))},"[]":Qu({get(){return this},set(t,e){return this.replace(0,this.length,e),this}}),firstObject:Qu(function(){return dr(this,0)}).readOnly(),lastObject:Qu(function(){return dr(this,this.length-1)}).readOnly(),slice(t=0,e){let n,i=sd(),r=this.length;for(t<0&&(t=r+t),n=void 0===e||e>r?r:e<0?r+e:e;t<n;)i[i.length]=dr(this,t++);return i},indexOf(t,e){return Ku(this,t,e,!1)},lastIndexOf(t,e){let n=this.length;(void 0===e||e>=n)&&(e=n-1),e<0&&(e+=n);for(let i=e;i>=0;i--)if(dr(this,i)===t)return i;return-1},forEach(t,e=null){let n=this.length;for(let i=0;i<n;i++){let n=this.objectAt(i);t.call(e,n,i,this)}return this},getEach:td,setEach(t,e){return this.forEach(n=>zs(n,t,e))},map(t,e=null){let n=sd();return this.forEach((i,r,s)=>n[r]=t.call(e,i,r,s)),n},mapBy:td,filter(t,e=null){let n=sd();return this.forEach((i,r,s)=>{t.call(e,i,r,s)&&n.push(i)}),n},reject(t,e=null){return this.filter(function(){return!t.apply(e,arguments)})},filterBy(){return this.filter($u(...arguments))},rejectBy(){return this.reject($u(...arguments))},find(t,e=null){return Wu(this,t,e)},findBy(){return Wu(this,$u(...arguments))},every(t,e=null){return Zu(this,t,e)},isEvery(){return Zu(this,$u(...arguments))},any(t,e=null){return Hu(this,t,e)},isAny(){return Hu(this,$u(...arguments))},reduce(t,e){let n=e;return this.forEach(function(e,i){n=t(n,e,i,this)},this),n},invoke(t,...e){let n=sd();return this.forEach(i=>n.push(i[t]?.(...e))),n},toArray(){return this.map(t=>t)},compact(){return this.filter(t=>null!=t)},includes(t,e){return-1!==Ku(this,t,e,!0)},sortBy(){let t=arguments;return this.toArray().sort((e,n)=>{for(let i=0;i<t.length;i++){let r=t[i],s=Nu(Cs(e,r),Cs(n,r));if(s)return s}return 0})},uniq(){return Vu(this)},uniqBy(t){return Vu(this,t)},without(t){if(!this.includes(t))return this;let e=t==t?e=>e!==t:t=>t==t;return this.filter(e)}}),nd=Vl.create(ed,nc,{clear(){let t=this.length;return 0===t||this.replace(0,t,Uu),this},insertAt(t,e){return Xu(this,t,e),this},removeAt(t,e){return Yu(this,t,e)},pushObject(t){return Xu(this,this.length,t)},pushObjects(t){return this.replace(this.length,0,t),this},popObject(){let t=this.length;if(0===t)return null;let e=dr(this,t-1);return this.removeAt(t-1,1),e},shiftObject(){if(0===this.length)return null;let t=dr(this,0);return this.removeAt(0),t},unshiftObject(t){return Xu(this,0,t)},unshiftObjects(t){return this.replace(0,0,t),this},reverseObjects(){let t=this.length;if(0===t)return this;let e=this.toArray().reverse();return this.replace(0,t,e),this},setObjects(t){if(0===t.length)return this.clear();let e=this.length;return this.replace(0,e,t),this},removeObject(t){let e=this.length||0;for(;--e>=0;)dr(this,e)===t&&this.removeAt(e);return this},removeObjects(t){os();for(let e=t.length-1;e>=0;e--)this.removeObject(t[e]);return as(),this},addObject(t){return this.includes(t)||this.pushObject(t),this},addObjects(t){return os(),t.forEach(t=>this.addObject(t)),as(),this}});let id=Vl.create(nd,Th,{objectAt(t){return this[t]},replace(t,e,n=Uu){return Zs(this,t,e,n),this}});const rd=["length"];let sd;id.keys().forEach(t=>{Array.prototype[t]&&rd.push(t)}),id=id.without(...rd),sd=function(t){return rr(t)?t:id.apply(t??[])};const od=Object.freeze(Object.defineProperty({__proto__:null,get A(){return sd},MutableArray:nd,get NativeArray(){return id},default:ed,isArray:Ju,makeArray:mh,removeAt:Yu,uniqBy:Vu},Symbol.toStringTag,{value:"Module"})),ad=kt("MODEL"),ld=Vl.create(Xl,{isController:!0,concatenatedProperties:["queryParams"],target:null,store:null,init(){this._super(...arguments);let t=hr(this);t&&(this.namespace=t.lookup("application:main"),this.target=t.lookup("router:main"))},model:ps({get(){return this[ad]},set(t,e){return this[ad]=e}}),queryParams:null,_qpDelegate:null,_qpChanged(t,e){let n=e.indexOf(".[]"),i=-1===n?e:e.slice(0,n);(0,t._qpDelegate)(i,Cs(t,i))}});class cd extends(ru.extend(ld)){}function hd(...t){return Rs("controller",...t)}const ud=Object.freeze(Object.defineProperty({__proto__:null,ControllerMixin:ld,default:cd,inject:hd},Symbol.toStringTag,{value:"Module"})),dd=Symbol("ENGINE_PARENT");function pd(t){return t[dd]}class fd extends(Mh.extend(Hl,Kl)){static setupRegistry(t,e){}[dd];_booted=!1;init(t){super.init(t),et(this),this.base??=this.application;let e=this.__registry__=new El({fallback:this.base.__registry__});this.__container__=e.container({owner:this}),this._booted=!1}_bootPromise=null;boot(t){return this._bootPromise||(this._bootPromise=new ph.Promise(e=>{e(this._bootSync(t))})),this._bootPromise}_bootSync(t){return this._booted||(this.cloneParentDependencies(),this.setupRegistry(t),this.base.runInstanceInitializers(this),this._booted=!0),this}setupRegistry(t=this.__container__.lookup("-environment:main")){this.constructor.setupRegistry(this.__registry__,t)}unregister(t){this.__container__.reset(t),this.__registry__.unregister(t)}buildChildEngineInstance(t,e={}){let n=this.lookup(`engine:${t}`);if(!n)throw new Error(`You attempted to mount the engine '${t}', but it is not registered with its parent.`);let i=n.buildInstance(e);return i[dd]=this,i}cloneParentDependencies(){const t=pd(this);["route:basic","service:-routing"].forEach(e=>{let n=t.resolveRegistration(e);this.register(e,n)});let e=t.lookup("-environment:main");this.register("-environment:main",e,{instantiate:!1});let n=["router:main",Ml`-bucket-cache:main`,"-view-registry:main","renderer:-dom","service:-document"];e.isInteractive&&n.push("event_dispatcher:main"),n.forEach(e=>{let n=t.lookup(e);this.register(e,n,{instantiate:!1})})}}let gd=function(t,e,n){let{get:i}=n;return void 0!==i&&(n.get=function(){let t,n=on(this,e),r=Ge(()=>{t=i.call(this)});return me(n,r),je(r),t}),n};function md(...t){if(xr(t)){let[e,n,i]=t;return gd(0,n,i)}{const e=t[0];let n=function(t,n){return gd(0,n,e)};return Or(n),n}}Or(md);var yd=Object.create;function vd(){var t=yd(null);return t.__=void 0,delete t.__,t}var _d=function(t,e,n){this.path=t,this.matcher=e,this.delegate=n};_d.prototype.to=function(t,e){var n=this.delegate;if(n&&n.willAddRoute&&(t=n.willAddRoute(this.matcher.target,t)),this.matcher.add(this.path,t),e){if(0===e.length)throw new Error("You must have an argument in the function passed to `to`");this.matcher.addChild(this.path,t,e,this.delegate)}};var bd=function(t){this.routes=vd(),this.children=vd(),this.target=t};function wd(t,e,n){return function(i,r){var s=t+i;if(!r)return new _d(s,e,n);r(wd(s,e,n))}}function xd(t,e,n){for(var i=0,r=0;r<t.length;r++)i+=t[r].path.length;var s={path:e=e.substr(i),handler:n};t.push(s)}function Cd(t,e,n,i){for(var r=e.routes,s=Object.keys(r),o=0;o<s.length;o++){var a=s[o],l=t.slice();xd(l,a,r[a]);var c=e.children[a];c?Cd(l,c,n,i):n.call(i,l)}}function Sd(t){return t.split("/").map(Ed).join("/")}bd.prototype.add=function(t,e){this.routes[t]=e},bd.prototype.addChild=function(t,e,n,i){var r=new bd(e);this.children[t]=r;var s=wd(t,r,i);i&&i.contextEntered&&i.contextEntered(e,s),n(s)};var kd=/%|\//g;function Ed(t){return t.length<3||-1===t.indexOf("%")?t:decodeURIComponent(t).replace(kd,encodeURIComponent)}var Td=/%(?:2(?:4|6|B|C)|3(?:B|D|A)|40)/g;function Ld(t){return encodeURIComponent(t).replace(Td,decodeURIComponent)}var Md=/(\/|\.|\*|\+|\?|\||\(|\)|\[|\]|\{|\}|\\)/g,Rd=Array.isArray,Pd=Object.prototype.hasOwnProperty;function Id(t,e){if("object"!=typeof t||null===t)throw new Error("You must pass an object as the second argument to `generate`.");if(!Pd.call(t,e))throw new Error("You must provide param `"+e+"` to `generate`.");var n=t[e],i="string"==typeof n?n:""+n;if(0===i.length)throw new Error("You must provide a param `"+e+"`.");return i}var Od=[];Od[0]=function(t,e){for(var n=e,i=t.value,r=0;r<i.length;r++){var s=i.charCodeAt(r);n=n.put(s,!1,!1)}return n},Od[1]=function(t,e){return e.put(47,!0,!0)},Od[2]=function(t,e){return e.put(-1,!1,!0)},Od[4]=function(t,e){return e};var Ad=[];Ad[0]=function(t){return t.value.replace(Md,"\\$1")},Ad[1]=function(){return"([^/]+)"},Ad[2]=function(){return"(.+)"},Ad[4]=function(){return""};var zd=[];zd[0]=function(t){return t.value},zd[1]=function(t,e){var n=Id(e,t.value);return Gd.ENCODE_AND_DECODE_PATH_SEGMENTS?Ld(n):n},zd[2]=function(t,e){return Id(e,t.value)},zd[4]=function(){return""};var Fd=Object.freeze({}),jd=Object.freeze([]);function Dd(t,e,n){e.length>0&&47===e.charCodeAt(0)&&(e=e.substr(1));for(var i=e.split("/"),r=void 0,s=void 0,o=0;o<i.length;o++){var a,l,c=i[o];12&(a=2<<(l=""===c?4:58===c.charCodeAt(0)?1:42===c.charCodeAt(0)?2:0))&&(c=c.slice(1),(r=r||[]).push(c),(s=s||[]).push(!!(4&a))),14&a&&n[l]++,t.push({type:l,value:Ed(c)})}return{names:r||jd,shouldDecodes:s||jd}}function Nd(t,e,n){return t.char===e&&t.negate===n}var Bd=function(t,e,n,i,r){this.states=t,this.id=e,this.char=n,this.negate=i,this.nextStates=r?e:null,this.pattern="",this._regex=void 0,this.handlers=void 0,this.types=void 0};function Ud(t,e){return t.negate?t.char!==e&&-1!==t.char:t.char===e||-1===t.char}function qd(t,e){for(var n=[],i=0,r=t.length;i<r;i++){var s=t[i];n=n.concat(s.match(e))}return n}Bd.prototype.regex=function(){return this._regex||(this._regex=new RegExp(this.pattern)),this._regex},Bd.prototype.get=function(t,e){var n=this.nextStates;if(null!==n)if(Rd(n))for(var i=0;i<n.length;i++){var r=this.states[n[i]];if(Nd(r,t,e))return r}else{var s=this.states[n];if(Nd(s,t,e))return s}},Bd.prototype.put=function(t,e,n){var i;if(i=this.get(t,e))return i;var r=this.states;return i=new Bd(r,r.length,t,e,n),r[r.length]=i,null==this.nextStates?this.nextStates=i.id:Rd(this.nextStates)?this.nextStates.push(i.id):this.nextStates=[this.nextStates,i.id],i},Bd.prototype.match=function(t){var e=this.nextStates;if(!e)return[];var n=[];if(Rd(e))for(var i=0;i<e.length;i++){var r=this.states[e[i]];Ud(r,t)&&n.push(r)}else{var s=this.states[e];Ud(s,t)&&n.push(s)}return n};var Vd=function(t){this.length=0,this.queryParams=t||{}};function $d(t){var e;t=t.replace(/\+/gm,"%20");try{e=decodeURIComponent(t)}catch(IN){e=""}return e}Vd.prototype.splice=Array.prototype.splice,Vd.prototype.slice=Array.prototype.slice,Vd.prototype.push=Array.prototype.push;var Gd=function(){this.names=vd();var t=[],e=new Bd(t,0,-1,!0,!1);t[0]=e,this.states=t,this.rootState=e};function Wd(){let t=new Error("TransitionAborted");return t.name="TransitionAborted",t.code="TRANSITION_ABORTED",t}function Hd(t){if("object"==typeof(e=t)&&null!==e&&"boolean"==typeof e.isAborted&&t.isAborted)throw Wd();var e}Gd.prototype.add=function(t,e){for(var n,i=this.rootState,r="^",s=[0,0,0],o=new Array(t.length),a=[],l=!0,c=0,h=0;h<t.length;h++){for(var u=t[h],d=Dd(a,u.path,s),p=d.names,f=d.shouldDecodes;c<a.length;c++){var g=a[c];4!==g.type&&(l=!1,i=i.put(47,!1,!1),r+="/",i=Od[g.type](g,i),r+=Ad[g.type](g))}o[h]={handler:u.handler,names:p,shouldDecodes:f}}l&&(i=i.put(47,!1,!1),r+="/"),i.handlers=o,i.pattern=r+"$",i.types=s,"object"==typeof e&&null!==e&&e.as&&(n=e.as),n&&(this.names[n]={segments:a,handlers:o})},Gd.prototype.handlersFor=function(t){var e=this.names[t];if(!e)throw new Error("There is no route named "+t);for(var n=new Array(e.handlers.length),i=0;i<e.handlers.length;i++){var r=e.handlers[i];n[i]=r}return n},Gd.prototype.hasRoute=function(t){return!!this.names[t]},Gd.prototype.generate=function(t,e){var n=this.names[t],i="";if(!n)throw new Error("There is no route named "+t);for(var r=n.segments,s=0;s<r.length;s++){var o=r[s];4!==o.type&&(i+="/",i+=zd[o.type](o,e))}return"/"!==i.charAt(0)&&(i="/"+i),e&&e.queryParams&&(i+=this.generateQueryString(e.queryParams)),i},Gd.prototype.generateQueryString=function(t){var e=[],n=Object.keys(t);n.sort();for(var i=0;i<n.length;i++){var r=n[i],s=t[r];if(null!=s){var o=encodeURIComponent(r);if(Rd(s))for(var a=0;a<s.length;a++){var l=r+"[]="+encodeURIComponent(s[a]);e.push(l)}else o+="="+encodeURIComponent(s),e.push(o)}}return 0===e.length?"":"?"+e.join("&")},Gd.prototype.parseQueryString=function(t){for(var e=t.split("&"),n={},i=0;i<e.length;i++){var r=e[i].split("="),s=$d(r[0]),o=s.length,a=!1,l=void 0;1===r.length?l="true":(o>2&&"[]"===s.slice(o-2)&&(a=!0,n[s=s.slice(0,o-2)]||(n[s]=[])),l=r[1]?$d(r[1]):""),a?n[s].push(l):n[s]=l}return n},Gd.prototype.recognize=function(t){var e,n=[this.rootState],i={},r=!1,s=t.indexOf("#");-1!==s&&(t=t.substr(0,s));var o=t.indexOf("?");if(-1!==o){var a=t.substr(o+1,t.length);t=t.substr(0,o),i=this.parseQueryString(a)}"/"!==t.charAt(0)&&(t="/"+t);var l=t;Gd.ENCODE_AND_DECODE_PATH_SEGMENTS?t=Sd(t):(t=decodeURI(t),l=decodeURI(l));var c=t.length;c>1&&"/"===t.charAt(c-1)&&(t=t.substr(0,c-1),l=l.substr(0,l.length-1),r=!0);for(var h=0;h<t.length&&(n=qd(n,t.charCodeAt(h))).length;h++);for(var u=[],d=0;d<n.length;d++)n[d].handlers&&u.push(n[d]);n=function(t){return t.sort(function(t,e){var n=t.types||[0,0,0],i=n[0],r=n[1],s=n[2],o=e.types||[0,0,0],a=o[0],l=o[1],c=o[2];if(s!==c)return s-c;if(s){if(i!==a)return a-i;if(r!==l)return l-r}return r!==l?r-l:i!==a?a-i:0})}(u);var p=u[0];return p&&p.handlers&&(r&&p.pattern&&"(.+)$"===p.pattern.slice(-5)&&(l+="/"),e=function(t,e,n){var i=t.handlers,r=t.regex();if(!r||!i)throw new Error("state not initialized");var s=e.match(r),o=1,a=new Vd(n);a.length=i.length;for(var l=0;l<i.length;l++){var c=i[l],h=c.names,u=c.shouldDecodes,d=Fd,p=!1;if(h!==jd&&u!==jd)for(var f=0;f<h.length;f++){p=!0;var g=h[f],m=s&&s[o++];d===Fd&&(d={}),Gd.ENCODE_AND_DECODE_PATH_SEGMENTS&&u[f]?d[g]=m&&decodeURIComponent(m):d[g]=m}a[l]={handler:c.handler,params:d,isDynamic:p}}return a}(p,l,i)),e},Gd.VERSION="0.3.4",Gd.ENCODE_AND_DECODE_PATH_SEGMENTS=!0,Gd.Normalizer={normalizeSegment:Ed,normalizePath:Sd,encodePathSegment:Ld},Gd.prototype.map=function(t,e){var n=new bd;t(wd("",n,this.delegate)),Cd([],n,function(t){e?e(this,t):this.add(t)},this)};const Zd=Array.prototype.slice,Kd=Object.prototype.hasOwnProperty;function Yd(t,e){for(let n in e)Kd.call(e,n)&&(t[n]=e[n])}function Xd(t){let e,n,i=t&&t.length;if(i&&i>0){let r=t[i-1];if(function(t){if(t&&"object"==typeof t){let e=t;return"queryParams"in e&&Object.keys(e.queryParams).every(t=>"string"==typeof t)}return!1}(r))return n=r.queryParams,e=Zd.call(t,0,i-1),[e,n]}return[t,null]}function Jd(t){for(let e in t){let n=t[e];if("number"==typeof n)t[e]=""+n;else if(Array.isArray(n))for(let t=0,e=n.length;t<e;t++)n[t]=""+n[t]}}function Qd(t,...e){if(t.log)if(2===e.length){let[n,i]=e;t.log("Transition #"+n+": "+i)}else{let[n]=e;t.log(n)}}function tp(t){return"string"==typeof t||t instanceof String||"number"==typeof t||t instanceof Number}function ep(t,e){for(let n=0,i=t.length;n<i&&!1!==e(t[n]);n++);}function np(t,e){let n,i={all:{},changed:{},removed:{}};Yd(i.all,e);let r=!1;for(n in Jd(t),Jd(e),t)Kd.call(t,n)&&(Kd.call(e,n)||(r=!0,i.removed[n]=t[n]));for(n in e)if(Kd.call(e,n)){let s=t[n],o=e[n];if(ip(s)&&ip(o))if(s.length!==o.length)i.changed[n]=e[n],r=!0;else for(let t=0,a=s.length;t<a;t++)s[t]!==o[t]&&(i.changed[n]=e[n],r=!0);else t[n]!==e[n]&&(i.changed[n]=e[n],r=!0)}return r?i:void 0}function ip(t){return Array.isArray(t)}function rp(t){return"Router: "+t}const sp="__STATE__-2619860001345920-3322w3",op="__PARAMS__-261986232992830203-23323",ap="__QPS__-2619863929824844-32323",lp="__RDS__-2619863929824844-32323";class cp{constructor(t,e,n,i,r){if(this.from=null,this.to=void 0,this.isAborted=!1,this.isActive=!0,this.urlMethod="update",this.resolveIndex=0,this.queryParamsOnly=!1,this.isTransition=!0,this.isCausedByAbortingTransition=!1,this.isCausedByInitialTransition=!1,this.isCausedByAbortingReplaceTransition=!1,this._visibleQueryParams={},this.isIntermediate=!1,this[sp]=n||t.state,this.intent=e,this.router=t,this.data=e&&e.data||{},this.resolvedModels={},this[ap]={},this.promise=void 0,this.error=void 0,this[op]={},this.routeInfos=[],this.targetName=void 0,this.pivotHandler=void 0,this.sequence=-1,i)return this.promise=Mc.reject(i),void(this.error=i);if(this.isCausedByAbortingTransition=!!r,this.isCausedByInitialTransition=!!r&&(r.isCausedByInitialTransition||0===r.sequence),this.isCausedByAbortingReplaceTransition=!!r&&"replace"===r.urlMethod&&(!r.isCausedByAbortingTransition||r.isCausedByAbortingReplaceTransition),n){this[op]=n.params,this[ap]=n.queryParams,this.routeInfos=n.routeInfos;let e=n.routeInfos.length;e&&(this.targetName=n.routeInfos[e-1].name);for(let t=0;t<e;++t){let e=n.routeInfos[t];if(!e.isResolved)break;this.pivotHandler=e.route}this.sequence=t.currentSequence++,this.promise=n.resolve(this).catch(t=>{throw this.router.transitionDidError(t,this)},rp("Handle Abort"))}else this.promise=Mc.resolve(this[sp]),this[op]={}}then(t,e,n){return this.promise.then(t,e,n)}catch(t,e){return this.promise.catch(t,e)}finally(t,e){return this.promise.finally(t,e)}abort(){this.rollback();let t=new cp(this.router,void 0,void 0,void 0);return t.to=this.from,t.from=this.from,t.isAborted=!0,this.router.routeWillChange(t),this.router.routeDidChange(t),this}rollback(){this.isAborted||(Qd(this.router,this.sequence,this.targetName+": transition was aborted"),void 0!==this.intent&&null!==this.intent&&(this.intent.preTransitionState=this.router.state),this.isAborted=!0,this.isActive=!1,this.router.activeTransition=void 0)}redirect(t){this[lp]=t,this.rollback(),this.router.routeWillChange(t)}retry(){this.abort();let t=this.router.transitionByIntent(this.intent,!1);return null!==this.urlMethod&&t.method(this.urlMethod),t}method(t){return this.urlMethod=t,this}send(t=!1,e,n,i,r){this.trigger(t,e,n,i,r)}trigger(t=!1,e,...n){"string"==typeof t&&(e=t,t=!1),this.router.triggerEvent(this[sp].routeInfos.slice(0,this.resolveIndex+1),t,e,n)}followRedirects(){return this.promise.catch(t=>this[lp]?this[lp].followRedirects():Mc.reject(t))}toString(){return"Transition (sequence "+this.sequence+")"}log(t){Qd(this.router,this.sequence,t)}}function hp(t){return Qd(t.router,t.sequence,"detected abort."),Wd()}function up(t){return"object"==typeof t&&t instanceof cp&&t.isTransition}const dp=function(){function t(e){let n=Error.call(this,e);this.name="UnrecognizedURLError",this.message=e||"UnrecognizedURL",Error.captureStackTrace?Error.captureStackTrace(this,t):this.stack=n.stack}return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}();function pp(t,e){let n=t.factoryFor("controller:basic").class;n=class extends n{toString(){return`(generated ${e} controller)`}};let i=`controller:${e}`;return t.register(i,n),t.factoryFor(i)}function fp(t,e){pp(t,e);let n=`controller:${e}`;return t.lookup(n)}const gp=/\./g;function mp(t){let e,n,i=(t=t.slice())[t.length-1];return function(t){if(t&&"object"==typeof t){let e=t.queryParams;if(e&&"object"==typeof e)return Object.keys(e).every(t=>"string"==typeof t)}return!1}(i)?(t.pop(),e=i.queryParams):e={},"string"==typeof t[0]&&(n=t.shift()),{routeName:n,models:t,queryParams:e}}function yp(t,e){if(e._namesStashed)return;let n,i=e[e.length-1].name,r=t._routerMicrolib.recognizer.handlersFor(i);for(let s=0;s<e.length;++s){let t=e[s],i=r[s].names;i.length&&(n=t),t._names=i,t.route._stashNames(t,n)}e._namesStashed=!0}function vp(t,e){let n=t.split("."),i="";for(let r=0;r<n.length;r++){let t=n.slice(0,r+1).join(".");if(0!==e.indexOf(t))break;i=t}return i}function _p(t,e=[],n){let i="";for(let r of e){let e,s=vp(t,r);if(n)if(s&&s in n){let t=0===r.indexOf(s)?r.substring(s.length+1):r;e=Cs(n[s],t)}else e=Cs(n,r);i+=`::${r}:${e}`}return t+i.replace(gp,"-")}function bp(t,e){let n="string"==typeof t?{[t]:{as:null}}:t;for(let i in n){if(!Object.prototype.hasOwnProperty.call(n,i))return;let t=n[i],r="string"==typeof t?{as:t}:t,s={...e[i]||{as:null,scope:"model"},...r};e[i]=s}}function wp(t){return"string"==typeof t&&(""===t||"/"===t[0])}function xp(t,e){let n=0,i=0;for(let r in t)if(Object.prototype.hasOwnProperty.call(t,r)){if(t[r]!==e[r])return!1;n++}for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&i++;return n===i}const Cp=Symbol("render"),Sp=Symbol("render-state");class kp extends(Mh.extend(Xl,nu)){static isRouteFactory=!0;context={};_bucketCache;_internalName;_names;_router;constructor(t){if(super(t),t){let e=t.lookup("router:main"),n=t.lookup(Ml`-bucket-cache:main`);this._router=e,this._bucketCache=n,this._topLevelViewTemplate=t.lookup("template:-outlet"),this._environment=t.lookup("-environment:main")}}serialize(t,e){if(e.length<1||!t)return;let n={};if(1===e.length){let[i]=e;"object"==typeof t&&i in t?n[i]=Cs(t,i):/_id$/.test(i)?n[i]=Cs(t,"id"):er(t)&&(n[i]=Cs(t,i))}else n=Js(t,e);return n}_setRouteName(t){this.routeName=t;let e=hr(this);this.fullRouteName=Rp(e,t)}_stashNames(t,e){if(this._names)return;let n=this._names=t._names;n.length||(n=(t=e)&&t._names||[]);let i=Cs(this,"_qp").qps,r=new Array(n.length);for(let s=0;s<n.length;++s)r[s]=`${t.name}.${n[s]}`;for(let s of i)"model"===s.scope&&(s.parts=r)}_activeQPChanged(t,e){this._router._activeQPChanged(t.scopedPropertyName,e)}_updatingQPChanged(t){this._router._updatingQPChanged(t.urlKey)}paramsFor(t){let e=hr(this).lookup(`route:${t}`);if(void 0===e)return{};let n=this._router._routerMicrolib.activeTransition,i=n?n[sp]:this._router._routerMicrolib.state,r=e.fullRouteName,s={...i.params[r]},o=Lp(e,i);return Object.entries(o).reduce((t,[e,n])=>(t[e]=n,t),s)}serializeQueryParamKey(t){return t}serializeQueryParam(t,e,n){return this._router._serializeQueryParam(t,n)}deserializeQueryParam(t,e,n){return this._router._deserializeQueryParam(t,n)}_optionsForQueryParam(t){const e=Cs(this,"queryParams");return Cs(e,t.urlKey)||Cs(e,t.prop)||e[t.urlKey]||e[t.prop]||{}}resetController(t,e,n){return this}exit(t){this.deactivate(t),this.trigger("deactivate",t),this.teardownViews()}_internalReset(t,e){let n=this.controller;n._qpDelegate=Cs(this,"_qp").states.inactive,this.resetController(n,t,e)}enter(t){this[Sp]=void 0,this.activate(t),this.trigger("activate",t)}deactivate(t){}activate(t){}intermediateTransitionTo(...t){let[e,...n]=function(t,e){let n,i=hr(t),r=i.mountPoint;if(i.routable&&"string"==typeof e[0]){if(n=e[0],wp(n))throw new Error("Programmatic transitions by URL cannot be used within an Engine. Please use the route name instead.");n=`${r}.${n}`,e[0]=n}return e}(this,t);this._router.intermediateTransitionTo(e,...n)}refresh(){return this._router._routerMicrolib.refresh(this)}setup(t,e){let n=this.controllerName||this.routeName,i=this.controllerFor(n,!0)??this.generateController(n),r=Cs(this,"_qp");if(!this.controller){let t=r.propertyNames;!function(t,e){e.forEach(e=>{if(void 0===Rr(t,e)){let n=vt(t,e);null===n||"function"!=typeof n.get&&"function"!=typeof n.set||ms(t,e,md({get:n.get,set:n.set}))}Wr(t,`${e}.[]`,t,t._qpChanged,!1)})}(i,t),this.controller=i}let s=r.states;if(i._qpDelegate=s.allowOverrides,e){yp(this._router,e[sp].routeInfos);let t=this._bucketCache,n=e[op];r.propertyNames.forEach(e=>{let s=r.map[e];s.values=n;let o=_p(s.route.fullRouteName,s.parts,s.values),a=t.lookup(o,e,s.undecoratedDefaultValue);zs(i,e,a)});let s=Lp(this,e[sp]);Qs(i,s)}this.setupController(i,t,e),this._environment.options.shouldRender&&this[Cp](),ts(!1)}_qpChanged(t,e,n){if(!n)return;let i=this._bucketCache,r=_p(n.route.fullRouteName,n.parts,n.values);i.stash(r,t,e)}beforeModel(t){}afterModel(t,e){}redirect(t,e){}contextDidChange(){this.currentModel=this.context}model(t,e){let n,i,r=Cs(this,"_qp").map;for(let s in t){if("queryParams"===s||r&&s in r)continue;let t=s.match(/^(.*)_id$/);null!==t&&(n=t[1]),i=!0}if(!n){if(i)return Object.assign({},t);if(e.resolveIndex<1)return;return e[sp].routeInfos[e.resolveIndex-1].context}}deserialize(t,e){return this.model(this._paramsFor(this.routeName,t),e)}setupController(t,e,n){t&&void 0!==e&&zs(t,"model",e)}controllerFor(t,e=!1){let n=hr(this),i=n.lookup(`route:${t}`);return i&&i.controllerName&&(t=i.controllerName),n.lookup(`controller:${t}`)}generateController(t){return fp(hr(this),t)}modelFor(t){let e,n=hr(this),i=this._router&&this._router._routerMicrolib?this._router._routerMicrolib.activeTransition:void 0;e=n.routable&&void 0!==i?Rp(n,t):t;let r=n.lookup(`route:${e}`);if(null!=i){let t=r&&r.routeName||e;if(Object.prototype.hasOwnProperty.call(i.resolvedModels,t))return i.resolvedModels[t]}return r?.currentModel}[Sp]=void 0;[Cp](){this[Sp]=function(t){let e,n=hr(t),i=t.routeName,r=n.lookup(`controller:${t.controllerName||i}`),s=t.currentModel,o=n.lookup(`template:${t.templateName||i}`);return e=o?Fi(o)?o:o(n):t._topLevelViewTemplate(n),{owner:n,name:i,controller:r,model:s,template:e}}(this),xa(this._router,"_setOutlets")}willDestroy(){this.teardownViews()}teardownViews(){this[Sp]&&(this[Sp]=void 0,xa(this._router,"_setOutlets"))}buildRouteInfoMetadata(){}_paramsFor(t,e){return void 0!==this._router._routerMicrolib.activeTransition?this.paramsFor(t):e}get _store(){const t=hr(this);return this.routeName,{find(e,n){let i=t.factoryFor(`model:${e}`);if(i)return i=i.class,i.find(n)}}}static{Tu(this.prototype,"_store",[ps])}get _qp(){let t={},e=this.controllerName||this.routeName,n=hr(this),i=n.lookup(`controller:${e}`),r=Cs(this,"queryParams"),s=Object.keys(r).length>0;i?t=function(t,e){let n={},i={defaultValue:!0,type:!0,scope:!0,as:!0};for(let r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]={...t[r],...e[r]},i[r]=!0);for(let r in e)Object.prototype.hasOwnProperty.call(e,r)&&!i[r]&&(n[r]={...e[r],...t[r]});return n}(function(t){let e={};for(let n of t)bp(n,e);return e}(Cs(i,"queryParams")||[]),r):s&&(i=fp(n,e),t=r);let o=[],a={},l=[];for(let c in t){if(!Object.prototype.hasOwnProperty.call(t,c))continue;if("unknownProperty"===c||"_super"===c)continue;let n,r=t[c],s=r.scope||"model";"controller"===s&&(n=[]);let h=r.as||this.serializeQueryParamKey(c),u=Cs(i,c);u=Mp(u);let d=r.type||Fu(u),p=this.serializeQueryParam(u,h,d),f=`${e}:${c}`,g={undecoratedDefaultValue:Cs(i,c),defaultValue:u,serializedDefaultValue:p,serializedValue:p,type:d,urlKey:h,prop:c,scopedPropertyName:f,controllerName:e,route:this,parts:n,values:null,scope:s};a[c]=a[h]=a[f]=g,o.push(g),l.push(c)}return{qps:o,map:a,propertyNames:l,states:{inactive:(t,e)=>{let n=a[t];this._qpChanged(t,e,n)},active:(t,e)=>{let n=a[t];return this._qpChanged(t,e,n),this._activeQPChanged(n,e)},allowOverrides:(t,e)=>{let n=a[t];return this._qpChanged(t,e,n),this._updatingQPChanged(n)}}}}static{Tu(this.prototype,"_qp",[ps])}}function Ep(t){return t[Sp]}function Tp(t,e){if(e.fullQueryParams)return e.fullQueryParams;let n=e.routeInfos.every(t=>t.route),i={...e.queryParams};return t._deserializeQueryParams(e.routeInfos,i),n&&(e.fullQueryParams=i),i}function Lp(t,e){e.queryParamsFor=e.queryParamsFor||{};let n=t.fullRouteName,i=e.queryParamsFor[n];if(i)return i;let r=Tp(t._router,e),s=e.queryParamsFor[n]={},o=Cs(t,"_qp").qps;for(let a of o){let t=a.prop in r;s[a.prop]=t?r[a.prop]:Mp(a.defaultValue)}return s}function Mp(t){return Array.isArray(t)?sd(t.slice()):t}function Rp(t,e){if(t.routable){let n=t.mountPoint;return"application"===e?n:`${n}.${e}`}return e}const Pp=kp.prototype.serialize;kp.reopen({mergedProperties:["queryParams"],queryParams:{},templateName:null,controllerName:null,send(...t){if(this._router&&this._router._routerMicrolib||!b())this._router.send(...t);else{let e=t.shift(),n=this.actions[e];if(n)return n.apply(this,t)}},actions:{queryParamsDidChange(t,e,n){let i=Cs(this,"_qp").map,r=Object.keys(t).concat(Object.keys(n));for(let s of r){let t=i[s];if(t&&Cs(this._optionsForQueryParam(t),"refreshModel")&&this._router.currentState){this.refresh();break}}return!0},finalizeQueryParamChange(t,e,n){if("application"!==this.fullRouteName)return!0;if(!n)return;let i,r=n[sp].routeInfos,s=this._router,o=s._queryParamsFor(r),a=s._qpUpdates,l=!1;yp(s,r);for(let c of o.qps){let r,s,o=c.route,h=o.controller,u=c.urlKey in t&&c.urlKey;if(a.has(c.urlKey)?(r=Cs(h,c.prop),s=o.serializeQueryParam(r,c.urlKey,c.type)):u?(s=t[u],void 0!==s&&(r=o.deserializeQueryParam(s,c.urlKey,c.type))):(s=c.serializedDefaultValue,r=Mp(c.defaultValue)),h._qpDelegate=Cs(o,"_qp").states.inactive,s!==c.serializedValue){if(n.queryParamsOnly&&!1!==i){let t=Cs(o._optionsForQueryParam(c),"replace");t?i=!0:!1===t&&(i=!1)}zs(h,c.prop,r),l=!0}c.serializedValue=s,c.serializedDefaultValue===s||e.push({value:s,visible:!0,key:u||c.urlKey})}!0===l&&ts(!1),i&&n.method("replace"),o.qps.forEach(t=>{let e=Cs(t.route,"_qp");t.route.controller._qpDelegate=Cs(e,"states.active")}),s._qpUpdates.clear()}}});class Ip{cache;constructor(){this.cache=new Map}has(t){return this.cache.has(t)}stash(t,e,n){let i=this.cache.get(t);void 0===i&&(i=new Map,this.cache.set(t,i)),i.set(e,n)}lookup(t,e,n){if(!this.has(t))return n;let i=this.cache.get(t);return i.has(e)?i.get(e):n}}let Op=0;function Ap(t){return"function"==typeof t}class zp{parent;matches;enableLoadingSubstates;explicitIndex=!1;options;constructor(t=null,e){this.parent=t,this.enableLoadingSubstates=Boolean(e&&e.enableLoadingSubstates),this.matches=[],this.options=e}route(t,e,n){let i,r=null,s=`/_unused_dummy_error_path_route_${t}/:error`;if(Ap(e)?(i={},r=e):Ap(n)?(i=e,r=n):i=e||{},this.enableLoadingSubstates&&(jp(this,`${t}_loading`,{resetNamespace:i.resetNamespace}),jp(this,`${t}_error`,{resetNamespace:i.resetNamespace,path:s})),r){let e=Fp(this,t,i.resetNamespace),n=new zp(e,this.options);jp(n,"loading"),jp(n,"error",{path:s}),r.call(n),jp(this,t,i,n.generate())}else jp(this,t,i)}push(t,e,n,i){let r=e.split(".");if(this.options.engineInfo){let t=e.slice(this.options.engineInfo.fullName.length+1),n=Object.assign({localFullName:t},this.options.engineInfo);i&&(n.serializeMethod=i),this.options.addRouteForEngine(e,n)}else if(i)throw new Error(`Defining a route serializer on route '${e}' outside an Engine is not allowed.`);""!==t&&"/"!==t&&"index"!==r[r.length-1]||(this.explicitIndex=!0),this.matches.push(t,e,n)}generate(){let t=this.matches;return this.explicitIndex||this.route("index",{path:"/"}),e=>{for(let n=0;n<t.length;n+=3)e(t[n]).to(t[n+1],t[n+2])}}mount(t,e={}){let n=this.options.resolveRouteMap(t),i=t;e.as&&(i=e.as);let r,s=Fp(this,i,e.resetNamespace),o={name:t,instanceId:Op++,mountPoint:s,fullName:s},a=e.path;"string"!=typeof a&&(a=`/${i}`);let l=`/_unused_dummy_error_path_route_${i}/:error`;if(n){let t=!1,e=this.options.engineInfo;e&&(t=!0,this.options.engineInfo=o);let i=Object.assign({engineInfo:o},this.options),a=new zp(s,i);jp(a,"loading"),jp(a,"error",{path:l}),n.class.call(a),r=a.generate(),t&&(this.options.engineInfo=e)}let c=Object.assign({localFullName:"application"},o);if(this.enableLoadingSubstates){let t=`${i}_loading`,n="application_loading",r=Object.assign({localFullName:n},o);jp(this,t,{resetNamespace:e.resetNamespace}),this.options.addRouteForEngine(t,r),t=`${i}_error`,n="application_error",r=Object.assign({localFullName:n},o),jp(this,t,{resetNamespace:e.resetNamespace,path:l}),this.options.addRouteForEngine(t,r)}this.options.addRouteForEngine(s,c),this.push(a,s,r)}}function Fp(t,e,n){return function(t){return"application"!==t.parent}(t)&&!0!==n?`${t.parent}.${e}`:e}function jp(t,e,n={},i){let r=Fp(t,e,n.resetNamespace);"string"!=typeof n.path&&(n.path=`/${e}`),t.push(n.path,r,i,n.serialize)}class Dp{router;emberRouter;routerJsState;constructor(t,e,n){this.emberRouter=t,this.router=e,this.routerJsState=n}isActiveIntent(t,e,n){let i=this.routerJsState;if(!this.router.isActiveIntent(t,e,void 0,i))return!1;if(void 0!==n&&Object.keys(n).length>0){let r=Object.assign({},n);return this.emberRouter._prepareQueryParams(t,e,r),xp(r,i.queryParams)}return!0}}let Np=new WeakMap;function Bp(t,e={},n={includeAttributes:!1,localizeMapUpdates:!1}){const i=new WeakMap;return t.map((r,s)=>{let{name:o,params:a,paramNames:l,context:c,route:h}=r,u=r;if(Np.has(u)&&n.includeAttributes){let t=Np.get(u);t=function(t,e){let n={get metadata(){return qp(t)}};return!Object.isExtensible(e)||e.hasOwnProperty("metadata")?Object.freeze(Object.assign({},e,n)):Object.assign(e,n)}(h,t);let e=Up(t,c);return i.set(u,t),n.localizeMapUpdates||Np.set(u,e),e}const d=n.localizeMapUpdates?i:Np;let p={find(e,n){let i,r=[];3===e.length&&(r=t.map(t=>d.get(t)));for(let s=0;t.length>s;s++)if(i=d.get(t[s]),e.call(n,i,s,r))return i},get name(){return o},get paramNames(){return l},get metadata(){return qp(r.route)},get parent(){let e=t[s-1];return void 0===e?null:d.get(e)},get child(){let e=t[s+1];return void 0===e?null:d.get(e)},get localName(){let t=this.name.split(".");return t[t.length-1]},get params(){return a},get queryParams(){return e}};return n.includeAttributes&&(p=Up(p,c)),i.set(r,p),n.localizeMapUpdates||Np.set(r,p),p})}function Up(t,e){let n={get attributes(){return e}};return!Object.isExtensible(t)||t.hasOwnProperty("attributes")?Object.freeze(Object.assign({},t,n)):Object.assign(t,n)}function qp(t){return null!=t&&void 0!==t.buildRouteInfoMetadata?t.buildRouteInfoMetadata():null}class Vp{constructor(t,e,n,i){this._routePromise=void 0,this._route=null,this.params={},this.isResolved=!1,this.name=e,this.paramNames=n,this.router=t,i&&this._processRoute(i)}getModel(t){return Mc.resolve(this.context)}serialize(t){return this.params||{}}resolve(t){return Mc.resolve(this.routePromise).then(e=>(Hd(t),e)).then(()=>this.runBeforeModelHook(t)).then(()=>Hd(t)).then(()=>this.getModel(t)).then(e=>(Hd(t),e)).then(e=>this.runAfterModelHook(t,e)).then(e=>this.becomeResolved(t,e))}becomeResolved(t,e){let n,i=this.serialize(e);t&&(this.stashResolvedModel(t,e),t[op]=t[op]||{},t[op][this.name]=i);let r=e===this.context;!("context"in this)&&r||(n=e);let s=Np.get(this),o=new $p(this.router,this.name,this.paramNames,i,this.route,n);return void 0!==s&&Np.set(o,s),o}shouldSupersede(t){if(!t)return!0;let e=t.context===this.context;return t.name!==this.name||"context"in this&&!e||this.hasOwnProperty("params")&&!function(t,e){if(t===e)return!0;if(!t||!e)return!1;for(let n in t)if(t.hasOwnProperty(n)&&t[n]!==e[n])return!1;return!0}(this.params,t.params)}get route(){return null!==this._route?this._route:this.fetchRoute()}set route(t){this._route=t}get routePromise(){return this._routePromise||this.fetchRoute(),this._routePromise}set routePromise(t){this._routePromise=t}log(t,e){t.log&&t.log(this.name+": "+e)}updateRoute(t){return t._internalName=this.name,this.route=t}runBeforeModelHook(t){let e;return t.trigger&&t.trigger(!0,"willResolveModel",t,this.route),this.route&&void 0!==this.route.beforeModel&&(e=this.route.beforeModel(t)),up(e)&&(e=null),Mc.resolve(e)}runAfterModelHook(t,e){let n,i=this.name;var r;return this.stashResolvedModel(t,e),void 0!==this.route&&void 0!==this.route.afterModel&&(n=this.route.afterModel(e,t)),n=up(r=n)?null:r,Mc.resolve(n).then(()=>t.resolvedModels[i])}stashResolvedModel(t,e){t.resolvedModels=t.resolvedModels||{},t.resolvedModels[this.name]=e}fetchRoute(){let t=this.router.getRoute(this.name);return this._processRoute(t)}_processRoute(t){return this.routePromise=Mc.resolve(t),null!==(e=t)&&"object"==typeof e&&"function"==typeof e.then?(this.routePromise=this.routePromise.then(t=>this.updateRoute(t)),this.route=void 0):t?this.updateRoute(t):void 0;var e}}class $p extends Vp{constructor(t,e,n,i,r,s){super(t,e,n,r),this.params=i,this.isResolved=!0,this.context=s}resolve(t){return t&&t.resolvedModels&&(t.resolvedModels[this.name]=this.context),Mc.resolve(this)}}class Gp extends Vp{constructor(t,e,n,i,r){super(t,e,n,r),this.params={},i&&(this.params=i)}getModel(t){let e=this.params;t&&t[ap]&&(e={},Yd(e,this.params),e.queryParams=t[ap]);let n,i=this.route;return i.deserialize?n=i.deserialize(e,t):i.model&&(n=i.model(e,t)),n&&up(n)&&(n=void 0),Mc.resolve(n)}}class Wp extends Vp{constructor(t,e,n,i){super(t,e,n),this.context=i,this.serializer=this.router.getSerializer(e)}getModel(t){return void 0!==this.router.log&&this.router.log(this.name+": resolving provided model"),super.getModel(t)}serialize(t){let{paramNames:e,context:n}=this;t||(t=n);let i={};if(tp(t))return i[e[0]]=t,i;if(this.serializer)return this.serializer.call(null,t,e);if(void 0!==this.route&&this.route.serialize)return this.route.serialize(t,e);if(1!==e.length)return;let r=e[0];return/_id$/.test(r)?i[r]=t.id:i[r]=t,i}}class Hp{constructor(t,e={}){this.router=t,this.data=e}}function Zp(t,e,n){let i=t.routeInfos,r=e.resolveIndex>=i.length?i.length-1:e.resolveIndex,s=e.isAborted;throw new Jp(n,t.routeInfos[r].route,s,t)}function Kp(t,e){if(e.resolveIndex===t.routeInfos.length)return;let n=t.routeInfos[e.resolveIndex],i=Yp.bind(null,t,e);return n.resolve(e).then(i,null,t.promiseLabel("Proceed"))}function Yp(t,e,n){let i=t.routeInfos[e.resolveIndex].isResolved;if(t.routeInfos[e.resolveIndex++]=n,!i){let{route:t}=n;void 0!==t&&t.redirect&&t.redirect(n.context,e)}return Hd(e),Kp(t,e)}class Xp{constructor(){this.routeInfos=[],this.queryParams={},this.params={}}promiseLabel(t){let e="";return ep(this.routeInfos,function(t){return""!==e&&(e+="."),e+=t.name,!0}),rp("'"+e+"': "+t)}resolve(t){let e=this.params;ep(this.routeInfos,t=>(e[t.name]=t.params||{},!0)),t.resolveIndex=0;let n=Kp.bind(null,this,t),i=Zp.bind(null,this,t);return Mc.resolve(null,this.promiseLabel("Start transition")).then(n,null,this.promiseLabel("Resolve route")).catch(i,this.promiseLabel("Handle error")).then(()=>this)}}class Jp{constructor(t,e,n,i){this.error=t,this.route=e,this.wasAborted=n,this.state=i}}class Qp extends Hp{constructor(t,e,n,i=[],r={},s){super(t,s),this.preTransitionState=void 0,this.name=e,this.pivotHandler=n,this.contexts=i,this.queryParams=r}applyToState(t,e){let n=this.router.recognizer.handlersFor(this.name),i=n[n.length-1].handler;return this.applyToHandlers(t,n,i,e,!1)}applyToHandlers(t,e,n,i,r){let s,o,a=new Xp,l=this.contexts.slice(0),c=e.length;if(this.pivotHandler)for(s=0,o=e.length;s<o;++s)if(e[s].handler===this.pivotHandler._internalName){c=s;break}for(s=e.length-1;s>=0;--s){let o=e[s],h=o.handler,u=t.routeInfos[s],d=null;if(d=o.names.length>0?s>=c?this.createParamHandlerInfo(h,o.names,l,u):this.getHandlerInfoForDynamicSegment(h,o.names,l,u,n,s):this.createParamHandlerInfo(h,o.names,l,u),r){d=d.becomeResolved(null,d.context);let t=u&&u.context;o.names.length>0&&void 0!==u.context&&d.context===t&&(d.params=u&&u.params),d.context=t}let p=u;(s>=c||d.shouldSupersede(u))&&(c=Math.min(s,c),p=d),i&&!r&&(p=p.becomeResolved(null,p.context)),a.routeInfos.unshift(p)}if(l.length>0)throw new Error("More context objects were passed than there are dynamic segments for the route: "+n);return i||this.invalidateChildren(a.routeInfos,c),Yd(a.queryParams,this.queryParams||{}),i&&t.queryParams&&Yd(a.queryParams,t.queryParams),a}invalidateChildren(t,e){for(let n=e,i=t.length;n<i;++n)if(t[n].isResolved){let{name:e,params:i,route:r,paramNames:s}=t[n];t[n]=new Gp(this.router,e,s,i,r)}}getHandlerInfoForDynamicSegment(t,e,n,i,r,s){let o;if(n.length>0){if(o=n[n.length-1],tp(o))return this.createParamHandlerInfo(t,e,n,i);n.pop()}else{if(i&&i.name===t)return i;if(!this.preTransitionState)return i;{let t=this.preTransitionState.routeInfos[s];o=null==t?void 0:t.context}}return new Wp(this.router,t,e,o)}createParamHandlerInfo(t,e,n,i){let r={},s=e.length,o=[];for(;s--;){let a=i&&t===i.name&&i.params||{},l=n[n.length-1],c=e[s];tp(l)?r[c]=""+n.pop():a.hasOwnProperty(c)?r[c]=a[c]:o.push(c)}if(o.length>0)throw new Error(`You didn't provide enough string/numeric parameters to satisfy all of the dynamic segments for route ${t}. Missing params: ${o}`);return new Gp(this.router,t,e,r)}}class tf extends Hp{constructor(t,e,n){super(t,n),this.url=e,this.preTransitionState=void 0}applyToState(t){let e,n,i=new Xp,r=this.router.recognizer.recognize(this.url);if(!r)throw new dp(this.url);let s=!1,o=this.url;function a(t){if(t&&t.inaccessibleByURL)throw new dp(o);return t}for(e=0,n=r.length;e<n;++e){let n=r[e],o=n.handler,l=[];this.router.recognizer.hasRoute(o)&&(l=this.router.recognizer.handlersFor(o)[e].names);let c=new Gp(this.router,o,l,n.params),h=c.route;h?a(h):c.routePromise=c.routePromise.then(a);let u=t.routeInfos[e];s||c.shouldSupersede(u)?(s=!0,i.routeInfos[e]=c):i.routeInfos[e]=u}return Yd(i.queryParams,r.queryParams),i}}let ef=class{constructor(t){this._lastQueryParams={},this.state=void 0,this.oldState=void 0,this.activeTransition=void 0,this.currentRouteInfos=void 0,this._changedQueryParams=void 0,this.currentSequence=0,this.log=t,this.recognizer=new Gd,this.reset()}map(t){this.recognizer.map(t,function(t,e){for(let n=e.length-1,i=!0;n>=0&&i;--n){let r=e[n],s=r.handler;t.add(e,{as:s}),i="/"===r.path||""===r.path||".index"===s.slice(-6)}})}hasRoute(t){return this.recognizer.hasRoute(t)}queryParamsTransition(t,e,n,i){if(this.fireQueryParamDidChange(i,t),!e&&this.activeTransition)return this.activeTransition;{let t=new cp(this,void 0,void 0);return t.queryParamsOnly=!0,n.queryParams=this.finalizeQueryParamChange(i.routeInfos,i.queryParams,t),t[ap]=i.queryParams,this.toReadOnlyInfos(t,i),this.routeWillChange(t),t.promise=t.promise.then(e=>(t.isAborted||(this._updateURL(t,n),this.didTransition(this.currentRouteInfos),this.toInfos(t,i.routeInfos,!0),this.routeDidChange(t)),e),null,rp("Transition complete")),t}}transitionByIntent(t,e){try{return this.getTransitionByIntent(t,e)}catch(n){return new cp(this,t,void 0,n,void 0)}}recognize(t){let e=new tf(this,t),n=this.generateNewState(e);if(null===n)return n;let i=Bp(n.routeInfos,n.queryParams,{includeAttributes:!1,localizeMapUpdates:!0});return i[i.length-1]}recognizeAndLoad(t){let e=new tf(this,t),n=this.generateNewState(e);if(null===n)return Mc.reject(`URL ${t} was not recognized`);let i=new cp(this,e,n,void 0);return i.then(()=>{let t=Bp(n.routeInfos,i[ap],{includeAttributes:!0,localizeMapUpdates:!1});return t[t.length-1]})}generateNewState(t){try{return t.applyToState(this.state,!1)}catch(e){return null}}getTransitionByIntent(t,e){let n,i=!!this.activeTransition,r=i?this.activeTransition[sp]:this.state,s=t.applyToState(r,e),o=np(r.queryParams,s.queryParams);if(nf(s.routeInfos,r.routeInfos)){if(o){let t=this.queryParamsTransition(o,i,r,s);return t.queryParamsOnly=!0,t}return this.activeTransition||new cp(this,void 0,void 0)}if(e){let t=new cp(this,void 0,s);return t.isIntermediate=!0,this.toReadOnlyInfos(t,s),this.setupContexts(s,t),this.routeWillChange(t),this.activeTransition}return n=new cp(this,t,s,void 0,this.activeTransition),function(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;++n){if(t[n].name!==e[n].name)return!1;if(!rf(t[n].params,e[n].params))return!1}return!0}(s.routeInfos,r.routeInfos)&&(n.queryParamsOnly=!0),this.toReadOnlyInfos(n,s),this.activeTransition&&this.activeTransition.redirect(n),this.activeTransition=n,n.promise=n.promise.then(t=>this.finalizeTransition(n,t),null,rp("Settle transition promise when transition is finalized")),i||this.notifyExistingHandlers(s,n),this.fireQueryParamDidChange(s,o),n}doTransition(t,e=[],n=!1){let i,r=e[e.length-1],s={};if(r&&Object.prototype.hasOwnProperty.call(r,"queryParams")&&(s=e.pop().queryParams),void 0===t){Qd(this,"Updating query params");let{routeInfos:t}=this.state;i=new Qp(this,t[t.length-1].name,void 0,[],s)}else"/"===t.charAt(0)?(Qd(this,"Attempting URL transition to "+t),i=new tf(this,t)):(Qd(this,"Attempting transition to "+t),i=new Qp(this,t,void 0,e,s));return this.transitionByIntent(i,n)}finalizeTransition(t,e){try{Qd(t.router,t.sequence,"Resolved all models on destination route; finalizing transition.");let n=e.routeInfos;return this.setupContexts(e,t),t.isAborted?(this.state.routeInfos=this.currentRouteInfos,Mc.reject(hp(t))):(this._updateURL(t,e),t.isActive=!1,this.activeTransition=void 0,this.triggerEvent(this.currentRouteInfos,!0,"didTransition",[]),this.didTransition(this.currentRouteInfos),this.toInfos(t,e.routeInfos,!0),this.routeDidChange(t),Qd(this,t.sequence,"TRANSITION COMPLETE."),n[n.length-1].route)}catch(i){if("object"!=typeof(n=i)||null===n||"TRANSITION_ABORTED"!==n.code){let e=t[sp].routeInfos;t.trigger(!0,"error",i,t,e[e.length-1].route),t.abort()}throw i}var n}setupContexts(t,e){let n,i,r,s=this.partitionRoutes(this.state,t);for(n=0,i=s.exited.length;n<i;n++)r=s.exited[n].route,delete r.context,void 0!==r&&(void 0!==r._internalReset&&r._internalReset(!0,e),void 0!==r.exit&&r.exit(e));let o=this.oldState=this.state;this.state=t;let a=this.currentRouteInfos=s.unchanged.slice();try{for(n=0,i=s.reset.length;n<i;n++)r=s.reset[n].route,void 0!==r&&void 0!==r._internalReset&&r._internalReset(!1,e);for(n=0,i=s.updatedContext.length;n<i;n++)this.routeEnteredOrUpdated(a,s.updatedContext[n],!1,e);for(n=0,i=s.entered.length;n<i;n++)this.routeEnteredOrUpdated(a,s.entered[n],!0,e)}catch(l){throw this.state=o,this.currentRouteInfos=o.routeInfos,l}this.state.queryParams=this.finalizeQueryParamChange(a,t.queryParams,e)}fireQueryParamDidChange(t,e){e&&(this._changedQueryParams=e.all,this.triggerEvent(t.routeInfos,!0,"queryParamsDidChange",[e.changed,e.all,e.removed]),this._changedQueryParams=void 0)}routeEnteredOrUpdated(t,e,n,i){let r=e.route,s=e.context;function o(r){return n&&void 0!==r.enter&&r.enter(i),Hd(i),r.context=s,void 0!==r.contextDidChange&&r.contextDidChange(),void 0!==r.setup&&r.setup(s,i),Hd(i),t.push(e),r}return void 0===r?e.routePromise=e.routePromise.then(o):o(r),!0}partitionRoutes(t,e){let n,i,r,s=t.routeInfos,o=e.routeInfos,a={updatedContext:[],exited:[],entered:[],unchanged:[],reset:[]},l=!1;for(i=0,r=o.length;i<r;i++){let t=s[i],e=o[i];t&&t.route===e.route||(n=!0),n?(a.entered.push(e),t&&a.exited.unshift(t)):l||t.context!==e.context?(l=!0,a.updatedContext.push(e)):a.unchanged.push(t)}for(i=o.length,r=s.length;i<r;i++)a.exited.unshift(s[i]);return a.reset=a.updatedContext.slice(),a.reset.reverse(),a}_updateURL(t,e){let n=t.urlMethod;if(!n)return;let{routeInfos:i}=e,{name:r}=i[i.length-1],s={};for(let o=i.length-1;o>=0;--o){let t=i[o];Yd(s,t.params),t.route.inaccessibleByURL&&(n=null)}if(n){s.queryParams=t._visibleQueryParams||e.queryParams;let i=this.recognizer.generate(r,s),o=t.isCausedByInitialTransition,a="replace"===n&&!t.isCausedByAbortingTransition,l=t.queryParamsOnly&&"replace"===n,c="replace"===n&&t.isCausedByAbortingReplaceTransition;o||a||l||c?this.replaceURL(i):this.updateURL(i)}}finalizeQueryParamChange(t,e,n){for(let s in e)e.hasOwnProperty(s)&&null===e[s]&&delete e[s];let i=[];this.triggerEvent(t,!0,"finalizeQueryParamChange",[e,i,n]),n&&(n._visibleQueryParams={});let r={};for(let s=0,o=i.length;s<o;++s){let t=i[s];r[t.key]=t.value,n&&!1!==t.visible&&(n._visibleQueryParams[t.key]=t.value)}return r}toReadOnlyInfos(t,e){let n=this.state.routeInfos;this.fromInfos(t,n),this.toInfos(t,e.routeInfos),this._lastQueryParams=e.queryParams}fromInfos(t,e){if(void 0!==t&&e.length>0){let n=Bp(e,Object.assign({},this._lastQueryParams),{includeAttributes:!0,localizeMapUpdates:!1});t.from=n[n.length-1]||null}}toInfos(t,e,n=!1){if(void 0!==t&&e.length>0){let i=Bp(e,Object.assign({},t[ap]),{includeAttributes:n,localizeMapUpdates:!1});t.to=i[i.length-1]||null}}notifyExistingHandlers(t,e){let n,i,r,s,o=this.state.routeInfos;for(i=o.length,n=0;n<i&&(r=o[n],s=t.routeInfos[n],s&&r.name===s.name);n++)s.isResolved;this.triggerEvent(o,!0,"willTransition",[e]),this.routeWillChange(e),this.willTransition(o,t.routeInfos,e)}reset(){this.state&&ep(this.state.routeInfos.slice().reverse(),function(t){let e=t.route;return void 0!==e&&void 0!==e.exit&&e.exit(),!0}),this.oldState=void 0,this.state=new Xp,this.currentRouteInfos=void 0}handleURL(t){return"/"!==t.charAt(0)&&(t="/"+t),this.doTransition(t).method(null)}transitionTo(t,...e){return"object"==typeof t?(e.push(t),this.doTransition(void 0,e,!1)):this.doTransition(t,e)}intermediateTransitionTo(t,...e){return this.doTransition(t,e,!0)}refresh(t){let e=this.activeTransition,n=e?e[sp]:this.state,i=n.routeInfos;void 0===t&&(t=i[0].route),Qd(this,"Starting a refresh transition");let r=i[i.length-1].name,s=new Qp(this,r,t,[],this._changedQueryParams||n.queryParams),o=this.transitionByIntent(s,!1);return e&&"replace"===e.urlMethod&&o.method(e.urlMethod),o}replaceWith(t){return this.doTransition(t).method("replace")}generate(t,...e){let n=Xd(e),i=n[0],r=n[1],s=new Qp(this,t,void 0,i).applyToState(this.state,!1),o={};for(let a=0,l=s.routeInfos.length;a<l;++a)Yd(o,s.routeInfos[a].serialize());return o.queryParams=r,this.recognizer.generate(t,o)}applyIntent(t,e){let n=new Qp(this,t,void 0,e),i=this.activeTransition&&this.activeTransition[sp]||this.state;return n.applyToState(i,!1)}isActiveIntent(t,e,n,i){let r,s,o=i||this.state,a=o.routeInfos;if(!a.length)return!1;let l=a[a.length-1].name,c=this.recognizer.handlersFor(l),h=0;for(s=c.length;h<s&&(r=a[h],r.name!==t);++h);if(h===c.length)return!1;let u=new Xp;u.routeInfos=a.slice(0,h+1),c=c.slice(0,h+1);let d=nf(new Qp(this,l,void 0,e).applyToHandlers(u,c,l,!0,!0).routeInfos,u.routeInfos);if(!n||!d)return d;let p={};Yd(p,n);let f=o.queryParams;for(let g in f)f.hasOwnProperty(g)&&p.hasOwnProperty(g)&&(p[g]=f[g]);return d&&!np(p,n)}isActive(t,...e){let[n,i]=Xd(e);return this.isActiveIntent(t,n,i)}trigger(t,...e){this.triggerEvent(this.currentRouteInfos,!1,t,e)}};function nf(t,e){if(t.length!==e.length)return!1;for(let n=0,i=t.length;n<i;++n)if(t[n]!==e[n])return!1;return!0}function rf(t,e){if(t===e)return!0;if(!t||!e)return!1;let n=Object.keys(t),i=Object.keys(e);if(n.length!==i.length)return!1;for(let r=0,s=n.length;r<s;++r){let i=n[r];if(t[i]!==e[i])return!1}return!0}function sf(){return this}const{slice:of}=Array.prototype;class af extends(Mh.extend(nu)){_routerMicrolib;_didSetupRouter=!1;_initialTransitionStarted=!1;currentURL=null;currentRouteName=null;currentPath=null;currentRoute=null;_qpCache=Object.create(null);_qpUpdates=new Set;_queuedQPChanges={};_bucketCache;_toplevelView=null;_handledErrors=new Set;_engineInstances=Object.create(null);_engineInfoByRoute=Object.create(null);_routerService;_slowTransitionTimer=null;namespace;static dslCallbacks;static map(t){return this.dslCallbacks||(this.dslCallbacks=[],this.reopenClass({dslCallbacks:this.dslCallbacks})),this.dslCallbacks.push(t),this}static _routePath(t){let e,n,i,r=[];function s(t,e){for(let n=0;n<t.length;++n)if(t[n]!==e[n])return!1;return!0}for(let o=1;o<t.length;o++){for(e=t[o].name,n=e.split("."),i=of.call(r);i.length&&!s(i,n);)i.shift();r.push(...n.slice(i.length))}return r.join(".")}constructor(t){super(t),this._resetQueuedQueryParameterChanges(),this.namespace=t.lookup("application:main");let e=t.lookup(Ml`-bucket-cache:main`);this._bucketCache=e;let n=t.lookup("service:router");this._routerService=n}_initRouterJs(){let t=Cs(this,"location"),e=this;const n=al(this);let i=Object.create(null),r=this._routerMicrolib=new class extends ef{getRoute(t){let r=t,s=n,o=e._engineInfoByRoute[r];o&&(s=e._getEngineInstance(o),r=o.localFullName);let a=`route:${r}`,l=s.lookup(a);if(i[t])return l;if(i[t]=!0,!l){let t=s.factoryFor("route:basic").class;s.register(a,class extends t{}),l=s.lookup(a)}if(l._setRouteName(r),o&&!function(t){return t.serialize===Pp}(l))throw new Error("Defining a custom serialize method on an Engine route is not supported.");return l}getSerializer(t){let n=e._engineInfoByRoute[t];if(n)return n.serializeMethod||Pp}updateURL(n){xa(()=>{t.setURL(n),zs(e,"currentURL",n)})}didTransition(t){e.didTransition(t)}willTransition(t,n){e.willTransition(t,n)}triggerEvent(t,n,i,r){return pf.bind(e)(t,n,i,r)}routeWillChange(t){e.trigger("routeWillChange",t),e._routerService.trigger("routeWillChange",t),t.isIntermediate&&e.set("currentRoute",t.to)}routeDidChange(t){e.set("currentRoute",t.to),xa(()=>{e.trigger("routeDidChange",t),e._routerService.trigger("routeDidChange",t)})}transitionDidError(t,n){return t.wasAborted||n.isAborted?hp(n):(n.trigger(!1,"error",t.error,n,t.route),e._isErrorHandled(t.error)?(n.rollback(),this.routeDidChange(n),t.error):(n.abort(),t.error))}replaceURL(n){t.replaceURL?xa(()=>{t.replaceURL(n),zs(e,"currentURL",n)}):this.updateURL(n)}},s=this.constructor.dslCallbacks||[sf],o=this._buildDSL();o.route("application",{path:"/",resetNamespace:!0,overrideNameAssertion:!0},function(){for(let t=0;t<s.length;t++)s[t].call(this)}),r.map(o.generate())}_buildDSL(){let t=this._hasModuleBasedResolver(),e=this;const n=al(this);let i={enableLoadingSubstates:t,resolveRouteMap:t=>n.factoryFor(`route-map:${t}`),addRouteForEngine(t,n){e._engineInfoByRoute[t]||(e._engineInfoByRoute[t]=n)}};return new zp(null,i)}_resetQueuedQueryParameterChanges(){this._queuedQPChanges={}}_hasModuleBasedResolver(){let t=Cs(al(this),"application.__registry__.resolver.moduleBasedResolver");return Boolean(t)}startRouting(){if(this.setupRouter()){let t=Cs(this,"initialURL");void 0===t&&(t=Cs(this,"location").getURL());let e=this.handleURL(t);if(e&&e.error)throw e.error}}setupRouter(){if(this._didSetupRouter)return!1;this._didSetupRouter=!0,this._setupLocation();let t=Cs(this,"location");return!Cs(t,"cancelRouterSetup")&&(this._initRouterJs(),t.onUpdateURL(t=>{this.handleURL(t)}),!0)}_setOutlets(){if(this.isDestroying||this.isDestroyed)return;let t=this._routerMicrolib.currentRouteInfos;if(!t)return;let e=null,n=null;for(let i of t){let t=Ep(i.route);if(!t)break;{let i={render:t,outlets:{main:void 0}};n?n.outlets.main=i:e=i,n=i}}if(null!==e)if(this._toplevelView)this._toplevelView.setOutletState(e);else{let t=al(this),n=t.factoryFor("view:-outlet"),i=t.lookup("application:main"),r=t.lookup("-environment:main"),s=t.lookup("template:-outlet");this._toplevelView=n.create({environment:r,template:s,application:i}),this._toplevelView.setOutletState(e);let o=t.lookup("-application-instance:main");o&&o.didCreateRootView(this._toplevelView)}}handleURL(t){let e=t.split(/#(.+)?/)[0];return this._doURLTransition("handleURL",e)}_doURLTransition(t,e){this._initialTransitionStarted=!0;let n=this._routerMicrolib[t](e||"/");return mf(n,this),n}transitionTo(...t){if(wp(t[0]))return this._doURLTransition("transitionTo",t[0]);let{routeName:e,models:n,queryParams:i}=mp(t);return this._doTransition(e,n,i)}intermediateTransitionTo(t,...e){this._routerMicrolib.intermediateTransitionTo(t,...e),gf(this)}replaceWith(...t){return this.transitionTo(...t).method("replace")}generate(t,...e){let n=this._routerMicrolib.generate(t,...e);return this.location.formatURL(n)}isActive(t){return this._routerMicrolib.isActive(t)}isActiveIntent(t,e,n){return this.currentState.isActiveIntent(t,e,n)}send(t,...e){this._routerMicrolib.trigger(t,...e)}hasRoute(t){return this._routerMicrolib.hasRoute(t)}reset(){this._didSetupRouter=!1,this._initialTransitionStarted=!1,this._routerMicrolib&&this._routerMicrolib.reset()}willDestroy(){this._toplevelView&&(this._toplevelView.destroy(),this._toplevelView=null),super.willDestroy(),this.reset();let t=this._engineInstances;for(let e in t){let n=t[e];for(let t in n)ya(n[t],"destroy")}}_activeQPChanged(t,e){this._queuedQPChanges[t]=e,xa(this,this._fireQueryParamTransition)}_updatingQPChanged(t){this._qpUpdates.add(t)}_fireQueryParamTransition(){this.transitionTo({queryParams:this._queuedQPChanges}),this._resetQueuedQueryParameterChanges()}_setupLocation(){let t=this.location,e=this.rootURL,n=al(this);"string"==typeof t&&(t=zs(this,"location",n.lookup(`location:${t}`))),null!==t&&"object"==typeof t&&(e&&zs(t,"rootURL",e),"function"==typeof t.initState&&t.initState())}_serializeQueryParams(t,e){yf(this,t,e,(t,n,i)=>{if(i)delete e[t],e[i.urlKey]=i.route.serializeQueryParam(n,i.urlKey,i.type);else{if(void 0===n)return;e[t]=this._serializeQueryParam(n,Fu(n))}})}_serializeQueryParam(t,e){return null==t?t:"array"===e?JSON.stringify(t):`${t}`}_deserializeQueryParams(t,e){yf(this,t,e,(t,n,i)=>{i&&(delete e[t],e[i.prop]=i.route.deserializeQueryParam(n,i.urlKey,i.type))})}_deserializeQueryParam(t,e){return null==t?t:"boolean"===e?"true"===t:"number"===e?Number(t).valueOf():"array"===e?sd(JSON.parse(t)):t}_pruneDefaultQueryParamValues(t,e){let n=this._queryParamsFor(t);for(let i in e){let t=n.map[i];t&&t.serializedDefaultValue===e[i]&&delete e[i]}}_doTransition(t,e,n,i){let r=t||function(t){let e=t.activeTransition?t.activeTransition[sp].routeInfos:t.state.routeInfos;return e[e.length-1].name}(this._routerMicrolib);this._initialTransitionStarted=!0;let s={};this._processActiveTransitionQueryParams(r,e,s,n),Object.assign(s,n),this._prepareQueryParams(r,e,s,Boolean(i));let o=this._routerMicrolib.transitionTo(r,...e,{queryParams:s});return mf(o,this),o}_processActiveTransitionQueryParams(t,e,n,i){if(!this._routerMicrolib.activeTransition)return;let r={},s=this._qpUpdates,o=Tp(this,this._routerMicrolib.activeTransition[sp]);for(let a in o)s.has(a)||(r[a]=o[a]);this._fullyScopeQueryParams(t,e,i),this._fullyScopeQueryParams(t,e,r),Object.assign(n,r)}_prepareQueryParams(t,e,n,i){let r=ff(this,t,e);this._hydrateUnsuppliedQueryParams(r,n,Boolean(i)),this._serializeQueryParams(r.routeInfos,n),i||this._pruneDefaultQueryParamValues(r.routeInfos,n)}_getQPMeta(t){let e=t.route;return e&&Cs(e,"_qp")}_queryParamsFor(t){let e=t[t.length-1].name,n=this._qpCache[e];if(void 0!==n)return n;let i,r=!0,s={},o=[];for(let l of t)if(i=this._getQPMeta(l),i){for(let t of i.qps)o.push(t);Object.assign(s,i.map)}else r=!1;let a={qps:o,map:s};return r&&(this._qpCache[e]=a),a}_fullyScopeQueryParams(t,e,n){let i,r=ff(this,t,e).routeInfos;for(let s of r)if(i=this._getQPMeta(s),i)for(let t of i.qps){let e=t.prop in n&&t.prop||t.scopedPropertyName in n&&t.scopedPropertyName||t.urlKey in n&&t.urlKey;e&&e!==t.scopedPropertyName&&(n[t.scopedPropertyName]=n[e],delete n[e])}}_hydrateUnsuppliedQueryParams(t,e,n){let i,r,s,o=t.routeInfos,a=this._bucketCache;for(let l of o)if(i=this._getQPMeta(l),i)for(let n=0,o=i.qps.length;n<o;++n)if(r=i.qps[n],s=r.prop in e&&r.prop||r.scopedPropertyName in e&&r.scopedPropertyName||r.urlKey in e&&r.urlKey,s)s!==r.scopedPropertyName&&(e[r.scopedPropertyName]=e[s],delete e[s]);else{let n=_p(r.route.fullRouteName,r.parts,t.params);e[r.scopedPropertyName]=a.lookup(n,r.prop,r.defaultValue)}}_scheduleLoadingEvent(t,e){this._cancelSlowTransitionTimer(),this._slowTransitionTimer=Ca("routerTransitions",this,this._handleSlowTransition,t,e)}currentState=null;targetState=null;_handleSlowTransition(t,e){if(!this._routerMicrolib.activeTransition)return;let n=new Dp(this,this._routerMicrolib,this._routerMicrolib.activeTransition[sp]);this.set("targetState",n),t.trigger(!0,"loading",t,e)}_cancelSlowTransitionTimer(){this._slowTransitionTimer&&ka(this._slowTransitionTimer),this._slowTransitionTimer=null}_markErrorAsHandled(t){this._handledErrors.add(t)}_isErrorHandled(t){return this._handledErrors.has(t)}_clearHandledError(t){this._handledErrors.delete(t)}_getEngineInstance({name:t,instanceId:e,mountPoint:n}){let i=this._engineInstances,r=i[t];r||(r=Object.create(null),i[t]=r);let s=r[e];return s||(s=al(this).buildChildEngineInstance(t,{routable:!0,mountPoint:n}),s.boot(),r[e]=s),s}}function lf(t,e){for(let n=t.length-1;n>=0;--n){let i=t[n],r=i.route;if(void 0!==r&&!0!==e(r,i))return}}let cf={willResolveModel(t,e,n){this._scheduleLoadingEvent(e,n)},error(t,e,n){let i=this,r=t[t.length-1];lf(t,(t,n)=>{if(n!==r){let n=uf(t,"error");if(n)return i._markErrorAsHandled(e),i.intermediateTransitionTo(n,e),!1}let s=hf(t,"error");return!s||(i._markErrorAsHandled(e),i.intermediateTransitionTo(s,e),!1)}),function(t,e){let n,i=[];n=t&&"object"==typeof t&&"object"==typeof t.errorThrown?t.errorThrown:t,e&&i.push(e),n&&(n.message&&i.push(n.message),n.stack&&i.push(n.stack),"string"==typeof n&&i.push(n)),console.error(...i)}(e,`Error while processing route: ${n.targetName}`)},loading(t,e){let n=this,i=t[t.length-1];lf(t,(t,r)=>{if(r!==i){let e=uf(t,"loading");if(e)return n.intermediateTransitionTo(e),!1}let s=hf(t,"loading");return s?(n.intermediateTransitionTo(s),!1):e.pivotHandler!==t})}};function hf(t,e){let n=al(t),{routeName:i,fullRouteName:r,_router:s}=t,o=`${r}_${e}`;return df(n,s,`${i}_${e}`,o)?o:""}function uf(t,e){let n=al(t),{routeName:i,fullRouteName:r,_router:s}=t,o="application"===r?e:`${r}.${e}`;return df(n,s,"application"===i?e:`${i}.${e}`,o)?o:""}function df(t,e,n,i){let r=e.hasRoute(i),s=t.factoryFor(`template:${n}`)||t.factoryFor(`route:${n}`);return r&&s}function pf(t,e,n,i){if(!t){if(e)return;throw new Error(`Can't trigger action '${n}' because your app hasn't finished transitioning into its first route. To trigger an action on destination routes during a transition, you can call \`.send()\` on the \`Transition\` object passed to the \`model/beforeModel/afterModel\` hooks.`)}let r,s,o,a=!1;for(let c=t.length-1;c>=0;c--)if(r=t[c],s=r.route,o=s&&s.actions&&s.actions[n],o){if(!0!==o.apply(s,i))return void("error"===n&&s._router._markErrorAsHandled(i[0]));a=!0}let l=cf[n];if(l)l.call(this,t,...i);else if(!a&&!e)throw new Error(`Nothing handled the action '${n}'. If you did handle the action, this error can be caused by returning true from an action handler in a controller, causing the action to bubble.`)}function ff(t,e,n){let i=t._routerMicrolib.applyIntent(e,n),{routeInfos:r,params:s}=i;for(let o of r)o.isResolved?s[o.name]=o.params:s[o.name]=o.serialize(o.context);return i}function gf(t){let e=t._routerMicrolib.currentRouteInfos;if(0===e.length)return;let n=af._routePath(e),i=e[e.length-1].name,r=t.location.getURL();zs(t,"currentPath",n),zs(t,"currentRouteName",i),zs(t,"currentURL",r)}function mf(t,e){let n=new Dp(e,e._routerMicrolib,t[sp]);e.currentState||e.set("currentState",n),e.set("targetState",n),t.promise=t.catch(t=>{if(!e._isErrorHandled(t))throw t;e._clearHandledError(t)},"Transition Error")}function yf(t,e,n,i){let r=t._queryParamsFor(e);for(let s in n)Object.prototype.hasOwnProperty.call(n,s)&&i(s,n[s],r.map[s])}function vf(t){return void 0!==t.hash?t.hash.substring(0):""}af.reopen({didTransition:function(){gf(this),this._cancelSlowTransitionTimer(),this.notifyPropertyChange("url"),this.set("currentState",this.targetState)},willTransition:function(){},rootURL:"/",location:"hash",url:ps(function(){let t=Cs(this,"location");if("string"!=typeof t)return t.getURL()})});class _f extends Mh{_hashchangeHandler;_location;init(){this.location=this._location??window.location,this._hashchangeHandler=void 0}getHash(){return vf(this.location)}getURL(){let t=this.getHash().substring(1),e=t;return"/"!==e[0]&&(e="/",t&&(e+=`#${t}`)),e}setURL(t){this.location.hash=t,this.lastSetURL=t}replaceURL(t){this.location.replace(`#${t}`),this.lastSetURL=t}lastSetURL=null;onUpdateURL(t){this._removeEventListener(),this._hashchangeHandler=_a(this,function(){let e=this.getURL();this.lastSetURL!==e&&(this.lastSetURL=null,t(e))}),window.addEventListener("hashchange",this._hashchangeHandler)}formatURL(t){return`#${t}`}willDestroy(){this._removeEventListener()}_removeEventListener(){this._hashchangeHandler&&window.removeEventListener("hashchange",this._hashchangeHandler)}}let bf=!1;function wf(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(t){let e,n;return e=16*Math.random()|0,n="x"===t?e:3&e|8,n.toString(16)})}class xf extends Mh{history;_previousURL;_popstateHandler;rootURL="/";getHash(){return vf(this.location)}init(){this._super(...arguments);let t=document.querySelector("base"),e="";null!==t&&t.hasAttribute("href")&&(e=t.getAttribute("href")??""),this.baseURL=e,this.location=this.location??window.location,this._popstateHandler=void 0}initState(){let t=this.history??window.history;this.history=t;let{state:e}=t,n=this.formatURL(this.getURL());e&&e.path===n?this._previousURL=this.getURL():this.replaceState(n)}getURL(){let{location:t,rootURL:e,baseURL:n}=this,i=t.pathname;e=e.replace(/\/$/,""),n=n.replace(/\/$/,"");let r=i.replace(new RegExp(`^${n}(?=/|$)`),"").replace(new RegExp(`^${e}(?=/|$)`),"").replace(/\/\//g,"/");return r+=(t.search||"")+this.getHash(),r}setURL(t){let{state:e}=this.history;t=this.formatURL(t),e&&e.path===t||this.pushState(t)}replaceURL(t){let{state:e}=this.history;t=this.formatURL(t),e&&e.path===t||this.replaceState(t)}pushState(t){let e={path:t,uuid:wf()};this.history.pushState(e,"",t),this._previousURL=this.getURL()}replaceState(t){let e={path:t,uuid:wf()};this.history.replaceState(e,"",t),this._previousURL=this.getURL()}onUpdateURL(t){this._removeEventListener(),this._popstateHandler=()=>{(bf||(bf=!0,this.getURL()!==this._previousURL))&&t(this.getURL())},window.addEventListener("popstate",this._popstateHandler)}formatURL(t){let{rootURL:e,baseURL:n}=this;return""!==t?(e=e.replace(/\/$/,""),n=n.replace(/\/$/,"")):"/"===n[0]&&"/"===e[0]&&(n=n.replace(/\/$/,"")),n+e+t}willDestroy(){this._removeEventListener()}_removeEventListener(){this._popstateHandler&&window.removeEventListener("popstate",this._popstateHandler)}}class Cf extends Mh{updateCallback;initState(){this._super(...arguments);let{rootURL:t}=this}getURL(){let{path:t,rootURL:e}=this;return e=e.replace(/\/$/,""),t.replace(new RegExp(`^${e}(?=/|$)`),"")}setURL(t){this.path=t}onUpdateURL(t){this.updateCallback=t}handleURL(t){this.path=t,this.updateCallback&&this.updateCallback(t)}formatURL(t){let{rootURL:e}=this;return""!==t&&(e=e.replace(/\/$/,"")),e+t}}function Sf(t){return null==t}function kf(t){if(null==t)return!0;if(!xs(t)&&"number"==typeof t.size)return!t.size;if("object"==typeof t){let e=Cs(t,"size");if("number"==typeof e)return!e;let n=Cs(t,"length");if("number"==typeof n)return!n}return"number"==typeof t.length&&"function"!=typeof t&&!t.length}function Ef(t){return Ds(t).readOnly()}Cf.reopen({path:"",rootURL:"/"});const Tf=/[ _]/g,Lf=new sr(1e3,t=>{return(e=t,Af.get(e)).replace(Tf,"-");var e}),Mf=/^(-|_)+(.)?/,Rf=/(.)(-|_|\.|\s)+(.)?/g,Pf=/(^|\/|\.)([a-z])/g,If=new sr(1e3,t=>{let e=(t,e,n)=>n?`_${n.toUpperCase()}`:"",n=(t,e,n,i)=>e+(i?i.toUpperCase():""),i=t.split("/");for(let r=0;r<i.length;r++)i[r]=i[r].replace(Mf,e).replace(Rf,n);return i.join("/").replace(Pf,t=>t.toUpperCase())}),Of=/([a-z\d])([A-Z])/g,Af=new sr(1e3,t=>t.replace(Of,"$1_$2").toLowerCase());function zf(t){return Lf.get(t)}function Ff(t){return Object.hasOwnProperty.call(t.since,"enabled")||g._ALL_DEPRECATIONS_ENABLED}let jf=parseFloat(g._OVERRIDE_DEPRECATION_VERSION??or);function Df(t){return function(t,e=jf){let n=t.replace(/(\.0+)/g,"");return e>=parseFloat(n)}(t.until)}function Nf(t){return{options:t,test:!Ff(t),isEnabled:Ff(t)||Df(t),isRemoved:Df(t)}}const Bf={DEPRECATE_IMPORT_EMBER:t=>Nf({id:`deprecate-import-${zf(t).toLowerCase()}-from-ember`,for:"ember-source",since:{available:"5.10.0",enabled:"6.5.0"},until:"7.0.0",url:`https://deprecations.emberjs.com/id/import-${zf(t).toLowerCase()}-from-ember`}),DEPRECATE_IMPORT_INJECT:Nf({for:"ember-source",id:"importing-inject-from-ember-service",since:{available:"6.2.0",enabled:"6.3.0"},until:"7.0.0",url:"https://deprecations.emberjs.com/id/importing-inject-from-ember-service"}),DEPRECATE_AMD_BUNDLES:Nf({for:"ember-source",id:"using-amd-bundles",since:{available:"6.10.0",enabled:"6.10.0"},until:"7.0.0",url:"https://deprecations.emberjs.com/id/using-amd-bundles"})};function Uf(t,e){const{options:n}=e;if(e.isRemoved)throw new Error(`The API deprecated by ${n.id} was removed in ember-source ${n.until}. The message was: ${t}. Please see ${n.url} for more details.`)}function qf(...t){return Rs("service",...t)}class Vf extends ru{static isServiceFactory=!0}const $f=Object.freeze(Object.defineProperty({__proto__:null,default:Vf,inject:function(...t){return Uf("Importing `inject` from `@ember/service` is deprecated. Please import `service` instead.",Bf.DEPRECATE_IMPORT_INJECT),Rs("service",...t)},service:qf},Symbol.toStringTag,{value:"Module"})),Gf=Symbol("ROUTER");function Wf(t,e){return"/"===e?t:t.substring(e.length)}class Hf extends(Vf.extend(nu)){[Gf];get _router(){let t=this[Gf];if(void 0!==t)return t;let e=hr(this).lookup("router:main");return this[Gf]=e}willDestroy(){super.willDestroy(),this[Gf]=void 0}transitionTo(...t){if(wp(t[0]))return this._router._doURLTransition("transitionTo",t[0]);let{routeName:e,models:n,queryParams:i}=mp(t);return this._router._doTransition(e,n,i,!0)}replaceWith(...t){return this.transitionTo(...t).method("replace")}urlFor(t,...e){return this._router.setupRouter(),this._router.generate(t,...e)}isActive(...t){let{routeName:e,models:n,queryParams:i}=mp(t);this._router.setupRouter();let r=this._router._routerMicrolib;if(je(on(this._router,"currentURL")),!r.isActiveIntent(e,n))return!1;if(Object.keys(i).length>0){let t=e;i=Object.assign({},i),this._router._prepareQueryParams(t,n,i,!0);let s=Object.assign({},r.state.queryParams);return this._router._prepareQueryParams(t,n,s,!0),xp(i,s)}return!0}recognize(t){this._router.setupRouter();let e=Wf(t,this.rootURL);return this._router._routerMicrolib.recognize(e)}recognizeAndLoad(t){this._router.setupRouter();let e=Wf(t,this.rootURL);return this._router._routerMicrolib.recognizeAndLoad(e)}refresh(t){if(!t)return this._router._routerMicrolib.refresh();let e=hr(this).lookup(`route:${t}`);return this._router._routerMicrolib.refresh(e)}static{ku(this.prototype,"currentRouteName",[Ef("_router.currentRouteName")])}#c=void Lu(this,"currentRouteName");static{ku(this.prototype,"currentURL",[Ef("_router.currentURL")])}#h=void Lu(this,"currentURL");static{ku(this.prototype,"location",[Ef("_router.location")])}#u=void Lu(this,"location");static{ku(this.prototype,"rootURL",[Ef("_router.rootURL")])}#d=void Lu(this,"rootURL");static{ku(this.prototype,"currentRoute",[Ef("_router.currentRoute")])}#p=void Lu(this,"currentRoute")}class Zf extends Vf{[Gf];get router(){let t=this[Gf];if(void 0!==t)return t;let e=hr(this).lookup("router:main");return e.setupRouter(),this[Gf]=e}hasRoute(t){return this.router.hasRoute(t)}transitionTo(t,e,n,i){let r=this.router._doTransition(t,e,n);return i&&r.method("replace"),r}normalizeQueryParams(t,e,n){this.router._prepareQueryParams(t,e,n)}_generateURL(t,e,n){let i={};return n&&(Object.assign(i,n),this.normalizeQueryParams(t,e,i)),this.router.generate(t,...e,{queryParams:i})}generateURL(t,e,n){if(this.router._initialTransitionStarted)return this._generateURL(t,e,n);try{return this._generateURL(t,e,n)}catch(i){return}}isActiveForRoute(t,e,n,i){let r=this.router._routerMicrolib.recognizer.handlersFor(n),s=r[r.length-1].handler,o=function(t,e){let n=0;for(let i=0;i<e.length&&(n+=e[i].names.length,e[i].handler!==t);i++);return n}(n,r);return t.length>o&&(n=s),i.isActiveIntent(n,t,e)}}Zf.reopen({targetState:Ef("router.targetState"),currentState:Ef("router.currentState"),currentRouteName:Ef("router.currentRouteName"),currentPath:Ef("router.currentPath")});class Kf{constructor(t){this.buffer=t,this.size=0}encode(t,e,...n){if(t>255)throw new Error(`Opcode type over 8-bits. Got ${t}.`);let i=t|e|arguments.length-2<<8;this.buffer.push(i);for(const r of n)this.buffer.push(r);this.size=this.buffer.length}patch(t,e){if(-1!==this.buffer[t+1])throw new Error("Trying to patch operand in populated slot instead of a reserved slot.");this.buffer[t+1]=e}}const Yf=32,Xf=31;function Jf(t){return(t|=0)<0?function(t){return-536870913&t}(t):function(t){return~t}(t)}function Qf(t){return e=>{if(!function(t){return Array.isArray(t)&&2===t.length}(e))return!1;let n=e[0];return n===Xf||n===Yf||n===t}}[1,-1].forEach(t=>{return e=Jf(t),(e|=0)>-536870913?function(t){return~t}(e):function(t){return 536870912|t}(e);var e});const tg=Qf(39),eg=Qf(38),ng=Qf(37),ig=Qf(35);function rg(t,e,n,i){let{symbols:{upvars:r}}=n,s=r[t[1]],o=e?.lookupBuiltInHelper?.(s)??null;return i.helper(o,s)}function sg(t){return{type:1,value:t}}function og(t){return{type:5,value:t}}function ag(t){return{type:7,value:t}}function lg(t){return{type:8,value:t}}class cg{label(t,e){this.labels[t]=e}target(t,e){this.targets.push({at:t,target:e})}patch(t){let{targets:e,labels:n}=this;for(const{at:i,target:r}of e){let e=n[r]-i;t.getbyaddr(i),t.setbyaddr(i,e)}}constructor(){this.labels=vn(),this.targets=[]}}function hg(t,e,n,i){let{program:{constants:r},resolver:s}=e;if(function(t){return t<1e3}(i[0])){let[e,...n]=i;t.push(r,e,...n)}else switch(i[0]){case 1e3:return t.label(i[1]);case 1001:return t.startLabels();case 1002:return t.stopLabels();case 1004:return function(t,e,n,[,i,r]){if(tg(i),i[0]===Yf){let{scopeValues:t,owner:s,symbols:{lexical:o}}=n,a=t[i[1]];r(e.component(a,s,!1,o?.at(i[1])))}else{let{symbols:{upvars:s},owner:o}=n,a=s[i[1]],l=t?.lookupComponent?.(a,o)??null;r(e.resolvedComponent(l,a))}}(s,r,n,i);case 1003:return function(t,e,n,[,i,r]){eg(i);let s=i[0];if(s===Yf){let{scopeValues:t,symbols:{lexical:s}}=n,o=t[i[1]];r(e.modifier(o,s?.at(i[1])??void 0))}else if(s===Xf){let{symbols:{upvars:s}}=n,o=s[i[1]],a=t?.lookupBuiltInModifier?.(o)??null;r(e.modifier(a,o))}else{let{symbols:{upvars:s},owner:o}=n,a=s[i[1]],l=t?.lookupModifier?.(a,o)??null;r(e.modifier(l))}}(s,r,n,i);case 1005:return function(t,e,n,[,i,r]){ng(i);let s=i[0];if(s===Yf){let{scopeValues:t}=n,s=t[i[1]];r(e.helper(s))}else if(s===Xf)r(rg(i,t,n,e));else{let{symbols:{upvars:s},owner:o}=n,a=s[i[1]],l=t?.lookupHelper?.(a,o)??null;r(e.helper(l,a))}}(s,r,n,i);case 1007:return function(t,e,n,[,i,{ifComponent:r,ifHelper:s}]){ig(i);let o=i[0];if(o===Yf){let{scopeValues:t,owner:o,symbols:{lexical:a}}=n,l=t[i[1]],c=e.component(l,o,!0,a?.at(i[1]));if(null!==c)return void r(c);s(e.helper(l,null,!0))}else if(o===Xf)s(rg(i,t,n,e));else{let{symbols:{upvars:o},owner:a}=n,l=o[i[1]],c=t?.lookupComponent?.(l,a)??null;if(null!==c)r(e.resolvedComponent(c,l));else{let n=t?.lookupHelper?.(l,a)??null;s(e.helper(n,l))}}}(s,r,n,i);case 1008:return function(t,e,n,[,i,{ifComponent:r,ifHelper:s,ifValue:o}]){ig(i);let a=i[0];if(a===Yf){let{scopeValues:t,owner:a,symbols:{lexical:l}}=n,c=t[i[1]];if("function"!=typeof c&&("object"!=typeof c||null===c))return void o(e.value(c));let h=e.component(c,a,!0,l?.at(i[1]));if(null!==h)return void r(h);let u=e.helper(c,null,!0);if(null!==u)return void s(u);o(e.value(c))}else if(a===Xf)s(rg(i,t,n,e));else{let{symbols:{upvars:o},owner:a}=n,l=o[i[1]],c=t?.lookupComponent?.(l,a)??null;if(null!==c)return void r(e.resolvedComponent(c,l));let h=t?.lookupHelper?.(l,a)??null;null!==h&&s(e.helper(h,l))}}(s,r,n,i);case 1010:{let[,t,e]=i;e(n.symbols.upvars[t],n.moduleName);break}case 1011:{let[,t,e]=i,s=n.scopeValues[t];e(r.value(s));break}default:throw new Error(`Unexpected high level opcode ${i[0]}`)}}class ug{constructor(t,e,n){this.heap=t,this.meta=e,this.stdlib=n,this.labelsStack=new wn,this.encoder=new Kf([]),this.errors=[],this.handle=t.malloc()}error(t){this.encoder.encode(30,0),this.errors.push(t)}commit(t){let e=this.handle;return this.heap.pushMachine(5),this.heap.finishMalloc(e,t),(n=this.errors)&&n.length>0?{errors:this.errors,handle:e}:e;var n}push(t,e,...n){let{heap:i}=this;var r;let s=e|((r=e)>=0&&r<=15?si:0)|n.length<<8;i.pushRaw(s);for(let o=0;o<n.length;o++){let e=n[o];i.pushRaw(this.operand(t,e))}}operand(t,e){if("number"==typeof e)return e;if("object"==typeof e&&null!==e){if(Array.isArray(e))return t.array(e);switch(e.type){case 1:return this.currentLabels.target(this.heap.offset,e.value),-1;case 2:return t.value(this.meta.isStrictMode);case 3:case 6:case 7:case 8:return t.value(e.value);case 4:return t.value((n=e.value,i=this.meta,new Wg(n[0],i,{parameters:n[1]||hn})));case 5:return this.stdlib[e.value]}}var n,i;return t.value(e)}get currentLabels(){return this.labelsStack.current}label(t){this.currentLabels.label(t,this.heap.offset+1)}startLabels(){this.labelsStack.push(new cg)}stopLabels(){this.labelsStack.pop().patch(this.heap)}}function dg(t,e){return{evaluation:t,encoder:new ug(t.program.heap,e,t.stdlib),meta:e}}class pg{add(t,e){this.names[t]=this.funcs.push(e)-1}compile(t,e){let n=e[0],i=this.names[n],r=this.funcs[i];e[0],r(t,e)}constructor(){this.names={},this.funcs=[]}}const fg=new pg;function gg(t,e){if(void 0!==e&&0!==e.length)for(let n=0;n<e.length;n++)t(22,e[n])}function mg(t,e){Array.isArray(e)?fg.compile(t,e):(vg(t,e),t(31))}function yg(t,e){vg(t,e),t(31)}function vg(t,e){let n=e;var i;"number"==typeof n&&(n=(i=n)%1==0&&i<=536870911&&i>=-536870912?Jf(n):function(t){return{type:6,value:t}}(n)),t(30,n)}function _g(t,e,n,i){t(0),Tg(t,n,i,!1),t(16,e),t(1),t(36,8)}function bg(t,e,n,i){t(0),Tg(t,e,n,!1),t(33,2,1),t(107),i?(t(36,8),i(),t(1),t(34,1)):(t(1),t(34,1),t(36,8))}function wg(t,e,n,i,r){t(0),Tg(t,i,r,!1),t(86),mg(t,n),t(77,e,{type:2,value:void 0}),t(1),t(36,8)}function xg(t,e,n){Tg(t,n,null,!0),t(23,e),t(24),t(61),t(64),t(40),t(1)}function Cg(t,e){!function(t,e){null!==e?t(63,ag({parameters:e})):vg(t,null)}(t,e&&e[1]),t(62),Eg(t,e)}function Sg(t,e){t(0),Eg(t,e),t(61),t(2),t(1)}function kg(t,e,n){let i=e[1],r=i.length,s=Math.min(n,r);if(0!==s){if(t(0),s){t(39);for(let e=0;e<s;e++)t(33,2,n-e),t(19,i[e])}Eg(t,e),t(61),t(2),s&&t(40),t(1)}else Sg(t,e)}function Eg(t,e){null===e?vg(t,null):t(28,{type:4,value:e})}function Tg(t,e,n,i){if(null===e&&null===n)return void t(83);let r=Lg(t,e)<<4;i&&(r|=8);let s=dn;if(n){s=n[0];let e=n[1];for(let n=0;n<e.length;n++)mg(t,e[n])}t(82,s,dn,r)}function Lg(t,e){if(null===e)return 0;for(let n=0;n<e.length;n++)mg(t,e[n]);return e.length}function Mg(t){let[,e,n,i]=t.block;return{symbols:{locals:e,upvars:n,lexical:i},scopeValues:t.scope?.()??null,isStrictMode:t.isStrictMode,moduleName:t.moduleName,owner:t.owner,size:e.length}}fg.add(29,(t,[,e])=>{for(let n of e)mg(t,n);t(27,e.length)}),fg.add(28,(t,[,e,n,i])=>{ng(e)?t(1005,e,e=>{_g(t,e,n,i)}):(mg(t,e),bg(t,n,i))}),fg.add(50,(t,[,e,n,i,r])=>{wg(t,n,e,i,r)}),fg.add(30,(t,[,e,n])=>{t(21,e),gg(t,n)}),fg.add(Yf,(t,[,e,n])=>{t(1011,e,e=>{t(29,e),gg(t,n)})}),fg.add(Xf,(t,e)=>{t(1010,e[1],()=>{t(1005,e,e=>{_g(t,e,null,null)})})}),fg.add(37,(t,e)=>{t(1010,e[1],()=>{t(1005,e,e=>{_g(t,e,null,null)})})}),fg.add(27,t=>yg(t,void 0)),fg.add(48,(t,[,e])=>{mg(t,e),t(25)}),fg.add(49,(t,[,e])=>{mg(t,e),t(24),t(61),t(26)}),fg.add(52,(t,[,e,n,i])=>{mg(t,i),mg(t,n),mg(t,e),t(109)}),fg.add(51,(t,[,e])=>{mg(t,e),t(110)}),fg.add(53,(t,[,e])=>{mg(t,e),t(111)}),fg.add(54,(t,[,e])=>{t(0),Tg(t,e,null,!1),t(112),t(1),t(36,8)});class Rg{constructor(t){this.blocks=t,this.names=t?Object.keys(t):[]}get(t){return this.blocks&&this.blocks[t]||null}has(t){let{blocks:e}=this;return null!==e&&t in e}with(t,e){let{blocks:n}=this;return new Rg(n?Cn({},n,{[t]:e}):{[t]:e})}get hasAny(){return null!==this.blocks}}const Pg=new Rg(null);function Ig(t){if(null===t)return Pg;let e=vn(),[n,i]=t;for(const[r,s]of gn(n))e[s]=i[r];return new Rg(e)}function Og(t,e,n){let i=[],r=0;n(function(t,e){i.push({match:t,callback:e,label:"CLAUSE"+r++})}),t(69,1),e(),t(1001);for(let s of i.slice(0,-1))t(67,sg(s.label),s.match);for(let s=i.length-1;s>=0;s--){let e=i[s];t(1e3,e.label),t(34,1),e.callback(),0!==s&&t(4,sg("END"))}t(1e3,"END"),t(1002),t(70)}function Ag(t,e,n){t(1001),t(0),t(6,sg("ENDINITIAL")),t(69,e()),n(),t(1e3,"FINALLY"),t(70),t(5),t(1e3,"ENDINITIAL"),t(1),t(1002)}function zg(t,e,n,i){return Ag(t,e,()=>{t(66,sg("ELSE")),n(),t(4,sg("FINALLY")),t(1e3,"ELSE"),void 0!==i&&i()})}function Fg(t,e,n,i,r,s){let{compilable:o,capabilities:a,handle:l}=e,c=n?[n,[]]:null,h=Ig(s);o?(t(78,l),function(t,{capabilities:e,layout:n,elementBlock:i,positional:r,named:s,blocks:o}){let{symbolTable:a}=n;if(yi(e,ri.prepareArgs))return void Dg(t,{capabilities:e,elementBlock:i,positional:r,named:s,atNames:!0,blocks:o,layout:n});t(36,4),t(33,3,1),t(35,4),t(0);let{symbols:l}=a,c=[],h=[],u=[],d=o.names;if(null!==i){let e=l.indexOf("&attrs");-1!==e&&(Cg(t,i),c.push(e))}for(const p of d){let e=l.indexOf(`&${p}`);-1!==e&&(Cg(t,o.get(p)),c.push(e))}if(yi(e,ri.createArgs)){let e=Lg(t,r)<<4;e|=8;let n=dn;if(null!==s){n=s[0];let e=s[1];for(let i=0;i<e.length;i++){let r=l.indexOf(n[i]);mg(t,e[i]),h.push(r)}}t(82,n,dn,e),h.push(-1)}else if(null!==s){let e=s[0],n=s[1];for(let i=0;i<n.length;i++){let r=e[i],s=l.indexOf(r);-1!==s&&(mg(t,n[i]),h.push(s),u.push(r))}}t(97,4),yi(e,ri.dynamicScope)&&t(59),yi(e,ri.createInstance)&&t(87,0|o.has("default")),t(88,4),yi(e,ri.createArgs)?t(90,4):t(90,4,u),t(37,l.length+1,Object.keys(o).length>0?1:0),t(19,0);for(const p of fn(h))-1===p?t(34,1):t(19,p+1);null!==r&&t(34,r.length);for(const p of fn(c))t(20,p+1);t(28,lg(n)),t(61),t(2),t(100,4),t(1),t(40),yi(e,ri.dynamicScope)&&t(60),t(98),t(35,4)}(t,{capabilities:a,layout:o,elementBlock:c,positional:i,named:r,blocks:h})):(t(78,l),Dg(t,{capabilities:a,elementBlock:c,positional:i,named:r,atNames:!0,blocks:h}))}function jg(t,e,n,i,r,s,o,a){let l=n?[n,[]]:null,c=Ig(s);Ag(t,()=>(mg(t,e),t(33,3,0),2),()=>{t(66,sg("ELSE")),a?t(81):t(80,{type:2,value:void 0}),t(79),Dg(t,{capabilities:!0,elementBlock:l,positional:i,named:r,atNames:o,blocks:c}),t(1e3,"ELSE")})}function Dg(t,{capabilities:e,elementBlock:n,positional:i,named:r,atNames:s,blocks:o,layout:a}){let l=!!o,c=!0===e||yi(e,ri.prepareArgs)||!(!r||0===r[0].length),h=o.with("attrs",n);t(36,4),t(33,3,1),t(35,4),t(0),function(t,e,n,i,r){let s=i.names;for(const l of s)Cg(t,i.get(l));let o=Lg(t,e)<<4;r&&(o|=8),i.hasAny&&(o|=7);let a=hn;if(n){a=n[0];let e=n[1];for(let n=0;n<e.length;n++)mg(t,e[n])}t(82,a,s,o)}(t,i,r,h,s),t(85,4),Ng(t,h.has("default"),l,c,()=>{a?(t(63,ag(a.symbolTable)),t(28,lg(a)),t(61)):t(92,4),t(95,4)}),t(35,4)}function Ng(t,e,n,i,r=null){t(97,4),t(59),t(87,0|e),r&&r(),t(88,4),t(90,4),t(38,4),t(19,0),i&&t(17,4),n&&t(18,4),t(34,1),t(96,4),t(100,4),t(1),t(40),t(60),t(98)}const Bg=new pg,Ug=["class","id","value","name","type","style","href"],qg=["div","span","p","a"];function Vg(t){return"string"==typeof t?t:qg[t]}function $g(t){return"string"==typeof t?t:Ug[t]}function Gg(t){return null===t?null:[t[0].map(t=>`@${t}`),t[1]]}Bg.add(3,(t,e)=>t(42,e[1])),Bg.add(13,t=>t(55)),Bg.add(12,t=>t(54)),Bg.add(4,(t,[,e,n,i])=>{eg(e)?t(1003,e,e=>{t(0),Tg(t,n,i,!1),t(57,e),t(1)}):(mg(t,e),t(0),Tg(t,n,i,!1),t(33,2,1),t(108),t(1))}),Bg.add(14,(t,[,e,n,i])=>{t(51,$g(e),n,i??null)}),Bg.add(24,(t,[,e,n,i])=>{t(105,$g(e),n,i??null)}),Bg.add(15,(t,[,e,n,i])=>{mg(t,n),t(52,$g(e),!1,i??null)}),Bg.add(22,(t,[,e,n,i])=>{mg(t,n),t(52,$g(e),!0,i??null)}),Bg.add(16,(t,[,e,n,i])=>{mg(t,n),t(53,$g(e),!1,i??null)}),Bg.add(23,(t,[,e,n,i])=>{mg(t,n),t(53,$g(e),!0,i??null)}),Bg.add(10,(t,[,e])=>{t(48,Vg(e))}),Bg.add(11,(t,[,e])=>{t(89),t(48,Vg(e))}),Bg.add(8,(t,[,e,n,i,r])=>{tg(e)?t(1004,e,e=>{Fg(t,e,n,null,i,r)}):jg(t,e,n,null,i,r,!0,!0)}),Bg.add(18,(t,[,e,n])=>xg(t,e,n)),Bg.add(17,(t,[,e])=>xg(t,e,null)),Bg.add(26,(t,[,e,n,i])=>{t(103,function(t,e,n){return{type:3,value:{locals:t,upvars:e,lexical:n}}}(e,n,i))}),Bg.add(1,(t,[,e])=>{if(Array.isArray(e))if(ig(e))t(1008,e,{ifComponent(e){Fg(t,e,null,null,null,null)},ifHelper(e){t(0),_g(t,e,null,null),t(3,og("cautious-non-dynamic-append")),t(1)},ifValue(e){t(0),t(29,e),t(3,og("cautious-non-dynamic-append")),t(1)}});else if(28===e[0]){let[,n,i,r]=e;ig(n)?t(1007,n,{ifComponent(e){Fg(t,e,null,i,Gg(r),null)},ifHelper(e){t(0),_g(t,e,i,r),t(3,og("cautious-non-dynamic-append")),t(1)}}):Og(t,()=>{mg(t,n),t(106)},e=>{e(0,()=>{t(81),t(79),Dg(t,{capabilities:!0,elementBlock:null,positional:i,named:r,atNames:!1,blocks:Ig(null)})}),e(1,()=>{bg(t,i,r,()=>{t(3,og("cautious-non-dynamic-append"))})})})}else t(0),mg(t,e),t(3,og("cautious-append")),t(1);else t(41,null==e?"":String(e))}),Bg.add(2,(t,[,e])=>{Array.isArray(e)?(t(0),mg(t,e),t(3,og("trusting-append")),t(1)):t(41,null==e?"":String(e))}),Bg.add(6,(t,[,e,n,i,r])=>{tg(e)?t(1004,e,e=>{Fg(t,e,null,n,Gg(i),r)}):jg(t,e,null,n,i,r,!1,!1)}),Bg.add(40,(t,[,e,n,i,r])=>{zg(t,()=>(mg(t,n),void 0===r?yg(t,void 0):mg(t,r),mg(t,i),t(33,3,0),4),()=>{t(50),Sg(t,e),t(56)})}),Bg.add(41,(t,[,e,n,i])=>zg(t,()=>(mg(t,e),t(71),1),()=>{Sg(t,n)},i?()=>{Sg(t,i)}:void 0)),Bg.add(42,(t,[,e,n,i,r])=>Ag(t,()=>(n?mg(t,n):yg(t,null),mg(t,e),2),()=>{t(72,sg("BODY"),sg("ELSE")),t(0),t(33,2,1),t(6,sg("ITER")),t(1e3,"ITER"),t(74,sg("BREAK")),t(1e3,"BODY"),kg(t,i,2),t(34,2),t(4,sg("FINALLY")),t(1e3,"BREAK"),t(1),t(73),t(4,sg("FINALLY")),t(1e3,"ELSE"),r&&Sg(t,r)})),Bg.add(44,(t,[,e,n])=>{kg(t,n,Lg(t,e))}),Bg.add(45,(t,[,e,n])=>{if(e){let[i,r]=e;Lg(t,r),function(t,e,n){t(59),t(58,e),n(),t(60)}(t,i,()=>{Sg(t,n)})}else Sg(t,n)}),Bg.add(46,(t,[,e,n,i,r])=>{tg(e)?t(1004,e,e=>{Fg(t,e,null,n,Gg(i),r)}):jg(t,e,null,n,i,r,!1,!1)});class Wg{constructor(t,e,n,i="plain block"){this.statements=t,this.meta=e,this.symbolTable=n,this.moduleName=i,this.compiled=null}compile(t){return function(t,e){if(null!==t.compiled)return t.compiled;t.compiled=-1;let{statements:n,meta:i}=t,r=function(t,e,n){let i=Bg,r=dg(n,e),{encoder:s,evaluation:o}=r;function a(...t){hg(s,o,e,t)}for(const l of t)i.compile(a,l);return r.encoder.commit(e.size)}(n,i,e);return t.compiled=r,r}(this,t)}}class Hg{constructor(t,e,n,i,r){this.main=t,this.trustingGuardedAppend=e,this.cautiousGuardedAppend=n,this.trustingNonDynamicAppend=i,this.cautiousNonDynamicAppend=r}get"trusting-append"(){return this.trustingGuardedAppend}get"cautious-append"(){return this.cautiousGuardedAppend}get"trusting-non-dynamic-append"(){return this.trustingNonDynamicAppend}get"cautious-non-dynamic-append"(){return this.cautiousNonDynamicAppend}getAppend(t){return t?this.trustingGuardedAppend:this.cautiousGuardedAppend}}function Zg(t,e,n){Og(t,()=>t(76),i=>{i(2,()=>{e?(t(68),t(43)):t(47)}),"number"==typeof n?(i(0,()=>{t(81),t(79),function(t){t(36,4),t(33,3,1),t(35,4),t(0),t(83),t(85,4),Ng(t,!1,!1,!0,()=>{t(92,4),t(95,4)}),t(35,4)}(t)}),i(1,()=>{bg(t,null,null,()=>{t(3,n)})})):(i(0,()=>{t(47)}),i(1,()=>{t(47)})),i(4,()=>{t(68),t(44)}),i(5,()=>{t(68),t(45)}),i(6,()=>{t(68),t(46)})})}const Kg={symbols:{locals:null,upvars:null},moduleName:"stdlib",scopeValues:null,isStrictMode:!0,owner:null,size:0};function Yg(t,e){let n=new ug(t.program.heap,Kg);e(function(...e){hg(n,t,Kg,e)});let i=n.commit(0);if("number"!=typeof i)throw new Error("Unexpected errors compiling std");return i}class Xg{constructor({constants:t,heap:e},n,i){this.constants=t,this.heap=e,this.resolver=i.resolver,this.createOp=n,this.env=i.env,this.program=i.program,this.stdlib=function(t){let e=Yg(t,t=>function(t){t(75,4),Ng(t,!1,!1,!0)}(t)),n=Yg(t,t=>Zg(t,!0,null)),i=Yg(t,t=>Zg(t,!1,null)),r=Yg(t,t=>Zg(t,!0,n)),s=Yg(t,t=>Zg(t,!1,i));return new Hg(e,r,s,n,i)}(this)}}class Jg{constructor(t,e){this.layout=t,this.moduleName=e,this.compiled=null;let{block:n}=t,[,i]=n;i=i.slice();let r=i.indexOf("&attrs");this.attrsBlockNumber=-1===r?i.push("&attrs"):r+1,this.symbolTable={symbols:i},this.meta=Mg(t)}compile(t){if(null!==this.compiled)return this.compiled;let e=Mg(this.layout),n=dg(t,e),{encoder:i,evaluation:r}=n;var s,o,a;s=function(...t){hg(i,r,e,t)},o=this.layout,a=this.attrsBlockNumber,s(1001),function(t,e,n){t(36,5),n(),t(35,5)}(s,0,()=>{s(91,4),s(31),s(33,3,0)}),s(66,sg("BODY")),s(36,5),s(89),s(49),s(99,4),xg(s,a,null),s(54),s(1e3,"BODY"),Sg(s,[o.block[0],[]]),s(36,5),s(66,sg("END")),s(55),s(1e3,"END"),s(35,5),s(1002);let l=n.encoder.commit(e.size);return"number"!=typeof l||(this.compiled=l),l}}let Qg=0,tm={cacheHit:0,cacheMiss:0};function em({id:t,moduleName:e,block:n,scope:i,isStrictMode:r}){let s,o=t||"client-"+Qg++,a=null,l=new WeakMap,c=t=>{if(void 0===s&&(s=JSON.parse(n)),void 0===t)return null===a?(tm.cacheMiss++,a=new nm({id:o,block:s,moduleName:e,owner:null,scope:i,isStrictMode:r})):tm.cacheHit++,a;let c=l.get(t);return void 0===c?(tm.cacheMiss++,c=new nm({id:o,block:s,moduleName:e,owner:t,scope:i,isStrictMode:r}),l.set(t,c)):tm.cacheHit++,c};return c.__id=o,c.__meta={moduleName:e},c}class nm{constructor(t){this.parsedLayout=t,this.result="ok",this.layout=null,this.wrappedLayout=null}get moduleName(){return this.parsedLayout.moduleName}get id(){return this.parsedLayout.id}get referrer(){return{moduleName:this.parsedLayout.moduleName,owner:this.parsedLayout.owner}}asLayout(){return this.layout?this.layout:this.layout=function(t,e){let[n,i]=t.block;return new Wg(n,Mg(t),{symbols:i},e)}(Cn({},this.parsedLayout),this.moduleName)}asWrappedLayout(){return this.wrappedLayout?this.wrappedLayout:this.wrappedLayout=new Jg(Cn({},this.parsedLayout),this.moduleName)}}function im(t){if("error"===t.result)throw new Error(`Compile Error: ${t.problem} @ ${t.span.start}..${t.span.end}`);return t}const rm={id:"1b32f5c2-7623-43d6-a0ad-9672898920a1",moduleName:"__default__.hbs",block:JSON.stringify([[[18,1,null]],["&default"],[]]),scope:null,isStrictMode:!0},sm=Object.freeze([]),om=[!1,!0,null,void 0,sm],am=om.indexOf(sm);class lm{value(t){let e=this.indexMap,n=e.get(t);return void 0===n&&(n=this.values.push(t)-1,e.set(t,n)),n}array(t){if(0===t.length)return am;let e=new Array(t.length);for(let n=0;n<t.length;n++)e[n]=this.value(t[n]);return this.value(e)}toPool(){return this.values}hasHandle(t){return this.values.length>t}helper(t,e=null,n){let i=this.helperDefinitionCache.get(t);if(void 0===i){let e=Oi(t);if(null===e)return this.helperDefinitionCache.set(t,null),null;let n="function"==typeof e?e:e.getHelper(t);i=this.value(n),this.helperDefinitionCache.set(t,i),this.helperDefinitionCount++}return i}modifier(t,e=null,n){let i=this.modifierDefinitionCache.get(t);if(void 0===i){let n=Ri(t);if(null===n)return this.modifierDefinitionCache.set(t,null),null;let r={resolvedName:e,manager:n,state:t};i=this.value(r),this.modifierDefinitionCache.set(t,i),this.modifierDefinitionCount++}return i}component(t,e,n,i){let r=this.componentDefinitionCache.get(t);if(void 0===r){let n=zi(t);if(null===n)return this.componentDefinitionCache.set(t,null),null;let s,o=fi(n.getCapabilities(t)),a=Ji(t),l=null;s=mi(0,o,ri.dynamicLayout)?a?.(e):a?.(e)??this.defaultTemplate,void 0!==s&&(s=im(s),l=mi(0,o,ri.wrapped)?s.asWrappedLayout():s.asLayout()),r={resolvedName:null,handle:-1,manager:n,capabilities:o,state:t,compilable:l},r.handle=this.value(r),i&&(r.debugName=i),this.componentDefinitionCache.set(t,r),this.componentDefinitionCount++}return r}resolvedComponent(t,e){let n=this.componentDefinitionCache.get(t);if(void 0===n){let{manager:i,state:r,template:s}=t,o=fi(i.getCapabilities(t)),a=null;mi(0,o,ri.dynamicLayout)||(s=s??this.defaultTemplate),null!==s&&(s=im(s),a=mi(0,o,ri.wrapped)?s.asWrappedLayout():s.asLayout()),n={resolvedName:e,handle:-1,manager:i,capabilities:o,state:r,compilable:a},n.handle=this.value(n),this.componentDefinitionCache.set(t,n),this.componentDefinitionCount++}return n}getValue(t){return this.values[t]}getArray(t){let e=this.reifiedArrs,n=e[t];if(void 0===n){let i=this.getValue(t);n=new Array(i.length);for(const[t,e]of gn(i))n[t]=this.getValue(e);e[t]=n}return n}constructor(){this.reifiedArrs={[am]:sm},this.defaultTemplate=em(rm)(),this.helperDefinitionCount=0,this.modifierDefinitionCount=0,this.componentDefinitionCount=0,this.values=om.slice(),this.indexMap=new Map(this.values.map((t,e)=>[t,e])),this.helperDefinitionCache=new WeakMap,this.modifierDefinitionCache=new WeakMap,this.componentDefinitionCache=new WeakMap}}class cm{constructor(t){this.heap=t,this.offset=0}get size(){return 1+((768&this.heap.getbyaddr(this.offset))>>8)}get isMachine(){return this.heap.getbyaddr(this.offset)&si?1:0}get type(){return 255&this.heap.getbyaddr(this.offset)}get op1(){return this.heap.getbyaddr(this.offset+1)}get op2(){return this.heap.getbyaddr(this.offset+2)}get op3(){return this.heap.getbyaddr(this.offset+3)}}class hm{constructor(){this.offset=0,this.handle=0,this.heap=new Int32Array(1048576),this.handleTable=[],this.handleState=[]}entries(){return this.offset}pushRaw(t){this.sizeCheck(),this.heap[this.offset++]=t}pushOp(t){this.pushRaw(t)}pushMachine(t){this.pushRaw(t|si)}sizeCheck(){let{heap:t}=this;if(this.offset===this.heap.length){let e=new Int32Array(t.length+1048576);e.set(t,0),this.heap=e}}getbyaddr(t){return this.heap[t]}setbyaddr(t,e){this.heap[t]=e}malloc(){return this.handleTable.push(this.offset),this.handleTable.length-1}finishMalloc(t){}size(){return this.offset}getaddr(t){return this.handleTable[t]}sizeof(t){return this.handleTable,-1}free(t){this.handleState[t]=1}compact(){let t=0,{handleTable:e,handleState:n,heap:i}=this;for(let r=0;r<length;r++){let s=e[r],o=e[r+1]-s,a=n[r];if(2!==a)if(1===a)n[r]=2,t+=o;else if(0===a){for(let e=s;e<=r+o;e++)i[e-t]=i[e];e[r]=s-t}else 3===a&&(e[r]=s-t)}this.offset=this.offset-t}}class um{constructor(t,e){this.constants=t,this.heap=e,this._opcode=new cm(this.heap)}opcode(t){return this._opcode.offset=t,this._opcode}}const dm="http://www.w3.org/1998/Math/MathML",pm="http://www.w3.org/2000/svg";function fm(t){return function(t){t.nodeType}(t),t}function gm(t){if("number"==typeof t)return t;{let e=t.errors[0];throw new Error(`Compile Error: ${e.problem} @ ${e.span.start}..${e.span.end}`)}}function mm(t){if("error"===t.result)throw new Error(`Compile Error: ${t.problem} @ ${t.span.start}..${t.span.end}`);return t}function ym(t){return(t|=0)>-536870913?function(t){return~t}(t):function(t){return 536870912|t}(t)}[1,-1].forEach(t=>{return ym((e=t,(e|=0)<0?function(t){return-536870913&t}(e):function(t){return~t}(e)));var e});const vm=new class{constructor(){this.evaluateOpcode=new Array(113).fill(null)}add(t,e,n="syscall"){this.evaluateOpcode[t]={syscall:"machine"!==n,evaluate:e}}evaluate(t,e,n){let i=this.evaluateOpcode[n];i.syscall?(e.isMachine,i.syscall,e.isMachine,e.type,i.evaluate(t,e)):(e.isMachine,i.syscall,e.isMachine,e.type,i.evaluate(t.lowlevel,e))}},_m=Symbol("TYPE"),bm=Symbol("INNER"),wm=Symbol("OWNER"),xm=Symbol("ARGS"),Cm=Symbol("RESOLVED"),Sm=new WeakSet;function km(t){return Sm.has(t)}function Em(t,e){return km(t)&&t[_m]===e}class Tm{constructor(t,e,n,i,r=!1){Sm.add(this),this[_m]=t,this[bm]=e,this[wm]=n,this[xm]=i,this[Cm]=r}}function Lm(t){let e,n,i,r,s,o=t;for(;;){let{[xm]:t,[bm]:a}=o;if(null!==t){let{named:i,positional:r}=t;r.length>0&&(e=void 0===e?r:r.concat(e)),void 0===n&&(n=[]),n.unshift(i)}if(!km(a)){i=a,r=o[wm],s=o[Cm];break}o=a}return{definition:i,owner:r,resolved:s,positional:e,named:n}}function Mm(t,e,n,i,r=!1){return new Tm(t,e,n,i,r)}class Rm{constructor(t){this.bucket=t?Cn({},t):{}}get(t){return this.bucket[t]}set(t,e){return this.bucket[t]=e}child(){return new Rm(this.bucket)}}class Pm{static root(t,{self:e,size:n=0}){let i=new Array(n+1).fill(Rn);return new Pm(t,i,null).init({self:e})}static sized(t,e=0){let n=new Array(e+1).fill(Rn);return new Pm(t,n,null)}constructor(t,e,n){this.owner=t,this.slots=e,this.callerScope=n}init({self:t}){return this.slots[0]=t,this}snapshot(){return this.slots.slice()}getSelf(){return this.get(0)}getSymbol(t){return this.get(t)}getBlock(t){let e=this.get(t);return e===Rn?null:e}bind(t,e){this.set(t,e)}bindSelf(t){this.set(0,t)}bindSymbol(t,e){this.set(t,e)}bindBlock(t,e){this.set(t,e)}bindCallerScope(t){this.callerScope=t}getCallerScope(){return this.callerScope}child(){return new Pm(this.owner,this.slots.slice(),this.callerScope)}get(t){if(t>=this.slots.length)throw new RangeError(`BUG: cannot get $${t} from scope; length=${this.slots.length}`);return this.slots[t]}set(t,e){if(t>=this.slots.length)throw new RangeError(`BUG: cannot get $${t} from scope; length=${this.slots.length}`);this.slots[t]=e}}class Im{constructor(t,e){this.element=t,this.nextSibling=e}}class Om{constructor(t,e,n){this.parentNode=t,this.first=e,this.last=n}parentElement(){return this.parentNode}firstNode(){return this.first}lastNode(){return this.last}}function Am(t,e){let n=t.parentElement(),i=t.firstNode(),r=t.lastNode(),s=i;for(;;){let t=s.nextSibling;if(n.insertBefore(s,e),s===r)return t;s=t}}function zm(t){let e=t.parentElement(),n=t.firstNode(),i=t.lastNode(),r=n;for(;;){let t=r.nextSibling;if(e.removeChild(r),r===i)return t;r=t}}function Fm(t){return"getDebugCustomRenderTree"in t}let jm=0;class Dm{constructor(t){this.id=jm++,this.value=t}get(){return this.value}release(){this.value=null}toString(){let t=`Ref ${this.id}`;if(null===this.value)return`${t} (released)`;try{return`${t}: ${this.value}`}catch{return t}}}class Nm{begin(){this.reset()}create(t,e){let n=Cn({},e,{bounds:null,refs:new Set});this.nodes.set(t,n),this.appendChild(n,t),this.enter(t)}update(t){this.enter(t)}didRender(t,e){this.nodeFor(t).bounds=e,this.exit()}willDestroy(t){this.refs.get(t).release()}commit(){this.reset()}capture(){return this.captureRefs(this.roots)}reset(){if(0!==this.stack.size){let t=this.stack.toArray()[0],e=this.refs.get(t);for(void 0!==e&&this.roots.delete(e);!this.stack.isEmpty();)this.stack.pop()}}enter(t){this.stack.push(t)}exit(){this.stack.pop()}nodeFor(t){return this.nodes.get(t)}appendChild(t,e){let n=this.stack.current,i=new Dm(e);if(this.refs.set(e,i),n){let e=this.nodeFor(n);e.refs.add(i),t.parent=e}else this.roots.add(i)}captureRefs(t){let e=[];return t.forEach(n=>{let i=n.get();i?e.push(this.captureNode(`render-node:${n.id}`,i)):t.delete(n)}),e}captureNode(t,e){let n=this.nodeFor(e),{type:i,name:r,args:s,instance:o,refs:a}=n,l=this.captureTemplate(n),c=this.captureBounds(n),h=this.captureRefs(a);return{id:t,type:i,name:r,args:wy(s),instance:o,template:l,bounds:c,children:h}}captureTemplate({template:t}){return t||null}captureBounds(t){let e=t.bounds;return{parentElement:e.parentElement(),firstNode:e.firstNode(),lastNode:e.lastNode()}}constructor(){this.stack=new wn,this.refs=new WeakMap,this.roots=new Set,this.nodes=new WeakMap}}function Bm(t){return Um(t)?"":String(t)}function Um(t){return null==t||"function"!=typeof t.toString}function qm(t){return null!==t&&"object"==typeof t}function Vm(t){return qm(t)&&"function"==typeof t.toHTML}function $m(t){return"string"==typeof t}vm.add(39,t=>t.pushChildScope()),vm.add(40,t=>t.popScope()),vm.add(59,t=>t.pushDynamicScope()),vm.add(60,t=>t.popDynamicScope()),vm.add(28,(t,{op1:e})=>{t.stack.push(t.constants.getValue(e))}),vm.add(29,(t,{op1:e})=>{t.stack.push(An(t.constants.getValue(e)))}),vm.add(30,(t,{op1:e})=>{let n=t.stack;if(e>=0){let i=t.constants.getValue(e);n.push(i)}else n.push(ym(e))}),vm.add(31,t=>{let e,n=t.stack,i=n.pop();e=void 0===i?Rn:null===i?Pn:!0===i?In:!1===i?On:Mn(i),n.push(e)}),vm.add(33,(t,{op1:e,op2:n})=>{let i=t.fetchValue(e)-n;t.stack.dup(i)}),vm.add(34,(t,{op1:e})=>{t.stack.pop(e)}),vm.add(35,(t,{op1:e})=>{t.load(e)}),vm.add(36,(t,{op1:e})=>{t.fetch(e)}),vm.add(58,(t,{op1:e})=>{let n=t.constants.getArray(e);t.bindDynamicScope(n)}),vm.add(69,(t,{op1:e})=>{t.enter(e)}),vm.add(70,t=>{t.exit()}),vm.add(63,(t,{op1:e})=>{t.stack.push(t.constants.getValue(e))}),vm.add(62,t=>{t.stack.push(t.scope())}),vm.add(61,t=>{let e=t.stack,n=e.pop();n?e.push(t.compile(n)):e.push(null)}),vm.add(64,t=>{let{stack:e}=t,n=e.pop(),i=e.pop(),r=e.pop(),s=e.pop();if(null===r||null===n)return t.lowlevel.pushFrame(),void t.pushScope(i??t.scope());let o=i;{let t=r.parameters,e=t.length;if(e>0){o=o.child();for(let n=0;n<e;n++)o.bindSymbol(t[n],s.at(n))}}t.lowlevel.pushFrame(),t.pushScope(o),t.call(n)}),vm.add(65,(t,{op1:e})=>{let n=t.stack.pop(),i=Boolean(qn(n));Bn(n)?i&&t.lowlevel.goto(e):(i&&t.lowlevel.goto(e),t.updateWith(new Gm(n)))}),vm.add(66,(t,{op1:e})=>{let n=t.stack.pop(),i=Boolean(qn(n));Bn(n)?i||t.lowlevel.goto(e):(i||t.lowlevel.goto(e),t.updateWith(new Gm(n)))}),vm.add(67,(t,{op1:e,op2:n})=>{t.stack.peek()===n&&t.lowlevel.goto(e)}),vm.add(68,t=>{let e=t.stack.peek();Bn(e)||t.updateWith(new Gm(e))}),vm.add(71,t=>{let{stack:e}=t,n=e.pop();e.push(Fn(()=>It(qn(n))))});class Gm{constructor(t){this.ref=t,this.last=qn(t)}evaluate(t){let{last:e,ref:n}=this;e!==qn(n)&&t.throw()}}class Wm{constructor(t,e){this.ref=t,this.filter=e,this.last=e(qn(t))}evaluate(t){let{last:e,ref:n,filter:i}=this;e!==i(qn(n))&&t.throw()}}class Hm{finalize(t,e){this.target=e,this.didModify(t)}evaluate(t){let{tag:e,target:n,lastRevision:i}=this;!t.alwaysRevalidate&&de(e,i)&&(je(e),t.goto(n))}didModify(t){this.tag=t,this.lastRevision=ue(this.tag),je(t)}constructor(){this.tag=_e,this.lastRevision=1}}class Zm{constructor(t){this.debugLabel=t}evaluate(){Ie(this.debugLabel)}}class Km{constructor(t){this.target=t}evaluate(){let t=Oe();this.target.didModify(t)}}vm.add(41,(t,{op1:e})=>{t.tree().appendText(t.constants.getValue(e))}),vm.add(42,(t,{op1:e})=>{t.tree().appendComment(t.constants.getValue(e))}),vm.add(48,(t,{op1:e})=>{t.tree().openElement(t.constants.getValue(e))}),vm.add(49,t=>{let e=qn(t.stack.pop());t.tree().openElement(e)}),vm.add(50,t=>{let e=t.stack.pop(),n=t.stack.pop(),i=t.stack.pop(),r=qn(e),s=qn(n),o=qn(i);Bn(e)||t.updateWith(new Gm(e)),void 0===s||Bn(n)||t.updateWith(new Gm(n));let a=t.tree().pushRemoteElement(r,o,s);if(t.associateDestroyable(a),void 0!==t.env.debugRenderTree){let i=gy(void 0===s?{}:{insertBefore:n},[e]);t.env.debugRenderTree.create(a,{type:"keyword",name:"in-element",args:i,instance:null}),Wt(a,()=>{t.env.debugRenderTree?.willDestroy(a)})}}),vm.add(56,t=>{let e=t.tree().popRemoteElement();void 0!==t.env.debugRenderTree&&t.env.debugRenderTree.didRender(e,e)}),vm.add(54,t=>{let e=t.fetchValue(6),n=null;e&&(n=e.flush(t),t.loadValue(6,null)),t.tree().flushElement(n)}),vm.add(55,t=>{let e=t.tree().closeElement();null!==e&&e.forEach(e=>{t.env.scheduleInstallModifier(e);const n=e.manager.getDestroyable(e.state);null!==n&&t.associateDestroyable(n)})}),vm.add(57,(t,{op1:e})=>{if(!t.env.isInteractive)return;let n=t.getOwner(),i=t.stack.pop(),r=t.constants.getValue(e),{manager:s}=r,{constructing:o}=t.tree(),a=i.capture(),l=s.create(n,o,r.state,a),c={manager:s,state:l,definition:r};t.fetchValue(6).addModifier(t,c,a);let h=s.getTag(l);return null!==h?(je(h),t.updateWith(new Ym(h,c))):void 0}),vm.add(108,t=>{if(!t.env.isInteractive)return;let{stack:e}=t,n=e.pop(),i=e.pop().capture(),{positional:r,named:s}=i,{constructing:o}=t.tree(),a=t.getOwner(),l=Fn(()=>{let t,e,l=qn(n);if(!bn(l))return;if(Em(l,2)){let{definition:n,owner:o,positional:a,named:c}=Lm(l);e=n,t=o,void 0!==a&&(i.positional=a.concat(r)),void 0!==c&&(i.named=Object.assign({},...c,s))}else e=l,t=a;let c=Ri(e);if(null===c)throw new Error("BUG: modifier manager expected");let h={resolvedName:null,manager:c,state:e},u=c.create(t,o,h.state,i);return{manager:c,state:u,definition:h}}),c=qn(l),h=null;return void 0!==c&&(t.fetchValue(6).addModifier(t,c,i),h=c.manager.getTag(c.state),null!==h&&je(h)),!Bn(n)||h?t.updateWith(new Xm(h,c,l)):void 0});class Ym{constructor(t,e){this.tag=t,this.modifier=e,this.lastUpdated=ue(t)}evaluate(t){let{modifier:e,tag:n,lastUpdated:i}=this;je(n),de(n,i)||(t.env.scheduleUpdateModifier(e),this.lastUpdated=ue(n))}}class Xm{constructor(t,e,n){this.tag=t,this.instance=e,this.instanceRef=n,this.lastUpdated=ue(t??Se)}evaluate(t){let{tag:e,lastUpdated:n,instance:i,instanceRef:r}=this,s=qn(r);if(s!==i){if(void 0!==i){let t=i.manager.getDestroyable(i.state);null!==t&&Ht(t)}if(void 0!==s){let{manager:n,state:i}=s,r=n.getDestroyable(i);null!==r&&Gt(this,r),e=n.getTag(i),null!==e&&(this.lastUpdated=ue(e)),this.tag=e,t.env.scheduleInstallModifier(s)}this.instance=s}else null===e||de(e,n)||(t.env.scheduleUpdateModifier(i),this.lastUpdated=ue(e));null!==e&&je(e)}}vm.add(51,(t,{op1:e,op2:n,op3:i})=>{let r=t.constants.getValue(e),s=t.constants.getValue(n),o=i?t.constants.getValue(i):null;t.tree().setStaticAttribute(r,s,o)}),vm.add(52,(t,{op1:e,op2:n,op3:i})=>{let r=t.constants.getValue(e),s=t.constants.getValue(n),o=t.stack.pop(),a=qn(o),l=i?t.constants.getValue(i):null,c=t.tree().setDynamicAttribute(r,a,s,l);Bn(o)||t.updateWith(new Jm(o,c,t.env))});class Jm{constructor(t,e,n){let i=!1;this.updateRef=Fn(()=>{let r=qn(t);i?e.update(r,n):i=!0}),qn(this.updateRef)}evaluate(){qn(this.updateRef)}}vm.add(78,(t,{op1:e})=>{let n=t.constants.getValue(e),{manager:i,capabilities:r}=n,s={definition:n,manager:i,capabilities:r,state:null,handle:null,table:null,lookup:null};t.stack.push(s)}),vm.add(80,(t,{op1:e})=>{let n,i=t.stack,r=qn(i.pop()),s=t.constants,o=t.getOwner();if(s.getValue(e),t.loadValue(7,null),"string"==typeof r){let e=function(t,e,n,i){let r=t?.lookupComponent?.(n,i)??null;return e.resolvedComponent(r,n)}(t.context.resolver,s,r,o);n=e}else n=km(r)?r:s.component(r,o);i.push(n)}),vm.add(81,t=>{let e,n=t.stack,i=qn(n.pop()),r=t.constants;e=km(i)?i:r.component(i,t.getOwner(),!0),n.push(e)}),vm.add(79,t=>{let e,n,{stack:i}=t,r=i.pop();km(r)?n=e=null:(n=r.manager,e=r.capabilities),i.push({definition:r,capabilities:e,manager:n,state:null,handle:null,table:null})}),vm.add(82,(t,{op1:e,op2:n,op3:i})=>{let r=t.stack,s=t.constants.getArray(e),o=i>>4,a=8&i,l=7&i?t.constants.getArray(n):dn;t.args.setup(r,s,l,o,!!a),r.push(t.args)}),vm.add(83,t=>{let{stack:e}=t;e.push(t.args.empty(e))}),vm.add(86,t=>{let e=t.stack,n=e.pop().capture();e.push(n)}),vm.add(85,(t,{op1:e})=>{let n=t.stack,i=t.fetchValue(e),r=n.pop(),{definition:s}=i;if(Em(s,0)){s.manager;let e=t.constants,{definition:n,owner:o,resolved:a,positional:l,named:c}=Lm(s);if(a)s=n;else if("string"==typeof n){let i=t.context.resolver?.lookupComponent?.(n,o)??null;s=e.resolvedComponent(i,n)}else s=e.component(n,o);void 0!==c&&r.named.merge(Cn({},...c)),void 0!==l&&(r.realloc(l.length),r.positional.prepend(l));let{manager:h}=s;i.definition=s,i.manager=h,i.capabilities=s.capabilities,t.loadValue(7,o)}let{manager:o,state:a}=s;if(!mi(0,i.capabilities,ri.prepareArgs))return void n.push(r);let l=r.blocks.values,c=r.blocks.names,h=o.prepareArgs(a,r);if(h){r.clear();for(let r=0;r<l.length;r++)n.push(l[r]);let{positional:t,named:e}=h,i=t.length;for(let r=0;r<i;r++)n.push(t[r]);let s=Object.keys(e);for(let r=0;r<s.length;r++)n.push(e[s[r]]);r.setup(n,s,c,i,!1)}n.push(r)}),vm.add(87,(t,{op1:e})=>{let n=t.fetchValue(4),{definition:i,manager:r,capabilities:s}=n;if(!mi(0,s,ri.createInstance))return;let o=null;mi(0,s,ri.dynamicScope)&&(o=t.dynamicScope());let a=1&e,l=null;mi(0,s,ri.createArgs)&&(l=t.stack.peek());let c=null;mi(0,s,ri.createCaller)&&(c=t.getSelf());let h=r.create(t.getOwner(),i.state,l,t.env,o,c,!!a);n.state=h,mi(0,s,ri.updateHook)&&t.updateWith(new iy(h,r,o))}),vm.add(88,(t,{op1:e})=>{let{manager:n,state:i,capabilities:r}=t.fetchValue(e),s=n.getDestroyable(i);s&&t.associateDestroyable(s)}),vm.add(97,(t,{op1:e})=>{t.beginCacheGroup(void 0),t.tree().pushAppendingBlock()}),vm.add(89,t=>{t.loadValue(6,new Qm)}),vm.add(53,(t,{op1:e,op2:n,op3:i})=>{let r=t.constants.getValue(e),s=t.constants.getValue(n),o=t.stack.pop(),a=i?t.constants.getValue(i):null;t.fetchValue(6).setAttribute(r,o,s,a)}),vm.add(105,(t,{op1:e,op2:n,op3:i})=>{let r=t.constants.getValue(e),s=t.constants.getValue(n),o=i?t.constants.getValue(i):null;t.fetchValue(6).setStaticAttribute(r,s,o)});class Qm{setAttribute(t,e,n,i){let r={value:e,namespace:i,trusting:n};"class"===t&&this.classes.push(e),this.attributes[t]=r}setStaticAttribute(t,e,n){let i={value:e,namespace:n};"class"===t&&this.classes.push(e),this.attributes[t]=i}addModifier(t,e,n){if(this.modifiers.push(e),void 0!==t.env.debugRenderTree){const{manager:i,definition:r,state:s}=e;if(null===s||"object"!=typeof s&&"function"!=typeof s)return;let{element:o,constructing:a}=t.tree(),l=r.resolvedName??i.getDebugName(r.state),c=i.getDebugInstance(s),h=new Om(o,a,a);t.env.debugRenderTree.create(s,{type:"modifier",name:l,args:n,instance:c}),t.env.debugRenderTree.didRender(s,h),t.associateDestroyable(s),t.updateWith(new sy(s)),t.updateWith(new oy(s,h)),Wt(s,()=>{t.env.debugRenderTree?.willDestroy(s)})}}flush(t){let e,n=this.attributes;for(let i in this.attributes){if("type"===i){e=n[i];continue}let r=this.attributes[i];"class"===i?ey(t,"class",ty(this.classes),r.namespace,r.trusting):ey(t,i,r.value,r.namespace,r.trusting)}return void 0!==e&&ey(t,"type",e.value,e.namespace,e.trusting),this.modifiers}constructor(){this.attributes=vn(),this.classes=[],this.modifiers=[]}}function ty(t){return 0===t.length?"":1===t.length?t[0]:function(t){return t.every(t=>"string"==typeof t)}(t)?t.join(" "):(e=t,Fn(()=>{let t=[];for(const n of e){let e=Bm("string"==typeof n?n:qn(n));e&&t.push(e)}return 0===t.length?null:t.join(" ")}));var e}function ey(t,e,n,i,r=!1){if("string"==typeof n)t.tree().setStaticAttribute(e,n,i);else{let s=t.tree().setDynamicAttribute(e,qn(n),r,i);Bn(n)||t.updateWith(new Jm(n,s,t.env))}}function ny(t,e,n,i,r){let s=n.table.symbols.indexOf(t),o=i.get(e);-1!==s&&r.scope().bindBlock(s+1,o),n.lookup&&(n.lookup[t]=o)}vm.add(99,(t,{op1:e})=>{let{definition:n,state:i}=t.fetchValue(e),{manager:r}=n,s=t.fetchValue(6);r.didCreateElement(i,t.tree().constructing,s)}),vm.add(90,(t,{op1:e,op2:n})=>{let i=t.fetchValue(e),{definition:r,state:s}=i,{manager:o}=r,a=o.getSelf(s);if(void 0!==t.env.debugRenderTree){let i,r,o=t.fetchValue(e),{definition:l,manager:c}=o;if(t.stack.peek()===t.args)i=t.args.capture();else{let e=t.constants.getArray(n);t.args.setup(t.stack,e,[],0,!0),i=t.args.capture()}let h=l.compilable;if(null===h){mi(0,o.capabilities,ri.dynamicLayout);let e=t.context.resolver;h=null===e?null:c.getDynamicLayout(s,e),r=null!==h?h.moduleName:"__default__.hbs"}else r=h.moduleName;if(t.associateDestroyable(o),Fm(c))c.getDebugCustomRenderTree(o.definition.state,o.state,i,r).forEach(e=>{let{bucket:n}=e;t.env.debugRenderTree.create(n,e),Wt(o,()=>{t.env.debugRenderTree?.willDestroy(n)}),t.updateWith(new sy(n))});else{let e=function(t,e=t.manager){return t.resolvedName??t.debugName??e.getDebugName(t.state)}(l,c);t.env.debugRenderTree.create(o,{type:"component",name:e,args:i,template:r,instance:qn(a)}),Wt(o,()=>{t.env.debugRenderTree?.willDestroy(o)}),t.updateWith(new sy(o))}}t.stack.push(a)}),vm.add(91,(t,{op1:e})=>{let{definition:n,state:i}=t.fetchValue(e),{manager:r}=n,s=r.getTagName(i);t.stack.push(s)}),vm.add(92,(t,{op1:e})=>{let n=t.fetchValue(e),{manager:i,definition:r}=n,{stack:s}=t,{compilable:o}=r;if(null===o){let{capabilities:e}=n,r=t.context.resolver;o=null===r?null:i.getDynamicLayout(n.state,r),null===o&&(o=mi(0,e,ri.wrapped)?mm(t.constants.defaultTemplate).asWrappedLayout():mm(t.constants.defaultTemplate).asLayout())}let a=o.compile(t.context);s.push(o.symbolTable),s.push(a)}),vm.add(75,(t,{op1:e})=>{let n=t.stack.pop(),i=t.stack.pop(),{manager:r,capabilities:s}=n,o={definition:n,manager:r,capabilities:s,state:null,handle:i.handle,table:i.symbolTable,lookup:null};t.loadValue(e,o)}),vm.add(95,(t,{op1:e})=>{let{stack:n}=t,i=n.pop(),r=n.pop(),s=t.fetchValue(e);s.handle=i,s.table=r}),vm.add(38,(t,{op1:e})=>{let n,{table:i,manager:r,capabilities:s,state:o}=t.fetchValue(e);mi(0,s,ri.hasSubOwner)?(n=r.getOwner(o),t.loadValue(7,null)):(n=t.fetchValue(7),null===n?n=t.getOwner():t.loadValue(7,null)),t.pushRootScope(i.symbols.length+1,n)}),vm.add(17,(t,{op1:e})=>{let n=t.fetchValue(e),i=t.scope(),r=t.stack.peek(),s=r.named.atNames;for(let o=s.length-1;o>=0;o--){let t=s[o],e=n.table.symbols.indexOf(t),a=r.named.get(t,!0);-1!==e&&i.bindSymbol(e+1,a),n.lookup&&(n.lookup[t]=a)}}),vm.add(18,(t,{op1:e})=>{let n=t.fetchValue(e),{blocks:i}=t.stack.peek();for(const[r]of gn(i.names))ny(i.symbolNames[r],i.names[r],n,i,t)}),vm.add(96,(t,{op1:e})=>{let n=t.fetchValue(e);t.call(n.handle)}),vm.add(100,(t,{op1:e})=>{let n=t.fetchValue(e),{manager:i,state:r,capabilities:s}=n,o=t.tree().popBlock();void 0!==t.env.debugRenderTree&&(Fm(i)?i.getDebugCustomRenderTree(n.definition.state,r,Sy).reverse().forEach(e=>{let{bucket:n}=e;t.env.debugRenderTree.didRender(n,o),t.updateWith(new oy(n,o))}):(t.env.debugRenderTree.didRender(n,o),t.updateWith(new oy(n,o)))),mi(0,s,ri.createInstance)&&(i.didRenderLayout(r,o),t.env.didCreate(n),t.updateWith(new ry(n,o)))}),vm.add(98,t=>{t.commitCacheGroup()});class iy{constructor(t,e,n){this.component=t,this.manager=e,this.dynamicScope=n}evaluate(t){let{component:e,manager:n,dynamicScope:i}=this;n.update(e,i)}}class ry{constructor(t,e){this.component=t,this.bounds=e}evaluate(t){let{component:e,bounds:n}=this,{manager:i,state:r}=e;i.didUpdateLayout(r,n),t.env.didUpdate(e)}}class sy{constructor(t){this.bucket=t}evaluate(t){t.env.debugRenderTree?.update(this.bucket)}}class oy{constructor(t,e){this.bucket=t,this.bounds=e}evaluate(t){t.env.debugRenderTree?.didRender(this.bucket,this.bounds)}}class ay{constructor(){this.stack=null,this.positional=new cy,this.named=new hy,this.blocks=new py}empty(t){let e=t.registers[3]+1;return this.named.empty(t,e),this.positional.empty(t,e),this.blocks.empty(t,e),this}setup(t,e,n,i,r){this.stack=t;let s=this.named,o=e.length,a=t.registers[3]-o+1;s.setup(t,a,o,e,r);let l=a-i;this.positional.setup(t,l,i);let c=this.blocks,h=n.length,u=l-3*h;c.setup(t,u,h,n)}get base(){return this.blocks.base}get length(){return this.positional.length+this.named.length+3*this.blocks.length}at(t){return this.positional.at(t)}realloc(t){let{stack:e}=this;if(t>0&&null!==e){let{positional:n,named:i}=this,r=n.base+t;for(let t=n.length+i.length-1;t>=0;t--)e.copy(t+n.base,t+r);n.base+=t,i.base+=t,e.registers[3]+=t}}capture(){let t=0===this.positional.length?Cy:this.positional.capture();return{named:0===this.named.length?xy:this.named.capture(),positional:t}}clear(){let{stack:t,length:e}=this;e>0&&null!==t&&t.pop(e)}}const ly=un();class cy{constructor(){this.base=0,this.length=0,this.stack=null,this._references=null}empty(t,e){this.stack=t,this.base=e,this.length=0,this._references=ly}setup(t,e,n){this.stack=t,this.base=e,this.length=n,this._references=0===n?ly:null}at(t){let{base:e,length:n,stack:i}=this;return t<0||t>=n?Rn:i.get(t,e)}capture(){return this.references}prepend(t){let e=t.length;if(e>0){let{base:n,length:i,stack:r}=this;this.base=n-=e,this.length=i+e;for(let s=0;s<e;s++)r.set(t[s],s,n);this._references=null}}get references(){let t=this._references;if(!t){let{stack:e,base:n,length:i}=this;t=this._references=e.slice(n,n+i)}return t}}class hy{constructor(){this.base=0,this.length=0,this._references=null,this._names=dn,this._atNames=dn}empty(t,e){this.stack=t,this.base=e,this.length=0,this._references=ly,this._names=dn,this._atNames=dn}setup(t,e,n,i,r){this.stack=t,this.base=e,this.length=n,0===n?(this._references=ly,this._names=dn,this._atNames=dn):(this._references=null,r?(this._names=null,this._atNames=i):(this._names=i,this._atNames=null))}get names(){let t=this._names;return t||(t=this._names=this._atNames.map(this.toSyntheticName)),t}get atNames(){let t=this._atNames;return t||(t=this._atNames=this._names.map(this.toAtName)),t}has(t){return-1!==this.names.indexOf(t)}get(t,e=!1){let{base:n,stack:i}=this,r=(e?this.atNames:this.names).indexOf(t);return-1===r?Rn:i.get(r,n)}capture(){let{names:t,references:e}=this,n=vn();for(const[i,r]of gn(t))n[r]=e[i];return n}merge(t){let e=Object.keys(t);if(e.length>0){let{names:n,length:i,stack:r}=this,s=n.slice();for(const o of e)-1===s.indexOf(o)&&(i=s.push(o),r.push(t[o]));this.length=i,this._references=null,this._names=s,this._atNames=null}}get references(){let t=this._references;if(!t){let{base:e,length:n,stack:i}=this;t=this._references=i.slice(e,e+n)}return t}toSyntheticName(t){return t.slice(1)}toAtName(t){return`@${t}`}}function uy(t){return`&${t}`}const dy=un();class py{constructor(){this.internalValues=null,this._symbolNames=null,this.internalTag=null,this.names=dn,this.length=0,this.base=0}empty(t,e){this.stack=t,this.names=dn,this.base=e,this.length=0,this._symbolNames=null,this.internalTag=_e,this.internalValues=dy}setup(t,e,n,i){this.stack=t,this.names=i,this.base=e,this.length=n,this._symbolNames=null,0===n?(this.internalTag=_e,this.internalValues=dy):(this.internalTag=null,this.internalValues=null)}get values(){let t=this.internalValues;if(!t){let{base:e,length:n,stack:i}=this;t=this.internalValues=i.slice(e,e+3*n)}return t}has(t){return-1!==this.names.indexOf(t)}get(t){let e=this.names.indexOf(t);if(-1===e)return null;let{base:n,stack:i}=this,r=i.get(3*e,n),s=i.get(3*e+1,n),o=i.get(3*e+2,n);return null===o?null:[o,s,r]}capture(){return new fy(this.names,this.values)}get symbolNames(){let t=this._symbolNames;return null===t&&(t=this._symbolNames=this.names.map(uy)),t}}class fy{constructor(t,e){this.names=t,this.values=e,this.length=t.length}has(t){return-1!==this.names.indexOf(t)}get(t){let e=this.names.indexOf(t);return-1===e?null:[this.values[3*e+2],this.values[3*e+1],this.values[3*e]]}}function gy(t,e){return{named:t,positional:e}}function my(t){let e=vn();for(const[n,i]of Object.entries(t))e[n]=qn(i);return e}function yy(t){return t.map(qn)}const vy=Symbol("ARGUMENT_ERROR");function _y(t){return null!==t&&"object"==typeof t&&t[vy]}function by(t){return{[vy]:!0,error:t}}function wy(t){return{named:function(t){let e=vn();for(const[i,r]of Object.entries(t))try{e[i]=qn(r)}catch(n){e[i]=by(n)}return e}(t.named),positional:(e=t.positional,e.map(t=>{try{return qn(t)}catch(e){return by(e)}}))};var e}const xy=Object.freeze(Object.create(null)),Cy=ly,Sy=gy(xy,Cy);function ky(t){return"string"==typeof t?t:"function"!=typeof t.toString?"":String(t)}function Ey(t){let e,n=Oi(t);return e=null===n?null:"function"==typeof n?n:n.getHelper(t),e}function Ty(t){return t===Rn}vm.add(77,(t,{op1:e,op2:n})=>{let i=t.stack,r=i.pop(),s=i.pop(),o=t.getOwner();t.context.resolver,t.loadValue(8,function(t,e,n,i){let r,s;return Fn(()=>{let o=qn(e);return o===r||(s=Em(o,t)?i?Mm(t,o,n,i):i:0===t&&"string"==typeof o&&o||bn(o)?Mm(t,o,n,i):null,r=o),s})}(e,r,o,s))}),vm.add(107,t=>{let e,n=t.stack,i=n.pop(),r=n.pop().capture(),s=t.getOwner(),o=Fn(()=>{void 0!==e&&Ht(e);let t=qn(i);if(Em(t,1)){let{definition:n,owner:i,positional:s,named:a}=Lm(t),l=Ey(n);void 0!==a&&(r.named=Cn({},...a,r.named)),void 0!==s&&(r.positional=s.concat(r.positional)),e=l(r,i),Gt(o,e)}else if(bn(t)){let n=Ey(t);e=n(r,s),Zt(e)&&Gt(o,e)}else e=Rn}),a=Fn(()=>(qn(o),qn(e)));t.associateDestroyable(o),t.loadValue(8,a)}),vm.add(16,(t,{op1:e})=>{let n=t.stack,i=t.constants.getValue(e)(n.pop().capture(),t.getOwner(),t.dynamicScope());Zt(i)&&t.associateDestroyable(i),t.loadValue(8,i)}),vm.add(21,(t,{op1:e})=>{let n=t.referenceForSymbol(e);t.stack.push(n)}),vm.add(19,(t,{op1:e})=>{let n=t.stack.pop();t.scope().bindSymbol(e,n)}),vm.add(20,(t,{op1:e})=>{let n=t.stack.pop(),i=t.stack.pop(),r=t.stack.pop();t.scope().bindBlock(e,[n,i,r])}),vm.add(37,(t,{op1:e})=>{t.pushRootScope(e,t.getOwner())}),vm.add(22,(t,{op1:e})=>{let n=t.constants.getValue(e),i=t.stack.pop();t.stack.push($n(i,n))}),vm.add(23,(t,{op1:e})=>{let{stack:n}=t,i=t.scope().getBlock(e);n.push(i)}),vm.add(24,t=>{let{stack:e}=t,n=e.pop();if(n&&!Ty(n)){let[t,i,r]=n;e.push(r),e.push(i),e.push(t)}else e.push(null),e.push(null),e.push(null)}),vm.add(25,t=>{let{stack:e}=t,n=e.pop();n&&!Ty(n)?e.push(In):e.push(On)}),vm.add(26,t=>{t.stack.pop(),t.stack.pop();let e=t.stack.pop(),n=e&&e.parameters.length;t.stack.push(n?In:On)}),vm.add(27,(t,{op1:e})=>{let n=new Array(e);for(let r=e;r>0;r--)n[r-1]=t.stack.pop();var i;t.stack.push((i=n,Fn(()=>{const t=[];for(const e of i){const n=qn(e);null!=n&&t.push(ky(n))}return t.length>0?t.join(""):null})))}),vm.add(109,t=>{let e=t.stack.pop(),n=t.stack.pop(),i=t.stack.pop();t.stack.push(Fn(()=>It(qn(e))?qn(n):qn(i)))}),vm.add(110,t=>{let e=t.stack.pop();t.stack.push(Fn(()=>!It(qn(e))))}),vm.add(111,t=>{let e=t.dynamicScope(),n=t.stack,i=n.pop();n.push(Fn(()=>{let t=String(qn(i));return qn(e.get(t))}))}),vm.add(112,t=>{let{positional:e}=t.stack.pop().capture();t.loadValue(8,Fn(()=>{console.log(...yy(e))}))});class Ly{constructor(t,e,n){this.node=t,this.reference=e,this.lastValue=n}evaluate(){let t,e=qn(this.reference),{lastValue:n}=this;e!==n&&(t=Um(e)?"":$m(e)?e:String(e),t!==n)&&(this.node.nodeValue=this.lastValue=t)}}function My(t){return function(t){return $m(t)||Um(t)||"boolean"==typeof t||"number"==typeof t}(t)?2:Em(t,0)||Fi(t)?0:Em(t,1)||ji(t)?1:Vm(t)?4:function(t){return qm(t)&&11===t.nodeType}(t)?5:function(t){return qm(t)&&"number"==typeof t.nodeType}(t)?6:2}function Ry(t){return bn(t)?Em(t,0)||Fi(t)?0:1:2}function Py(t,e){console.info("Use `context`, and `get(<path>)` to debug this template."),e("this")}vm.add(76,t=>{let e=t.stack.peek();t.stack.push(My(qn(e))),Bn(e)||t.updateWith(new Wm(e,My))}),vm.add(106,t=>{let e=t.stack.peek();t.stack.push(Ry(qn(e))),Bn(e)||t.updateWith(new Wm(e,Ry))}),vm.add(43,t=>{let e=qn(t.stack.pop()),n=Um(e)?"":String(e);t.tree().appendDynamicHTML(n)}),vm.add(44,t=>{let e=qn(t.stack.pop()).toHTML(),n=Um(e)?"":e;t.tree().appendDynamicHTML(n)}),vm.add(47,t=>{let e=t.stack.pop(),n=qn(e),i=Um(n)?"":String(n),r=t.tree().appendDynamicText(i);Bn(e)||t.updateWith(new Ly(r,e,i))}),vm.add(45,t=>{let e=qn(t.stack.pop());t.tree().appendDynamicFragment(e)}),vm.add(46,t=>{let e=qn(t.stack.pop());t.tree().appendDynamicNode(e)});let Iy=Py;class Oy{#f;constructor(t,e){this.scope=t,this.#f=e}get(t){let e,{scope:n}=this,i=this.#f,r=t.split("."),[s,...o]=t.split(".");return"this"===s?e=n.getSelf():i.locals[s]?e=n.getSymbol(i.locals[s]):(e=this.scope.getSelf(),o=r),o.reduce((t,e)=>$n(t,e),e)}}vm.add(103,(t,{op1:e})=>{let n=t.constants.getValue(e),i=new Oy(t.scope(),n);Iy(qn(t.getSelf()),t=>qn(i.get(t)))}),vm.add(72,(t,{op1:e,op2:n})=>{let i=t.stack,r=i.pop(),s=qn(i.pop()),o=Qn(r,null===s?"@identity":String(s)),a=qn(o);t.updateWith(new Wm(o,t=>t.isEmpty())),a.isEmpty()?t.lowlevel.goto(n+1):(t.enterList(o,e),t.stack.push(a))}),vm.add(73,t=>{t.exitList()}),vm.add(74,(t,{op1:e})=>{let n=t.stack.peek().next();null!==n?t.registerItem(t.enterItem(n)):t.lowlevel.goto(e)});const Ay={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!1,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!1,updateHook:!1,createInstance:!1,wrapped:!1,willDestroy:!1,hasSubOwner:!1};class zy{getCapabilities(){return Ay}getDebugName({name:t}){return t}getSelf(){return Pn}getDestroyable(){return null}}const Fy=new zy;class jy{constructor(t="@glimmer/component/template-only",e="(unknown template-only component)"){this.moduleName=t,this.name=e}toString(){return this.moduleName}}function Dy(t,e){return new jy(t,e)}Ai(Fy,jy.prototype);const Ny={foreignObject:1,desc:1,title:1},By=Object.create(null);class Uy{constructor(t){this.document=t,this.setupUselessElement()}setupUselessElement(){this.uselessElement=this.document.createElement("div")}createElement(t,e){let n,i,r,s;if(e?(n=e.namespaceURI===pm||"svg"===t,r=e.namespaceURI===dm||"math"===t,i=!!Ny[e.tagName]):(n="svg"===t,r="math"===t,i=!1),!r&&!n||i)return this.document.createElement(t);if(By[t])throw new Error(`Cannot create a ${t} inside an SVG context`);return s=r?dm:pm,this.document.createElementNS(s,t)}insertBefore(t,e,n){t.insertBefore(e,n)}insertHTMLBefore(t,e,n){if(""===n){const n=this.createComment("");return t.insertBefore(n,e),new Om(t,n,n)}const i=e?e.previousSibling:t.lastChild;let r;if(null===e)t.insertAdjacentHTML("beforeend",n),r=t.lastChild;else if(e instanceof HTMLElement)e.insertAdjacentHTML("beforebegin",n),r=e.previousSibling;else{const{uselessElement:i}=this;t.insertBefore(i,e),i.insertAdjacentHTML("beforebegin",n),r=i.previousSibling,t.removeChild(i)}const s=i?i.nextSibling:t.firstChild;return new Om(t,s,r)}createTextNode(t){return this.document.createTextNode(t)}createComment(t){return this.document.createComment(t)}}function qy(t,e,n){if(!t)return e;if(!function(t,e){const n=t.createElementNS(e,"svg");try{n.insertAdjacentHTML("beforeend","<circle></circle>")}catch{}finally{return 1!==n.childNodes.length||n.firstChild.namespaceURI!==pm}}(t,n))return e;const i=t.createElement("div");return class extends e{insertHTMLBefore(t,e,r){return""===r||t.namespaceURI!==n?super.insertHTMLBefore(t,e,r):function(t,e,n,i){let r;if("FOREIGNOBJECT"===t.tagName.toUpperCase()){const t="<svg><foreignObject>"+n+"</foreignObject></svg>";xn(e),e.insertAdjacentHTML("afterbegin",t),r=e.firstChild.firstChild}else{const t="<svg>"+n+"</svg>";xn(e),e.insertAdjacentHTML("afterbegin",t),r=e.firstChild}return function(t,e,n){const i=t.firstChild;let r=i,s=i;for(;s;){const t=s.nextSibling;e.insertBefore(s,n),r=s,s=t}return new Om(e,i,r)}(r,t,i)}(t,i,r,e)}}}function Vy(t,e){return t&&function(t){const e=t.createElement("div");return e.appendChild(t.createTextNode("first")),e.insertAdjacentHTML("beforeend","second"),2!==e.childNodes.length}(t)?class extends e{constructor(t){super(t),this.uselessComment=t.createComment("")}insertHTMLBefore(t,e,n){if(""===n)return super.insertHTMLBefore(t,e,n);let i=!1;const r=e?e.previousSibling:t.lastChild;r&&r instanceof Text&&(i=!0,t.insertBefore(this.uselessComment,e));const s=super.insertHTMLBefore(t,e,n);return i&&t.removeChild(this.uselessComment),s}}:e}const $y="undefined"==typeof document?null:fm(document);let Gy=class extends Uy{createElementNS(t,e){return this.document.createElementNS(t,e)}setAttribute(t,e,n,i=null){i?t.setAttributeNS(i,e,n):t.setAttribute(e,n)}};Gy=Vy($y,Gy),Gy=qy($y,Gy,pm);const Wy=Gy;["b","big","blockquote","body","br","center","code","dd","div","dl","dt","em","embed","h1","h2","h3","h4","h5","h6","head","hr","i","img","li","listing","main","meta","nobr","ol","p","pre","ruby","s","small","span","strong","strike","sub","sup","table","tt","u","ul","var"].forEach(t=>By[t]=1);const Hy=/[\t\n\v\f\r \xa0\u{1680}\u{180e}\u{2000}-\u{200a}\u{2028}\u{2029}\u{202f}\u{205f}\u{3000}\u{feff}]/u,Zy="undefined"==typeof document?null:fm(document);class Ky extends Uy{constructor(t){super(t),this.document=t,this.namespace=null}setAttribute(t,e,n){t.setAttribute(e,n)}removeAttribute(t,e){t.removeAttribute(e)}insertAfter(t,e,n){this.insertBefore(t,e,n.nextSibling)}}let Yy=Ky;Yy=Vy(Zy,Yy),Yy=qy(Zy,Yy,pm);const Xy=Yy;function Jy(t,e){let n,i;if(e in t)i=e,n="prop";else{let r=e.toLowerCase();r in t?(n="prop",i=r):(n="attr",i=e)}return"prop"!==n||"style"!==i.toLowerCase()&&!function(t,e){let n=Qy[t.toUpperCase()];return!(!n||!n[e.toLowerCase()])}(t.tagName,i)||(n="attr"),{normalized:i,type:n}}const Qy={INPUT:{form:!0,autocorrect:!0,list:!0},SELECT:{form:!0},OPTION:{form:!0},TEXTAREA:{form:!0},LABEL:{form:!0},FIELDSET:{form:!0},LEGEND:{form:!0},OBJECT:{form:!0},OUTPUT:{form:!0},BUTTON:{form:!0}},tv=Symbol("TRANSACTION");class ev{didCreate(t){this.createdComponents.push(t)}didUpdate(t){this.updatedComponents.push(t)}scheduleInstallModifier(t){this.scheduledInstallModifiers.push(t)}scheduleUpdateModifier(t){this.scheduledUpdateModifiers.push(t)}commit(){let{createdComponents:t,updatedComponents:e}=this;for(const{manager:r,state:s}of t)r.didCreate(s);for(const{manager:r,state:s}of e)r.didUpdate(s);let{scheduledInstallModifiers:n,scheduledUpdateModifiers:i}=this;for(const{manager:r,state:s,definition:o}of n){let t=r.getTag(s);if(null!==t){let e=Ge(()=>r.install(s));me(t,e)}else r.install(s)}for(const{manager:r,state:s,definition:o}of i){let t=r.getTag(s);if(null!==t){let e=Ge(()=>r.update(s));me(t,e)}else r.update(s)}}constructor(){this.scheduledInstallModifiers=[],this.scheduledUpdateModifiers=[],this.createdComponents=[],this.updatedComponents=[]}}class nv{static{sv=tv}constructor(t,e){this.delegate=e,this[sv]=null,this.isInteractive=e.isInteractive,this.debugRenderTree=this.delegate.enableDebugTooling?new Nm:void 0,this.isArgumentCaptureError=this.delegate.enableDebugTooling?_y:void 0,t.appendOperations?(this.appendOperations=t.appendOperations,this.updateOperations=t.updateOperations):t.document&&(this.appendOperations=new Wy(t.document),this.updateOperations=new Ky(t.document))}getAppendOperations(){return this.appendOperations}getDOM(){return this.updateOperations}begin(){this[tv],this.debugRenderTree?.begin(),this[tv]=new ev}get transaction(){return this[tv]}didCreate(t){this.transaction.didCreate(t)}didUpdate(t){this.transaction.didUpdate(t)}scheduleInstallModifier(t){this.isInteractive&&this.transaction.scheduleInstallModifier(t)}scheduleUpdateModifier(t){this.isInteractive&&this.transaction.scheduleUpdateModifier(t)}commit(){let t=this.transaction;this[tv]=null,t.commit(),this.debugRenderTree?.commit(),this.delegate.onTransactionCommit()}}function iv(t,e,n,i){return{env:new nv(t,e),program:new um(n.constants,n.heap),resolver:i}}function rv(t,e){if(t[tv])e();else{t.begin();try{e()}finally{t.commit()}}}var sv;function ov(t){return Pi(t,{})}const av=ov(({positional:t})=>Fn(()=>yy(t),null)),lv=t=>(t=>null==t||"function"!=typeof t.toString)(t)?"":String(t),cv=ov(({positional:t})=>Fn(()=>yy(t).map(lv).join(""),null)),hv=ov(({positional:t})=>{let e=t[0];return Fn(()=>(...n)=>{let[i,...r]=yy(t);if(!Dn(e))return i.call(null,...r,...n);{let t=r.length>0?r[0]:n[0];Vn(e,t)}},null)}),uv=ov(({positional:t})=>{let e=t[0]??Rn,n=t[1]??Rn;return Fn(()=>{let t=qn(e);if(_n(t))return zt(t,String(qn(n)))},t=>{let i=qn(e);if(_n(i))return Ft(i,String(qn(n)),t)})}),dv=ov(({named:t})=>{let e=Fn(()=>my(t),null),n=new Map;for(let i in t)n.set(i,t[i]);return e.children=n,e});function pv(t){return Ve(t.argsCache)}class fv{constructor(t,e=()=>Sy){let n=qe(()=>e(t));this.argsCache=n}get named(){return pv(this).named||xy}get positional(){return pv(this).positional||Cy}}function gv(t,e,n){const i=cr(t),r=Oi(e).getDelegateFor(i);let s,o=new fv(t,n),a=r.createHelper(e,o);if(!_i(r))throw new Error("TODO: unreachable, to be implemented with hasScheduledEffect");return s=qe(()=>r.getValue(a)),Gt(t,s),bi(r)&&Gt(s,r.getDestroyable(a)),s}class mv{constructor(t,e){this.tag=ve(),this.listener=null,this.element=t,this.args=e,Wt(this,()=>{let{element:t,listener:e}=this;if(e){let{eventName:n,callback:i,options:r}=e;_v(t,n,i,r)}})}updateListener(){let{element:t,args:e,listener:n}=this;e.positional[0];let i=qn(e.positional[0]);e.positional[1];let r,s,o,a=qn(e.positional[1]);{let{once:t,passive:n,capture:i}=e.named;t&&(r=qn(t)),n&&(s=qn(n)),i&&(o=qn(i))}let l,c=!1;if(c=null===n||i!==n.eventName||a!==n.userProvidedCallback||r!==n.once||s!==n.passive||o!==n.capture,c&&(void 0===r&&void 0===s&&void 0===o||(l={once:r,passive:s,capture:o})),c){let e=a;this.listener={eventName:i,callback:e,userProvidedCallback:a,once:r,passive:s,capture:o,options:l},n&&_v(t,n.eventName,n.callback,n.options),function(t,e,n,i){yv++,t.addEventListener(e,n,i)}(t,i,e,l)}}}let yv=0,vv=0;function _v(t,e,n,i){vv++,t.removeEventListener(e,n,i)}const bv=Mi(new class{getDebugName(){return"on"}getDebugInstance(){return null}get counters(){return{adds:yv,removes:vv}}create(t,e,n,i){return new mv(e,i)}getTag({tag:t}){return t}install(t){t.updateListener()}update(t){t.updateListener()}getDestroyable(t){return t}},{});class wv{constructor(t,e,n,i){this.stack=t,this.externs=n,this.currentOpSize=0,this.context=e,this.registers=i}fetchRegister(t){return this.registers[t]}loadRegister(t,e){this.registers[t]=e}setPc(t){this.registers[0]=t}pushFrame(){this.stack.push(this.registers[1]),this.stack.push(this.registers[2]),this.registers[2]=this.registers[3]-1}popFrame(){this.registers[3]=this.registers[2]-1,this.registers[1]=this.stack.get(0),this.registers[2]=this.stack.get(1)}pushSmallFrame(){this.stack.push(this.registers[1])}popSmallFrame(){this.registers[1]=this.stack.pop()}goto(t){this.setPc(this.target(t))}target(t){return this.registers[0]+t-this.currentOpSize}call(t){this.registers[1]=this.registers[0],this.setPc(this.context.program.heap.getaddr(t))}returnTo(t){this.registers[1]=this.target(t)}return(){this.setPc(this.registers[1])}nextStatement(){let{registers:t,context:e}=this,n=t[0];if(-1===n)return null;let i=e.program.opcode(n),r=this.currentOpSize=i.size;return this.registers[0]+=r,i}evaluateOuter(t,e){this.evaluateInner(t,e)}evaluateInner(t,e){t.isMachine?this.evaluateMachine(t,e):this.evaluateSyscall(t,e)}evaluateMachine(t,e){switch(t.type){case 0:return void this.pushFrame();case 1:return void this.popFrame();case 3:return void this.call(t.op1);case 2:return void e.call(this.stack.pop());case 4:return void this.goto(t.op1);case 5:return void e.return();case 6:return void this.returnTo(t.op1)}}evaluateSyscall(t,e){vm.evaluate(e,t,t.type)}}const xv=["javascript:","vbscript:"],Cv=["A","BODY","LINK","IMG","IFRAME","BASE","FORM"],Sv=["EMBED"],kv=["href","src","background","action"],Ev=["src"];function Tv(t,e){return-1!==t.indexOf(e)}function Lv(t,e){return(null===t||Tv(Cv,t))&&Tv(kv,e)}function Mv(t,e){return null!==t&&Tv(Sv,t)&&Tv(Ev,e)}function Rv(t,e){return Lv(t,e)||Mv(t,e)}let Pv;function Iv(t,e,n){if(null==n)return n;if(Vm(n))return n.toHTML();const i=t.tagName.toUpperCase();let r=Bm(n);if(Lv(i,e)){let t=(s=r,Pv||(Pv=function(){const t=URL;if("object"==typeof t&&null!==t&&"function"==typeof t.parse){let e=t;return t=>{let n=null;return"string"==typeof t&&(n=e.parse(t).protocol),null===n?":":n}}if("function"==typeof t)return e=>{try{return new t(e).protocol}catch{return":"}};throw new Error('@glimmer/runtime needs a valid "globalThis.URL"')}()),Pv(s));if(Tv(xv,t))return`unsafe:${r}`}var s;return Mv(i,e)?`unsafe:${r}`:r}function Ov(t,e,n){const{tagName:i,namespaceURI:r}=t,s={element:t,name:e,namespace:n};if(r===pm)return Av(i,e,s);const{type:o,normalized:a}=Jy(t,e);return"attr"===o?Av(i,a,s):function(t,e,n){return Rv(t,e)?new Dv(e,n):function(t,e){return("INPUT"===t||"TEXTAREA"===t)&&"value"===e}(t,e)?new Bv(e,n):function(t,e){return"OPTION"===t&&"selected"===e}(t,e)?new Uv(e,n):new jv(e,n)}(i,a,s)}function Av(t,e,n){return Rv(t,e)?new Nv(n):new Fv(n)}class zv{constructor(t){this.attribute=t}}class Fv extends zv{set(t,e,n){const i=qv(e);if(null!==i){const{name:e,namespace:n}=this.attribute;t.__setAttribute(e,i,n)}}update(t,e){const n=qv(t),{element:i,name:r}=this.attribute;null===n?i.removeAttribute(r):i.setAttribute(r,n)}}class jv extends zv{constructor(t,e){super(e),this.normalizedName=t}set(t,e,n){null!=e&&(this.value=e,t.__setProperty(this.normalizedName,e))}update(t,e){const{element:n}=this.attribute;this.value!==t&&(n[this.normalizedName]=this.value=t,null==t&&this.removeAttribute())}removeAttribute(){const{element:t,namespace:e}=this.attribute;e?t.removeAttributeNS(e,this.normalizedName):t.removeAttribute(this.normalizedName)}}class Dv extends jv{set(t,e,n){const{element:i,name:r}=this.attribute,s=Iv(i,r,e);super.set(t,s,n)}update(t,e){const{element:n,name:i}=this.attribute,r=Iv(n,i,t);super.update(r,e)}}class Nv extends Fv{set(t,e,n){const{element:i,name:r}=this.attribute,s=Iv(i,r,e);super.set(t,s,n)}update(t,e){const{element:n,name:i}=this.attribute,r=Iv(n,i,t);super.update(r,e)}}class Bv extends jv{set(t,e){t.__setProperty("value",Bm(e))}update(t){const e=this.attribute.element,n=e.value,i=Bm(t);n!==i&&(e.value=i)}}class Uv extends jv{set(t,e){null!=e&&!1!==e&&t.__setProperty("selected",!0)}update(t){this.attribute.element.selected=!!t}}function qv(t){return!1===t||null==t||void 0===t.toString?null:!0===t?"":"function"==typeof t?null:String(t)}class Vv{constructor(t){this.node=t}firstNode(){return this.node}}class $v{constructor(t){this.node=t}lastNode(){return this.node}}class Gv{static forInitialRender(t,e){return new this(t,e.element,e.nextSibling).initialize()}static resume(t,e){let n=new this(t,e.parentElement(),e.reset(t)).initialize();return n.pushBlock(e),n}constructor(t,e,n){this.constructing=null,this.operations=null,this.cursors=new wn,this.modifierStack=new wn,this.blockStack=new wn,this.pushElement(e,n),this.env=t,this.dom=t.getAppendOperations(),this.updateOperations=t.getDOM()}initialize(){return this.pushAppendingBlock(),this}debugBlocks(){return this.blockStack.toArray()}get element(){return this.cursors.current.element}get nextSibling(){return this.cursors.current.nextSibling}get hasBlocks(){return this.blockStack.size>0}block(){return this.blockStack.current}popElement(){this.cursors.pop(),this.cursors.current}pushAppendingBlock(){return this.pushBlock(new Wv(this.element))}pushResettableBlock(){return this.pushBlock(new Zv(this.element))}pushBlockList(t){return this.pushBlock(new Kv(this.element,t))}pushBlock(t,e=!1){let n=this.blockStack.current;return null!==n&&(e||n.didAppendBounds(t)),this.__openBlock(),this.blockStack.push(t),t}popBlock(){return this.block().finalize(this),this.__closeBlock(),this.blockStack.pop()}__openBlock(){}__closeBlock(){}openElement(t){let e=this.__openElement(t);return this.constructing=e,e}__openElement(t){return this.dom.createElement(t,this.element)}flushElement(t){let e=this.element,n=this.constructing;this.__flushElement(e,n),this.constructing=null,this.operations=null,this.pushModifiers(t),this.pushElement(n,null),this.didOpenElement(n)}__flushElement(t,e){this.dom.insertBefore(t,e,this.nextSibling)}closeElement(){return this.willCloseElement(),this.popElement(),this.popModifiers()}pushRemoteElement(t,e,n){return this.__pushRemoteElement(t,e,n)}__pushRemoteElement(t,e,n){if(this.pushElement(t,n),void 0===n)for(;t.lastChild;)t.removeChild(t.lastChild);let i=new Hv(t);return this.pushBlock(i,!0)}popRemoteElement(){const t=this.popBlock();return this.popElement(),t}pushElement(t,e=null){this.cursors.push(new Im(t,e))}pushModifiers(t){this.modifierStack.push(t)}popModifiers(){return this.modifierStack.pop()}didAppendBounds(t){return this.block().didAppendBounds(t),t}didAppendNode(t){return this.block().didAppendNode(t),t}didOpenElement(t){return this.block().openElement(t),t}willCloseElement(){this.block().closeElement()}appendText(t){return this.didAppendNode(this.__appendText(t))}__appendText(t){let{dom:e,element:n,nextSibling:i}=this,r=e.createTextNode(t);return e.insertBefore(n,r,i),r}__appendNode(t){return this.dom.insertBefore(this.element,t,this.nextSibling),t}__appendFragment(t){let e=t.firstChild;if(e){let n=new Om(this.element,e,t.lastChild);return this.dom.insertBefore(this.element,t,this.nextSibling),n}{const t=this.__appendComment("");return new Om(this.element,t,t)}}__appendHTML(t){return this.dom.insertHTMLBefore(this.element,this.nextSibling,t)}appendDynamicHTML(t){let e=this.trustedContent(t);this.didAppendBounds(e)}appendDynamicText(t){let e=this.untrustedContent(t);return this.didAppendNode(e),e}appendDynamicFragment(t){let e=this.__appendFragment(t);this.didAppendBounds(e)}appendDynamicNode(t){let e=this.__appendNode(t),n=new Om(this.element,e,e);this.didAppendBounds(n)}trustedContent(t){return this.__appendHTML(t)}untrustedContent(t){return this.__appendText(t)}appendComment(t){return this.didAppendNode(this.__appendComment(t))}__appendComment(t){let{dom:e,element:n,nextSibling:i}=this,r=e.createComment(t);return e.insertBefore(n,r,i),r}__setAttribute(t,e,n){this.dom.setAttribute(this.constructing,t,e,n)}__setProperty(t,e){this.constructing[t]=e}setStaticAttribute(t,e,n){this.__setAttribute(t,e,n)}setDynamicAttribute(t,e,n,i){let r=Ov(this.constructing,t,i);return r.set(this,e,this.env),r}}class Wv{constructor(t){this.parent=t,this.first=null,this.last=null,this.nesting=0}parentElement(){return this.parent}firstNode(){return this.first.firstNode()}lastNode(){return this.last.lastNode()}openElement(t){this.didAppendNode(t),this.nesting++}closeElement(){this.nesting--}didAppendNode(t){0===this.nesting&&(this.first||(this.first=new Vv(t)),this.last=new $v(t))}didAppendBounds(t){0===this.nesting&&(this.first||(this.first=t),this.last=t)}finalize(t){null===this.first&&t.appendComment("")}}class Hv extends Wv{constructor(t){super(t),Wt(this,()=>{this.parentElement()===this.firstNode().parentNode&&zm(this)})}}class Zv extends Wv{constructor(t){super(t)}reset(){Ht(this);let t=zm(this);return this.first=null,this.last=null,this.nesting=0,t}}class Kv{constructor(t,e){this.parent=t,this.boundList=e,this.parent=t,this.boundList=e}parentElement(){return this.parent}firstNode(){return this.boundList[0].firstNode()}lastNode(){let t=this.boundList;return t[t.length-1].lastNode()}openElement(t){}closeElement(){}didAppendNode(t){}didAppendBounds(t){}finalize(t){this.boundList.length}}function Yv(t,e){return Gv.forInitialRender(t,e)}class Xv{constructor(t,{alwaysRevalidate:e=!1}){this.frameStack=new wn,this.env=t,this.dom=t.getDOM(),this.alwaysRevalidate=e}execute(t,e){this._execute(t,e)}_execute(t,e){let{frameStack:n}=this;for(this.try(t,e);!n.isEmpty();){let t=this.frame.nextStatement();void 0!==t?t.evaluate(this):n.pop()}}get frame(){return this.frameStack.current}goto(t){this.frame.goto(t)}try(t,e){this.frameStack.push(new n_(t,e))}throw(){this.frame.handleException(),this.frameStack.pop()}}class Jv{constructor(t,e,n,i){this.state=t,this.context=e,this.children=i,this.bounds=n}parentElement(){return this.bounds.parentElement()}firstNode(){return this.bounds.firstNode()}lastNode(){return this.bounds.lastNode()}evaluate(t){t.try(this.children,null)}}class Qv extends Jv{evaluate(t){t.try(this.children,this)}handleException(){let{state:t,bounds:e,context:{env:n}}=this;!function(t){let{children:e}=$t(t);qt(e,Ht)}(this);let i=Gv.resume(n,e),r=t.evaluate(i),s=this.children=[],o=r.execute(t=>{t.updateWith(this),t.pushUpdating(s)});Gt(this,o.drop)}constructor(...t){super(...t),this.type="try"}}class t_ extends Qv{constructor(t,e,n,i,r,s){super(t,e,n,[]),this.key=i,this.memo=r,this.value=s,this.retained=!1,this.index=-1}shouldRemove(){return!this.retained}reset(){this.retained=!1}}class e_ extends Jv{constructor(t,e,n,i,r){super(t,e,n,i),this.iterableRef=r,this.type="list-block",this.opcodeMap=new Map,this.marker=null,this.lastIterator=qn(r)}initializeChild(t){t.index=this.children.length-1,this.opcodeMap.set(t.key,t)}evaluate(t){let e=qn(this.iterableRef);if(this.lastIterator!==e){let{bounds:n}=this,{dom:i}=t,r=this.marker=i.createComment("");i.insertAfter(n.parentElement(),r,n.lastNode()),this.sync(e),this.parentElement().removeChild(r),this.marker=null,this.lastIterator=e}super.evaluate(t)}sync(t){let{opcodeMap:e,children:n}=this,i=0,r=0;for(this.children=this.bounds.boundList=[];;){let s=t.next();if(null===s)break;let o=n[i],{key:a}=s;for(;void 0!==o&&o.retained;)o=n[++i];if(void 0!==o&&o.key===a)this.retainItem(o,s),i++;else if(e.has(a)){let t=e.get(a);if(t.index<r)this.moveItem(t,s,o);else{r=t.index;let e=!1;for(let t=i+1;t<r;t++)if(!n[t].retained){e=!0;break}e?(this.moveItem(t,s,o),i++):(this.retainItem(t,s),i=r+1)}}else this.insertItem(s,o)}for(const s of n)s.retained?s.reset():this.deleteItem(s)}retainItem(t,e){let{children:n}=this;Vn(t.memo,e.memo),Vn(t.value,e.value),t.retained=!0,t.index=n.length,n.push(t)}insertItem(t,e){let{opcodeMap:n,bounds:i,state:r,children:s,context:{env:o}}=this,{key:a}=t,l=void 0===e?this.marker:e.firstNode(),c=Gv.forInitialRender(o,{element:i.parentElement(),nextSibling:l});r.evaluate(c).execute(e=>{let i=e.enterItem(t);i.index=s.length,s.push(i),n.set(a,i),Gt(this,i)})}moveItem(t,e,n){let i,r,{children:s}=this;Vn(t.memo,e.memo),Vn(t.value,e.value),t.retained=!0,void 0===n?Am(t,this.marker):(i=t.lastNode().nextSibling,r=n.firstNode(),i!==r&&Am(t,r)),t.index=s.length,s.push(t)}deleteItem(t){Ht(t),zm(t),this.opcodeMap.delete(t.key)}}class n_{constructor(t,e){this.ops=t,this.exceptionHandler=e,this.current=0}goto(t){this.current=t}nextStatement(){return this.ops[this.current++]}handleException(){this.exceptionHandler&&this.exceptionHandler.handleException()}}class i_{constructor(t,e,n,i){this.env=t,this.updating=e,this.bounds=n,this.drop=i,Gt(this,i),Wt(this,()=>zm(this.bounds))}rerender({alwaysRevalidate:t=!1}={alwaysRevalidate:!1}){let{env:e,updating:n}=this;new Xv(e,{alwaysRevalidate:t}).execute(n,this)}parentElement(){return this.bounds.parentElement()}firstNode(){return this.bounds.firstNode()}lastNode(){return this.bounds.lastNode()}handleException(){}}class r_{static restore(t,e){const n=new this(t.slice(),[0,-1,t.length-1,0]);return n.registers[0]=e,n.registers[3]=t.length-1,n.registers[2]=-1,n}constructor(t=[],e){this.stack=t,this.registers=e}push(t){this.stack[++this.registers[3]]=t}dup(t=this.registers[3]){this.stack[++this.registers[3]]=this.stack[t]}copy(t,e){this.stack[e]=this.stack[t]}pop(t=1){let e=this.stack[this.registers[3]];return this.registers[3]-=t,e}peek(t=0){return this.stack[this.registers[3]-t]}get(t,e=this.registers[2]){return this.stack[e+t]}set(t,e,n=this.registers[2]){this.stack[n+e]=t}slice(t,e){return this.stack.slice(t,e)}capture(t){let e=this.registers[3]+1,n=e-t;return this.stack.slice(n,e)}reset(){this.stack.length=0}}class s_{constructor(t,e){this.drop={},this.scope=new wn,this.dynamicScope=new wn,this.updating=new wn,this.cache=new wn,this.list=new wn,this.destroyable=new wn,this.scope.push(t),this.dynamicScope.push(e),this.destroyable.push(this.drop)}}class o_{#g;get stack(){return this.lowlevel.stack}get pc(){return this.lowlevel.fetchRegister(0)}#m;fetch(t){let e=this.fetchValue(t);this.stack.push(e)}load(t){let e=this.stack.pop();this.loadValue(t,e)}loadValue(t,e){this.#m[t]=e}fetchValue(t){return function(t){return t<=3}(t)?this.lowlevel.fetchRegister(t):this.#m[t]}call(t){null!==t&&this.lowlevel.call(t)}return(){this.lowlevel.return()}#y;constructor({scope:t,dynamicScope:e,stack:n,pc:i},r,s){this.#m=[null,null,null,null,null,null,null,null,null];let o=r_.restore(n,i);this.#y=s,this.context=r,this.#g=new s_(t,e),this.args=new ay,this.lowlevel=new wv(o,r,void 0,o.registers),this.pushUpdating()}static initial(t,e){let n=Pm.root(e.owner,e.scope??{self:Rn,size:0});const i=function(t,e,n){return{pc:t,scope:e,dynamicScope:n,stack:[]}}(t.program.heap.getaddr(e.handle),n,e.dynamicScope);return new o_(i,t,e.tree)}compile(t){return gm(t.compile(this.context))}get constants(){return this.context.program.constants}get program(){return this.context.program}get env(){return this.context.env}captureClosure(t,e=this.lowlevel.fetchRegister(0)){return{pc:e,scope:this.scope(),dynamicScope:this.dynamicScope(),stack:this.stack.capture(t)}}capture(t,e=this.lowlevel.fetchRegister(0)){return new a_(this.captureClosure(t,e),this.context)}beginCacheGroup(t){let e=this.updating(),n=new Hm;e.push(n),e.push(new Zm(t)),this.#g.cache.push(n),Ie()}commitCacheGroup(){let t=this.updating(),e=this.#g.cache.pop(),n=Oe();t.push(new Km(e)),e.finalize(n,t.length)}enter(t){let e=this.capture(t),n=this.tree().pushResettableBlock(),i=new Qv(e,this.context,n,[]);this.didEnter(i)}enterItem({key:t,value:e,memo:n}){let{stack:i}=this,r=ti(e),s=ti(n);i.push(r),i.push(s);let o=this.capture(2),a=this.tree().pushResettableBlock(),l=new t_(o,this.context,a,t,s,r);return this.didEnter(l),l}registerItem(t){this.listBlock().initializeChild(t)}enterList(t,e){let n=[],i=this.lowlevel.target(e),r=this.capture(0,i),s=this.tree().pushBlockList(n),o=new e_(r,this.context,s,n,t);this.#g.list.push(o),this.didEnter(o)}didEnter(t){this.associateDestroyable(t),this.#g.destroyable.push(t),this.updateWith(t),this.pushUpdating(t.children)}exit(){this.#g.destroyable.pop(),this.#y.popBlock(),this.popUpdating()}exitList(){this.exit(),this.#g.list.pop()}pushRootScope(t,e){let n=Pm.sized(e,t);return this.#g.scope.push(n),n}pushChildScope(){this.#g.scope.push(this.scope().child())}pushScope(t){this.#g.scope.push(t)}popScope(){this.#g.scope.pop()}pushDynamicScope(){let t=this.dynamicScope().child();return this.#g.dynamicScope.push(t),t}bindDynamicScope(t){let e=this.dynamicScope();for(const n of fn(t))e.set(n,this.stack.pop())}pushUpdating(t=[]){this.#g.updating.push(t)}popUpdating(){return this.#g.updating.pop()}updateWith(t){this.updating().push(t)}listBlock(){return this.#g.list.current}associateDestroyable(t){Gt(this.#g.destroyable.current,t)}updating(){return this.#g.updating.current}tree(){return this.#y}scope(){return this.#g.scope.current}dynamicScope(){return this.#g.dynamicScope.current}popDynamicScope(){this.#g.dynamicScope.pop()}getOwner(){return this.scope().owner}getSelf(){return this.scope().getSelf()}referenceForSymbol(t){return this.scope().getSymbol(t)}execute(t){return this._execute(t)}_execute(t){let e;t&&t(this);do{e=this.next()}while(!e.done);return e.value}next(){let t,{env:e}=this,n=this.lowlevel.nextStatement();return null!==n?(this.lowlevel.evaluateOuter(n,this),t={done:!1,value:null}):(this.stack.reset(),t={done:!0,value:new i_(e,this.popUpdating(),this.#y.popBlock(),this.#g.drop)}),t}}class a_{constructor(t,e){this.state=t,this.context=e}evaluate(t){return new o_(this.state,this.context,t)}}class l_{constructor(t){this.vm=t}next(){return this.vm.next()}sync(){return this.vm.execute()}}function c_(t,e,n,i,r,s=new Rm){let o=gm(r.compile(t)),a=r.symbolTable.symbols.length,l=o_.initial(t,{scope:{self:n,size:a},dynamicScope:s,tree:i,handle:o,owner:e});return new l_(l)}function h_(t,e,n,i,r={},s=new Rm){return function(t,e,n,i,r){const s=Object.keys(r).map(t=>[t,r[t]]),o=["main","else","attrs"],a=s.map(([t])=>`@${t}`);let l=t.constants.component(i,n,void 0,"{ROOT}");t.lowlevel.pushFrame();for(let u=0;u<3*o.length;u++)t.stack.push(null);t.stack.push(null),s.forEach(([,e])=>{t.stack.push(e)}),t.args.setup(t.stack,a,o,0,!0);const c=l.compilable,h={handle:gm(c.compile(e)),symbolTable:c.symbolTable};return t.stack.push(t.args),t.stack.push(h),t.stack.push(l),new l_(t)}(o_.initial(t,{tree:e,handle:t.stdlib.main,dynamicScope:s,owner:n}),t,n,i,function(t){const e=An(t);return Object.keys(t).reduce((t,n)=>(t[n]=$n(e,n),t),{})}(r))}function u_(t){return"%+b:0%"===t.nodeValue}class d_ extends Im{constructor(t,e,n){super(t,e),this.startingBlockDepth=n,this.candidate=null,this.injectedOmittedNode=!1,this.openBlockDepth=n-1}}class p_ extends Gv{constructor(t,e,n){if(super(t,e,n),this.unmatchedAttributes=null,this.blockDepth=0,n)throw new Error("Rehydration with nextSibling not supported");let i=this.currentCursor.element.firstChild;for(;null!==i&&!f_(i);)i=i.nextSibling;this.candidate=i;const r=m_(i);if(0!==r){const t=r-1,e=this.dom.createComment(`%+b:${t}%`);i.parentNode.insertBefore(e,this.candidate);let n=i.nextSibling;for(;null!==n&&(!g_(n)||m_(n)!==r);)n=n.nextSibling;const s=this.dom.createComment(`%-b:${t}%`);i.parentNode.insertBefore(s,n.nextSibling),this.candidate=e,this.startingBlockOffset=t}else this.startingBlockOffset=0}get currentCursor(){return this.cursors.current}get candidate(){return this.currentCursor?this.currentCursor.candidate:null}set candidate(t){this.currentCursor.candidate=t}disableRehydration(t){const e=this.currentCursor;e.candidate=null,e.nextSibling=t}enableRehydration(t){const e=this.currentCursor;e.candidate=t,e.nextSibling=null}pushElement(t,e=null){const n=new d_(t,e,this.blockDepth||0);null!==this.candidate&&(n.candidate=t.firstChild,this.candidate=t.nextSibling),this.cursors.push(n)}clearMismatch(t){let e=t;const n=this.currentCursor;if(null!==n){const t=n.openBlockDepth;if(t>=n.startingBlockDepth)for(;e&&!(g_(e)&&t>=y_(e,this.startingBlockOffset));)e=this.remove(e);else for(;null!==e;)e=this.remove(e);this.disableRehydration(e)}}__openBlock(){const{currentCursor:t}=this;if(null===t)return;const e=this.blockDepth;this.blockDepth++;const{candidate:n}=t;if(null===n)return;const{tagName:i}=t.element;f_(n)&&y_(n,this.startingBlockOffset)===e?(this.candidate=this.remove(n),t.openBlockDepth=e):"TITLE"!==i&&"SCRIPT"!==i&&"STYLE"!==i&&this.clearMismatch(n)}__closeBlock(){const{currentCursor:t}=this;if(null===t)return;const e=t.openBlockDepth;this.blockDepth--;const{candidate:n}=t;let i=!1;if(null!==n)if(i=!0,g_(n)&&y_(n,this.startingBlockOffset)===e){const e=this.remove(n);this.candidate=e,t.openBlockDepth--}else this.clearMismatch(n),i=!1;if(!i){const e=t.nextSibling;if(null!==e&&g_(e)&&y_(e,this.startingBlockOffset)===this.blockDepth){const n=this.remove(e);this.enableRehydration(n),t.openBlockDepth--}}}__appendNode(t){const{candidate:e}=this;return e||super.__appendNode(t)}__appendHTML(t){const e=this.markerBounds();if(e){const t=e.firstNode(),n=e.lastNode(),i=new Om(this.element,t.nextSibling,n.previousSibling),r=this.remove(t);return this.remove(n),null!==r&&b_(r)&&(this.candidate=this.remove(r),null!==this.candidate&&this.clearMismatch(this.candidate)),i}return super.__appendHTML(t)}remove(t){const e=t.parentNode,n=t.nextSibling;return e.removeChild(t),n}markerBounds(){const t=this.candidate;if(t&&__(t)){const e=t;let n=e.nextSibling;for(;!__(n);)n=n.nextSibling;return new Om(this.element,e,n)}return null}__appendText(t){const{candidate:e}=this;return e?3===e.nodeType?(e.nodeValue!==t&&(e.nodeValue=t),this.candidate=e.nextSibling,e):8===(n=e).nodeType&&"%|%"===n.nodeValue||b_(e)&&""===t?(this.candidate=this.remove(e),this.__appendText(t)):(this.clearMismatch(e),super.__appendText(t)):super.__appendText(t);var n}__appendComment(t){const e=this.candidate;return e&&8===e.nodeType?(e.nodeValue!==t&&(e.nodeValue=t),this.candidate=e.nextSibling,e):(e&&this.clearMismatch(e),super.__appendComment(t))}__openElement(t){const e=this.candidate;if(e&&v_(e)&&function(t,e){return t.namespaceURI===pm?t.tagName===e:t.tagName===e.toUpperCase()}(e,t))return this.unmatchedAttributes=[].slice.call(e.attributes),e;if(e){if(v_(e)&&"TBODY"===e.tagName)return this.pushElement(e,null),this.currentCursor.injectedOmittedNode=!0,this.__openElement(t);this.clearMismatch(e)}return super.__openElement(t)}__setAttribute(t,e,n){const i=this.unmatchedAttributes;if(i){const n=w_(i,t);if(n)return n.value!==e&&(n.value=e),void i.splice(i.indexOf(n),1)}return super.__setAttribute(t,e,n)}__setProperty(t,e){const n=this.unmatchedAttributes;if(n){const i=w_(n,t);if(i)return i.value!==e&&(i.value=e),void n.splice(n.indexOf(i),1)}return super.__setProperty(t,e)}__flushElement(t,e){const{unmatchedAttributes:n}=this;if(n){for(const t of n)this.constructing.removeAttribute(t.name);this.unmatchedAttributes=null}else super.__flushElement(t,e)}willCloseElement(){const{candidate:t,currentCursor:e}=this;null!==t&&this.clearMismatch(t),e&&e.injectedOmittedNode&&this.popElement(),super.willCloseElement()}getMarker(t,e){const n=t.querySelector(`script[glmr="${e}"]`);return n?fm(n):null}__pushRemoteElement(t,e,n){const i=this.getMarker(t,e);if(!i||i.parentNode,void 0===n){for(;null!==t.firstChild&&t.firstChild!==i;)this.remove(t.firstChild);n=null}const r=new d_(t,null,this.blockDepth);this.cursors.push(r),null===i?this.disableRehydration(n):this.candidate=this.remove(i);const s=new Hv(t);return this.pushBlock(s,!0)}didAppendBounds(t){if(super.didAppendBounds(t),this.candidate){const e=t.lastNode();this.candidate=e.nextSibling}return t}}function f_(t){return 8===t.nodeType&&0===t.nodeValue.lastIndexOf("%+b:",0)}function g_(t){return 8===t.nodeType&&0===t.nodeValue.lastIndexOf("%-b:",0)}function m_(t){return parseInt(t.nodeValue.slice(4),10)}function y_(t,e){return m_(t)-e}function v_(t){return 1===t.nodeType}function __(t){return 8===t.nodeType&&"%glmr%"===t.nodeValue}function b_(t){return 8===t.nodeType&&"% %"===t.nodeValue}function w_(t,e){for(const n of t)if(n.name===e)return n}function x_(t,e){return p_.forInitialRender(t,e)}const C_=Object.freeze(Object.defineProperty({__proto__:null,ConcreteBounds:Om,CurriedValue:Tm,CursorImpl:Im,DOMChanges:Xy,DOMTreeConstruction:Wy,DynamicAttribute:zv,DynamicScopeImpl:Rm,EMPTY_ARGS:Sy,EMPTY_NAMED:xy,EMPTY_POSITIONAL:Cy,EnvironmentImpl:nv,IDOMChanges:Ky,LowLevelVM:wv,NewTreeBuilder:Gv,RehydrateTree:p_,RemoteBlock:Hv,ResettableBlockImpl:Zv,SERIALIZATION_FIRST_NODE_STRING:"%+b:0%",ScopeImpl:Pm,SimpleDynamicAttribute:Fv,TEMPLATE_ONLY_COMPONENT_MANAGER:Fy,TemplateOnlyComponent:jy,TemplateOnlyComponentManager:zy,UpdatingVM:Xv,array:av,clear:zm,clientBuilder:Yv,concat:cv,createCapturedArgs:gy,curry:Mm,destroy:Ht,dynamicAttribute:Ov,fn:hv,get:uv,hash:dv,inTransaction:rv,invokeHelper:gv,isDestroyed:Yt,isDestroying:Kt,isSerializationFirstNode:u_,isWhitespace:function(t){return Hy.test(t)},normalizeProperty:Jy,on:bv,registerDestructor:Wt,rehydrationBuilder:x_,reifyArgs:function(t){return{named:my(t.named),positional:yy(t.positional)}},reifyNamed:my,reifyPositional:yy,renderComponent:h_,renderMain:c_,renderSync:function(t,e){let n;return rv(t,()=>n=e.sync()),n},resetDebuggerCallback:function(){Iy=Py},runtimeOptions:iv,setDebuggerCallback:function(t){Iy=t},templateOnlyComponent:Dy},Symbol.toStringTag,{value:"Module"})),S_=bv,k_=Symbol("MUTABLE_CELL"),E_=em({id:"yTlmws8O",block:'[[[46,[30,0],null,null,null]],[],["component"]]',moduleName:"packages/@ember/-internals/glimmer/lib/templates/root.hbs",isStrictMode:!0}),T_=em({id:"Cc/BCoQJ",block:'[[[11,"input"],[16,1,[30,0,["id"]]],[16,0,[30,0,["class"]]],[17,1],[16,4,[30,0,["type"]]],[16,"checked",[30,0,["checked"]]],[16,2,[30,0,["value"]]],[4,[32,0],["change",[30,0,["change"]]],null],[4,[32,0],["input",[30,0,["input"]]],null],[4,[32,0],["keyup",[30,0,["keyUp"]]],null],[4,[32,0],["paste",[30,0,["valueDidChange"]]],null],[4,[32,0],["cut",[30,0,["valueDidChange"]]],null],[12],[13]],["&attrs"],[]]',moduleName:"packages/@ember/-internals/glimmer/lib/templates/input.hbs",scope:()=>[S_],isStrictMode:!0});function L_(){}class M_{static toString(){return"internal component"}constructor(t,e,n){this.owner=t,this.args=e,this.caller=n,ur(this,t)}get id(){return et(this)}get class(){return"ember-view"}validateArguments(){for(let t of Object.keys(this.args.named))this.isSupportedArgument(t)||this.onUnsupportedArgument(t)}named(t){let e=this.args.named[t];return e?qn(e):void 0}positional(t){let e=this.args.positional[t];return e?qn(e):void 0}listenerFor(t){return this.named(t)||L_}isSupportedArgument(t){return!1}onUnsupportedArgument(t){}toString(){return`<${this.constructor}:${et(this)}>`}}const R_=new WeakMap;function P_(t,e){let n={create(){throw void 0},toString:()=>t.toString()};return R_.set(n,t),Ai(O_,n),Xi(e,n),n}const I_={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!0,attributeHook:!1,elementHook:!1,createCaller:!0,dynamicScope:!1,updateHook:!1,createInstance:!0,wrapped:!1,willDestroy:!1,hasSubOwner:!1},O_=new class{getCapabilities(){return I_}create(t,e,n,i,r,s){var o;let a=new(o=e,R_.get(o))(t,n.capture(),qn(s));return We(a.validateArguments.bind(a)),a}didCreate(){}didUpdate(){}didRenderLayout(){}didUpdateLayout(){}getDebugName(t){return t.toString()}getSelf(t){return An(t)}getDestroyable(t){return t}},A_=Object.freeze({});function z_(t){return function(t){return t.target}(t).value}function F_(t){return void 0===t?new j_(void 0):Bn(t)?new j_(qn(t)):Un(t)?new D_(t):new N_(t)}class j_{static{ku(this.prototype,"value",[Ps])}#v=void Lu(this,"value");constructor(t){this.value=t}get(){return this.value}set(t){this.value=t}}class D_{constructor(t){this.reference=t}get(){return qn(this.reference)}set(t){Vn(this.reference,t)}}class N_{local;upstream;lastUpstreamValue=A_;constructor(t){this.upstream=new D_(t)}get(){let t=this.upstream.get();return t!==this.lastUpstreamValue&&(this.lastUpstreamValue=t,this.local=new j_(t)),this.local.get()}set(t){this.local.set(t)}}class B_ extends M_{validateArguments(){super.validateArguments()}_value=F_(this.args.named.value);get value(){return this._value.get()}set value(t){this._value.set(t)}valueDidChange(t){this.value=z_(t)}static{Tu(this.prototype,"valueDidChange",[Ih])}change(t){this.valueDidChange(t)}input(t){this.valueDidChange(t)}keyUp(t){switch(t.key){case"Enter":this.listenerFor("enter")(t),this.listenerFor("insert-newline")(t);break;case"Escape":this.listenerFor("escape-press")(t)}}static{Tu(this.prototype,"keyUp",[Ih])}listenerFor(t){let e=super.listenerFor(t);return this.isVirtualEventListener(t,e)?function(t){return e=>t(z_(e),e)}(e):e}isVirtualEventListener(t,e){return-1!==["enter","insert-newline","escape-press"].indexOf(t)}}let U_;if(e){const t=Object.create(null),e=document.createElement("input");t[""]=!1,t.text=!0,t.checkbox=!0,U_=n=>{let i=t[n];if(void 0===i){try{e.type=n,i=e.type===n}catch(r){i=!1}finally{e.type="text"}t[n]=i}return i}}else U_=t=>""!==t;class q_ extends B_{static toString(){return"Input"}get class(){return this.isCheckbox?"ember-checkbox ember-view":"ember-text-field ember-view"}get type(){let t=this.named("type");return null==t?"text":U_(t)?t:"text"}get isCheckbox(){return"checkbox"===this.named("type")}_checked=F_(this.args.named.checked);get checked(){return this.isCheckbox?this._checked.get():void 0}set checked(t){this._checked.set(t)}change(t){this.isCheckbox?this.checkedDidChange(t):super.change(t)}static{Tu(this.prototype,"change",[Ih])}input(t){this.isCheckbox||super.input(t)}static{Tu(this.prototype,"input",[Ih])}checkedDidChange(t){let e=t.target;this.checked=e.checked}static{Tu(this.prototype,"checkedDidChange",[Ih])}isSupportedArgument(t){return-1!==["type","value","checked","enter","insert-newline","escape-press"].indexOf(t)||super.isSupportedArgument(t)}}const V_=P_(q_,T_),$_=em({id:"7Z3LFeO/",block:'[[[11,3],[16,1,[30,0,["id"]]],[16,0,[30,0,["class"]]],[16,"role",[30,0,["role"]]],[16,"title",[30,0,["title"]]],[16,"rel",[30,0,["rel"]]],[16,"tabindex",[30,0,["tabindex"]]],[16,"target",[30,0,["target"]]],[17,1],[16,6,[30,0,["href"]]],[4,[32,0],["click",[30,0,["click"]]],null],[12],[18,2,null],[13]],["&attrs","&default"],["yield"]]',moduleName:"packages/@ember/-internals/glimmer/lib/templates/link-to.hbs",scope:()=>[S_],isStrictMode:!0}),G_=[],W_={};function H_(t){return null==t}function Z_(t){return"object"==typeof t&&null!==t&&!0===t.isQueryParams}class K_ extends M_{static toString(){return"LinkTo"}static{ku(this.prototype,"routing",[qf("-routing")])}#_=void Lu(this,"routing");validateArguments(){super.validateArguments()}get class(){let t="ember-view";return this.isActive?(t+=this.classFor("active"),!1===this.willBeActive&&(t+=" ember-transitioning-out")):this.willBeActive&&(t+=" ember-transitioning-in"),this.isLoading&&(t+=this.classFor("loading")),this.isDisabled&&(t+=this.classFor("disabled")),t}get href(){if(this.isLoading)return"#";let{routing:t,route:e,models:n,query:i}=this;return je(on(t,"currentState")),t.generateURL(e,n,i)}click(t){if(!zh(t))return;let e=t.currentTarget;if(""!==e.target&&"_self"!==e.target)return;if(this.preventDefault(t),this.isDisabled)return;if(this.isLoading)return;let{routing:n,route:i,models:r,query:s,replace:o}=this,a={transition:void 0};cu(0,0,()=>{a.transition=n.transitionTo(i,r,s,o)})}static{Tu(this.prototype,"click",[Ih])}get route(){if("route"in this.args.named){let t=this.named("route");return t&&this.namespaceRoute(t)}return this.currentRoute}currentRouteCache=qe(()=>(je(on(this.routing,"currentState")),We(()=>this.routing.currentRouteName)));get currentRoute(){return Ve(this.currentRouteCache)}get models(){return"models"in this.args.named?this.named("models"):"model"in this.args.named?[this.named("model")]:G_}get query(){return"query"in this.args.named?{...this.named("query")}:W_}get replace(){return!0===this.named("replace")}get isActive(){return this.isActiveForState(this.routing.currentState)}get willBeActive(){let t=this.routing.currentState,e=this.routing.targetState;return t===e?null:this.isActiveForState(e)}get isLoading(){return H_(this.route)||this.models.some(t=>H_(t))}get isDisabled(){return Boolean(this.named("disabled"))}get isEngine(){return void 0!==pd(this.owner)}get engineMountPoint(){return this.owner.mountPoint}classFor(t){let e=this.named(`${t}Class`);return!0===e||H_(e)?` ${t}`:e?` ${e}`:""}namespaceRoute(t){let{engineMountPoint:e}=this;return void 0===e?t:"application"===t?e:`${e}.${t}`}isActiveForState(t){if(!function(t){return!H_(t)}(t))return!1;if(this.isLoading)return!1;let e=this.named("current-when");if("boolean"==typeof e)return e;if("string"==typeof e){let{models:n,routing:i}=this;return e.split(" ").some(e=>i.isActiveForRoute(n,void 0,this.namespaceRoute(e),t))}{let{route:e,models:n,query:i,routing:r}=this;return r.isActiveForRoute(n,i,e,t)}}preventDefault(t){t.preventDefault()}isSupportedArgument(t){return-1!==["route","model","models","query","replace","disabled","current-when","activeClass","loadingClass","disabledClass"].indexOf(t)||super.isSupportedArgument(t)}}let{prototype:Y_}=K_,X_=(t,e)=>t?Object.getOwnPropertyDescriptor(t,e)||X_(Object.getPrototypeOf(t),e):null;{let t=Y_.onUnsupportedArgument;Object.defineProperty(Y_,"onUnsupportedArgument",{configurable:!0,enumerable:!1,value:function(e){"href"===e||t.call(this,e)}})}{let t=X_(Y_,"models").get;Object.defineProperty(Y_,"models",{configurable:!0,enumerable:!1,get:function(){let e=t.call(this);return e.length>0&&!("query"in this.args.named)&&Z_(e[e.length-1])&&(e=e.slice(0,-1)),e}});let e=X_(Y_,"query").get;Object.defineProperty(Y_,"query",{configurable:!0,enumerable:!1,get:function(){if("query"in this.args.named){let t=e.call(this);return Z_(t)?t.values??W_:t}{let e=t.call(this);if(e.length>0){let t=e[e.length-1];if(Z_(t)&&null!==t.values)return t.values}return W_}}})}{let t=Y_.onUnsupportedArgument;Object.defineProperty(Y_,"onUnsupportedArgument",{configurable:!0,enumerable:!1,value:function(e){"params"!==e&&t.call(this,e)}})}const J_=P_(K_,$_),Q_=em({id:"KVdeMchh",block:'[[[11,"textarea"],[16,1,[30,0,["id"]]],[16,0,[30,0,["class"]]],[17,1],[16,2,[30,0,["value"]]],[4,[32,0],["change",[30,0,["change"]]],null],[4,[32,0],["input",[30,0,["input"]]],null],[4,[32,0],["keyup",[30,0,["keyUp"]]],null],[4,[32,0],["paste",[30,0,["valueDidChange"]]],null],[4,[32,0],["cut",[30,0,["valueDidChange"]]],null],[12],[13]],["&attrs"],[]]',moduleName:"packages/@ember/-internals/glimmer/lib/templates/textarea.hbs",scope:()=>[S_],isStrictMode:!0});class tb extends B_{static toString(){return"Textarea"}get class(){return"ember-text-area ember-view"}change(t){super.change(t)}static{Tu(this.prototype,"change",[Ih])}input(t){super.input(t)}static{Tu(this.prototype,"input",[Ih])}isSupportedArgument(t){return-1!==["type","value","enter","insert-newline","escape-press"].indexOf(t)||super.isSupportedArgument(t)}}const eb=P_(tb,Q_);function nb(t){if("error"===t.result)throw new Error(`Compile Error: ${t.problem} @ ${t.span.start}..${t.span.end}`);return t}function ib(t,e){return"attrs"===e[0]&&(e.shift(),1===e.length)?$n(t,e[0]):Gn(t,e)}function rb(t){let e=t.indexOf(":");return-1===e?[t,t,!0]:[t.substring(0,e),t.substring(e+1),!1]}function sb(t,e,n,i){let[r,s,o]=n;if("id"===s){let e=Cs(t,r);null==e&&(e=t.elementId);let n=Mn(e);return void i.setAttribute("id",n,!0,null)}let a=r.indexOf(".")>-1?ib(e,r.split(".")):$n(e,r);i.setAttribute(s,a,!1,null)}function ob(t,e){let n;return Fn(()=>{let i=qn(t);return!0===i?n||(n=zf(e)):i||0===i?String(i):null})}function ab(){}class lb{classRef=null;rootRef;argsRevision;constructor(t,e,n,i,r,s){this.component=t,this.args=e,this.argsTag=n,this.finalizer=i,this.hasWrappedElement=r,this.isInteractive=s,this.classRef=null,this.argsRevision=null===e?0:ue(n),this.rootRef=An(t),Wt(this,()=>this.willDestroy(),!0),Wt(this,()=>this.component.destroy())}willDestroy(){let{component:t,isInteractive:e}=this;if(e){Ae(),t.trigger("willDestroyElement"),t.trigger("willClearRender"),ze();let e=qh(t);e&&(Gh(e),Wh(t))}t.renderer.unregister(t)}finalize(){let{finalizer:t}=this;t(),this.finalizer=ab}}function cb(t){let e=Object.create(null),n=Object.create(null);for(let i in t){let r=t[i],s=qn(r);Un(r)?e[i]=new ub(r,s):e[i]=s,n[i]=s}return n.attrs=e,n}const hb=Symbol("REF");class ub{value;[k_];[hb];constructor(t,e){this[k_]=!0,this[hb]=t,this.value=e}update(t){Vn(this[hb],t)}}const db=St("ARGS"),pb=St("HAS_BLOCK"),fb=Symbol("DIRTY_TAG"),gb=Symbol("IS_DISPATCHING_ATTRS"),mb=Symbol("BOUNDS"),yb=Mn("ember-view");class vb{templateFor(t){let e,{layout:n,layoutName:i}=t,r=hr(t);if(void 0===n){if(void 0===i)return null;e=r.lookup(`template:${i}`)}else{if("function"!=typeof n)return null;e=n}return nb(e(r)).asWrappedLayout()}getDynamicLayout(t){return this.templateFor(t.component)}getTagName(t){let{component:e,hasWrappedElement:n}=t;return n?e&&e.tagName||"div":null}getCapabilities(){return wb}prepareArgs(t,e){if(e.named.has("__ARGS__")){let{__ARGS__:t,...n}=e.named.capture(),i=qn(t);return{positional:i.positional,named:{...n,...i.named}}}const{positionalParams:n}=t.class??t;if(null==n||0===e.positional.length)return null;let i;if("string"==typeof n){let t=e.positional.capture();i={[n]:Fn(()=>yy(t))},Object.assign(i,e.named.capture())}else{if(!(Array.isArray(n)&&n.length>0))return null;{const t=Math.min(n.length,e.positional.length);i={},Object.assign(i,e.named.capture());for(let r=0;r<t;r++)i[n[r]]=e.positional.at(r)}}return{positional:hn,named:i}}create(t,e,n,{isInteractive:i},r,s,o){let a=r.view,l=n.named.capture();Ie();let c=cb(l);c[db]=l;let h=Oe();!function(t,e){t.named.has("id")&&(e.elementId=e.id)}(n,c),c.parentView=a,c[pb]=o,c._target=qn(s),ur(c,t),Ae();let u=e.create(c),d=uu("render.component",_b,u);r.view=u,null!=a&&Kh(a,u),u.trigger("didReceiveAttrs");let p=""!==u.tagName;p||(i&&u.trigger("willRender"),u._transitionTo("hasElement"),i&&u.trigger("willInsertElement"));let f=new lb(u,l,h,d,p,i);return n.named.has("class")&&(f.classRef=n.named.get("class")),i&&p&&u.trigger("willRender"),ze(),je(f.argsTag),je(u[fb]),f}getDebugName(t){return t.fullName||t.normalizedName||t.class?.name||t.name}getSelf({rootRef:t}){return t}didCreateElement({component:t,classRef:e,isInteractive:n,rootRef:i},r,s){$h(t,r),Vh(r,t);let{attributeBindings:o,classNames:a,classNameBindings:l}=t;if(o&&o.length)!function(t,e,n,i){let r=[],s=t.length-1;for(;-1!==s;){let o=rb(t[s]),a=o[1];-1===r.indexOf(a)&&(r.push(a),sb(e,n,o,i)),s--}if(-1===r.indexOf("id")){let t=e.elementId?e.elementId:et(e);i.setAttribute("id",Mn(t),!1,null)}}(o,t,i,s);else{let e=t.elementId?t.elementId:et(t);s.setAttribute("id",Mn(e),!1,null)}if(e){const t=ob(e);s.setAttribute("class",t,!1,null)}a&&a.length&&a.forEach(t=>{s.setAttribute("class",Mn(t),!1,null)}),l&&l.length&&l.forEach(t=>{!function(t,e,n){let i=e.split(":"),[r,s,o]=i;if(""===r)n.setAttribute("class",Mn(s),!0,null);else{let e,i=r.indexOf(".")>-1,a=i?r.split("."):[],l=i?ib(t,a):$n(t,r);e=void 0===s?ob(l,i?a[a.length-1]:r):function(t,e,n){return Fn(()=>qn(t)?e:n)}(l,s,o),n.setAttribute("class",e,!1,null)}}(i,t,s)}),s.setAttribute("class",yb,!1,null),"ariaRole"in t&&s.setAttribute("role",$n(i,"ariaRole"),!1,null),t._transitionTo("hasElement"),n&&(Ae(),t.trigger("willInsertElement"),ze())}didRenderLayout(t,e){t.component[mb]=e,t.finalize()}didCreate({component:t,isInteractive:e}){e&&(t._transitionTo("inDOM"),t.trigger("didInsertElement"),t.trigger("didRender"))}update(t){let{component:e,args:n,argsTag:i,argsRevision:r,isInteractive:s}=t;if(t.finalizer=uu("render.component",bb,e),Ae(),null!==n&&!de(i,r)){Ie();let r=cb(n);i=t.argsTag=Oe(),t.argsRevision=ue(i),e[gb]=!0,e.setProperties(r),e[gb]=!1,e.trigger("didUpdateAttrs"),e.trigger("didReceiveAttrs")}s&&(e.trigger("willUpdate"),e.trigger("willRender")),ze(),je(i),je(e[fb])}didUpdateLayout(t){t.finalize()}didUpdate({component:t,isInteractive:e}){e&&(t.trigger("didUpdate"),t.trigger("didRender"))}getDestroyable(t){return t}}function _b(t){return t.instrumentDetails({initialRender:!0})}function bb(t){return t.instrumentDetails({initialRender:!1})}const wb={dynamicLayout:!0,dynamicTag:!0,prepareArgs:!0,createArgs:!0,attributeHook:!0,elementHook:!0,createCaller:!0,dynamicScope:!0,updateHook:!0,createInstance:!0,wrapped:!0,willDestroy:!0,hasSubOwner:!1},xb=new vb;function Cb(t){return t===xb}let Sb=new WeakMap;const kb=Object.freeze([]);class Eb extends(Iu.extend(rc,Ou,{didReceiveAttrs(){},didRender(){},didUpdate(){},didUpdateAttrs(){},willRender(){},willUpdate(){}},{concatenatedProperties:["attributeBindings","classNames","classNameBindings"],classNames:kb,classNameBindings:kb})){isComponent=!0;init(t){super.init(t),this._superRerender=this.rerender,this.rerender=this._rerender,this[gb]=!1,this[fb]=ye(),this[mb]=null;const e=this._dispatcher;if(e){let t=Sb.get(e);t||(t=new WeakSet,Sb.set(e,t));let n=Object.getPrototypeOf(this);t.has(n)||(e.lazyEvents.forEach((t,n)=>{null!==t&&"function"==typeof this[t]&&e.setupHandlerForBrowserEvent(n)}),t.add(n))}this.elementId||""===this.tagName||(this.elementId=et(this))}__dispatcher;get _dispatcher(){if(void 0===this.__dispatcher){let t=hr(this);if(t.lookup("-environment:main").isInteractive){let e=t.lookup("event_dispatcher:main");this.__dispatcher=e}else this.__dispatcher=null}return this.__dispatcher}on(t,e,n){return this._dispatcher?.setupHandlerForEmberEvent(t),super.on(t,e,n)}_rerender(){ge(this[fb]),this._superRerender()}[is](t,e){if(this[gb])return;let n=this[db],i=void 0!==n?n[t]:void 0;void 0!==i&&Un(i)&&Vn(i,2===arguments.length?e:Cs(this,t))}getAttr(t){return this.get(t)}readDOMAttr(t){let e=qh(this),n="http://www.w3.org/2000/svg"===e.namespaceURI,{type:i,normalized:r}=Jy(e,t);return n||"attr"===i?e.getAttribute(r):e[r]}get childViews(){return Zh(this)}static{Tu(this.prototype,"childViews",[Cr({configurable:!1,enumerable:!1})])}appendChild(t){Kh(this,t)}_transitionTo(t){let e=this._currentState,n=this._currentState=this._states[t];this._state=t,e&&e.exit&&e.exit(this),n.enter&&n.enter(this)}nearestOfType(t){let e=this.parentView;for(;e;){if(t.detect(e.constructor))return e;e=e.parentView}}nearestWithProperty(t){let e=this.parentView;for(;e;){if(t in e)return e;e=e.parentView}}rerender(){return this._currentState.rerender(this)}get element(){return this.renderer.getElement(this)}static{Tu(this.prototype,"element",[Cr({configurable:!1,enumerable:!1})])}appendTo(t){let n;return n=e&&"string"==typeof t?document.querySelector(t):t,this.renderer.appendTo(this,n),this}append(){return this.appendTo(document.body)}willInsertElement(){return this}didInsertElement(){return this}willClearRender(){return this}destroy(){return super.destroy(),this._currentState.destroy(this),this}willDestroyElement(){return this}didDestroyElement(){return this}parentViewDidChange(){return this}handleEvent(t,e){return this._currentState.handleEvent(this,t,e)}static isComponentFactory=!0;static toString(){return"@ember/component"}}Eb.reopenClass({positionalParams:[]}),Ai(xb,Eb);const Tb=Symbol("RECOMPUTE_TAG"),Lb=Symbol("IS_CLASSIC_HELPER");class Mb extends ru{static isHelperFactory=!0;static[Lb]=!0;static helper=Ab;init(t){super.init(t),this[Tb]=ye()}recompute(){va(()=>ge(this[Tb]))}}class Rb{capabilities=vi(0,{hasValue:!0,hasDestroyable:!0});ownerInjection;constructor(t){let e={};ur(e,t),this.ownerInjection=e}createHelper(t,e){var n;return{instance:null!=(n=t)&&"class"in n?t.create():t.create(this.ownerInjection),args:e}}getDestroyable({instance:t}){return t}getValue({instance:t,args:e}){let{positional:n,named:i}=e,r=t.compute(n,i);return je(t[Tb]),r}getDebugName(t){return nt((t.class||t).prototype)}}Zi(t=>new Rb(t),Mb);const Pb=Oi(Mb);class Ib{isHelperFactory=!0;constructor(t){this.compute=t}create(){return{compute:this.compute}}}const Ob=new class{capabilities=vi(0,{hasValue:!0});createHelper(t,e){return()=>t.compute.call(null,e.positional,e.named)}getValue(t){return t()}getDebugName(t){return nt(t.compute)}};function Ab(t){return new Ib(t)}Zi(()=>Ob,Ib.prototype);class zb{__string;constructor(t){this.__string=t}toString(){return`${this.__string}`}toHTML(){return this.toString()}}const Fb=function(t){return null==t?t="":"string"!=typeof t&&(t=String(t)),new zb(t)};function jb(t){return{object:`${t.name}:main`}}const Db={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!1,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!0,updateHook:!1,createInstance:!0,wrapped:!1,willDestroy:!1,hasSubOwner:!1},Nb=fi(Db),Bb=new class{create(t,e,n,i,r){let s=r.get("outletState"),o=e.ref;r.set("outletState",o);let a={finalize:uu("render.outlet",jb,e)};if(void 0!==i.debugRenderTree){let t=qn(s),e=t?.render?.owner,n=qn(o),i=n?.render?.owner;if(e&&e!==i){let{mountPoint:t}=i;t&&(a.engine={mountPoint:t,instance:i})}}return a}getDebugName({name:t}){return`{{outlet}} for ${t}`}getDebugCustomRenderTree(t,e){let n=[];return n.push({bucket:e,type:"outlet",name:"main",args:Sy,instance:void 0,template:void 0}),e.engine&&n.push({bucket:e.engine,type:"engine",name:e.engine.mountPoint,args:Sy,instance:e.engine.instance,template:void 0}),n}getCapabilities(){return Db}getSelf(){return Rn}didCreate(){}didUpdate(){}didRenderLayout(t){t.finalize()}didUpdateLayout(){}getDestroyable(){return null}},Ub=em({id:"Hacwyo/Q",block:'[[[8,[30,1],null,[["@controller","@model"],[[30,2],[30,3]]],null]],["@Component","@controller","@model"],[]]',moduleName:"/home/runner/work/ember.js/ember.js/packages/@ember/-internals/glimmer/lib/component-managers/outlet.ts",isStrictMode:!0});class qb{handle=-1;resolvedName=null;manager=Bb;capabilities=Nb;compilable;constructor(t,e){this.state=e,this.compilable=nb(Ub(t)).asLayout()}}class Vb extends vb{component;constructor(t){super(),this.component=t}create(t,e,n,{isInteractive:i},r){let s=this.component,o=uu("render.component",_b,s);r.view=s;let a=""!==s.tagName;a||(i&&s.trigger("willRender"),s._transitionTo("hasElement"),i&&s.trigger("willInsertElement"));let l=new lb(s,null,_e,o,a,i);return je(s[fb]),l}}const $b={dynamicLayout:!0,dynamicTag:!0,prepareArgs:!1,createArgs:!1,attributeHook:!0,elementHook:!0,createCaller:!0,dynamicScope:!0,updateHook:!0,createInstance:!0,wrapped:!0,willDestroy:!1,hasSubOwner:!1};class Gb{handle=-1;resolvedName="-top-level";state;manager;capabilities=fi($b);compilable=null;constructor(t){this.manager=new Vb(t);let e=xl(t);this.state=e}}function Wb(t){return Pi(t,{})}class Hb{constructor(t){this.inner=t}}const Zb=Wb(({positional:t})=>{const e=t[0];return Fn(()=>{let t=qn(e);return je(gr(t)),er(t)&&(t=Jl(t)),new Hb(t)})});class Kb{position=0;constructor(t){this.length=t}isEmpty(){return!1}memoFor(t){return t}next(){let{length:t,position:e}=this;if(e>=t)return null;let n=this.valueFor(e),i=this.memoFor(e);return this.position++,{value:n,memo:i}}}class Yb extends Kb{static from(t){return t.length>0?new this(t):null}static fromForEachable(t){let e=[];return t.forEach(t=>e.push(t)),this.from(e)}constructor(t){super(t.length),this.array=t}valueFor(t){return this.array[t]}}class Xb extends Kb{static from(t){return t.length>0?new this(t):null}constructor(t){super(t.length),this.array=t}valueFor(t){return dr(this.array,t)}}class Jb extends Kb{static fromIndexable(t){let e=Object.keys(t);if(0===e.length)return null;{let n=[];for(let i of e){let e;e=t[i],Fe()&&(je(on(t,i)),Array.isArray(e)&&je(on(e,"[]"))),n.push(e)}return new this(e,n)}}static fromForEachable(t){let e=[],n=[],i=0,r=!1;return t.forEach(function(t,s){r=r||arguments.length>=2,r&&e.push(s),n.push(t),i++}),0===i?null:r?new this(e,n):new Yb(n)}constructor(t,e){super(e.length),this.keys=t,this.values=e}valueFor(t){return this.values[t]}memoFor(t){return this.keys[t]}}class Qb{static from(t){let e=t[Symbol.iterator](),n=e.next(),{done:i}=n;return i?null:new this(e,n)}position=0;constructor(t,e){this.iterable=t,this.result=e}isEmpty(){return!1}next(){let{iterable:t,result:e,position:n}=this;if(e.done)return null;let i=this.valueFor(e,n),r=this.memoFor(e,n);return this.position++,this.result=t.next(),{value:i,memo:r}}}class tw extends Qb{valueFor(t){return t.value}memoFor(t,e){return e}}class ew extends Qb{valueFor(t){return t.value[1]}memoFor(t){return t.value[0]}}function nw(t){return null!=t&&"function"==typeof t.forEach}function iw(t){return null!=t&&"function"==typeof t[Symbol.iterator]}var rw;rw={scheduleRevalidate(){ma.ensureInstance()},toBool:function(t){return er(t)?(je(fr(t,"content")),Boolean(Cs(t,"isTruthy"))):Ju(t)?(je(fr(t,"[]")),0!==t.length):null!==(e=t)&&"object"==typeof e&&"function"==typeof e.toHTML?Boolean(t.toString()):Boolean(t);var e},toIterator:function(t){return t instanceof Hb?function(t){return function(t){return null!==t&&("object"==typeof t||"function"==typeof t)}(t)?Array.isArray(t)||rr(t)?Jb.fromIndexable(t):iw(t)?ew.from(t):nw(t)?Jb.fromForEachable(t):Jb.fromIndexable(t):null}(t.inner):function(t){return H(t)?Array.isArray(t)?Yb.from(t):rr(t)?Xb.from(t):iw(t)?tw.from(t):nw(t)?Yb.fromForEachable(t):null:null}(t)},getProp:Ss,setProp:Fs,getPath:Cs,setPath:zs,scheduleDestroy(t,e){ba("actions",null,e,t)},scheduleDestroyed(t){ba("destroy",null,t)}},Nt=rw.scheduleRevalidate,Mt=rw.scheduleDestroy,Rt=rw.scheduleDestroyed,Pt=rw.toIterator,It=rw.toBool,Ot=rw.getProp,At=rw.setProp,zt=rw.getPath,Ft=rw.setPath;class sw{enableDebugTooling=g._DEBUG_RENDER_TREE;constructor(t,e){this.owner=t,this.isInteractive=e}onTransactionCommit(){}}const ow=Wb(({positional:t,named:e})=>{const n=t[0];let i=e.type,r=e.loc,s=e.original;return qn(i),qn(r),qn(s),Fn(()=>qn(n))});let aw;aw=t=>t.positional[0];const lw=Wb(aw),cw=Wb(({positional:t})=>Fn(()=>{let e=t[0],n=t[1],i=qn(e).split("."),r=i[i.length-1],s=qn(n);return!0===s?zf(r):s||0===s?String(s):""})),hw=Wb(({positional:t},e)=>{let n=qn(t[0]);return An(e.factoryFor(n)?.class)}),uw=Wb(({positional:t})=>{const e=t[0];return Fn(()=>{let t=qn(e);return H(t)&&je(fr(t,"[]")),t})}),dw=Wb(({positional:t})=>Nn(t[0])),pw=Wb(({positional:t})=>jn(t[0])),fw=Wb(({positional:t,named:e})=>zn(qn(t[0]))),gw=Wb(()=>An(([3e7]+-1e3+-4e3+-2e3+-1e11).replace(/[0-3]/g,t=>(4*t^16*Math.random()>>(2&t)).toString(16)))),mw={dynamicLayout:!0,dynamicTag:!1,prepareArgs:!1,createArgs:!0,attributeHook:!1,elementHook:!1,createCaller:!0,dynamicScope:!0,updateHook:!0,createInstance:!0,wrapped:!1,willDestroy:!1,hasSubOwner:!0},yw=new class{getDynamicLayout(t){return nb(t.engine.lookup("template:application")(t.engine)).asLayout()}getCapabilities(){return mw}getOwner(t){return t.engine}create(t,{name:e},n,i){let r=t.buildChildEngineInstance(e);r.boot();let s,o,a,l,c=r.factoryFor("controller:application")||pp(r,"application");if(n.named.has("model")&&(l=n.named.get("model")),void 0===l)s=c.create(),o=An(s),a={engine:r,controller:s,self:o,modelRef:l};else{let t=qn(l);s=c.create({model:t}),o=An(s),a={engine:r,controller:s,self:o,modelRef:l}}return i.debugRenderTree&&Gt(r,s),a}getDebugName({name:t}){return t}getDebugCustomRenderTree(t,e,n,i){return[{bucket:e.engine,instance:e.engine,type:"engine",name:t.name,args:n},{bucket:e.controller,instance:e.controller,type:"route-template",name:"application",args:n,template:i}]}getSelf({self:t}){return t}getDestroyable(t){return t.engine}didCreate(){}didUpdate(){}didRenderLayout(){}didUpdateLayout(){}update(t){let{controller:e,modelRef:n}=t;void 0!==n&&e.set("model",qn(n))}};class vw{handle=-1;state;manager=yw;compilable=null;capabilities=fi(mw);constructor(t){this.resolvedName=t,this.state={name:t}}}const _w=Wb((t,e)=>{let n,i,r,s=t.positional[0];return n=gy(t.named,Cy),Fn(()=>{let t=qn(s);return"string"==typeof t?(i===t||(i=t,r=Mm(0,new vw(t),e,n,!0)),r):(r=null,i=null,null)})}),bw={dynamicLayout:!1,dynamicTag:!1,prepareArgs:!1,createArgs:!0,attributeHook:!1,elementHook:!1,createCaller:!1,dynamicScope:!1,updateHook:!1,createInstance:!0,wrapped:!1,willDestroy:!1,hasSubOwner:!1},ww=fi(bw),xw=new class{create(t,e,n){let i=n.named.get("controller");return{self:i,controller:qn(i)}}getSelf({self:t}){return t}getDebugName({name:t}){return`route-template (${t})`}getDebugCustomRenderTree({name:t,templateName:e},n,i){return[{bucket:n,type:"route-template",name:t,args:i,instance:n.controller,template:e}]}getCapabilities(){return bw}didRenderLayout(){}didUpdateLayout(){}didCreate(){}didUpdate(){}getDestroyable(){return null}};class Cw{handle=-1;resolvedName;state;manager=xw;capabilities=ww;compilable;constructor(t,e){let n=nb(e);this.resolvedName=t,this.state={name:t,templateName:n.moduleName},this.compilable=n.asLayout()}}function Sw(t,e,n){return Mm(0,new Cw(e,n),t,null,!0)}const kw=Wb((t,e,n)=>{let i=Fn(()=>{let t=qn(n.get("outletState"));return t?.outlets?.main}),r=null,s=null;return Fn(()=>{let t=qn(i),n=function(t,e){if(void 0===e)return null;let n=e.render;if(void 0===n)return null;let i=n.template;return null==i?null:{ref:t,name:n.name,template:i,controller:n.controller}}(i,t);if(!function(t,e){return null!==t&&null!==e&&t.template===e.template&&t.controller===e.controller}(n,r))if(r=n,null!==n){let o,a=t?.render?.owner??e,l=vn(),c=n.template;o=Fi(c)?c:Sw(a,n.name,c),l.Component=An(o),l.controller=An(n.controller);let h=Gn(i,["render","model"]),u=qn(h);l.model=Fn(()=>(r===n&&(u=qn(h)),u));let d=gy(l,Cy);s=Mm(0,new qb(e,n),a,d,!0)}else s=null;return s})});function Ew(t){return{object:`component:${t}`}}const Tw={mut:dw,readonly:pw,unbound:fw,"-hash":dv,"-each-in":Zb,"-normalize-class":cw,"-resolve":hw,"-track-array":uw,"-mount":_w,"-outlet":kw,"-in-el-null":lw},Lw={...Tw,array:av,concat:cv,fn:hv,get:uv,hash:dv,"unique-id":gw};Lw["-disallow-dynamic-resolution"]=ow;const Mw={},Rw={...Mw,on:bv};class Pw{componentDefinitionCache=new Map;lookupPartial(){return null}lookupHelper(t,e){let n=Lw[t];if(void 0!==n)return n;let i=e.factoryFor(`helper:${t}`);if(void 0===i)return null;let r=i.class;return void 0===r?null:"function"==typeof r&&!0===r[Lb]?(Pi(Pb,i),i):r}lookupBuiltInHelper(t){return Tw[t]??null}lookupModifier(t,e){let n=Rw[t];if(void 0!==n)return n;let i=e.factoryFor(`modifier:${t}`);return void 0===i?null:i.class||null}lookupBuiltInModifier(t){return Mw[t]??null}lookupComponent(t,e){let n=function(t,e){let n=function(t,e){let n=`component:${t}`;return e.factoryFor(n)||null}(e,t);if(null!=(i=n)&&"function"==typeof i.create&&n.class){let t=Ji(n.class);if(void 0!==t)return{component:n,layout:t}}var i;return null===n?null:{component:n,layout:null}}(e,t);if(null===n)return null;let i,r=null;i=null===n.component?r=n.layout(e):n.component;let s=this.componentDefinitionCache.get(i);if(void 0!==s)return s;null===r&&null!==n.layout&&(r=n.layout(e));let o=uu("render.getComponentDefinition",Ew,t),a=null;if(null===n.component)a={state:Dy(void 0,t),manager:Fy,template:r};else{let t=n.component,e=t.class,i=zi(e);a={state:Cb(i)?t:e,manager:i,template:r}}return o(),this.componentDefinitionCache.set(i,a),a}}const Iw="-top-level";class Ow{static extend(t){return class extends Ow{static create(e){return e?super.create(Object.assign({},t,e)):super.create(t)}}}static reopenClass(t){Object.assign(this,t)}static create(t){let{environment:e,application:n,template:i}=t,r=hr(t),s=i(r);return new Ow(e,r,s,n)}ref;state;constructor(t,e,n,i){this._environment=t,this.owner=e,this.template=n,this.namespace=i;let r=ye(),s={outlets:{main:void 0},render:{owner:e,name:Iw,controller:void 0,model:void 0,template:n}},o=this.ref=Fn(()=>(je(r),s),t=>{ge(r),s.outlets.main=t});this.state={ref:o,name:Iw,template:n,controller:void 0}}appendTo(t){let e;e=this._environment.hasDOM&&"string"==typeof t?document.querySelector(t):t,ba("render",this.owner.lookup("renderer:-dom"),"appendOutletView",this,e)}rerender(){}setOutletState(t){Vn(this.ref,t)}destroy(){}}class Aw{constructor(t,e){this.view=t,this.outletState=e}child(){return new Aw(this.view,this.outletState)}get(t){return this.outletState}set(t,e){return this.outletState=e,e}}const zw=()=>{};class Fw{type="component";#b;#w;constructor(t,e,n){this.#w=()=>{let i=h_(t.context,t.builder(t.env,n.into),t.owner,e,n?.args),r=this.#b=i.sync();Gt(this,this.#b),this.#w=()=>{if(!Kt(r)&&!Yt(r))return r.rerender({alwaysRevalidate:!1})}}}isFor(t){return!1}render(){this.#w()}destroy(){Ht(this)}get destroyed(){return Yt(this)}get result(){return this.#b}}class jw{type="classic";id;result;destroyed;render;env;constructor(t,e,n,i,r,s,o,a){this.root=t,this.id=t instanceof Ow?et(t):Dh(t),this.result=void 0,this.destroyed=!1,this.env=e.env,this.render=()=>{let t=nb(i).asLayout(),l=c_(e,n,r,a(e.env,{element:s,nextSibling:null}),t,o),c=this.result=l.sync();Gt(n,c),this.render=()=>{if(!Kt(c)&&!Yt(c))return c.rerender({alwaysRevalidate:!1})}}}isFor(t){return this.root===t}destroy(){let{result:t,env:e}=this;this.destroyed=!0,this.root=null,this.result=void 0,this.render=void 0,void 0!==t&&rv(e,()=>Ht(t))}}const Dw=[];function Nw(t){let e=Dw.indexOf(t);Dw.splice(e,1)}let Bw=null,Uw=0;ma.on("begin",function(){for(let t of Dw)t.rerender()}),ma.on("end",function(){for(let t of Dw)if(!t.isValid()){if(Uw>g._RERENDER_LOOP_LIMIT)throw Uw=0,t.destroy(),new Error("infinite rendering invalidation detected");return Uw++,ma.join(null,zw)}Uw=0,function(){if(null!==Bw){let t=Bw.resolve;Bw=null,ma.join(null,t)}}()});class qw{static create(t,e){const n=new qw(t,e);return Gt(e,n),n}#x;#C=-1;#S=!1;#k=!1;#E=[];#T=[];constructor(t,e){this.#x=t,Wt(this,()=>{this.clearAllRoots(e)})}get debug(){return{roots:this.#E,inRenderTransaction:this.#S,isInteractive:this.isInteractive}}get roots(){return this.#E}get owner(){return this.#x.owner}get builder(){return this.#x.builder}get context(){return this.#x.context}get env(){return this.context.env}get isInteractive(){return this.#x.context.env.isInteractive}renderRoot(t,e){let n=this.#E;return n.push(t),Gt(this,t),1===n.length&&function(t){Dw.push(t)}(e),this.#L(e),t}#L(t){if(this.#S)return;this.#S=!0;let e=!1;try{this.renderRoots(t),e=!0}finally{e||(this.#C=ue(Se)),this.#S=!1}}renderRoots(t){let e,n=this.#E,i=this.#T;do{e=n.length,rv(this.context.env,()=>{for(let t=0;t<n.length;t++){let r=n[t];r.destroyed?i.push(r):t>=e||r.render()}this.#C=ue(Se)})}while(n.length>e);for(;i.length;){let t=i.pop(),e=n.indexOf(t);n.splice(e,1)}0===this.#E.length&&Nw(t)}scheduleRevalidate(t){ma.scheduleOnce("render",this,this.revalidate,t)}isValid(){return this.#k||0===this.#E.length||de(Se,this.#C)}revalidate(t){this.isValid()||this.#L(t)}clearAllRoots(t){let e=this.#E;for(let n of e)Ht(n);this.#T.length=0,this.#E=[],e.length&&Nw(t)}}class Vw{static strict(t,n,i){return new Vw(t,{hasDOM:e,...i},n,new Pw,Yv)}state;constructor(t,e,n,i,r){let s={constants:new lm,heap:new hm},o=iv({document:n},new sw(t,e.isInteractive),s,i),a=new Xg(s,t=>new cm(t),o);this.state=qw.create({owner:t,context:a,builder:r},this)}get debugRenderTree(){let{debugRenderTree:t}=this.state.env;return t}isValid(){return this.state.isValid()}destroy(){Ht(this)}render(t,e){const n=new Fw(this.state,t,{args:e.args,into:(i=e.into,"element"in i?i:{element:i,nextSibling:null})});var i;return this.state.renderRoot(n,this)}rerender(){this.state.scheduleRevalidate(this)}}class $w extends Vw{static strict(t,n,i){return new Vw(t,{hasDOM:e,...i},n,new Pw,Yv)}_rootTemplate;_viewRegistry;static create(t){let{_viewRegistry:e}=t,n=hr(t),i=n.lookup("service:-document"),r=n.lookup("-environment:main"),s=n.lookup(Ml`template:-root`),o=n.lookup("service:-dom-builder");return new this(n,i,r,s,e,o)}constructor(t,e,n,i,r,s=Yv,o=new Pw){super(t,n,e,o,s),this._rootTemplate=i(t),this._viewRegistry=r||t.lookup("-view-registry:main")}appendOutletView(t,e){let n=new qb((i=t).owner,i.state);var i;let{name:r,template:s}=t.state,o=vn();o.Component=An(Sw(t.owner,r,s)),o.controller=Rn,o.model=Rn;let a=gy(o,Cy);this._appendDefinition(t,Mm(0,n,t.owner,a,!0),e)}appendTo(t,e){let n=new Gb(t);this._appendDefinition(t,Mm(0,n,this.state.owner,null,!0),e)}_appendDefinition(t,e,n){let i=An(e),r=new Aw(null,Rn),s=new jw(t,this.state.context,this.state.owner,this._rootTemplate,i,n,r,this.state.builder);this.state.renderRoot(s,this)}cleanupRootFor(t){if(Yt(this))return;let e=this.state.roots,n=e.length;for(;n--;){let i=e[n];"classic"===i.type&&i.isFor(t)&&(i.destroy(),e.splice(n,1))}}remove(t){t._transitionTo("destroying"),this.cleanupRootFor(t),this.state.isInteractive&&t.trigger("didDestroyElement")}get _roots(){return this.state.debug.roots}get _inRenderTransaction(){return this.state.debug.inRenderTransaction}get _isInteractive(){return this.state.debug.isInteractive}get _context(){return this.state.context}register(t){let e=Dh(t);this._viewRegistry[e]=t}unregister(t){delete this._viewRegistry[Dh(t)]}getElement(t){if(this._isInteractive)return qh(t);throw new Error("Accessing `this.element` is not allowed in non-interactive environments (such as FastBoot).")}getBounds(t){let e=t[mb];return{parentElement:e.parentElement(),firstNode:e.firstNode(),lastNode:e.lastNode()}}}const Gw=em({id:"tiXbzL5t",block:'[[[46,[28,[32,0],null,null],null,null,null]],[],["component"]]',moduleName:"packages/@ember/-internals/glimmer/lib/templates/outlet.hbs",scope:()=>[kw],isStrictMode:!0});class Ww extends fd{rootElement=null;init(t){super.init(t),this.application._watchInstance(this),this.register("-application-instance:main",this,{instantiate:!1})}_bootSync(t){return this._booted||(t=new Hw(t),this.setupRegistry(t),t.rootElement?this.rootElement=t.rootElement:this.rootElement=this.application.rootElement,t.location&&zs(this.router,"location",t.location),this.application.runInstanceInitializers(this),t.isInteractive&&this.setupEventDispatcher(),this._booted=!0),this}setupRegistry(t){this.constructor.setupRegistry(this.__registry__,t)}_router;get router(){if(!this._router){let t=this.lookup("router:main");this._router=t}return this._router}didCreateRootView(t){t.appendTo(this.rootElement)}startRouting(){this.router.startRouting()}setupRouter(){this.router.setupRouter()}handleURL(t){return this.setupRouter(),this.router.handleURL(t)}setupEventDispatcher(){let t=this.lookup("event_dispatcher:main"),e=Cs(this.application,"customEvents"),n=Cs(this,"customEvents"),i=Object.assign({},e,n);return t.setup(i,this.rootElement),t}getURL(){return this.router.url}visit(t){this.setupRouter();let e=this.__container__.lookup("-environment:main"),n=this.router,i=()=>e.options.shouldRender?(null===Bw&&(Bw=dh.defer(),pa()||ma.schedule("actions",null,zw)),Bw.promise).then(()=>this):this,r=t=>{if(t.error&&t.error instanceof Error)throw t.error;if("TransitionAborted"===t.name&&n._routerMicrolib.activeTransition)return n._routerMicrolib.activeTransition.then(i,r);throw"TransitionAborted"===t.name?new Error(t.message):t},s=Cs(n,"location");return s.setURL(t),n.handleURL(s.getURL()).then(i,r)}willDestroy(){super.willDestroy(),this.application._unwatchInstance(this)}static setupRegistry(t,e={}){let n=e instanceof Hw?e:new Hw(e);t.register("-environment:main",n.toEnvironment(),{instantiate:!1}),t.register("service:-document",n.document,{instantiate:!1}),super.setupRegistry(t,n)}}class Hw{isInteractive;_renderMode;isBrowser;location=null;shouldRender;document;rootElement;constructor(t={}){this.isInteractive=Boolean(e),this._renderMode=t._renderMode,void 0!==t.isBrowser?this.isBrowser=Boolean(t.isBrowser):this.isBrowser=Boolean(e),this.isBrowser||(this.isInteractive=!1,this.location="none"),void 0!==t.shouldRender?this.shouldRender=Boolean(t.shouldRender):this.shouldRender=!0,this.shouldRender||(this.isInteractive=!1),t.document?this.document=t.document:this.document="undefined"!=typeof document?document:null,t.rootElement&&(this.rootElement=t.rootElement),void 0!==t.location&&(this.location=t.location),void 0!==t.isInteractive&&(this.isInteractive=Boolean(t.isInteractive))}toEnvironment(){return{...l,hasDOM:this.isBrowser,isInteractive:this.isInteractive,_renderMode:this._renderMode,options:this}}}function Zw(t,e){return null!=t&&"function"==typeof t[e]}class Kw extends Mh{static NAMESPACES=ao;static NAMESPACES_BY_ID=lo;static processAll=go;static byName=po;init(t){super.init(t),co(this)}toString(){let t=Cs(this,"name")||Cs(this,"modulePrefix");if(t)return t;uo();let e=no(this);return void 0===e&&(e=et(this),eo(this,e)),e}nameClasses(){fo(this)}destroy(){return ho(this),super.destroy()}}Kw.prototype.isNamespace=!0;const Yw=Object.freeze(Object.defineProperty({__proto__:null,default:Kw},Symbol.toStringTag,{value:"Module"}));var Xw=function(){function t(){this._vertices=new Jw}return t.prototype.add=function(t,e,n,i){if(!t)throw new Error("argument `key` is required");var r=this._vertices,s=r.add(t);if(s.val=e,n)if("string"==typeof n)r.addEdge(s,r.add(n));else for(var o=0;o<n.length;o++)r.addEdge(s,r.add(n[o]));if(i)if("string"==typeof i)r.addEdge(r.add(i),s);else for(o=0;o<i.length;o++)r.addEdge(r.add(i[o]),s)},t.prototype.addEdges=function(t,e,n,i){this.add(t,e,n,i)},t.prototype.each=function(t){this._vertices.walk(t)},t.prototype.topsort=function(t){this.each(t)},t}(),Jw=function(){function t(){this.length=0,this.stack=new Qw,this.path=new Qw,this.result=new Qw}return t.prototype.add=function(t){if(!t)throw new Error("missing key");for(var e,n=0|this.length,i=0;i<n;i++)if((e=this[i]).key===t)return e;return this.length=n+1,this[n]={idx:n,key:t,val:void 0,out:!1,flag:!1,length:0}},t.prototype.addEdge=function(t,e){this.check(t,e.key);for(var n=0|e.length,i=0;i<n;i++)if(e[i]===t.idx)return;e.length=n+1,e[n]=t.idx,t.out=!0},t.prototype.walk=function(t){this.reset();for(var e=0;e<this.length;e++){var n=this[e];n.out||this.visit(n,"")}this.each(this.result,t)},t.prototype.check=function(t,e){if(t.key===e)throw new Error("cycle detected: "+e+" <- "+e);if(0!==t.length){for(var n=0;n<t.length;n++)if(this[t[n]].key===e)throw new Error("cycle detected: "+e+" <- "+t.key+" <- "+e);if(this.reset(),this.visit(t,e),this.path.length>0){var i="cycle detected: "+e;throw this.each(this.path,function(t){i+=" <- "+t}),new Error(i)}}},t.prototype.reset=function(){this.stack.length=0,this.path.length=0,this.result.length=0;for(var t=0,e=this.length;t<e;t++)this[t].flag=!1},t.prototype.visit=function(t,e){var n=this,i=n.stack,r=n.path,s=n.result;for(i.push(t.idx);i.length;){var o=0|i.pop();if(o>=0){var a=this[o];if(a.flag)continue;if(a.flag=!0,r.push(o),e===a.key)break;i.push(~o),this.pushIncoming(a)}else r.pop(),s.push(~o)}},t.prototype.pushIncoming=function(t){for(var e=this.stack,n=t.length-1;n>=0;n--){var i=t[n];this[i].flag||e.push(i)}},t.prototype.each=function(t,e){for(var n=0,i=t.length;n<i;n++){var r=this[t[n]];e(r.key,r.val)}},t}(),Qw=function(){function t(){this.length=0}return t.prototype.push=function(t){this[this.length++]=0|t},t.prototype.pop=function(){return 0|this[--this.length]},t}();class tx extends Mh{constructor(t){super(t),this.resolver=hr(this).lookup("resolver-for-debugging:main")}resolver;canCatalogEntriesByType(t){return"model"!==t&&"template"!==t}catalogEntriesByType(t){let e=Kw.NAMESPACES,n=[],i=new RegExp(`${r=t,If.get(r)}$`);var r;return e.forEach(t=>{for(let e in t)Object.prototype.hasOwnProperty.call(t,e)&&i.test(e)&&"class"===Fu(t[e])&&n.push(zf(e.replace(i,"")))}),n}}class ex extends Mh{componentFor(t,e){let n=`component:${t}`;return e.factoryFor(n)}layoutFor(t,e,n){let i=`template:components/${t}`;return e.lookup(i,n)}}const nx=new WeakMap;class ix extends Gv{__openBlock(){let{tagName:t}=this.element;if("TITLE"!==t&&"SCRIPT"!==t&&"STYLE"!==t){let t=this.serializeBlockDepth++;this.__appendComment(`%+b:${t}%`)}super.__openBlock()}__closeBlock(){let{tagName:t}=this.element;if(super.__closeBlock(),"TITLE"!==t&&"SCRIPT"!==t&&"STYLE"!==t){let t=--this.serializeBlockDepth;this.__appendComment(`%-b:${t}%`)}}__appendHTML(t){let{tagName:e}=this.element;if("TITLE"===e||"SCRIPT"===e||"STYLE"===e)return super.__appendHTML(t);let n=this.__appendComment("%glmr%");if("TABLE"===e){let e=t.indexOf("<");e>-1&&"tr"===t.slice(e+1,e+3)&&(t=`<tbody>${t}</tbody>`)}""===t?this.__appendComment("% %"):super.__appendHTML(t);let i=this.__appendComment("%glmr%");return new Om(this.element,n,i)}__appendText(t){let{tagName:e}=this.element,n=function(t){let{element:e,nextSibling:n}=t;return null===n?e.lastChild:n.previousSibling}(this);return"TITLE"===e||"SCRIPT"===e||"STYLE"===e?super.__appendText(t):""===t?this.__appendComment("% %"):(n&&3===n.nodeType&&this.__appendComment("%|%"),super.__appendText(t))}closeElement(){return nx.has(this.element)&&(nx.delete(this.element),super.closeElement()),super.closeElement()}openElement(t){return"tr"===t&&"TBODY"!==this.element.tagName&&"THEAD"!==this.element.tagName&&"TFOOT"!==this.element.tagName&&(this.openElement("tbody"),nx.set(this.constructing,!0),this.flushElement(null)),super.openElement(t)}pushRemoteElement(t,e,n=null){let{dom:i}=this,r=i.createElement("script");return r.setAttribute("glmr",e),i.insertBefore(t,r,n),super.pushRemoteElement(t,e,n)}constructor(...t){super(...t),this.serializeBlockDepth=0}}function rx(t,e){return ix.forInitialRender(t,e)}function sx(t){t.register("service:-dom-builder",{create(t){switch(hr(t).lookup("-environment:main")._renderMode){case"serialize":return rx.bind(null);case"rehydrate":return x_.bind(null);default:return Yv.bind(null)}}}),t.register(Ml`template:-root`,E_),t.register("renderer:-dom",$w)}class ox extends(Kw.extend(Hl)){static initializers=Object.create(null);static instanceInitializers=Object.create(null);static initializer=lx("initializers");static instanceInitializer=lx("instanceInitializers");static buildRegistry(t){let e=new El({resolver:ax(t)});return e.set=zs,e.register("application:main",t,{instantiate:!1}),function(t){t.optionsForType("component",{singleton:!1}),t.optionsForType("view",{singleton:!1}),t.register("controller:basic",cd,{instantiate:!1}),t.register("service:-routing",Zf),t.register("resolver-for-debugging:main",t.resolver,{instantiate:!1}),t.register("container-debug-adapter:main",tx),t.register("component-lookup:main",ex)}(e),function(t){t.optionsForType("template",{instantiate:!1}),t.register("view:-outlet",Ow),t.register("template:-outlet",Gw),t.optionsForType("helper",{instantiate:!1}),t.register("component:input",V_),t.register("component:link-to",J_),t.register("component:textarea",eb)}(e),e}init(t){super.init(t),this.buildRegistry()}_initializersRan=!1;ensureInitializers(){this._initializersRan||(this.runInitializers(),this._initializersRan=!0)}buildInstance(t={}){return this.ensureInitializers(),fd.create({...t,base:this})}buildRegistry(){return this.__registry__=this.constructor.buildRegistry(this)}initializer(t){this.constructor.initializer(t)}instanceInitializer(t){this.constructor.instanceInitializer(t)}runInitializers(){this._runInitializer("initializers",(t,e)=>{e.initialize(this)})}runInstanceInitializers(t){this._runInitializer("instanceInitializers",(e,n)=>{n.initialize(t)})}_runInitializer(t,e){let n,i=Cs(this.constructor,t),r=function(t){let e=[];for(let n in t)e.push(n);return e}(i),s=new Xw;for(let o of r)n=i[o],s.add(n.name,n,n.before,n.after);s.topsort(e)}}function ax(t){let e={namespace:t};return t.Resolver.create(e)}function lx(t){return function(e){let n=this.superclass;if(void 0!==n[t]&&n[t]===this[t]){let e={[t]:Object.create(this[t])};this.reopenClass(e)}this[t][e.name]=e}}const cx=al,hx=ur;class ux extends ox{static buildRegistry(t){let e=super.buildRegistry(t);return function(t){t.register("router:main",af),t.register("-view-registry:main",{create:()=>cl(null)}),t.register("route:basic",kp),t.register("event_dispatcher:main",eu),t.register("location:hash",_f),t.register("location:history",xf),t.register("location:none",Cf),t.register(Ml`-bucket-cache:main`,{create:()=>new Ip}),t.register("service:router",Hf)}(e),sx(e),e}static initializer=lx("initializers");static instanceInitializer=lx("instanceInitializers");init(t){super.init(t),this.rootElement??="body",this._document??=null,this.eventDispatcher??=null,this.customEvents??=null,this.autoboot??=!0,this._document??=e?window.document:null,this._globalsMode??=!0,this._readinessDeferrals=1,this._booted=!1,this._applicationInstances=new Set,this.autoboot=this._globalsMode=Boolean(this.autoboot),this._globalsMode&&this._prepareForGlobalsMode(),this.autoboot&&this.waitForDOMReady()}buildInstance(t={}){return Ww.create({...t,base:this,application:this})}_watchInstance(t){this._applicationInstances.add(t)}_unwatchInstance(t){return this._applicationInstances.delete(t)}Router;_prepareForGlobalsMode(){this.Router=(this.Router||af).extend(),this._buildDeprecatedInstance()}__deprecatedInstance__;__container__;_buildDeprecatedInstance(){let t=this.buildInstance();this.__deprecatedInstance__=t,this.__container__=t.__container__}waitForDOMReady(){const t=this._document;if(null===t||"loading"!==t.readyState)ba("actions",this,this.domReady);else{let e=()=>{t.removeEventListener("DOMContentLoaded",e),ya(this,this.domReady)};t.addEventListener("DOMContentLoaded",e)}}domReady(){this.isDestroying||this.isDestroyed||this._bootSync()}deferReadiness(){this._readinessDeferrals++}advanceReadiness(){this._readinessDeferrals--,0===this._readinessDeferrals&&xa(this,this.didBecomeReady)}_bootPromise=null;boot(){if(this._bootPromise)return this._bootPromise;try{this._bootSync()}catch(t){}return this._bootPromise}_bootResolver=null;_bootSync(){if(this._booted||this.isDestroying||this.isDestroyed)return;let t=this._bootResolver=ph.defer();this._bootPromise=t.promise;try{this.runInitializers(),fl("application",this),this.advanceReadiness()}catch(IN){throw t.reject(IN),IN}}reset(){let t=this.__deprecatedInstance__;this._readinessDeferrals=1,this._bootPromise=null,this._bootResolver=null,this._booted=!1,va(this,function(){ya(t,"destroy"),this._buildDeprecatedInstance(),ba("actions",this,"_bootSync")})}didBecomeReady(){if(!this.isDestroying&&!this.isDestroyed)try{if(this.autoboot){let t;t=this._globalsMode?this.__deprecatedInstance__:this.buildInstance(),t._bootSync(),this.ready(),t.startRouting()}this._bootResolver.resolve(this),this._booted=!0}catch(IN){throw this._bootResolver.reject(IN),IN}}ready(){return this}willDestroy(){super.willDestroy(),dl.application===this&&(dl.application=void 0),this._applicationInstances.size&&(this._applicationInstances.forEach(t=>t.destroy()),this._applicationInstances.clear())}visit(t,e){return this.boot().then(()=>{let n=this.buildInstance();return n.boot(e).then(()=>n.visit(t)).catch(t=>{throw ya(n,"destroy"),t})})}}const dx=Object.freeze(Object.defineProperty({__proto__:null,_loaded:dl,default:ux,getOwner:cx,onLoad:pl,runLoadHooks:fl,setOwner:hx},Symbol.toStringTag,{value:"Module"})),px=Object.assign({},{});function fx(){return gx.global}const gx={packages:{},global:{}};let mx="undefined"!=typeof window?window._embroider_macros_runtime_config:void 0;if(mx){let t={config:function(t){return gx.packages[t]},getGlobalConfig:fx,setConfig(t,e){gx.packages[t]=e},setGlobalConfig(t,e){gx.global[t]=e}};for(let e of mx)e(t)}const yx={modulePrefix:"marco",environment:"production",rootURL:"/",locationType:"history",EmberENV:{},APP:{}},vx=Object.freeze(Object.defineProperty({__proto__:null,default:yx,enterTestMode:function(){yx.locationType="none",yx.APP.rootElement="#ember-testing",yx.APP.autoboot=!1;const t=fx()["@embroider/macros"];t&&(t.isTesting=!0)}},Symbol.toStringTag,{value:"Module"}));var _x;_x={throwOnUnhandled:!1,workflow:[]},self.deprecationWorkflow=self.deprecationWorkflow||{},self.deprecationWorkflow.deprecationLog={messages:new Set},self.deprecationWorkflow.flushDeprecations=t=>function({handler:t="silence",config:e={}}={}){let n=self.deprecationWorkflow.deprecationLog.messages,i=e.workflow??[],r=n.values().filter(t=>!i.some(e=>e.matchId===t)).map(e=>({handler:t,matchId:e})),s={...e,workflow:[...i,...r]};return`import setupDeprecationWorkflow from 'ember-cli-deprecation-workflow';\n\nsetupDeprecationWorkflow(${JSON.stringify(s,void 0,2)});`}({config:_x,...t});const bx=Object.freeze(Object.defineProperty({__proto__:null},Symbol.toStringTag,{value:"Module"}));function wx(t,e){return Wt(t,e)}function xx(t,e){return function(t,e,n=!1){let i=$t(t),r=n?"eagerDestructors":"destructors";i[r]=Vt(i[r],e)}(t,e)}!function(){const t="TEST_WAITERS",e="undefined"!=typeof Symbol?Symbol.for(t):t,n=function(){if("undefined"!=typeof globalThis)return globalThis;if("undefined"!=typeof self)return self;if("undefined"!=typeof window)return window;throw new Error("unable to locate global object")}();let i=n[e];void 0===i&&(i=n[e]=new Map)}();const Cx=Object.freeze(Object.defineProperty({__proto__:null,assertDestroyablesDestroyed:Dt,associateDestroyableChild:Gt,destroy:Ht,enableDestroyableTracking:jt,isDestroyed:Yt,isDestroying:Kt,registerDestructor:wx,unregisterDestructor:xx},Symbol.toStringTag,{value:"Module"}));let Sx;Sx=af;var kx=Sx;class Ex extends kx{location=yx.locationType;rootURL=yx.rootURL}Ex.map(function(){this.route("place",{path:"/place/:place_id"}),this.route("place.new",{path:"/place/new"}),this.route("search")});const Tx=Object.freeze(Object.defineProperty({__proto__:null,default:Ex},Symbol.toStringTag,{value:"Module"})),Lx=new WeakMap;function Mx(t,e,n,i){let r={configurable:!0,enumerable:!0,writable:!0,initializer:null};i&&(r.initializer=i);for(let s of n)r=s(t,e,r)||r;void 0===r.initializer?Object.defineProperty(t,e,r):function(t,e,n){let i=Lx.get(t);i||(i=new Map,Lx.set(t,i)),i.set(e,n)}(t,e,r)}function Rx(t,e,n){let i={...Object.getOwnPropertyDescriptor(t,e)};for(let r of n)i=r(t,e,i)||i;void 0!==i.initializer&&(i.value=i.initializer?i.initializer.call(t):void 0,i.initializer=void 0),Object.defineProperty(t,e,i)}function Px(t,e){let n=function(t,e){var n;let i=t.prototype;for(;i;){let t=null==(n=Lx.get(i))?void 0:n.get(e);if(t)return t;i=i.prototype}}(t.constructor,e);n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(t):void 0})}class Ix extends Vf{static{Mx(this.prototype,"selectedPlace",[Ps],function(){return null})}#M=void Px(this,"selectedPlace");static{Mx(this.prototype,"isSearching",[Ps],function(){return!1})}#R=void Px(this,"isSearching");static{Mx(this.prototype,"isCreating",[Ps],function(){return!1})}#P=void Px(this,"isCreating");static{Mx(this.prototype,"creationCoordinates",[Ps],function(){return null})}#I=void Px(this,"creationCoordinates");static{Mx(this.prototype,"returnToSearch",[Ps],function(){return!1})}#O=void Px(this,"returnToSearch");static{Mx(this.prototype,"currentCenter",[Ps],function(){return null})}#A=void Px(this,"currentCenter");static{Mx(this.prototype,"currentBounds",[Ps],function(){return null})}#z=void Px(this,"currentBounds");static{Mx(this.prototype,"searchBoxHasFocus",[Ps],function(){return!1})}#F=void Px(this,"searchBoxHasFocus");static{Mx(this.prototype,"selectionOptions",[Ps],function(){return{}})}#j=void Px(this,"selectionOptions");static{Mx(this.prototype,"preventNextZoom",[Ps],function(){return!1})}#D=void Px(this,"preventNextZoom");static{Mx(this.prototype,"searchResults",[Ps],function(){return[]})}#N=void Px(this,"searchResults");static{Mx(this.prototype,"currentSearch",[Ps],function(){return null})}#B=void Px(this,"currentSearch");static{Mx(this.prototype,"loadingState",[Ps],function(){return null})}#U=void Px(this,"loadingState");selectPlace(t,e={}){this.selectedPlace=t,this.selectionOptions=e}clearSelection(){this.selectedPlace=null,this.selectionOptions={},this.preventNextZoom=!1}setSearchResults(t){this.searchResults=t||[]}clearSearchResults(){this.searchResults=[],this.currentSearch=null}startSearch(){this.isSearching=!0,this.isCreating=!1,this.preventNextZoom=!1}stopSearch(){this.isSearching=!1}startCreating(){this.isCreating=!0,this.isSearching=!1}stopCreating(){this.isCreating=!1,this.creationCoordinates=null}updateCreationCoordinates(t,e){this.creationCoordinates={lat:t,lon:e}}setSearchBoxFocus(t){this.searchBoxHasFocus=t}updateCenter(t,e){this.currentCenter={lat:t,lon:e}}updateBounds(t){this.currentBounds=t}startLoading(t,e){this.loadingState={type:t,value:e}}stopLoading(t=null,e=null){t||e?this.loadingState&&this.loadingState.type===t&&this.loadingState.value===e&&(this.loadingState=null):this.loadingState=null}}const Ox=Object.freeze(Object.defineProperty({__proto__:null,default:Ix},Symbol.toStringTag,{value:"Module"}));function Ax(t){return"string"==typeof t&&t?t.replace(/[_-]/g," ").replace(/\w\S*/g,t=>t.replace(/^\w/,t=>t.toUpperCase())):""}const zx=Object.freeze(Object.defineProperty({__proto__:null,humanizeOsmTag:Ax},Symbol.toStringTag,{value:"Module"}));function Fx(t,e="Untitled Place"){if(!t)return e;const n=navigator.languages||[navigator.language||"en"];for(const i of n){if(!i)continue;const e=`name:${i.split("-")[0]}`;if(t[e])return t[e]}return t.name?t.name:t["name:en"]?t["name:en"]:e}const jx=["amenity","shop","tourism","historic","leisure","office","craft","building","landuse","public_transport","highway","aeroway","waterway","natural","place","border_type","admin_title"];function Dx(t){if(!t)return null;for(const e of jx){const n=t[e];if(n)return Ax("yes"===n?e:n)}return null}const Nx=Object.freeze(Object.defineProperty({__proto__:null,getLocalizedName:Fx,getPlaceType:Dx},Symbol.toStringTag,{value:"Module"})),Bx=[{id:"restaurants",label:"Restaurants",icon:"fork-and-knife",filter:['["amenity"~"^(restaurant|fast_food|food_court|pub|cafe)$"]["cuisine"!~"coffee"]'],types:["node","way"]},{id:"coffee",label:"Coffee",icon:"cup-and-saucer",filter:['["amenity"~"^(cafe|ice_cream)$"]','["shop"~"^(coffee|tea)$"]','["cuisine"~"coffee_shop"]'],types:["node","way"]},{id:"groceries",label:"Groceries",icon:"shopping-basket",filter:['["shop"~"^(supermarket|convenience|grocery|greengrocer|bakery|butcher|deli|farm|seafood)$"]'],types:["node","way"]},{id:"things-to-do",label:"Things to do",icon:"camera",filter:['["tourism"~"^(museum|gallery|attraction|viewpoint|zoo|theme_park|aquarium|artwork)$"]','["amenity"~"^(cinema|theatre|arts_centre|planetarium)$"]','["leisure"~"^(sports_centre|stadium|water_park)$"]','["historic"]','["shop"="flea_market"]'],types:["node","way","relation"]},{id:"accommodation",label:"Hotels",icon:"person-sleeping-in-bed",filter:['["tourism"~"^(hotel|hostel|motel)$"]'],types:["node","way","relation"]}];function Ux(t){return Bx.find(e=>e.id===t)}const qx=Object.freeze(Object.defineProperty({__proto__:null,POI_CATEGORIES:Bx,getCategoryById:Ux},Symbol.toStringTag,{value:"Module"}));class Vx extends Vf{static{Mx(this.prototype,"settings",[qf])}#q=void Px(this,"settings");controller=null;cachedResults=null;lastQueryKey=null;cancelAll(){this.controller&&(this.controller.abort(),this.controller=null)}async getNearbyPois(t,e,n=50){const i=`${t},${e},${n}`;if(this.lastQueryKey===i&&this.cachedResults)return console.debug("Returning cached Overpass results for:",i),this.cachedResults;this.controller&&this.controller.abort(),this.controller=new AbortController;const r=this.controller.signal,s=[`~"^(${["amenity","shop","tourism","historic","leisure","office","craft","building","landuse","public_transport","aeroway"].join("|")})$"~".*"`],o=Object.entries({public_transport:["stop_area","platform"]}).map(([t,e])=>`["${t}"!~"^(${e.join("|")})$"]`).join(""),a=`\n[out:json][timeout:25];\n(\n node(around:${n},${t},${e})\n [${s}]${o}[~"^name"~"."];\n way(around:${n},${t},${e})\n [${s}]${o}[~"^name"~"."];\n relation(around:${n},${t},${e})\n [${s}]${o}[~"^name"~"."];\n);\nout center;\n `.trim(),l=`${this.settings.overpassApi}?data=${encodeURIComponent(a)}`;try{const t=await this.fetchWithRetry(l,{signal:r});if(!t.ok)throw new Error("Overpass request failed");const e=(await t.json()).elements.map(this.normalizePoi);return this.lastQueryKey=i,this.cachedResults=e,e}catch(c){if("AbortError"===c.name)return console.debug("Overpass request aborted"),[];throw c}}async getCategoryPois(t,e,n,i){const r=Ux(e);if(!r||!t)return[];const s=n&&i?`cat:${e}:${n}:${i}`:null;if(s&&this.lastQueryKey===s&&this.cachedResults)return console.debug("Returning cached category results for:",s),this.cachedResults;this.controller&&this.controller.abort(),this.controller=new AbortController;const o=this.controller.signal,{minLat:a,minLon:l,maxLat:c,maxLon:h}=t,u=[],d=r.types||["node","way","relation"];r.filter.forEach(t=>{d.forEach(e=>{u.push(`${e}${t}[~"^name"~"."];`)})});const p=`\n[out:json][timeout:25][bbox:${a},${l},${c},${h}];\n(\n ${u.join("\n ")}\n);\nout center;\n `.trim(),f=`${this.settings.overpassApi}?data=${encodeURIComponent(p)}`;try{const t=await this.fetchWithRetry(f,{signal:o});if(!t.ok)throw new Error("Overpass request failed");const e=(await t.json()).elements.map(this.normalizePoi);return s&&(this.lastQueryKey=s,this.cachedResults=e),e}catch(g){if("AbortError"===g.name)return console.debug("Category search aborted"),[];throw console.error("Category search failed",g),g}}normalizePoi(t){const e=t.tags||{},n=Dx(e)||"Point of Interest";return{title:Fx(e),lat:t.lat||t.center?.lat,lon:t.lon||t.center?.lon,url:e.website,osmId:String(t.id),osmType:t.type,osmTags:e,description:e.description,source:"osm",type:n}}async fetchWithRetry(t,e={},n=3){try{const i=await fetch(t,e);return!i.ok&&n>0&&[502,503,504,429].includes(i.status)?(console.warn(`Overpass request failed with ${i.status}. Retrying... (${n} left)`),await new Promise(t=>setTimeout(t,1e3)),this.fetchWithRetry(t,e,n-1)):i}catch(i){if(n>0&&"AbortError"!==i.name)return console.debug(`Retrying Overpass request... (${n} left)`),await new Promise(t=>setTimeout(t,1e3)),this.fetchWithRetry(t,e,n-1);throw i}}async getPoiById(t,e=null){let n;n="node"===e?`[out:json][timeout:25];node(${t});out center;`:"way"===e?`[out:json][timeout:25];way(${t});out center;`:`\n[out:json][timeout:25];\n(\n node(${t});\n way(${t});\n);\nout center;\n `.trim();const i=`${this.settings.overpassApi}?data=${encodeURIComponent(n)}`,r=await this.fetchWithRetry(i);if(!r.ok)throw new Error("Overpass request failed");const s=await r.json();return s.elements[0]?this.normalizePoi(s.elements[0]):null}async fetchOsmObject(t,e){if(!t||!e)return null;let n;if("node"===e)n=`https://www.openstreetmap.org/api/0.6/node/${t}.json`;else if("way"===e)n=`https://www.openstreetmap.org/api/0.6/way/${t}/full.json`;else{if("relation"!==e)return console.error("Unknown OSM type:",e),null;n=`https://www.openstreetmap.org/api/0.6/relation/${t}/full.json`}try{const i=await this.fetchWithRetry(n);if(!i.ok){if(410===i.status)return console.warn("OSM object has been deleted"),null;throw new Error(`OSM API request failed: ${i.status}`)}const r=await i.json();return this.normalizeOsmApiData(r.elements,t,e)}catch(i){return console.error("Failed to fetch OSM object:",i),null}}normalizeOsmApiData(t,e,n){if(!t||0===t.length)return null;let i=t.find(t=>String(t.id)===String(e)&&t.type===n);if(!i)return null;let r=i;if("relation"===n&&i.members){const e=i.members.find(t=>"label"===t.role&&"node"===t.type),n=i.members.find(t=>"admin_centre"===t.role&&"node"===t.type),s=e||n;if(s){const e=t.find(t=>String(t.id)===String(s.ref)&&"node"===t.type);e&&(r=e)}}let s=r.lat,o=r.lon,a=null,l=null;if("way"===n&&i.nodes){const e=new Map;t.forEach(t=>{"node"===t.type&&e.set(t.id,[t.lon,t.lat])});const n=i.nodes.map(t=>e.get(t)).filter(Boolean);if(n.length>0){if(r===i){const t=n.reduce((t,e)=>t+e[1],0),e=n.reduce((t,e)=>t+e[0],0);s=t/n.length,o=e/n.length}const t=n.map(t=>t[1]),e=n.map(t=>t[0]);if(a={minLat:Math.min(...t),maxLat:Math.max(...t),minLon:Math.min(...e),maxLon:Math.max(...e)},n.length>1){const t=n[0],e=n[n.length-1];l=t[0]===e[0]&&t[1]===e[1]?{type:"Polygon",coordinates:[n]}:{type:"LineString",coordinates:n}}}}else if("relation"===n&&i.members){const e=[],n=new Map;t.forEach(t=>{"node"===t.type&&n.set(t.id,t)});const c=[];if(i.members.forEach(i=>{if("node"===i.type){const t=n.get(i.ref);t&&e.push(t)}else if("way"===i.type){const r=t.find(t=>"way"===t.type&&t.id===i.ref);if(r&&r.nodes){const t=[];r.nodes.forEach(i=>{const r=n.get(i);r&&(e.push(r),t.push([r.lon,r.lat]))}),t.length>1&&c.push(t)}}}),e.length>0){if(r===i){const t=e.reduce((t,e)=>t+e.lat,0),n=e.reduce((t,e)=>t+e.lon,0);s=t/e.length,o=n/e.length}const t=e.map(t=>t.lat),n=e.map(t=>t.lon);a={minLat:Math.min(...t),maxLat:Math.max(...t),minLon:Math.min(...n),maxLon:Math.max(...n)}}c.length>0&&(l={type:"MultiLineString",coordinates:c})}const c=r.tags||{},h=Dx(c)||"Point of Interest";return{title:Fx(c),lat:s,lon:o,bbox:a,geojson:l,url:c.website,osmId:String(r.id),osmType:r.type,osmTags:c,description:c.description,source:"osm",type:h}}}const $x=Object.freeze(Object.defineProperty({__proto__:null,default:Vx},Symbol.toStringTag,{value:"Module"}));class Gx extends Vf{static{Mx(this.prototype,"settings",[qf])}#q=void Px(this,"settings");controller=null;cancelAll(){this.controller&&(this.controller.abort(),this.controller=null)}get baseUrl(){return this.settings.photonApi}async search(t,e,n,i=10){if(!t||t.length<2)return[];this.controller&&this.controller.abort(),this.controller=new AbortController;const r=this.controller.signal,s=new URLSearchParams({q:t,limit:String(i)});e&&n&&(s.append("lat",parseFloat(e).toFixed(4)),s.append("lon",parseFloat(n).toFixed(4)));const o=`${this.baseUrl}?${s.toString()}`;try{const t=await this.fetchWithRetry(o,{signal:r});if(!t.ok)throw new Error(`Photon request failed with status ${t.status}`);const e=await t.json();return e.features?e.features.map(t=>this.normalizeFeature(t)):[]}catch(a){return"AbortError"===a.name||console.error("Photon search error:",a),[]}}normalizeFeature(t){const e=t.properties||{},n=(t.geometry||{}).coordinates||[],i=n[0],r=n[1],s=[];e.street&&s.push(e.housenumber?`${e.street} ${e.housenumber}`:e.street),e.city&&e.city!==e.name&&s.push(e.city),e.state&&e.state!==e.city&&s.push(e.state),e.country&&s.push(e.country);const o=s.join(", "),a=e.name||o||"Unknown Place",l={...e};e.osm_key&&e.osm_value&&(l[e.osm_key]=e.osm_value);const c=Dx(l)||Ax(e.osm_value);return{title:a,lat:r,lon:i,osmId:e.osm_id,osmType:{N:"node",W:"way",R:"relation"}[e.osm_type]||e.osm_type,osmTags:l,description:e.name?o:s.slice(1).join(", "),source:"photon",type:c}}async fetchWithRetry(t,e={},n=3){try{const i=await fetch(t,e);return!i.ok&&n>0&&[502,503,504,429].includes(i.status)?(console.warn(`Photon request failed with ${i.status}. Retrying... (${n} left)`),await new Promise(t=>setTimeout(t,1e3)),this.fetchWithRetry(t,e,n-1)):i}catch(i){if(n>0&&"AbortError"!==i.name)return console.debug(`Retrying Photon request... (${n} left)`,i),await new Promise(t=>setTimeout(t,1e3)),this.fetchWithRetry(t,e,n-1);throw i}}}const Wx=Object.freeze(Object.defineProperty({__proto__:null,default:Gx},Symbol.toStringTag,{value:"Module"}));class Hx extends Vf{static{Mx(this.prototype,"overpassApi",[Ps],function(){return"https://overpass-api.de/api/interpreter"})}#V=void Px(this,"overpassApi");static{Mx(this.prototype,"mapKinetic",[Ps],function(){return!0})}#$=void Px(this,"mapKinetic");static{Mx(this.prototype,"photonApi",[Ps],function(){return"https://photon.komoot.io/api/"})}#G=void Px(this,"photonApi");static{Mx(this.prototype,"showQuickSearchButtons",[Ps],function(){return!0})}#W=void Px(this,"showQuickSearchButtons");overpassApis=[{name:"overpass-api.de (DE)",url:"https://overpass-api.de/api/interpreter"},{name:"private.coffee (AT)",url:"https://overpass.private.coffee/api/interpreter"}];photonApis=[{name:"photon.komoot.io",url:"https://photon.komoot.io/api/"}];constructor(){super(...arguments),this.loadSettings()}loadSettings(){const t=localStorage.getItem("marco:overpass-api");t&&(this.overpassApis.some(e=>e.url===t)?this.overpassApi=t:(this.overpassApi="https://overpass-api.de/api/interpreter",localStorage.setItem("marco:overpass-api",this.overpassApi)));const e=localStorage.getItem("marco:map-kinetic");null!==e&&(this.mapKinetic="true"===e);const n=localStorage.getItem("marco:show-quick-search");null!==n&&(this.showQuickSearchButtons="true"===n)}updateOverpassApi(t){this.overpassApi=t,localStorage.setItem("marco:overpass-api",t)}updateMapKinetic(t){this.mapKinetic=t,localStorage.setItem("marco:map-kinetic",String(t))}updateShowQuickSearchButtons(t){this.showQuickSearchButtons=t,localStorage.setItem("marco:show-quick-search",String(t))}updatePhotonApi(t){this.photonApi=t}}const Zx=Object.freeze(Object.defineProperty({__proto__:null,default:Hx},Symbol.toStringTag,{value:"Module"}));function Kx(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Yx,Xx={exports:{}},Jx=(Yx||(Yx=1,Xx.exports=function(){var t={548:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.Access=void 0;class n{constructor(){this.reset()}get scopes(){return Object.keys(this.scopeModeMap).map(t=>({name:t,mode:this.scopeModeMap[t]}))}get scopeParameter(){return this.scopes.map(t=>`${this._scopeNameForParameter(t)}:${t.mode}`).join(" ")}claim(t,e){if("string"!=typeof t||-1!==t.indexOf("/")||0===t.length)throw new Error("Scope should be a non-empty string without forward slashes");if("string"!=typeof e||!e.match(/^rw?$/))throw new Error("Mode should be either 'r' or 'rw'");this._adjustRootPaths(t),this.scopeModeMap[t]=e}get(t){return this.scopeModeMap[t]}remove(t){const e={};for(const n in this.scopeModeMap)e[n]=this.scopeModeMap[n];this.reset(),delete e[t];for(const n in e)this.claim(n,e[n])}checkPermission(t,e){const n=this.get(t);return n&&("r"===e||"rw"===n)}checkPathPermission(t,e){if(this.checkPermission("*",e))return!0;const n=this._getModuleName(t);return!!this.checkPermission(n,e)}reset(){this.rootPaths=[],this.scopeModeMap={}}_getModuleName(t){if("/"!==t[0])throw new Error("Path should start with a slash");const e=t.replace(/^\/public/,"").match(/^\/([^/]*)\//);return e?e[1]:"*"}_adjustRootPaths(t){"*"in this.scopeModeMap||"*"===t?this.rootPaths=["/"]:t in this.scopeModeMap||(this.rootPaths.push("/"+t+"/"),this.rootPaths.push("/public/"+t+"/"))}_scopeNameForParameter(t){if("*"===t.name&&this.storageType){if("2012.04"===this.storageType)return"";if(this.storageType.match(/remotestorage-0[01]/))return"root"}return t.name}setStorageType(t){this.storageType=t}static _rs_init(){}}e.Access=n,e.default=n},275:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Authorize=void 0;const s=r(n(334)),o=n(746),a=r(n(503)),l=n(368);let c;function h(t){const e=t||u.getLocation().href,n={};for(const[s,o]of new URL(e).searchParams)n[s]=o;const i=e.indexOf("#");if(-1===i)return n;const r=e.substring(i+1);return r.includes("=")?r.split("&").reduce(function(t,e){const n=e.split("=");if("state"===n[0]&&n[1].match(/rsDiscovery/)){let e=decodeURIComponent(n[1]);const i=e.substr(e.indexOf("rsDiscovery=")).split("&")[0].split("=")[1];t.rsDiscovery=JSON.parse(atob(i)),e=e.replace(new RegExp("&?rsDiscovery="+i),""),e.length>0&&(t.state=e)}else t[decodeURIComponent(n[0])]=decodeURIComponent(n[1]);return t},n):n}class u{static authorize(t,e){if((0,s.default)("[Authorize] authURL = ",e.authURL,"scope = ",e.scope,"redirectUri = ",e.redirectUri,"clientId = ",e.clientId,"response_type =",e.response_type),!e.scope)throw new Error("Cannot authorize due to undefined or empty scope; did you forget to access.claim()?");if(!(0,o.localStorageAvailable)()&&"remotestorage"===t.backend){e.redirectUri+=e.redirectUri.indexOf("#")>0?"&":"#";const n={userAddress:t.remote.userAddress,href:t.remote.href,storageApi:t.remote.storageApi,properties:t.remote.properties};e.redirectUri+="rsDiscovery="+(0,o.toBase64)(JSON.stringify(n))}const n=function(t){const e=new URL(t.redirectUri);t.state||(t.state=e.hash?e.hash.substring(1):""),t.response_type||(t.response_type="token");const n=new URL(t.authURL);n.searchParams.set("redirect_uri",t.redirectUri.replace(/#.*$/,"")),n.searchParams.set("scope",t.scope),n.searchParams.set("client_id",t.clientId);for(const i of["state","response_type","code_challenge","code_challenge_method","token_access_type"]){const e=t[i];e&&n.searchParams.set(i,e)}return n.href}(e);o.globalContext.cordova?u.openWindow(n,e.redirectUri,"location=yes,clearsessioncache=yes,clearcache=yes").then(e=>{t.remote.configure({token:e.access_token})}):u.setLocation(n)}static refreshAccessToken(t,e,n){return i(this,void 0,void 0,function*(){var t,i,r;yield e.configure({token:null,tokenType:null});const o=new URLSearchParams({grant_type:"refresh_token",client_id:e.clientId,refresh_token:n}),c=yield(0,l.requestWithTimeout)("POST",e.TOKEN_URL,{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:o.toString(),responseType:"json"});if(200!==(null==c?void 0:c.status))throw yield e.configure({refreshToken:null}),new a.default("refresh token rejected:"+JSON.stringify(c.response));{(0,s.default)(`[Authorize] access token good for ${null===(t=null==c?void 0:c.response)||void 0===t?void 0:t.expires_in} seconds`);const n={token:null===(i=null==c?void 0:c.response)||void 0===i?void 0:i.access_token,tokenType:null===(r=null==c?void 0:c.response)||void 0===r?void 0:r.token_type};if(!n.token)throw new Error(`no access_token in "successful" refresh: ${c.response}`);yield e.configure(n)}})}static setLocation(t){if("string"==typeof t)document.location.href=t;else{if("object"!=typeof t)throw"Invalid location "+t;document.location=t}}static _rs_supported(){return"undefined"!=typeof document}static _rs_cleanup(t){t.removeEventListener("features-loaded",c)}}e.Authorize=u,u.IMPLIED_FAKE_TOKEN=!1,u.getLocation=function(){return document.location},u.openWindow=function(t,e,n){return new Promise((i,r)=>{const s=open(t,"_blank",n);function o(){r("Authorization was canceled")}s&&!s.closed?(s.addEventListener("loadstart",function(t){if(0!==t.url.indexOf(e))return;s.removeEventListener("exit",o),s.close();const n=h(t.url);n?i(n):r("Authorization error")}),s.addEventListener("exit",o)):r("Authorization popup was blocked")})},u._rs_init=function(t){const e=h();let n;e&&(n=u.getLocation(),n.hash=""),c=function(){let r=!1;if(e){if(e.error)throw"access_denied"===e.error?new a.default("Authorization failed: access denied",{code:"access_denied"}):new a.default(`Authorization failed: ${e.error}`);e.rsDiscovery&&t.remote.configure(e.rsDiscovery),e.access_token&&(t.remote.configure({token:e.access_token}),r=!0),e.remotestorage&&(t.connect(e.remotestorage),r=!0),e.state&&(n=u.getLocation(),u.setLocation(n.href.split("#")[0]+"#"+e.state)),e.code&&(function(e){i(this,void 0,void 0,function*(){var i,r,o,a;const c=sessionStorage.getItem("remotestorage:codeVerifier");if(!c)return void(0,s.default)("[Authorize] Ignoring OAuth code parameter, because no PKCE code verifier found in sessionStorage");n=u.getLocation();let h=n.origin;"/"!==n.pathname&&(h+=n.pathname);const d=new URLSearchParams({code:e,grant_type:"authorization_code",client_id:t.remote.clientId,redirect_uri:h,code_verifier:c}),p=yield(0,l.requestWithTimeout)("POST",t.remote.TOKEN_URL,{headers:{"Content-Type":"application/x-www-form-urlencoded"},body:d.toString(),responseType:"json"});if(200===p.status){(0,s.default)(`[Authorize] access token good for ${null===(i=null==p?void 0:p.response)||void 0===i?void 0:i.expires_in} seconds`);const e={token:null===(r=null==p?void 0:p.response)||void 0===r?void 0:r.access_token,refreshToken:null===(o=null==p?void 0:p.response)||void 0===o?void 0:o.refresh_token,tokenType:null===(a=null==p?void 0:p.response)||void 0===a?void 0:a.token_type};e.token?t.remote.configure(e):t._emit("error",new Error(`no access_token in "successful" response: ${p.response}`)),sessionStorage.removeItem("remotestorage:codeVerifier")}else t._emit("error",new Error(`${p.statusText}: ${p.response}`))})}(e.code),r=!0),r||t.remote.stopWaitingForToken()}else t.remote.stopWaitingForToken()},t.on("features-loaded",c)},e.default=u},424:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.BaseClient=void 0;const s=r(n(439)),o=r(n(613)),a=r(n(491)),l=r(n(93)),c=r(n(28)),h=n(746);class u{constructor(t,e){if(this.schemas={configurable:!0,get(){return u.Types.inScope(this.moduleName)}},"/"!==e[e.length-1])throw"Not a folder: "+e;"/"===e&&(this.makePath=t=>("/"===t[0]?"":"/")+t),this.storage=t,this.base=e,this.moduleName=function(t){const e=t.split("/");return t.length>2?e[1]:"root"}(this.base),this.addEvents(["change"]),this.on=this.on.bind(this),t.onChange(this.base,this._fireChange.bind(this))}scope(t){return new u(this.storage,this.makePath(t))}getListing(t,e){return i(this,void 0,void 0,function*(){if("string"!=typeof t)t="";else if(t.length>0&&!(0,h.isFolder)(t))return Promise.reject("Not a folder: "+t);return this.storage.get(this.makePath(t),e).then(t=>404===t.statusCode?{}:t.body)})}getAll(t,e){return i(this,void 0,void 0,function*(){if("string"!=typeof t)t="";else if(t.length>0&&!(0,h.isFolder)(t))return Promise.reject("Not a folder: "+t);return this.storage.get(this.makePath(t),e).then(n=>{if(404===n.statusCode)return{};if("object"==typeof n.body){const i=Object.keys(n.body);if(0===i.length)return{};const r=i.map(i=>this.storage.get(this.makePath(t+i),e).then(t=>{if("string"==typeof t.body)try{t.body=JSON.parse(t.body)}catch(t){}"object"==typeof t.body&&(n.body[i]=t.body)}));return Promise.all(r).then(()=>n.body)}})})}getFile(t,e){return i(this,void 0,void 0,function*(){return"string"!=typeof t?Promise.reject("Argument 'path' of baseClient.getFile must be a string"):this.storage.get(this.makePath(t),e).then(t=>({data:t.body,contentType:t.contentType,revision:t.revision}))})}storeFile(t,e,n){return i(this,void 0,void 0,function*(){return"string"!=typeof t?Promise.reject("Argument 'contentType' of baseClient.storeFile must be a string"):"string"!=typeof e?Promise.reject("Argument 'path' of baseClient.storeFile must be a string"):"string"!=typeof n&&"object"!=typeof n?Promise.reject("Argument 'body' of baseClient.storeFile must be a string, ArrayBuffer, or ArrayBufferView"):(this.storage.access.checkPathPermission(this.makePath(e),"rw")||console.warn("WARNING: Editing a document to which only read access ('r') was claimed"),this.storage.put(this.makePath(e),n,t).then(t=>200===t.statusCode||201===t.statusCode?t.revision:Promise.reject("Request (PUT "+this.makePath(e)+") failed with status: "+t.statusCode)))})}getObject(t,e){return i(this,void 0,void 0,function*(){return"string"!=typeof t?Promise.reject("Argument 'path' of baseClient.getObject must be a string"):this.storage.get(this.makePath(t),e).then(e=>{if("object"==typeof e.body)return e.body;if("string"==typeof e.body)try{return JSON.parse(e.body)}catch(e){throw new Error("Not valid JSON: "+this.makePath(t))}else if(void 0!==e.body&&200===e.statusCode)return Promise.reject("Not an object: "+this.makePath(t))})})}storeObject(t,e,n){return i(this,void 0,void 0,function*(){if("string"!=typeof t)return Promise.reject("Argument 'typeAlias' of baseClient.storeObject must be a string");if("string"!=typeof e)return Promise.reject("Argument 'path' of baseClient.storeObject must be a string");if("object"!=typeof n)return Promise.reject("Argument 'object' of baseClient.storeObject must be an object");this._attachType(n,t);try{const t=this.validate(n);if(!t.valid)return Promise.reject(t)}catch(t){return Promise.reject(t)}return this.storage.put(this.makePath(e),JSON.stringify(n),"application/json; charset=UTF-8").then(t=>200===t.statusCode||201===t.statusCode?t.revision:Promise.reject("Request (PUT "+this.makePath(e)+") failed with status: "+t.statusCode))})}remove(t){return i(this,void 0,void 0,function*(){return"string"!=typeof t?Promise.reject("Argument 'path' of baseClient.remove must be a string"):(this.storage.access.checkPathPermission(this.makePath(t),"rw")||console.warn("WARNING: Removing a document to which only read access ('r') was claimed"),this.storage.delete(this.makePath(t),this.storage.connected))})}getItemURL(t){if("string"!=typeof t)throw"Argument 'path' of baseClient.getItemURL must be a string";return this.storage.connected?(t=(0,h.cleanPath)(this.makePath(t)),this.storage.remote.href+t):void 0}cache(t,e="ALL"){if("string"!=typeof t)throw"Argument 'path' of baseClient.cache must be a string";if("string"!=typeof e)throw"Argument 'strategy' of baseClient.cache must be a string or undefined";if("FLUSH"!==e&&"SEEN"!==e&&"ALL"!==e)throw'Argument \'strategy\' of baseclient.cache must be one of ["FLUSH", "SEEN", "ALL"]';return this.storage.caching.set(this.makePath(t),e),this}declareType(t,e,n){let i;if(n&&"string"==typeof e)i=e;else if(n||"string"==typeof e){if(!n&&"string"==typeof e)throw new Error("declareType() requires a JSON Schema object to be passed, in order to validate object types/formats")}else n=e,i=this._defaultTypeURI(t);u.Types.declare(this.moduleName,t,i,n)}validate(t){const e=u.Types.getSchema(t["@context"]);if(e)return s.default.validateResult(t,e);throw new a.default(t["@context"])}_defaultTypeURI(t){return"http://remotestorage.io/spec/modules/"+encodeURIComponent(this.moduleName)+"/"+encodeURIComponent(t)}_attachType(t,e){t["@context"]=u.Types.resolveAlias(this.moduleName+"/"+e)||this._defaultTypeURI(e)}makePath(t){return this.base+(t||"")}_fireChange(t){c.default.changeEvents[t.origin]&&(["new","old","lastCommon"].forEach(function(e){if((!t[e+"ContentType"]||/^application\/(.*)json(.*)/.exec(t[e+"ContentType"]))&&"string"==typeof t[e+"Value"])try{t[e+"Value"]=JSON.parse(t[e+"Value"])}catch(t){}}),this._emit("change",t))}static _rs_init(){}}e.BaseClient=u,u.Types=o.default,(0,h.applyMixins)(u,[l.default]),e.default=u},285:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Caching=void 0;const r=n(746),s=i(n(334));class o{constructor(t){this.pendingActivations=[],this._access=t.access,this.reset()}set(t,e){if("string"!=typeof t)throw new Error("path should be a string");if(!(0,r.isFolder)(t))throw new Error("path should be a folder");if(!this._access.checkPathPermission(t,"r"))throw new Error('No access to path "'+t+'". You must claim access to it first.');if(void 0===e||!e.match(/^(FLUSH|SEEN|ALL)$/))throw new Error("strategy should be 'FLUSH', 'SEEN', or 'ALL'");this._rootPaths[t]=e,"ALL"===e&&(this.activateHandler?this.activateHandler(t):this.pendingActivations.push(t))}enable(t){this.set(t,"ALL")}disable(t){this.set(t,"FLUSH")}onActivate(t){(0,s.default)("[Caching] Setting activate handler",t,this.pendingActivations),this.activateHandler=t;for(let e=0;e<this.pendingActivations.length;e++)t(this.pendingActivations[e]);this.pendingActivations=[]}checkPath(t){return void 0!==this._rootPaths[t]?this._rootPaths[t]:"/"===t?"SEEN":this.checkPath((0,r.containingFolder)(t))}reset(){this._rootPaths={}}static _rs_init(){}}e.Caching=o,e.default=o},496:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const s=r(n(451)),o=r(n(93)),a=r(n(28)),l=r(n(334)),c=n(746);function h(t){if("object"==typeof t&&"string"==typeof t.path)if((0,c.isFolder)(t.path)){if(t.local&&t.local.itemsMap)return t.local;if(t.common&&t.common.itemsMap)return t.common}else{if(t.local){if(t.local.body&&t.local.contentType)return t.local;if(!1===t.local.body)return}if(t.common&&t.common.body&&t.common.contentType)return t.common}}function u(t,e){for(const n in t){if(t[n]&&t[n].remote)return!0;const i=h(t[n]);if(i&&i.timestamp&&(new Date).getTime()-i.timestamp<=e)return!1;if(!i)return!0}return!0}function d(t){const e={path:t,common:{}};return(0,c.isFolder)(t)&&(e.common.itemsMap={}),e}function p(t,e){return t.common||(t.common={itemsMap:{}}),t.common.itemsMap||(t.common.itemsMap={}),t.local||(t.local=(0,c.deepClone)(t.common)),t.local.itemsMap||(t.local.itemsMap=t.common.itemsMap),t.local.itemsMap[e]=!0,t}class f{constructor(){this._updateNodesRunning=!1,this._updateNodesQueued=[],(new s.default).isBrowser()&&c.globalContext.BroadcastChannel&&(this.broadcastChannel=new BroadcastChannel("remotestorage:changes"),this.broadcastChannel.onmessage=t=>{this.emitChange(t.data)})}get(t,e,n){return i(this,void 0,void 0,function*(){return"number"==typeof e?this.getNodes((0,c.pathsFromRoot)(t)).then(i=>{const r=h(i[t]);return u(i,e)?n(t):r?{statusCode:200,body:r.body||r.itemsMap,contentType:r.contentType}:{statusCode:404}}):this.getNodes([t]).then(e=>{const n=h(e[t]);if(n){if((0,c.isFolder)(t))for(const t in n.itemsMap)n.itemsMap.hasOwnProperty(t)&&!1===n.itemsMap[t]&&delete n.itemsMap[t];return{statusCode:200,body:n.body||n.itemsMap,contentType:n.contentType}}return{statusCode:404}})})}put(t,e,n){return i(this,void 0,void 0,function*(){const i=(0,c.pathsFromRoot)(t);return this._updateNodes(i,function(t,i){try{for(let r=0,s=t.length;r<s;r++){const s=t[r];let o,a=i[s];a||(i[s]=a=d(s)),0===r?(o=h(a),a.local={body:e,contentType:n,previousBody:o?o.body:void 0,previousContentType:o?o.contentType:void 0}):a=p(a,t[r-1].substring(s.length))}return i}catch(t){throw(0,l.default)("[Cachinglayer] Error during PUT",i,t),t}})})}delete(t,e){return i(this,void 0,void 0,function*(){const n=(0,c.pathsFromRoot)(t);return this._updateNodes(n,function(t,n){for(let i=0,r=t.length;i<r;i++){const r=t[i],s=n[r];let o;if(s)if(0===i)o=h(s),s.local={body:!e&&void 0,previousBody:o?o.body:void 0,previousContentType:o?o.contentType:void 0};else{s.local||(s.local=(0,c.deepClone)(s.common));const e=t[i-1].substring(r.length);if(delete s.local.itemsMap[e],Object.getOwnPropertyNames(s.local.itemsMap).length>0)break}else console.error("Cannot delete non-existing node "+r)}return n})})}flush(t){return this._getAllDescendentPaths(t).then(t=>this.getNodes(t)).then(t=>{for(const e in t){const n=t[e];n&&n.common&&n.local&&this.emitChange({path:n.path,origin:"local",oldValue:!1===n.local.body?void 0:n.local.body,newValue:!1===n.common.body?void 0:n.common.body}),t[e]=void 0}return this.setNodes(t)})}emitChange(t){a.default.changeEvents[t.origin]&&this._emit("change",t)}fireInitial(){a.default.changeEvents.local&&this.forAllNodes(t=>{if((0,c.isDocument)(t.path)){const e=h(t);e&&this.emitChange({path:t.path,origin:"local",oldValue:void 0,oldContentType:void 0,newValue:e.body,newContentType:e.contentType})}}).then(()=>{this._emit("local-events-done")})}onDiff(t){this.diffHandler=t}_updateNodes(t,e){return new Promise((n,i)=>{this._doUpdateNodes(t,e,{resolve:n,reject:i})})}_doUpdateNodes(t,e,n){return i(this,void 0,void 0,function*(){if(this._updateNodesRunning)return void this._updateNodesQueued.push({paths:t,cb:e,promise:n});this._updateNodesRunning=!0;try{let i=yield this.getNodes(t);const r=(0,c.deepClone)(i),s=[];i=e(t,i);for(const t in i){const e=i[t];(0,c.equal)(e,r[t])?delete i[t]:(0,c.isDocument)(t)&&((0,c.equal)(e.local.body,e.local.previousBody)&&e.local.contentType===e.local.previousContentType||s.push({path:t,origin:"window",oldValue:e.local.previousBody,newValue:!1===e.local.body?void 0:e.local.body,oldContentType:e.local.previousContentType,newContentType:e.local.contentType}),void 0===e.local.body?i[t]=void 0:(delete e.local.previousBody,delete e.local.previousContentType))}yield this.setNodes(i),this._emitChangeEvents(s),n.resolve({statusCode:200})}catch(t){n.reject(t)}this._updateNodesRunning=!1;const i=this._updateNodesQueued.shift();i&&(yield this._doUpdateNodes(i.paths,i.cb,i.promise))})}_emitChangeEvents(t){for(let e=0,n=t.length;e<n;e++){const n=t[e];this.emitChange(n),this.diffHandler&&this.diffHandler(n.path),this.broadcastChannel&&"window"===n.origin&&this.broadcastChannel.postMessage(n)}}_getAllDescendentPaths(t){return(0,c.isFolder)(t)?this.getNodes([t]).then(e=>{const n=[t],i=h(e[t]),r=Object.keys(i.itemsMap).map(e=>this._getAllDescendentPaths(t+e).then(t=>{for(let e=0,i=t.length;e<i;e++)n.push(t[e])}));return Promise.all(r).then(()=>n)}):Promise.resolve([t])}_getInternals(){return{getLatest:h,makeNode:d,isOutdated:u}}}(0,c.applyMixins)(f,[o.default]),t.exports=f},28:function(t){t.exports={cache:!0,changeEvents:{local:!0,window:!1,remote:!0,conflict:!0},cordovaRedirectUri:void 0,logging:!1,modules:[],backgroundSyncInterval:6e4,disableFeatures:[],discoveryTimeout:5e3,isBackground:!1,requestTimeout:3e4,syncInterval:1e4}},373:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(199)),s=i(n(28)),o=i(n(334)),a=n(746);let l;const c="remotestorage:discover";let h={};const u=function(t){return new Promise((e,n)=>{if(t in h)return e(h[t]);const i=new r.default({tls_only:!1,uri_fallback:!0,request_timeout:s.default.discoveryTimeout});return setTimeout(()=>n(new Error("timed out")),s.default.discoveryTimeout),i.lookup(t,function(i,r){if(i)return n(i);if("object"!=typeof r.idx.links.remotestorage||"number"!=typeof r.idx.links.remotestorage.length||r.idx.links.remotestorage.length<=0)return(0,o.default)("[Discover] WebFinger record for "+t+" does not have remotestorage defined in the links section ",JSON.stringify(r.json)),n("WebFinger record for "+t+" does not have remotestorage defined in the links section.");const s=r.idx.links.remotestorage[0],a=s.properties["http://tools.ietf.org/html/rfc6749#section-4.2"]||s.properties["auth-endpoint"],u=s.properties["http://remotestorage.io/spec/version"]||s.type;return h[t]={href:s.href,storageApi:u,authURL:a,properties:s.properties},l&&localStorage.setItem(c,JSON.stringify({cache:h})),e(h[t])})})};(u.DiscoveryError=function(t){this.name="DiscoveryError",this.message=t,this.stack=(new Error).stack}).prototype=Object.create(Error.prototype),u.DiscoveryError.prototype.constructor=u.DiscoveryError,u._rs_init=function(){if(l=(0,a.localStorageAvailable)(),l){const t=JSON.parse(localStorage.getItem(c));t&&(h=t.cache)}},u._rs_supported=function(){return Object.prototype.hasOwnProperty.call(a.globalContext,"fetch")||Object.prototype.hasOwnProperty.call(a.globalContext,"XMLHttpRequest")},u._rs_cleanup=function(){l&&localStorage.removeItem(c)},t.exports=u},706:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const s=r(n(93)),o=r(n(424)),a=r(n(941)),l=r(n(982)),c=r(n(503)),h=n(746),u=n(368),d=n(684),p=r(n(275));let f;const g="remotestorage:dropbox",m="https://api.dropboxapi.com/2/files/list_folder",y="https://api.dropboxapi.com/2/files/list_folder/continue",v="/remotestorage";function _(t){return(v+"/"+t).replace(/\/+$/,"").replace(/\/+/g,"/")}const b=/[\u007f-\uffff]/g;function w(t){return JSON.stringify(t).replace(b,function(t){return"\\u"+("000"+t.charCodeAt(0).toString(16)).slice(-4)})}function x(t,e){return new RegExp("^"+e.join("\\/")+"(\\/|$)").test(t.error_summary)}function C(t){return t instanceof ArrayBuffer||(0,u.isArrayBufferView)(t)}class S extends d.RemoteBase{constructor(t){if(super(t),this.online=!0,this.storageApi="draft-dejong-remotestorage-19",this._initialFetchDone=!1,this.addEvents(["connected","not-connected"]),this.clientId=t.apiKeys.dropbox.appKey,this.TOKEN_URL="https://api.dropboxapi.com/oauth2/token",this._revCache=new a.default("rev"),this._fetchDeltaCursor=null,this._fetchDeltaPromise=null,this._itemRefs={},f=(0,h.localStorageAvailable)(),f){const t=(0,h.getJSONFromLocalStorage)(g);t&&this.configure(t),this._itemRefs=(0,h.getJSONFromLocalStorage)(`${g}:shares`)||{}}this.connected&&setTimeout(this._emit.bind(this),0,"connected")}connect(){return i(this,void 0,void 0,function*(){try{if(this.rs.setBackend("dropbox"),this.token)T(this.rs);else{const{codeVerifier:t,codeChallenge:e,state:n}=yield(0,h.generateCodeVerifier)();sessionStorage.setItem("remotestorage:codeVerifier",t),sessionStorage.setItem("remotestorage:state",n),this.rs.authorize({authURL:"https://www.dropbox.com/oauth2/authorize",scope:"account_info.read files.content.read files.content.write files.metadata.read files.metadata.write",clientId:this.clientId,response_type:"code",state:n,code_challenge:e,code_challenge_method:"S256",token_access_type:"offline"})}}catch(t){throw this.rs._emit("error",t),this.rs.setBackend(void 0),t}})}configure(t){return i(this,void 0,void 0,function*(){void 0!==t.userAddress&&(this.userAddress=t.userAddress),void 0!==t.token&&(this.token=t.token),void 0!==t.refreshToken&&(this.refreshToken=t.refreshToken),void 0!==t.tokenType&&(this.tokenType=t.tokenType);const e=()=>{f&&localStorage.setItem(g,JSON.stringify({userAddress:this.userAddress,token:this.token,refreshToken:this.refreshToken,tokenType:this.tokenType}))};if(this.refreshToken||this.token)if(this.connected=!0,this.userAddress)this._emit("connected"),e();else try{const t=yield this.info();this.userAddress=t.email,this._emit("connected"),e()}catch(t){this.connected=!1,this.rs._emit("error",new Error("Could not fetch user info.")),e.apply(this)}else(()=>{this.connected=!1,f&&localStorage.removeItem(g),this.rs.setBackend(void 0)})()})}_getFolder(t){const e=this._revCache,n=n=>{let r;if(200!==n.status&&409!==n.status)return Promise.reject("Unexpected response status: "+n.status);try{r=JSON.parse(n.responseText)}catch(t){return Promise.reject(t)}if(409===n.status)return x(r,["path","not_found"])?Promise.resolve({}):Promise.reject(new Error("API returned an error: "+r.error_summary));const s=r.entries.reduce((n,i)=>{try{const r="folder"===i[".tag"],s=i.path_display.split("/").slice(-1)[0]+(r?"/":"");if(r)n[s]={ETag:e.get(t+s)};else{const e=new Date(i.server_modified);n[s]={ETag:i.rev,"Content-Length":i.size,"Last-Modified":e.toUTCString()},this._revCache.set(t+s,i.rev)}}catch(e){console.error(`[Dropbox] folder “${t}” has entry ${JSON.stringify(i)}:`,e)}return n},{});return r.has_more?i(r.cursor).then(function(t){return Object.assign(s,t)}):Promise.resolve(s)},i=t=>{const e={body:{cursor:t}};return this._request("POST",y,e).then(n)};return this._request("POST",m,{body:{path:_(t)}}).then(n).then(function(n){return Promise.resolve({statusCode:200,body:n,contentType:"application/json; charset=UTF-8",revision:e.get(t)})})}get(t,e={}){if(!this.connected)return Promise.reject("not connected (path: "+t+")");const n=this._revCache.get(t);if(null===n)return Promise.resolve({statusCode:404});if(e&&e.ifNoneMatch){if(!this._initialFetchDone)return this.fetchDelta().then(()=>this.get(t,e));if(n&&n===e.ifNoneMatch)return Promise.resolve({statusCode:304})}if("/"===t.slice(-1))return this._getFolder(t);const i={headers:{"Dropbox-API-Arg":w({path:_(t)})},responseType:"arraybuffer"};return e&&e.ifNoneMatch&&(i.headers["If-None-Match"]=e.ifNoneMatch),this._request("GET","https://content.dropboxapi.com/2/files/download",i).then(e=>{const n=e.status;let i,r,s,o;return 200!==n&&409!==n?Promise.resolve({statusCode:n}):(i=e.getResponseHeader("Dropbox-API-Result"),(0,h.getTextFromArrayBuffer)(e.response,"UTF-8").then(a=>{r=a,409===n&&(i=r);try{i=JSON.parse(i)}catch(t){return Promise.reject(t)}if(409===n)return x(i,["path","not_found"])?{statusCode:404}:Promise.reject(new Error('API error while downloading file ("'+t+'"): '+i.error_summary));if(s=e.getResponseHeader("Content-Type"),o=i.rev,this._revCache.set(t,o),this._shareIfNeeded(t),(0,h.shouldBeTreatedAsBinary)(a,s))r=e.response;else try{r=JSON.parse(r),s="application/json; charset=UTF-8"}catch(t){}return{statusCode:n,body:r,contentType:s,revision:o}}))})}put(t,e,n){return i(this,arguments,void 0,function*(t,e,n,i={}){if(!this.connected)throw new Error("not connected (path: "+t+")");const r=this._revCache.get(t);if(i&&i.ifMatch&&r&&r!==i.ifMatch)return{statusCode:412,revision:r};if(i&&"*"===i.ifNoneMatch&&r&&"rev"!==r)return{statusCode:412,revision:r};if(!n.match(/charset=/)&&C(e)&&(n+="; charset=binary"),e.length>157286400)throw new Error("Cannot upload file larger than 150MB");const s={body:e,contentType:n,path:t};if(i&&(i.ifMatch||"*"===i.ifNoneMatch)){const e=yield this._getMetadata(t);if(i&&"*"===i.ifNoneMatch&&e)return{statusCode:412,revision:e.rev};if(i&&i.ifMatch&&e&&e.rev!==i.ifMatch)return{statusCode:412,revision:e.rev}}const o=yield this._uploadSimple(s);return this._shareIfNeeded(t),o})}delete(t){return i(this,arguments,void 0,function*(t,e={}){if(!this.connected)throw new Error("not connected (path: "+t+")");const n=this._revCache.get(t);if((null==e?void 0:e.ifMatch)&&n&&e.ifMatch!==n)return{statusCode:412,revision:n};if(null==e?void 0:e.ifMatch){const n=yield this._getMetadata(t);if((null==e?void 0:e.ifMatch)&&n&&n.rev!==e.ifMatch)return{statusCode:412,revision:n.rev}}return this._deleteSimple(t)})}_shareIfNeeded(t){if(t.match(/^\/public\/.*[^/]$/)&&void 0===this._itemRefs[t])return this.share(t)}share(t){const e={body:{path:_(t)}};return this._request("POST","https://api.dropboxapi.com/2/sharing/create_shared_link_with_settings",e).then(e=>{if(200!==e.status&&409!==e.status)return Promise.reject(new Error("Invalid response status:"+e.status));let n;try{n=JSON.parse(e.responseText)}catch(t){return Promise.reject(new Error("Invalid response body: "+e.responseText))}return 409===e.status?x(n,["shared_link_already_exists"])?this._getSharedLink(t):Promise.reject(new Error("API error: "+n.error_summary)):Promise.resolve(n.url)}).then(e=>(this._itemRefs[t]=e,f&&localStorage.setItem(g+":shares",JSON.stringify(this._itemRefs)),Promise.resolve(e)),e=>(e.message='Sharing Dropbox file or folder ("'+t+'") failed: '+e.message,Promise.reject(e)))}info(){return this._request("POST","https://api.dropboxapi.com/2/users/get_current_account",{}).then(function(t){let e;try{const n=JSON.parse(t.responseText);e=null==n?void 0:n.email}catch(e){return Promise.reject(new Error("Could not query current account info: Invalid API response: "+t.responseText))}return Promise.resolve({email:e})})}_request(t,e,n){return i(this,arguments,void 0,function*(t,e,n,i=1){if(this.isForbiddenRequestMethod(t,e))throw`Don't use ${t} on directories!`;if(!this.token)throw new c.default("No access token");n.headers||(n.headers={}),n.headers.Authorization="Bearer "+this.token,"object"!=typeof n.body||C(n.body)||(n.body=JSON.stringify(n.body),n.headers["Content-Type"]="application/json; charset=UTF-8"),this.rs._emit("wire-busy",{method:t,isFolder:(0,h.isFolder)(e)});try{const r=yield(0,u.requestWithTimeout)(t,e,n);return this.online||(this.online=!0,this.rs._emit("network-online")),this.rs._emit("wire-done",{method:t,isFolder:(0,h.isFolder)(e),success:!0}),401===(null==r?void 0:r.status)&&this.refreshToken?i>=3?(console.error(`Abandoned after ${i} attempts: ${t} ${e}`),r):(this.rs._emit("wire-busy",{method:t,isFolder:(0,h.isFolder)(e)}),yield p.default.refreshAccessToken(this.rs,this,this.refreshToken),this.rs._emit("wire-done",{method:t,isFolder:(0,h.isFolder)(e),success:!0}),this._request(t,e,n,i+1)):[503,429].includes(null==r?void 0:r.status)?(this.online&&(this.online=!1,this.rs._emit("network-offline")),i>=3?(console.warn(`Abandoned after ${i} attempts: ${t} ${e}`),r):(yield new Promise(t=>setTimeout(t,(0,u.retryAfterMs)(r))),this._request(t,e,n,i+1))):r}catch(n){throw this.online&&(this.online=!1,this.rs._emit("network-offline")),this.rs._emit("wire-done",{method:t,isFolder:(0,h.isFolder)(e),success:!1}),n}})}fetchDelta(...t){if(this._fetchDeltaPromise)return this._fetchDeltaPromise;const e=t=>i(this,void 0,void 0,function*(){let n,i;"string"==typeof t?(n=y,i={cursor:t}):(n=m,i={path:v,recursive:!0,include_deleted:!0});try{const r=yield this._request("POST",n,{body:i});if(401===r.status)throw new c.default;if(200!==r.status&&409!==r.status)throw new Error("Invalid response status: "+r.status);let s;try{s=JSON.parse(r.responseText)}catch(t){throw new Error("Invalid response body: "+r.responseText)}if(409===r.status){if(!x(s,["path","not_found"]))throw new Error("API returned an error: "+s.error_summary);s={cursor:null,entries:[],has_more:!1}}if(t||this._revCache.deactivatePropagation(),s.entries.forEach(t=>{const e=t.path_display.slice(14);"deleted"===t[".tag"]?(this._revCache.delete(e),this._revCache.delete(e+"/")):"file"===t[".tag"]&&this._revCache.set(e,t.rev)}),this._fetchDeltaCursor=s.cursor,s.has_more)return e(s.cursor);this._revCache.activatePropagation(),this._initialFetchDone=!0}catch(t){if("timeout"===t)return;throw t}});return this._fetchDeltaPromise=e(this._fetchDeltaCursor).catch(t=>("object"==typeof t&&"message"in t?t.message="Dropbox: fetchDelta: "+t.message:t=`Dropbox: fetchDelta: ${t}`,this.rs._emit("error",t),this._fetchDeltaPromise=null,Promise.reject(t))).then(()=>(this._fetchDeltaPromise=null,Promise.resolve(t))),this._fetchDeltaPromise}_getMetadata(t){const e={path:_(t)};return this._request("POST","https://api.dropboxapi.com/2/files/get_metadata",{body:e}).then(t=>{if(200!==t.status&&409!==t.status)return Promise.reject(new Error("Invalid response status:"+t.status));let e;try{e=JSON.parse(t.responseText)}catch(e){return Promise.reject(new Error("Invalid response body: "+t.responseText))}return 409===t.status?x(e,["path","not_found"])?Promise.resolve():Promise.reject(new Error("API error: "+e.error_summary)):Promise.resolve(e)}).then(void 0,e=>(e.message='Could not load metadata for file or folder ("'+t+'"): '+e.message,Promise.reject(e)))}_uploadSimple(t){const e={path:_(t.path),mode:{".tag":"overwrite",update:void 0},mute:!0};return t.ifMatch&&(e.mode={".tag":"update",update:t.ifMatch}),this._request("POST","https://content.dropboxapi.com/2/files/upload",{body:t.body,headers:{"Content-Type":"application/octet-stream","Dropbox-API-Arg":w(e)}}).then(e=>{if(200!==e.status&&409!==e.status)return Promise.resolve({statusCode:e.status});let n;try{n=JSON.parse(e.responseText)}catch(t){return Promise.reject(new Error("Invalid API result: "+e.responseText))}return 409===e.status?x(n,["path","conflict"])?this._getMetadata(t.path).then(function(t){return Promise.resolve({statusCode:412,revision:t.rev})}):(this.rs._emit("error",new Error(n.error_summary)),Promise.resolve({statusCode:e.status})):(this._revCache.set(t.path,n.rev),Promise.resolve({statusCode:e.status,revision:n.rev}))})}_deleteSimple(t){const e={path:_(t)};return this._request("POST","https://api.dropboxapi.com/2/files/delete",{body:e}).then(t=>{if(200!==t.status&&409!==t.status)return Promise.resolve({statusCode:t.status});let e;try{e=JSON.parse(t.responseText)}catch(e){return Promise.reject(new Error("Invalid response body: "+t.responseText))}if(409===t.status){if(x(e,["path_lookup","not_found"]))return Promise.resolve({statusCode:404});this.rs._emit("error",new Error(e.error_summary))}return Promise.resolve({statusCode:t.status})}).then(e=>(200!==e.statusCode&&404!==e.statusCode||(this._revCache.delete(t),delete this._itemRefs[t]),Promise.resolve(e)),e=>(e.message='Could not delete Dropbox file or folder ("'+t+'"): '+e.message,Promise.reject(e)))}_getSharedLink(t){return i(this,void 0,void 0,function*(){const e={body:{path:_(t),direct_only:!0}};return this._request("POST","https://api.dropbox.com/2/sharing/list_shared_links",e).then(t=>{if(200!==t.status&&409!==t.status)return Promise.reject(new Error("Invalid response status: "+t.status));let e;try{e=JSON.parse(t.responseText)}catch(e){return Promise.reject(new Error("Invalid response body: "+t.responseText))}return 409===t.status?Promise.reject(new Error("API error: "+(null==e?void 0:e.error_summary)||0)):e.links.length?Promise.resolve(e.links[0].url):Promise.reject(new Error("No links returned"))},e=>(e.message='Could not get link to a shared file or folder ("'+t+'"): '+e.message,Promise.reject(e)))})}static _rs_init(t){f=(0,h.localStorageAvailable)(),t.apiKeys.dropbox&&(t.dropbox=new S(t)),"dropbox"===t.backend&&T(t)}static _rs_supported(){return!0}static _rs_cleanup(t){!function(t){(function(t){t._origRemote&&(t.remote=t._origRemote,delete t._origRemote)})(t),function(t){t._dropboxOrigSync&&(t.sync.sync=t._dropboxOrigSync,delete t._dropboxOrigSync)}(t),function(t){t._origBaseClientGetItemURL&&(o.default.prototype.getItemURL=t._origBaseClientGetItemURL,delete t._origBaseClientGetItemURL)}(t),E(t)}(t),f&&localStorage.removeItem(g),t.setBackend(void 0)}}function k(t,...e){t._dropboxOrigSync||(t._dropboxOrigSync=t.sync.sync.bind(t.sync),t.sync.sync=function(){return this.dropbox.fetchDelta(t,...e).then(t._dropboxOrigSync,function(e){t._emit("error",new l.default(e)),t._emit("sync-done")})}.bind(t))}function E(t){t._dropboxOrigSyncCycle&&(t.syncCycle=t._dropboxOrigSyncCycle,delete t._dropboxOrigSyncCycle)}function T(t){!function(t){t._origRemote||(t._origRemote=t.remote,t.remote=t.dropbox)}(t),t.sync?k(t):function(t,...e){t._dropboxOrigSyncCycle||(t._dropboxOrigSyncCycle=t.syncCycle,t.syncCycle=()=>{if(!t.sync)throw new Error("expected sync to be initialized by now");k(t),t._dropboxOrigSyncCycle(t,...e),E(t)})}(t),function(t){t._origBaseClientGetItemURL||(t._origBaseClientGetItemURL=o.default.prototype.getItemURL,o.default.prototype.getItemURL=function(){throw new Error("getItemURL is not implemented for Dropbox yet")})}(t)}(0,h.applyMixins)(S,[s.default]),t.exports=S},451:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(93)),s=n(746),o=i(n(334));class a{constructor(){this.addEvents(["background","foreground"]),this.mode="undefined"!=typeof window?"browser":"node","browser"===this.mode&&(this.setBrowserPrefixedNames(),document.addEventListener(this.visibilityChangeEvent,this.setVisibility.bind(this),!1),this.setVisibility())}setBrowserPrefixedNames(){"browser"===this.mode&&(void 0!==document.hidden?(this.hiddenProperty="hidden",this.visibilityChangeEvent="visibilitychange"):void 0!==document.mozHidden?(this.hiddenProperty="mozHidden",this.visibilityChangeEvent="mozvisibilitychange"):void 0!==document.msHidden?(this.hiddenProperty="msHidden",this.visibilityChangeEvent="msvisibilitychange"):void 0!==document.webkitHidden&&(this.hiddenProperty="webkitHidden",this.visibilityChangeEvent="webkitvisibilitychange"))}setVisibility(){document[this.hiddenProperty]?((0,o.default)("[Env] Going into background mode"),this.goBackground()):((0,o.default)("[Env] Going into foreground mode"),this.goForeground())}isBrowser(){return"browser"===this.mode}isNode(){return"node"===this.mode}goBackground(){this._emit("background")}goForeground(){this._emit("foreground")}static _rs_init(){}static _rs_cleanup(){}}(0,s.applyMixins)(a,[r.default]),t.exports=a},93:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.EventHandling=void 0;const r=i(n(334));class s{addEvents(t){t.forEach(t=>this._addEvent(t))}addEventListener(t,e){if("string"!=typeof t)throw new Error("Argument eventName should be a string");if("function"!=typeof e)throw new Error("Argument handler should be a function");(0,r.default)("[EventHandling] Adding event listener",t),this._validateEvent(t),this._handlers[t].push(e)}on(t,e){return this.addEventListener(t,e)}removeEventListener(t,e){this._validateEvent(t);const n=this._handlers[t].length;for(let i=0;i<n;i++)if(this._handlers[t][i]===e)return void this._handlers[t].splice(i,1)}_emit(t,...e){this._validateEvent(t),this._handlers[t].slice().forEach(t=>{t(...e)})}_validateEvent(t){if(!(t in this._handlers))throw new Error("Unknown event: "+t)}_delegateEvent(t,e){e.on(t,e=>{this._emit(t,e)})}_addEvent(t){void 0===this._handlers&&(this._handlers={}),this._handlers[t]=[]}}e.EventHandling=s,e.default=s},545:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(28)),s=i(n(451)),o=i(n(334)),a=n(746),l=i(n(370)),c=i(n(548)),h=i(n(275)),u=i(n(373)),d=i(n(424)),p=i(n(801)),f=i(n(706)),g=i(n(600)),m=i(n(313)),y=i(n(285)),v=i(n(567)),_=i(n(794)),b=i(n(365)),w={features:[],featuresDone:0,readyFired:!1,loadFeatures(){this.features=[],this.featuresDone=0,this.readyFired=!1,this.featureModules={WireClient:g.default,Dropbox:f.default,GoogleDrive:p.default,Access:c.default,Discover:u.default,Authorize:h.default,BaseClient:d.default,Env:s.default},r.default.cache&&(0,a.extend)(this.featureModules,{Caching:y.default,IndexedDB:v.default,LocalStorage:_.default,InMemoryStorage:b.default,Sync:m.default}),r.default.disableFeatures.forEach(t=>{this.featureModules[t]&&delete this.featureModules[t]}),this._allLoaded=!1;for(const t in this.featureModules)this.loadFeature(t)},hasFeature(t){for(let e=this.features.length-1;e>=0;e--)if(this.features[e].name===t)return this.features[e].supported;return!1},loadFeature(t){const e=this.featureModules[t],n=!e._rs_supported||e._rs_supported();(0,o.default)(`[RemoteStorage] [FEATURE ${t}] initializing ...`),"object"==typeof n?n.then(()=>{this.featureSupported(t,!0),this.initFeature(t)},()=>{this.featureSupported(t,!1)}):"boolean"==typeof n?(this.featureSupported(t,n),n&&this.initFeature(t)):this.featureSupported(t,!1)},initFeature(t){const e=this.featureModules[t];let n;try{n=e._rs_init(this)}catch(e){return void this.featureFailed(t,e)}"object"==typeof n&&"function"==typeof n.then?n.then(()=>{this.featureInitialized(t)},e=>{this.featureFailed(t,e)}):this.featureInitialized(t)},featureFailed(t,e){(0,o.default)(`[RemoteStorage] [FEATURE ${t}] initialization failed (${e})`),this.featureDone()},featureSupported(t,e){(0,o.default)(`[RemoteStorage] [FEATURE ${t}]${e?"":"not "} supported`),e||this.featureDone()},featureInitialized(t){(0,o.default)(`[RemoteStorage] [FEATURE ${t}] initialized`),this.features.push({name:t,init:this.featureModules[t]._rs_init,supported:!0,cleanup:this.featureModules[t]._rs_cleanup}),this.featureDone()},featureDone(){this.featuresDone++,this.featuresDone===Object.keys(this.featureModules).length&&setTimeout(this.featuresLoaded.bind(this),0)},_setCachingModule(){["IndexedDB","LocalStorage","InMemoryStorage"].some(t=>{if(this.features.some(e=>e.name===t))return this.features.local=this.featureModules[t],!0})},_fireReady(){try{this.readyFired||(this._emit("ready"),this.readyFired=!0)}catch(t){console.error("'ready' failed: ",t,t.stack),this._emit("error",t)}},featuresLoaded(){(0,o.default)("[RemoteStorage] All features loaded"),this._setCachingModule(),this.local=r.default.cache&&this.features.local&&new this.features.local,this.local&&this.remote?(this._setGPD(l.default,this),this._bindChange(this.local)):this.remote&&this._setGPD(this.remote,this.remote),this.remote&&(this.remote.on("connected",()=>{this._fireReady(),this._emit("connected")}),this.remote.on("not-connected",()=>{this._fireReady(),this._emit("not-connected")}),this.remote.connected&&(this._fireReady(),this._emit("connected")),this.hasFeature("Authorize")||this.remote.stopWaitingForToken()),this._collectCleanupFunctions();try{this._allLoaded=!0,this._emit("features-loaded")}catch(t){(0,a.logError)(t),this._emit("error",t)}this._processPending()},_collectCleanupFunctions(){this._cleanups=[];for(let t=0;t<this.features.length;t++){const e=this.features[t].cleanup;"function"==typeof e&&this._cleanups.push(e)}}};t.exports=w},801:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(424)),s=i(n(93)),o=n(746),a=n(368),l=n(684),c="https://www.googleapis.com",h="remotestorage:googledrive",u="application/vnd.google-apps.folder";let d;function p(t){return"/"===t.substr(-1)&&(t=t.substr(0,t.length-1)),decodeURIComponent(t)}function f(t){return t.replace(/[^\/]+\/?$/,"")}function g(t){const e=t.split("/");return"/"===t.substr(-1)?e[e.length-2]+"/":e[e.length-1]}function m(t){return(0,o.cleanPath)(`/remotestorage/${t}`)}class y{constructor(t){this._items={},this.maxAge=t,this._items={}}get(t){const e=this._items[t],n=(new Date).getTime();return e&&e.t>=n-this.maxAge?e.v:void 0}set(t,e){this._items[t]={v:e,t:(new Date).getTime()}}}class v extends l.RemoteBase{constructor(t,e){if(super(t),this.online=!0,this.storageApi="draft-dejong-remotestorage-19",this.addEvents(["connected","not-connected"]),this.clientId=e,this._fileIdCache=new y(300),d=(0,o.localStorageAvailable)(),d){const t=(0,o.getJSONFromLocalStorage)(h);t&&this.configure(t)}}configure(t){void 0!==t.userAddress&&(this.userAddress=t.userAddress),void 0!==t.token&&(this.token=t.token);const e=function(){d&&localStorage.setItem(h,JSON.stringify({userAddress:this.userAddress,token:this.token}))},n=function(){this.connected=!1,delete this.token,d&&localStorage.removeItem(h)};this.token?(this.connected=!0,this.userAddress?(this._emit("connected"),e.apply(this)):this.info().then(t=>{this.userAddress=t.user.emailAddress,this._emit("connected"),e.apply(this)}).catch(()=>{n.apply(this),this.rs._emit("error",new Error("Could not fetch user info."))})):n.apply(this)}connect(){this.rs.setBackend("googledrive"),this.rs.authorize({authURL:"https://accounts.google.com/o/oauth2/auth",scope:"https://www.googleapis.com/auth/drive",clientId:this.clientId})}get(t,e={}){return(0,o.isFolder)(t)?this._getFolder(m(t)):this._getFile(m(t),e)}put(t,e,n,i={}){const r=m(t);function s(t){if(t.status>=200&&t.status<300){const e=JSON.parse(t.responseText),n=this.stripQuotes(e.etag);return Promise.resolve({statusCode:200,contentType:e.mimeType,revision:n})}return 412===t.status?Promise.resolve({statusCode:412,revision:"conflict"}):Promise.reject("PUT failed with status "+t.status+" ("+t.responseText+")")}return this._getFileId(r).then(t=>t?i&&"*"===i.ifNoneMatch?s({status:412}):this._updateFile(t,r,e,n,i).then(s):this._createFile(r,e,n).then(s))}delete(t,e={}){const n=m(t);return this._getFileId(n).then(t=>t?this._getMeta(t).then(n=>{let i;return"object"==typeof n&&"string"==typeof n.etag&&(i=this.stripQuotes(n.etag)),e&&e.ifMatch&&e.ifMatch!==i?{statusCode:412,revision:i}:this._request("DELETE",c+"/drive/v2/files/"+t,{}).then(t=>200===t.status||204===t.status?{statusCode:200}:Promise.reject("Delete failed: "+t.status+" ("+t.responseText+")"))}):Promise.resolve({statusCode:200}))}info(){const t=c+"/drive/v2/about?fields=user";return this._request("GET",t,{}).then(function(t){try{const e=JSON.parse(t.responseText);return Promise.resolve(e)}catch(t){return Promise.reject(t)}})}_updateFile(t,e,n,i,r){const s={mimeType:i},o={"Content-Type":"application/json; charset=UTF-8"};return r&&r.ifMatch&&(o["If-Match"]=this.addQuotes(r.ifMatch)),this._request("PUT",c+"/upload/drive/v2/files/"+t+"?uploadType=resumable",{body:JSON.stringify(s),headers:o}).then(t=>412===t.status?t:this._request("PUT",t.getResponseHeader("Location"),{body:i.match(/^application\/json/)?JSON.stringify(n):n}))}_createFile(t,e,n){return this._getParentId(t).then(i=>{const r={title:p(g(t)),mimeType:n,parents:[{kind:"drive#fileLink",id:i}]};return this._request("POST",c+"/upload/drive/v2/files?uploadType=resumable",{body:JSON.stringify(r),headers:{"Content-Type":"application/json; charset=UTF-8"}}).then(t=>this._request("POST",t.getResponseHeader("Location"),{body:n.match(/^application\/json/)?JSON.stringify(e):e}))})}_getFile(t,e){return this._getFileId(t).then(t=>this._getMeta(t).then(t=>{let n;if("object"==typeof t&&"string"==typeof t.etag&&(n=this.stripQuotes(t.etag)),e&&e.ifNoneMatch&&n===e.ifNoneMatch)return Promise.resolve({statusCode:304});if(!t.downloadUrl){if(!t.exportLinks||!t.exportLinks["text/html"])return Promise.resolve({statusCode:200,body:"",contentType:t.mimeType,revision:n});t.mimeType+=";export=text/html",t.downloadUrl=t.exportLinks["text/html"]}return this._request("GET",t.downloadUrl,{responseType:"arraybuffer"}).then(e=>(0,o.getTextFromArrayBuffer)(e.response,"UTF-8").then(function(i){let r=i;if(t.mimeType.match(/^application\/json/))try{r=JSON.parse(r)}catch(t){}else(0,o.shouldBeTreatedAsBinary)(i,t.mimeType)&&(r=e.response);return{statusCode:200,body:r,contentType:t.mimeType,revision:n}}))}))}_getFolder(t){return this._getFileId(t).then(e=>{let n,i,r;if(!e)return Promise.resolve({statusCode:404});const s="'"+e+"' in parents";return this._request("GET",c+"/drive/v2/files?q="+encodeURIComponent(s)+"&fields="+encodeURIComponent("items(downloadUrl,etag,fileSize,id,mimeType,title,labels)")+"&maxResults=1000&trashed=false",{}).then(e=>{var s;if(200!==e.status)return Promise.reject("request failed or something: "+e.status);try{n=JSON.parse(e.responseText)}catch(t){return Promise.reject("non-JSON response from GoogleDrive")}r={};for(const a of n.items)(null===(s=a.labels)||void 0===s?void 0:s.trashed)||(i=this.stripQuotes(a.etag),a.mimeType===u?(this._fileIdCache.set(t+(0,o.cleanPath)(a.title)+"/",a.id),r[a.title+"/"]={ETag:i}):(this._fileIdCache.set(t+(0,o.cleanPath)(a.title),a.id),r[a.title]={ETag:i,"Content-Type":a.mimeType,"Content-Length":a.fileSize}));return Promise.resolve({statusCode:200,body:r,contentType:"application/json; charset=UTF-8",revision:void 0})})})}_getParentId(t){const e=f(t);return this._getFileId(e).then(t=>t?Promise.resolve(t):this._createFolder(e))}_createFolder(t){return this._getParentId(t).then(e=>this._request("POST",c+"/drive/v2/files",{body:JSON.stringify({title:p(g(t)),mimeType:u,parents:[{id:e}]}),headers:{"Content-Type":"application/json; charset=UTF-8"}}).then(t=>{const e=JSON.parse(t.responseText);return Promise.resolve(e.id)}))}_getFileId(t){let e;return"/"===t?Promise.resolve("root"):(e=this._fileIdCache.get(t))?Promise.resolve(e):this._getFolder(f(t)).then(()=>(e=this._fileIdCache.get(t),e?Promise.resolve(e):"/"===t.substr(-1)?this._createFolder(t).then(()=>this._getFileId(t)):Promise.resolve()))}_getMeta(t){return this._request("GET",c+"/drive/v2/files/"+t,{}).then(function(e){return 200===e.status?Promise.resolve(JSON.parse(e.responseText)):Promise.reject("request (getting metadata for "+t+") failed with status: "+e.status)})}_request(t,e,n){return this.isForbiddenRequestMethod(t,e)?Promise.reject(`Don't use ${t} on directories!`):(n.headers||(n.headers={}),n.headers.Authorization="Bearer "+this.token,this.rs._emit("wire-busy",{method:t,isFolder:(0,o.isFolder)(e)}),(0,a.requestWithTimeout)(t,e,n).then(n=>n&&401===n.status?void this.connect():(this.online||(this.online=!0,this.rs._emit("network-online")),this.rs._emit("wire-done",{method:t,isFolder:(0,o.isFolder)(e),success:!0}),Promise.resolve(n)),n=>(this.online&&(this.online=!1,this.rs._emit("network-offline")),this.rs._emit("wire-done",{method:t,isFolder:(0,o.isFolder)(e),success:!1}),Promise.reject(n))))}static _rs_init(t){const e=t.apiKeys.googledrive;var n;e&&(t.googledrive=new v(t,e.clientId),"googledrive"===t.backend&&(t._origRemote=t.remote,t.remote=t.googledrive,(n=t)._origBaseClientGetItemURL||(n._origBaseClientGetItemURL=r.default.prototype.getItemURL,r.default.prototype.getItemURL=function(){throw new Error("getItemURL is not implemented for Google Drive yet")})))}static _rs_supported(){return!0}static _rs_cleanup(t){var e;t.setBackend(void 0),t._origRemote&&(t.remote=t._origRemote,delete t._origRemote),(e=t)._origBaseClientGetItemURL&&(r.default.prototype.getItemURL=e._origBaseClientGetItemURL,delete e._origBaseClientGetItemURL)}}(0,o.applyMixins)(v,[s.default]),t.exports=v},567:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const s=r(n(93)),o=r(n(496)),a=r(n(334)),l=n(746),c="remotestorage";let h;class u extends o.default{constructor(t){super(),this.addEvents(["change","local-events-done"]),this.db=t||h,this.db?(this.getsRunning=0,this.putsRunning=0,this.changesQueued={},this.changesRunning={},this.commitSlownessWarning=null):(0,a.default)("[IndexedDB] Failed to open DB")}getNodes(t){return i(this,void 0,void 0,function*(){const e=[],n={};for(let i=0,r=t.length;i<r;i++)void 0!==this.changesQueued[t[i]]?n[t[i]]=(0,l.deepClone)(this.changesQueued[t[i]]||void 0):void 0!==this.changesRunning[t[i]]?n[t[i]]=(0,l.deepClone)(this.changesRunning[t[i]]||void 0):e.push(t[i]);return e.length>0?this.getNodesFromDb(e).then(function(t){for(const e in n)t[e]=n[e];return t}):n})}setNodes(t){return i(this,void 0,void 0,function*(){for(const e in t)this.changesQueued[e]=t[e]||!1;this.maybeFlush()})}maybeFlush(){0===this.putsRunning?this.flushChangesQueued():this.commitSlownessWarning||(this.commitSlownessWarning=n.g.setInterval(function(){console.warn("WARNING: waited more than 10 seconds for previous commit to finish")},1e4))}flushChangesQueued(){this.commitSlownessWarning&&(clearInterval(this.commitSlownessWarning),this.commitSlownessWarning=null),Object.keys(this.changesQueued).length>0&&(this.changesRunning=this.changesQueued,this.changesQueued={},this.setNodesInDb(this.changesRunning).then(this.flushChangesQueued.bind(this)))}getNodesFromDb(t){return new Promise((e,n)=>{const i=this.db.transaction(["nodes"],"readonly"),r=i.objectStore("nodes"),s={};this.getsRunning++,t.map(t=>{r.get(t).onsuccess=e=>{s[t]=e.target.result}}),i.oncomplete=()=>{e(s),this.getsRunning--},i.onerror=i.onabort=()=>{n("get transaction error/abort"),this.getsRunning--}})}setNodesInDb(t){return i(this,void 0,void 0,function*(){return new Promise((e,n)=>{const i=this.db.transaction(["nodes"],"readwrite"),r=i.objectStore("nodes"),s=(new Date).getTime();this.putsRunning++,(0,a.default)("[IndexedDB] Starting puts",t,this.putsRunning);for(const o in t){const e=t[o];if("object"==typeof e)try{r.put(e)}catch(t){throw(0,a.default)("[IndexedDB] Error while putting",e,t),t}else try{r.delete(o)}catch(t){throw(0,a.default)("[IndexedDB] Error while removing",r,e,t),t}}i.oncomplete=()=>{this.putsRunning--,(0,a.default)("[IndexedDB] Finished puts",t,this.putsRunning,(new Date).getTime()-s+"ms"),e()},i.onerror=()=>{this.putsRunning--,n("transaction error")},i.onabort=()=>{n("transaction abort"),this.putsRunning--}})})}reset(t){const e=this.db.name;this.db.close(),u.clean(e,()=>{u.open(e,(n,i)=>{n?(0,a.default)(`[IndexedDB] Error while resetting database ${e}:`,n):this.db=i,"function"==typeof t&&t(self)})})}forAllNodes(t){return i(this,void 0,void 0,function*(){return new Promise(e=>{this.db.transaction(["nodes"],"readonly").objectStore("nodes").openCursor().onsuccess=n=>{const i=n.target.result;i?(t(i.value),i.continue()):e()}})})}closeDB(){0===this.putsRunning?this.db.close():setTimeout(this.closeDB.bind(this),100)}static open(t,e){const n=setTimeout(function(){e("timeout trying to open db")},1e4);try{const i=indexedDB.open(t,2);i.onerror=function(){(0,a.default)("[IndexedDB] Opening DB failed",i),clearTimeout(n),e(i.error)},i.onupgradeneeded=function(t){const e=i.result;(0,a.default)("[IndexedDB] Upgrade: from ",t.oldVersion," to ",t.newVersion),1!==t.oldVersion&&((0,a.default)("[IndexedDB] Creating object store: nodes"),e.createObjectStore("nodes",{keyPath:"path"})),(0,a.default)("[IndexedDB] Creating object store: changes"),e.createObjectStore("changes",{keyPath:"path"})},i.onsuccess=function(){clearTimeout(n);const r=i.result;if(!r.objectStoreNames.contains("nodes")||!r.objectStoreNames.contains("changes"))return(0,a.default)("[IndexedDB] Missing object store. Resetting the database."),void u.clean(t,function(){u.open(t,e)});e(null,i.result)}}catch(i){(0,a.default)("[IndexedDB] Failed to open database: "+i),(0,a.default)("[IndexedDB] Resetting database and trying again."),clearTimeout(n),u.clean(t,function(){u.open(t,e)})}}static clean(t,e){const n=indexedDB.deleteDatabase(t);n.onsuccess=function(){(0,a.default)(`[IndexedDB] Deleted database "${t}"`),e()},n.onerror=n.onabort=function(e){console.error('Failed to remove database "'+t+'"',e)}}static _rs_init(t){return new Promise((e,n)=>{u.open(c,function(i,r){i?n(i):(h=r,r.onerror=()=>{t._emit("error",i)},e())})})}static _rs_supported(){return new Promise((t,e)=>{const n=(0,l.getGlobalContext)();let i=!1;if("undefined"!=typeof navigator&&navigator.userAgent.match(/Android (2|3|4\.[0-3])/)&&(navigator.userAgent.match(/Chrome|Firefox/)||(i=!0)),"indexedDB"in n&&!i)try{const n=indexedDB.open("rs-check");n.onerror=function(){e()},n.onsuccess=function(){n.result.close(),indexedDB.deleteDatabase("rs-check"),t()}}catch(t){e()}else e()})}static _rs_cleanup(t){return new Promise(e=>{t.local instanceof u&&t.local.closeDB(),u.clean(c,e)})}diffHandler(){}}(0,l.applyMixins)(u,[s.default]),t.exports=u},365:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(93)),s=i(n(496)),o=n(746);class a extends s.default{constructor(){super(),this._storage={},this.addEvents(["change","local-events-done"])}getNodes(t){const e={};for(let n=0,i=t.length;n<i;n++)e[t[n]]=(0,o.deepClone)(this._storage[t[n]]);return Promise.resolve(e)}setNodes(t){for(const e in t)void 0===t[e]?delete this._storage[e]:this._storage[e]=t[e];return Promise.resolve()}forAllNodes(t){for(const e in this._storage)t(this._storage[e]);return Promise.resolve()}diffHandler(){}static _rs_init(){}static _rs_supported(){return!0}static _rs_cleanup(){}}(0,o.applyMixins)(a,[r.default]),t.exports=a},794:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const r=i(n(496)),s=i(n(93)),o=i(n(334)),a=n(746),l="remotestorage:cache:nodes:";function c(t){return t.substr(0,26)===l||"remotestorage:cache:changes:"===t.substr(0,28)}class h extends r.default{constructor(){super(),this.addEvents(["change","local-events-done"])}diffHandler(...t){}getNodes(t){const e={};for(let n=0,r=t.length;n<r;n++)try{const i=JSON.parse(localStorage.getItem(l+t[n]));e[t[n]]=i||void 0}catch(i){(0,o.default)(`[LocalStorage] Failed to get node: ${i.message}`),e[t[n]]=void 0}return Promise.resolve(e)}setNodes(t){for(const e in t)localStorage.setItem(l+e,JSON.stringify(t[e]));return Promise.resolve()}forAllNodes(t){let e;for(let n=0,i=localStorage.length;n<i;n++)if(localStorage.key(n).substr(0,26)===l){try{e=JSON.parse(localStorage.getItem(localStorage.key(n)))}catch(t){e=void 0}e&&t(e)}return Promise.resolve()}static _rs_init(){}static _rs_supported(){return(0,a.localStorageAvailable)()}static _rs_cleanup(){const t=[];(0,o.default)("[LocalStorage] Starting cleanup");for(let e=0,n=localStorage.length;e<n;e++){const n=localStorage.key(e);c(n)&&t.push(n)}for(const e in t)(0,o.default)("[LocalStorage] Removing",e),localStorage.removeItem(e)}}(0,a.applyMixins)(h,[s.default]),t.exports=h},334:function(t,e,n){const i=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(28));t.exports=function(...t){i.default.logging&&console.log(...t)}},684:function(t,e,n){var i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteBase=void 0;const r=i(n(93)),s=n(746);class o extends r.default{constructor(t){super(),this.rs=t,this.connected=!1}stopWaitingForToken(){this.connected||this._emit("not-connected")}addQuotes(t){return"string"!=typeof t?t:"*"===t?"*":'"'+t+'"'}stripQuotes(t){return"string"!=typeof t?t:t.replace(/^["']|["']$/g,"")}isForbiddenRequestMethod(t,e){return("PUT"===t||"DELETE"===t)&&(0,s.isFolder)(e)}}e.RemoteBase=o},423:function(t,e,n){var i=this&&this.__createBinding||(Object.create?function(t,e,n,i){void 0===i&&(i=n);var r=Object.getOwnPropertyDescriptor(e,n);r&&!("get"in r?!e.__esModule:r.writable||r.configurable)||(r={enumerable:!0,get:function(){return e[n]}}),Object.defineProperty(t,i,r)}:function(t,e,n,i){void 0===i&&(i=n),t[i]=e[n]}),r=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.prototype.hasOwnProperty.call(t,n)&&i(e,t,n);return r(e,t),e},o=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.RemoteStorage=void 0;const a=o(n(28)),l=o(n(334)),c=n(746),h=o(n(548)),u=o(n(275)),d=o(n(424)),p=o(n(285)),f=n(93),g=o(n(801)),m=o(n(706)),y=o(n(373)),v=o(n(982)),_=o(n(503)),b=o(n(545)),w=s(n(746)),x=(0,c.getGlobalContext)();let C;function S(t){return 403!==t.statusCode&&401!==t.statusCode||this._emit("error",new _.default),Promise.resolve(t)}function k(t){return"number"==typeof t&&t>=2e3&&t<=36e5}var E;!function(t){t.GOOGLE="googledrive",t.DROPBOX="dropbox"}(E||(E={}));class T{constructor(t){if(this._pending=[],this._cleanups=[],this._pathHandlers={change:{}},this.apiKeys={},this._init=b.default.loadFeatures,this.features=b.default.features,this.loadFeature=b.default.loadFeature,this.featureSupported=b.default.featureSupported,this.featureDone=b.default.featureDone,this.featuresDone=b.default.featuresDone,this.featuresLoaded=b.default.featuresLoaded,this.featureInitialized=b.default.featureInitialized,this.featureFailed=b.default.featureFailed,this.hasFeature=b.default.hasFeature,this._setCachingModule=b.default._setCachingModule,this._collectCleanupFunctions=b.default._collectCleanupFunctions,this._fireReady=b.default._fireReady,this.initFeature=b.default.initFeature,"object"==typeof t&&(0,c.extend)(a.default,t),this.addEvents(["ready","authing","connecting","connected","disconnected","not-connected","conflict","error","features-loaded","sync-interval-change","sync-started","sync-req-done","sync-done","wire-busy","wire-done","network-offline","network-online"]),this._setGPD({get:this._pendingGPD("get"),put:this._pendingGPD("put"),delete:this._pendingGPD("delete")}),C=(0,c.localStorageAvailable)(),C){this.apiKeys=(0,c.getJSONFromLocalStorage)("remotestorage:api-keys")||{};const t=localStorage.getItem("remotestorage:backend");"dropbox"===t||"googledrive"===t?this.setBackend(t):this.setBackend("remotestorage")}const e=this.on;this.on=function(t,n){if(this._allLoaded)switch(t){case"features-loaded":setTimeout(n,0);break;case"ready":this.remote&&setTimeout(n,0);break;case"connected":this.remote&&this.remote.connected&&setTimeout(n,0);break;case"not-connected":this.remote&&!this.remote.connected&&setTimeout(n,0)}return e.call(this,t,n)},this._init(),this.fireInitial=function(){this.local&&setTimeout(this.local.fireInitial.bind(this.local),0)}.bind(this),this.on("ready",this.fireInitial.bind(this)),this.loadModules()}get connected(){return this.remote.connected}loadModules(){a.default.modules.forEach(this.addModule.bind(this))}authorize(t){if(this.access.setStorageType(this.remote.storageApi),void 0===t.scope&&(t.scope=this.access.scopeParameter),x.cordova)t.redirectUri=a.default.cordovaRedirectUri;else{const e=u.default.getLocation();let n=e.origin;"/"!==e.pathname&&(n+=e.pathname),t.redirectUri=n}void 0===t.clientId&&(t.clientId=t.redirectUri.match(/^(https?:\/\/[^/]+)/)[0]),u.default.authorize(this,t)}impliedauth(t,e){t=t||this.remote.storageApi,e=e||String(document.location),(0,l.default)("ImpliedAuth proceeding due to absent authURL; storageApi = "+t+" redirectUri = "+e),this.remote.configure({token:u.default.IMPLIED_FAKE_TOKEN}),document.location.href=e}connect(t,e){if(this.setBackend("remotestorage"),t.indexOf("@")<0&&!t.match(/^(https?:\/\/)?[^\s\/$\.?#]+\.[^\s]*$/))this._emit("error",new T.DiscoveryError("Not a valid user address or URL."));else{if(t.indexOf("@")<0&&!t.match(/^https?:\/\//)&&(t=`https://${t}`),x.cordova){if("string"!=typeof a.default.cordovaRedirectUri)return void this._emit("error",new T.DiscoveryError("Please supply a custom HTTPS redirect URI for your Cordova app"));if(!x.cordova.InAppBrowser)return void this._emit("error",new T.DiscoveryError("Please include the InAppBrowser Cordova plugin to enable OAuth"))}this.remote.configure({userAddress:t}),this._emit("connecting"),(0,y.default)(t).then(n=>{if(this._emit("authing"),n.userAddress=t,this.remote.configure(n),!this.remote.connected)if(n.authURL)if(void 0===e)this.authorize({authURL:n.authURL});else{if("string"!=typeof e)throw new Error("Supplied bearer token must be a string");(0,l.default)("Skipping authorization sequence and connecting with known token"),this.remote.configure({token:e})}else this.impliedauth()},()=>{this._emit("error",new T.DiscoveryError("No storage information found for this user address."))})}}reconnect(){this.remote.configure({token:null}),"remotestorage"===this.backend?this.connect(this.remote.userAddress):this.remote.connect()}disconnect(){this.remote&&this.remote.configure({userAddress:null,href:null,storageApi:null,token:null,properties:null}),this._setGPD({get:this._pendingGPD("get"),put:this._pendingGPD("put"),delete:this._pendingGPD("delete")});const t=this._cleanups.length;let e=0;const n=()=>{e++,e>=t&&(this._init(),(0,l.default)('Cleanups done, emitting "disconnected" event'),this._emit("disconnected"))};t>0?this._cleanups.forEach(t=>{const e=t(this);"object"==typeof e&&"function"==typeof e.then?e.then(n):n()}):n()}setBackend(t){this.backend=t,C&&(void 0!==t?localStorage.setItem("remotestorage:backend",t):localStorage.removeItem("remotestorage:backend"))}onChange(t,e){this._pathHandlers.change[t]||(this._pathHandlers.change[t]=[]),this._pathHandlers.change[t].push(e)}enableLog(){a.default.logging=!0}disableLog(){a.default.logging=!1}log(...t){l.default.apply(T,t)}setApiKeys(t){const e=[E.GOOGLE,E.DROPBOX];if("object"!=typeof t||!Object.keys(t).every(t=>e.includes(t)))return console.error("setApiKeys() was called with invalid arguments"),!1;Object.keys(t).forEach(e=>{const n=t[e];if(n){switch(e){case E.DROPBOX:this.apiKeys[E.DROPBOX]={appKey:n},void 0!==this.dropbox&&this.dropbox.clientId===n||m.default._rs_init(this);break;case E.GOOGLE:this.apiKeys[E.GOOGLE]={clientId:n},void 0!==this.googledrive&&this.googledrive.clientId===n||g.default._rs_init(this)}return!0}delete this.apiKeys[e]}),C&&localStorage.setItem("remotestorage:api-keys",JSON.stringify(this.apiKeys))}setCordovaRedirectUri(t){if("string"!=typeof t||!t.match(/http(s)?:\/\//))throw new Error("Cordova redirect URI must be a URI string");a.default.cordovaRedirectUri=t}_setGPD(t,e){function n(t){return function(...n){return t.apply(e,n).then(S.bind(this))}}this.get=n(t.get),this.put=n(t.put),this.delete=n(t.delete)}_pendingGPD(t){return(...e)=>{const n=Array.prototype.slice.call(e);return new Promise((e,i)=>{this._pending.push({method:t,args:n,promise:{resolve:e,reject:i}})})}}_processPending(){this._pending.forEach(t=>{try{this[t.method](...t.args).then(t.promise.resolve,t.promise.reject)}catch(e){t.promise.reject(e)}}),this._pending=[]}_bindChange(t){t.on("change",this._dispatchEvent.bind(this,"change"))}_dispatchEvent(t,e){Object.keys(this._pathHandlers[t]).forEach(n=>{const i=n.length;e.path.substr(0,i)===n&&this._pathHandlers[t][n].forEach(t=>{const i={};for(const n in e)i[n]=e[n];i.relativePath=e.path.replace(new RegExp("^"+n),"");try{t(i)}catch(t){console.error("'change' handler failed: ",t,t.stack),this._emit("error",t)}})})}scope(t){if("string"!=typeof t)throw"Argument 'path' of baseClient.scope must be a string";return this.access.checkPathPermission(t,"r")||console.warn("WARNING: Please use remoteStorage.access.claim() to ask for access permissions first: https://remotestorage.io/rs.js/docs/api/access/classes/Access.html#claim"),new d.default(this,t)}getSyncInterval(){return a.default.syncInterval}setSyncInterval(t){if(!k(t))throw t+" is not a valid sync interval";const e=a.default.syncInterval;a.default.syncInterval=t,this._emit("sync-interval-change",{oldValue:e,newValue:t})}getBackgroundSyncInterval(){return a.default.backgroundSyncInterval}setBackgroundSyncInterval(t){if(!k(t))throw t+" is not a valid sync interval";const e=a.default.backgroundSyncInterval;a.default.backgroundSyncInterval=t,this._emit("sync-interval-change",{oldValue:e,newValue:t})}getCurrentSyncInterval(){return a.default.isBackground?a.default.backgroundSyncInterval:a.default.syncInterval}getRequestTimeout(){return a.default.requestTimeout}setRequestTimeout(t){if("number"!=typeof t)throw t+" is not a valid request timeout";a.default.requestTimeout=t}setupSyncCycle(){this.sync&&!this.sync.stopped&&((0,l.default)("[Sync] Setting up sync cycle"),this.on("sync-done",()=>{(0,l.default)("[Sync] Sync done. Setting timer to",this.getCurrentSyncInterval()),this.sync&&!this.sync.stopped&&(this._syncTimer&&clearTimeout(this._syncTimer),this._syncTimer=setTimeout(this.sync.sync.bind(this.sync),this.getCurrentSyncInterval()))}),this.sync.sync())}startSync(){return a.default.cache?(this.sync.stopped=!1,this.syncStopped=!1,this.sync.sync()):(console.warn("Nothing to sync, because caching is disabled."),Promise.resolve())}stopSync(){clearTimeout(this._syncTimer),this._syncTimer=void 0,this.sync?((0,l.default)("[Sync] Stopping sync"),this.sync.stopped=!0):((0,l.default)("[Sync] Will instantiate sync stopped"),this.syncStopped=!0)}addModule(t){const e=t.name,n=t.builder;if(Object.defineProperty(this,e,{configurable:!0,get:function(){const t=this._loadModule(e,n);return Object.defineProperty(this,e,{value:t}),t}}),-1!==e.indexOf("-")){const t=e.replace(/\-[a-z]/g,function(t){return t[1].toUpperCase()});Object.defineProperty(this,t,{get:function(){return this[e]}})}}_loadModule(t,e){if(e)return e(new d.default(this,"/"+t+"/"),new d.default(this,"/public/"+t+"/")).exports;throw"Unknown module: "+t}}e.RemoteStorage=T,T.SyncError=v.default,T.Unauthorized=_.default,T.DiscoveryError=y.default.DiscoveryError,T.util=w,Object.defineProperty(T.prototype,"access",{configurable:!0,get:function(){const t=new h.default;return Object.defineProperty(this,"access",{value:t}),t}}),Object.defineProperty(T.prototype,"caching",{configurable:!0,get:function(){const t=new p.default(this);return Object.defineProperty(this,"caching",{value:t}),t}}),(0,c.applyMixins)(T,[f.EventHandling]),e.default=T},368:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.isArrayBufferView=void 0,e.retryAfterMs=function(t){const e=1e3*parseInt(t.getResponseHeader("Retry-After"));return e>=1e3?e:Math.max(1500,Math.min(6e4,Math.round(o.default.syncInterval/(2.9+.2*Math.random()))))},e.requestWithTimeout=function(t,n,r){return i(this,void 0,void 0,function*(){return"function"==typeof fetch?function(t,e,n){return i(this,void 0,void 0,function*(){const i="function"==typeof AbortController?new AbortController:null;let r;const a=new Promise((t,e)=>{r=setTimeout(()=>{i&&i.abort(),e("timeout")},o.default.requestTimeout)});let l;const c={},h=fetch(e,{method:t,headers:n.headers,body:n.body,signal:i?i.signal:void 0}).then(t=>{switch((0,s.default)("[requests fetch]",t),t.headers.forEach((t,e)=>{c[e.toUpperCase()]=t}),l={readyState:4,status:t.status,statusText:t.statusText,response:void 0,getResponseHeader:t=>c[t.toUpperCase()]||null,responseType:n.responseType,responseURL:e},n.responseType){case"arraybuffer":return t.arrayBuffer();case"blob":return t.blob();case"json":return t.json();case void 0:case"":case"text":return t.text();default:throw new Error("responseType 'document' is not currently supported using fetch")}}).then(t=>(l.response=t,n.responseType&&"text"!==n.responseType||(l.responseText=t),l)).finally(()=>{clearTimeout(r)});return Promise.race([h,a])})}(t,n,r):"function"==typeof XMLHttpRequest?function(t,n,r){return i(this,void 0,void 0,function*(){return new Promise((i,a)=>{(0,s.default)("[requests XHR]",t,n);let l=!1;const c=setTimeout(()=>{l=!0,a("timeout")},o.default.requestTimeout),h=new XMLHttpRequest;if(h.open(t,n,!0),r.responseType&&(h.responseType=r.responseType),r.headers)for(const t in r.headers)h.setRequestHeader(t,r.headers[t]);h.onload=()=>{l||(clearTimeout(c),i(h))},h.onerror=t=>{l||(clearTimeout(c),a(t))};let u=r.body;"object"==typeof u&&!(0,e.isArrayBufferView)(u)&&u instanceof ArrayBuffer&&(u=new Uint8Array(u)),h.send(u)})})}(t,n,r):Promise.reject("[Requests] You need to add a polyfill for fetch or XMLHttpRequest")})};const s=r(n(334)),o=r(n(28));if("function"==typeof(n.g||window).ArrayBufferView)e.isArrayBufferView=function(t){return t&&t instanceof(n.g||window).ArrayBufferView};else{const t=[Int8Array,Uint8Array,Int16Array,Uint16Array,Int32Array,Uint32Array,Float32Array,Float64Array];e.isArrayBufferView=function(e){for(let n=0;n<8;n++)if(e instanceof t[n])return!0;return!1}}},941:function(t){t.exports=class{constructor(t){this._itemsRev={},this._storage={},this._canPropagate=!1,this.defaultValue=t,this.activatePropagation()}get(t){t=t.toLowerCase();let e=this._storage[t];return void 0===e&&(e=this.defaultValue,this._storage[t]=e),e}set(t,e){return t=t.toLowerCase(),this._storage[t]===e||(this._storage[t]=e,e||delete this._itemsRev[t],this._updateParentFolderItemRev(t,e),this._canPropagate&&this._propagate(t)),e}delete(t){return this.set(t,null)}deactivatePropagation(){return this._canPropagate=!1,!0}activatePropagation(){return this._canPropagate||(this._generateFolderRev("/"),this._canPropagate=!0),!0}_hashCode(t){let e=0;if(0===t.length)return e;for(let n=0;n<t.length;n++)e=(e<<5)-e+t.charCodeAt(n),e|=0;return e}_generateHash(t){const e=t.sort().join("|");return""+this._hashCode(e)}_updateParentFolderItemRev(t,e){if("/"!==t){const n=this._getParentFolder(t);this._itemsRev[n]||(this._itemsRev[n]={});const i=this._itemsRev[n];e?i[t]=e:delete i[t],this._updateParentFolderItemRev(n,this.defaultValue)}}_getParentFolder(t){return t.substr(0,t.lastIndexOf("/",t.length-2)+1)}_propagate(t){if("/"!==t){const e=this._getParentFolder(t),n=this._itemsRev[e],i=[];for(const t in n)i.push(n[t]);const r=this._generateHash(i);this.set(e,r)}}_generateFolderRev(t){const e=this._itemsRev[t];let n=this.defaultValue;if(e){const t=[];for(const n in e){let i;i="/"===n.substr(-1)?this._generateFolderRev(n):e[n],t.push(i)}t.length>0&&(n=this._generateHash(t))}return this.set(t,n),n}}},491:function(t){class e extends Error{constructor(t){super();const e=new Error("Schema not found: "+t);return e.name="SchemaNotFound",e}}t.exports=e},982:function(t){class e extends Error{constructor(t){super(),this.name="SyncError",this.message="Sync failed: ","string"==typeof t?this.message+=t:(this.message+=t.message,this.stack=t.stack,this.originalError=t)}}t.exports=e},313:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Sync=void 0;const s=r(n(28)),o=r(n(451)),a=r(n(93)),l=r(n(334)),c=r(n(275)),h=r(n(982)),u=r(n(503)),d=n(746);let p,f;function g(t,e,n){return{action:t,path:e,promise:n}}function m(t,e){return t.common.revision!==e&&(!t.remote||t.remote.revision!==e)}function y(t){return!!t.common&&!!t.common.revision}class v{constructor(t){this.numThreads=10,this._tasks={},this._running={},this._timeStarted={},this._finishedTasks=[],this.rs=t,this.rs.local.onDiff(t=>{this.addTask(t),this.doTasks()}),this.rs.caching.onActivate(t=>{this.addTask(t),this.doTasks()}),this.addEvents(["done","req-done"])}now(){return(new Date).getTime()}queueGetRequest(t){return i(this,void 0,void 0,function*(){return new Promise((e,n)=>{this.rs.remote.connected?this.rs.remote.online?(this.addTask(t,function(){this.rs.local.get(t).then(t=>e(t))}.bind(this)),this.doTasks()):n("cannot fulfill maxAge requirement - remote is not online"):n("cannot fulfill maxAge requirement - remote is not connected")})})}corruptServerItemsMap(t){if("object"!=typeof t||Array.isArray(t))return!0;for(const e in t){const n=t[e];if("object"!=typeof n)return!0;if("string"!=typeof n.ETag)return!0;if((0,d.isFolder)(e)){if(-1!==e.substring(0,e.length-1).indexOf("/"))return!0}else if(-1!==e.indexOf("/"))return!0}return!1}corruptItemsMap(t){if("object"!=typeof t||Array.isArray(t))return!0;for(const e in t)if("boolean"!=typeof t[e])return!0;return!1}corruptRevision(t){return"object"!=typeof t||Array.isArray(t)||t.revision&&"string"!=typeof t.revision||t.body&&"string"!=typeof t.body&&"object"!=typeof t.body||t.contentType&&"string"!=typeof t.contentType||t.contentLength&&"number"!=typeof t.contentLength||t.timestamp&&"number"!=typeof t.timestamp||t.itemsMap&&this.corruptItemsMap(t.itemsMap)}isCorrupt(t){return"object"!=typeof t||Array.isArray(t)||"string"!=typeof t.path||this.corruptRevision(t.common)||t.local&&this.corruptRevision(t.local)||t.remote&&this.corruptRevision(t.remote)||t.push&&this.corruptRevision(t.push)}hasTasks(){return Object.keys(this._tasks).length>0}collectDiffTasks(){return i(this,void 0,void 0,function*(){let t=0;return this.rs.local.forAllNodes(e=>{t>100||(this.isCorrupt(e)?((0,l.default)("[Sync] WARNING: corrupt node in local cache",e),"object"==typeof e&&e.path&&(this.addTask(e.path),t++)):(this.needsFetch(e)&&this.rs.access.checkPathPermission(e.path,"r")||(0,d.isDocument)(e.path)&&this.needsPush(e)&&this.rs.access.checkPathPermission(e.path,"rw"))&&(this.addTask(e.path),t++))}).then(()=>t)})}inConflict(t){return!(!t.local||!t.remote||void 0===t.remote.body&&!t.remote.itemsMap)}needsRefresh(t){return!!t.common&&(!t.common.timestamp||this.now()-t.common.timestamp>s.default.syncInterval)}needsFetch(t){return!!this.inConflict(t)||!(!t.common||void 0!==t.common.itemsMap||void 0!==t.common.body)||!(!t.remote||void 0!==t.remote.itemsMap||void 0!==t.remote.body)}needsPush(t){return!this.inConflict(t)&&(!(!t.local||t.push)||void 0)}needsRemotePut(t){return t.local&&"string"==typeof t.local.body}needsRemoteDelete(t){return t.local&&!1===t.local.body}getParentPath(t){const e=t.match(/^(.*\/)([^\/]+\/?)$/);if(e)return e[1];throw new Error('Not a valid path: "'+t+'"')}deleteChildPathsFromTasks(){for(const t in this._tasks){const e=(0,d.pathsFromRoot)(t);for(let n=1;n<e.length;n++)this._tasks[e[n]]&&(Array.isArray(this._tasks[t])&&this._tasks[t].length&&Array.prototype.push.apply(this._tasks[e[n]],this._tasks[t]),delete this._tasks[t])}}collectRefreshTasks(){return i(this,void 0,void 0,function*(){yield this.rs.local.forAllNodes(t=>{let e;if(this.needsRefresh(t)){try{e=this.getParentPath(t.path)}catch(t){}e&&this.rs.access.checkPathPermission(e,"r")?this.addTask(e):this.rs.access.checkPathPermission(t.path,"r")&&this.addTask(t.path)}}),this.deleteChildPathsFromTasks()})}flush(t){for(const e in t)"FLUSH"===this.rs.caching.checkPath(e)&&t[e]&&!t[e].local&&((0,l.default)("[Sync] Flushing",e),t[e]=void 0);return t}doTask(t){return i(this,void 0,void 0,function*(){return this.rs.local.getNodes([t]).then(e=>{const n=e[t];return void 0===n||function(t){return!(!t.remote||!t.remote.revision||t.remote.itemsMap||t.remote.body)}(n)?g("get",t,this.rs.remote.get(t)):this.needsRemotePut(n)?(n.push=(0,d.deepClone)(n.local),n.push.timestamp=this.now(),this.rs.local.setNodes(this.flush(e)).then(()=>{let e;return e=y(n)?{ifMatch:n.common.revision}:{ifNoneMatch:"*"},g("put",t,this.rs.remote.put(t,n.push.body,n.push.contentType,e))})):this.needsRemoteDelete(n)?(n.push={body:!1,timestamp:this.now()},this.rs.local.setNodes(this.flush(e)).then(()=>y(n)?g("delete",t,this.rs.remote.delete(t,{ifMatch:n.common.revision})):g("get",t,this.rs.remote.get(t)))):y(n)?g("get",t,this.rs.remote.get(t,{ifNoneMatch:n.common.revision})):g("get",t,this.rs.remote.get(t))})})}autoMergeFolder(t){if(t.remote.itemsMap&&(t.common=t.remote,delete t.remote,t.common.itemsMap)){for(const e in t.common.itemsMap)t.local.itemsMap[e]||(t.local.itemsMap[e]=!1);for(const e in t.local.itemsMap)t.common.itemsMap[e]||this.addTask(t.path+e);(0,d.equal)(t.local.itemsMap,t.common.itemsMap)&&delete t.local}return t}autoMergeDocument(t){var e;return function(t){return(!t.remote||!t.remote.revision||t.remote.revision===t.common.revision)&&(void 0===t.common.body&&!1===t.remote.body||t.remote.body===t.common.body&&t.remote.contentType===t.common.contentType)}(t)?delete(t=function(t){return t.remote&&!1===t.remote.body&&t.local&&!1===t.local.body&&delete t.local,t}(t)).remote:void 0!==t.remote.body&&(!1===t.remote.body&&!1===(null===(e=t.local)||void 0===e?void 0:e.body)||((0,l.default)("[Sync] Emitting conflict event"),setTimeout(this.rs.local.emitChange.bind(this.rs.local),10,{origin:"conflict",path:t.path,oldValue:t.local.body,newValue:t.remote.body,lastCommonValue:t.common.body,oldContentType:t.local.contentType,newContentType:t.remote.contentType,lastCommonContentType:t.common.contentType})),!1===t.remote.body?t.common={}:t.common=t.remote,delete t.remote,delete t.local),t}autoMerge(t){if(t.remote){if(t.local)return(0,d.isFolder)(t.path)?this.autoMergeFolder(t):this.autoMergeDocument(t);if((0,d.isFolder)(t.path))void 0!==t.remote.itemsMap&&(t.common=t.remote,delete t.remote);else if(void 0!==t.remote.body){const e={origin:"remote",path:t.path,oldValue:!1===t.common.body?void 0:t.common.body,newValue:!1===t.remote.body?void 0:t.remote.body,oldContentType:t.common.contentType,newContentType:t.remote.contentType};if(void 0===e.oldValue&&void 0===e.newValue||this.rs.local.emitChange(e),!1===t.remote.body)return;t.common=t.remote,delete t.remote}return t}t.common.body&&this.rs.local.emitChange({origin:"remote",path:t.path,oldValue:t.common.body,newValue:void 0,oldContentType:t.common.contentType,newContentType:void 0})}updateCommonTimestamp(t,e){return i(this,void 0,void 0,function*(){return this.rs.local.getNodes([t]).then(n=>(n[t]&&n[t].common&&n[t].common.revision===e&&(n[t].common.timestamp=this.now()),this.rs.local.setNodes(this.flush(n))))})}markChildren(t,e,n,r){return i(this,void 0,void 0,function*(){const i=[],s={},o={};for(const n in e)i.push(t+n),s[t+n]=e[n];for(const e in r)i.push(t+e);const a=yield this.rs.local.getNodes(i);let l,c;for(const e in a)if(c=a[e],s[e])c&&c.common?m(c,s[e].ETag)&&(n[e]=(0,d.deepClone)(c),n[e].remote={revision:s[e].ETag,timestamp:this.now()},n[e]=this.autoMerge(n[e])):(l=this.rs.caching.checkPath(e),"ALL"===l&&(n[e]={path:e,common:{timestamp:this.now()},remote:{revision:s[e].ETag,timestamp:this.now()}})),n[e]&&s[e]["Content-Type"]&&(n[e].remote.contentType=s[e]["Content-Type"]),n[e]&&s[e]["Content-Length"]&&(n[e].remote.contentLength=s[e]["Content-Length"]);else if(r[e.substring(t.length)]&&c&&c.common){if(c.common.itemsMap)for(const t in c.common.itemsMap)o[e+t]=!0;if(c.local&&c.local.itemsMap)for(const t in c.local.itemsMap)o[e+t]=!0;if(c.remote||(0,d.isFolder)(e))n[e]=void 0;else if(n[e]=this.autoMerge(c),void 0===n[e]){const i=this.getParentPath(e),r=n[i],s=e.substring(t.length);r&&r.local&&(delete r.local.itemsMap[s],(0,d.equal)(r.local.itemsMap,r.common.itemsMap)&&delete r.local)}}const h=yield this.markRemoteDeletions(Object.keys(o),n);h&&(yield this.rs.local.setNodes(this.flush(h)))})}markRemoteDeletions(t,e){return i(this,void 0,void 0,function*(){if(0===t.length)return e;const n=yield this.rs.local.getNodes(t),i={};function r(t,e){if(t&&t.itemsMap)for(const n in t.itemsMap)i[e+n]=!0}for(const t in n){const i=n[t];i&&((0,d.isFolder)(t)?(r(i.common,t),r(i.local,t)):i.common&&void 0!==i.common.body&&(e[t]=(0,d.deepClone)(i),e[t].remote={body:!1,timestamp:this.now()},e[t]=this.autoMerge(e[t])))}const s=yield this.markRemoteDeletions(Object.keys(i),e);s&&(yield this.rs.local.setNodes(this.flush(s)))})}completeFetch(t,e,n,r){return i(this,void 0,void 0,function*(){let i,s;const o=(0,d.pathsFromRoot)(t);(0,d.isFolder)(t)?i=[t]:(s=o[1],i=[t,s]);const a=yield this.rs.local.getNodes(i),l=a[s],c={};let h,u=a[t];function p(t){if(t&&t.itemsMap)for(h in t.itemsMap)e[h]||(c[h]=!0)}if("object"==typeof u&&u.path===t&&"object"==typeof u.common||(u={path:t,common:{}},a[t]=u),u.remote={revision:r,timestamp:this.now()},(0,d.isFolder)(t))for(h in p(u.common),p(u.remote),u.remote.itemsMap={},e)u.remote.itemsMap[h]=!0;else u.remote.body=e,u.remote.contentType=n,l&&l.local&&l.local.itemsMap&&(h=t.substring(s.length),!1!==e?l.local.itemsMap[h]=!0:l.local.itemsMap[h]&&delete l.local.itemsMap[h],(0,d.equal)(l.local.itemsMap,l.common.itemsMap)&&delete l.local);return a[t]=this.autoMerge(u),{toBeSaved:a,missingChildren:c}})}completePush(t,e,n,r){return i(this,void 0,void 0,function*(){const i=yield this.rs.local.getNodes([t]),s=i[t];if(!s.push)throw this.stopped=!0,new Error("completePush called but no push version!");n?((0,l.default)("[Sync] We have a conflict"),s.remote&&s.remote.revision===r||(s.remote={revision:r||"conflict",timestamp:this.now()},delete s.push),i[t]=this.autoMerge(s)):(s.common={revision:r,timestamp:this.now()},"put"===e?(s.common.body=s.push.body,s.common.contentType=s.push.contentType,(0,d.equal)(s.local.body,s.push.body)&&s.local.contentType===s.push.contentType&&delete s.local,delete s.push):"delete"===e&&(!1===s.local.body?i[t]=void 0:delete s.push)),yield this.rs.local.setNodes(this.flush(i))})}dealWithFailure(t){return i(this,void 0,void 0,function*(){const e=yield this.rs.local.getNodes([t]);if(e[t])return delete e[t].push,this.rs.local.setNodes(this.flush(e))})}interpretStatus(t){const e={statusCode:t,successful:void 0,conflict:void 0,unAuth:void 0,notFound:void 0,changed:void 0,networkProblems:void 0};if("string"==typeof t&&("offline"===t||"timeout"===t))return e.successful=!1,e.networkProblems=!0,e;if("number"==typeof t){const n=Math.floor(t/100);return e.successful=2===n||304===t||412===t||404===t,e.conflict=412===t,e.unAuth=401===t&&this.rs.remote.token!==c.default.IMPLIED_FAKE_TOKEN||402===t||403===t,e.notFound=404===t,e.changed=304!==t,e}}handleGetResponse(t,e,n,r,s){return i(this,void 0,void 0,function*(){if(e.notFound&&(n=!!(0,d.isFolder)(t)&&{}),e.changed){const e=yield this.completeFetch(t,n,r,s);if((0,d.isFolder)(t)){if(this.corruptServerItemsMap(n))return(0,l.default)("[Sync] WARNING: Discarding corrupt folder description from server for "+t),!1;yield this.markChildren(t,n,e.toBeSaved,e.missingChildren)}else yield this.rs.local.setNodes(this.flush(e.toBeSaved))}else yield this.updateCommonTimestamp(t,s);return!0})}handleResponse(t,e,n){return i(this,void 0,void 0,function*(){const i=this.interpretStatus(n.statusCode);if(i.successful){if("get"===e)return this.handleGetResponse(t,i,n.body,n.contentType,n.revision);if("put"===e||"delete"===e)return this.completePush(t,e,i.conflict,n.revision).then(function(){return!0});throw new Error(`cannot handle response for unknown action ${e}`)}{let e;return e=i.unAuth?new u.default:i.networkProblems?new h.default("Network request failed."):new Error("HTTP response code "+i.statusCode+" received."),this.dealWithFailure(t).then(()=>{throw this.rs._emit("error",e),e})}})}finishTask(t){return i(this,arguments,void 0,function*(t,e=!0){if(void 0===t.action)return void delete this._running[t.path];if(e&&((0,l.default)("[Sync] queue finished task:",t.path),this._finishedTasks.push(t),this._finishedTasks.length>1))return void(0,l.default)("[Sync] delaying finished task:",t.path);let n;(0,l.default)("[Sync] run task:",t.path);try{n=yield t.promise}catch(e){(0,l.default)("[Sync] wire client rejects its promise",t.path,t.action,e),n={statusCode:"offline"}}try{const e=yield this.handleResponse(t.path,t.action,n);this.finishSuccessfulTask(t,e)}catch(e){this.finishUnsuccessfulTask(t,e)}})}finishSuccessfulTask(t,e){return i(this,void 0,void 0,function*(){if(this._finishedTasks.shift(),delete this._timeStarted[t.path],delete this._running[t.path],e&&this._tasks[t.path]){for(let e=0;e<this._tasks[t.path].length;e++)this._tasks[t.path][e]();delete this._tasks[t.path]}this.rs._emit("sync-req-done",{tasksRemaining:Object.keys(this._tasks).length}),this._finishedTasks.length>0?yield this.finishTask(this._finishedTasks[0],!1):yield this.collectTasks(!1).then(()=>{!this.hasTasks()||this.stopped?(this.done||(this.done=!0),this.rs._emit("sync-done",{completed:!0})):setTimeout(()=>{this.doTasks()},10)})})}finishUnsuccessfulTask(t,e){return i(this,void 0,void 0,function*(){(0,l.default)("[Sync]",e.message),this._finishedTasks.shift(),delete this._timeStarted[t.path],delete this._running[t.path],this.rs._emit("sync-req-done",{tasksRemaining:Object.keys(this._tasks).length}),this._finishedTasks.length>0?yield this.finishTask(this._finishedTasks[0],!1):this.done||(this.done=!0,this.rs._emit("sync-done",{completed:!1}))})}tasksWanted(){return this.rs.remote.connected?this.rs.remote.online?this.numThreads:1:0}doTasks(){const t=this.tasksWanted()-Object.keys(this._running).length;if(t<=0)return!0;this.hasTasks()&&!this.done&&this.rs._emit("sync-started");let e,n=0;for(e in this._tasks)if(!this._running[e]&&(this._timeStarted[e]=this.now(),this._running[e]=this.doTask(e).then(this.finishTask.bind(this)),n++,n>=t))break;return n>=t}collectTasks(){return i(this,arguments,void 0,function*(t=!0){if(!this.hasTasks()&&!this.stopped)return(yield this.collectDiffTasks())>0?void 0:t?this.collectRefreshTasks():void 0})}addTask(t,e){this._tasks[t]||(this._tasks[t]=[]),"function"==typeof e&&this._tasks[t].push(e)}sync(){return i(this,void 0,void 0,function*(){if(this.done=!1,!this.doTasks()){try{yield this.collectTasks()}catch(t){throw(0,l.default)("[Sync] Sync error",t),new Error("Local cache unavailable")}this.doTasks()}})}static _rs_init(t){p=function(){const e=new o.default;e.isBrowser()&&function(t,e){function n(t){const n=e.getCurrentSyncInterval();s.default.isBackground=!t;const i=e.getCurrentSyncInterval();e._emit("sync-interval-change",{oldValue:n,newValue:i})}t.on("background",()=>n(!1)),t.on("foreground",()=>n(!0))}(e,t),t.sync||(t.sync=new v(t),t.syncStopped&&((0,l.default)("[Sync] Initializing with sync stopped"),t.sync.stopped=!0,delete t.syncStopped)),t.setupSyncCycle()},f=function(){t.removeEventListener("connected",f),t.startSync()},t.on("ready",p),t.on("connected",f)}static _rs_cleanup(t){t.stopSync(),t.removeEventListener("ready",p),t.removeEventListener("connected",f),t.sync=void 0,delete t.sync}}e.Sync=v,(0,d.applyMixins)(v,[a.default]),e.default=v},370:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};const r=(this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}})(n(334));function s(t){return"dropbox"===this.backend&&!!t.match(/^\/public\/.*[^\/]$/)}const o={get:function(t,e){if(this.local){if(void 0===e)e="object"==typeof(n=this).remote&&n.remote.connected&&n.remote.online?2*n.getSyncInterval():((0,r.default)("Not setting default maxAge, because remote is offline or not connected"),!1);else if("number"!=typeof e&&!1!==e)return Promise.reject("Argument 'maxAge' must be 'false' or a number");return this.local.get(t,e,this.sync.queueGetRequest.bind(this.sync))}return this.remote.get(t);var n},put:function(t,e,n){return s.bind(this)(t)?o._wrapBusyDone.call(this,this.remote.put(t,e,n)):this.local?this.local.put(t,e,n):o._wrapBusyDone.call(this,this.remote.put(t,e,n))},delete:function(t,e){return this.local?this.local.delete(t,e):o._wrapBusyDone.call(this,this.remote.delete(t,e))},_wrapBusyDone:function(t){return i(this,void 0,void 0,function*(){return this._emit("wire-busy"),t.then(t=>(this._emit("wire-done",{success:!0}),Promise.resolve(t)),t=>(this._emit("wire-done",{success:!1}),Promise.reject(t)))})}};t.exports=o},613:function(t,e){Object.defineProperty(e,"__esModule",{value:!0}),e.BaseClientTypes=void 0;class n{constructor(){this.uris={},this.schemas={},this.aliases={}}declare(t,e,n,i){const r=t+"/"+e;if(i.extends){const e=i.extends.split("/"),n=1===e.length?t+"/"+e.shift():e.join("/"),s=this.uris[n];if(!s)throw"Type '"+r+"' tries to extend unknown schema '"+n+"'";i.extends=this.schemas[s]}this.uris[r]=n,this.aliases[n]=r,this.schemas[n]=i}resolveAlias(t){return this.uris[t]}getSchema(t){return this.schemas[t]}inScope(t){const e=t.length,n={};for(const i in this.uris)if(i.substr(0,e+1)===t+"/"){const t=this.uris[i];n[t]=this.schemas[t]}return n}}e.BaseClientTypes=n;const i=new n;e.default=i},503:function(t){class e extends Error{constructor(t,e={}){super(),this.name="Unauthorized",this.message=void 0===t?"App authorization expired or revoked.":t,void 0!==e.code&&(this.code=e.code),this.stack=(new Error).stack}}t.exports=e},746:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})};function r(t,e){if("object"==typeof t&&!Array.isArray(t)&&null!==t)for(const n in t)if("object"==typeof t[n]&&null!==t[n])if("[object ArrayBuffer]"===t[n].toString()){e[n]=new ArrayBuffer(t[n].byteLength);const i=new Int8Array(t[n]);new Int8Array(e[n]).set(i)}else r(t[n],e[n])}Object.defineProperty(e,"__esModule",{value:!0}),e.toBase64=e.getTextFromArrayBuffer=e.shouldBeTreatedAsBinary=e.getJSONFromLocalStorage=e.localStorageAvailable=e.pathsFromRoot=e.deepClone=e.equal=e.bindAll=e.cleanPath=e.baseName=e.isDocument=e.isFolder=e.containingFolder=e.extend=e.getGlobalContext=e.globalContext=e.logError=void 0,e.generateCodeVerifier=function(){return i(this,arguments,void 0,function*(t=128){const e=new Uint8Array(t);crypto.getRandomValues(e);const n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-._~",i=Array.from(e).map(t=>n[t%66]),r=i.join(""),s=Uint8Array.from(i.map(t=>t.charCodeAt(0))),o=(a=yield crypto.subtle.digest("SHA-256",s),btoa(String.fromCharCode.apply(null,new Uint8Array(a))).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,""));var a;return crypto.getRandomValues(e),{codeVerifier:r,codeChallenge:o,state:Array.from(e).map(t=>n[t%66]).join("")}})},e.applyMixins=function(t,e){e.forEach(e=>{Object.getOwnPropertyNames(e.prototype).forEach(n=>{Object.defineProperty(t.prototype,n,Object.getOwnPropertyDescriptor(e.prototype,n))})})},e.logError=t=>{"string"==typeof t?console.error(t):console.error(t.message,t.stack)},e.globalContext="undefined"!=typeof window?window:"object"==typeof self?self:n.g,e.getGlobalContext=()=>"undefined"!=typeof window?window:"object"==typeof self?self:n.g,e.extend=(...t)=>{const e=t[0];return Array.prototype.slice.call(t,1).forEach(function(t){for(const n in t)e[n]=t[n]}),e},e.containingFolder=t=>{if(""===t)return"/";if(!t)throw"Path not given!";return t.replace(/\/+/g,"/").replace(/[^\/]+\/?$/,"")},e.isFolder=t=>"/"===t.slice(-1),e.isDocument=t=>!(0,e.isFolder)(t),e.baseName=t=>{const n=t.split("/");return(0,e.isFolder)(t)?n[n.length-2]+"/":n[n.length-1]},e.cleanPath=t=>t.replace(/\/+/g,"/").split("/").map(encodeURIComponent).join("/").replace(/'/g,"%27"),e.bindAll=t=>{for(const e in this)"function"==typeof t[e]&&(t[e]=t[e].bind(t))},e.equal=(t,n,i=[])=>{let r;if(typeof t!=typeof n)return!1;if("number"==typeof t||"boolean"==typeof t||"string"==typeof t)return t===n;if("function"==typeof t)return t.toString()===n.toString();if(t instanceof ArrayBuffer&&n instanceof ArrayBuffer&&(t=new Uint8Array(t),n=new Uint8Array(n)),t instanceof Array){if(t.length!==n.length)return!1;for(let r=0,s=t.length;r<s;r++)if(!(0,e.equal)(t[r],n[r],i))return!1}else{for(r in t)if(t.hasOwnProperty(r)&&!(r in n))return!1;for(r in n){if(!n.hasOwnProperty(r))continue;if(!(r in t))return!1;let s;if("object"==typeof n[r]){if(i.indexOf(n[r])>=0)continue;s=i.slice(),s.push(n[r])}if(!(0,e.equal)(t[r],n[r],s))return!1}}return!0},e.deepClone=t=>{if(void 0!==t){const e=JSON.parse(JSON.stringify(t));return r(t,e),e}},e.pathsFromRoot=t=>{const e=[t],n=t.replace(/\/$/,"").split("/");for(;n.length>1;)n.pop(),e.push(n.join("/")+"/");return e},e.localStorageAvailable=()=>{const t=(0,e.getGlobalContext)();if(!("localStorage"in t))return!1;try{return t.localStorage.setItem("rs-check","1"),t.localStorage.removeItem("rs-check"),!0}catch(t){return!1}},e.getJSONFromLocalStorage=t=>{const n=(0,e.getGlobalContext)();try{return JSON.parse(n.localStorage.getItem(t))}catch(t){}},e.shouldBeTreatedAsBinary=(t,e)=>!!(e&&e.match(/charset=binary/)||/[\x00-\x08\x0E-\x1F\uFFFD]/.test(t)),e.getTextFromArrayBuffer=(t,n)=>new Promise(i=>{if("undefined"==typeof Blob||"undefined"==typeof FileReader){const e=Buffer.from(t);i(e.toString(n))}else{let r;const s=e.globalContext;if(s.BlobBuilder=s.BlobBuilder||s.WebKitBlobBuilder,void 0!==s.BlobBuilder){const e=new s.BlobBuilder;e.append(t),r=e.getBlob()}else r=new Blob([t]);const o=new FileReader;"function"==typeof o.addEventListener?o.addEventListener("loadend",function(t){i(t.target.result)}):o.onloadend=function(t){i(t.target.result)},o.readAsText(r,n)}}),e.toBase64=t=>{const n=(0,e.getGlobalContext)();return"btoa"in n?n.btoa(t):Buffer.from(t).toString("base64")}},600:function(t,e,n){var i=this&&this.__awaiter||function(t,e,n,i){return new(n||(n=Promise))(function(r,s){function o(t){try{l(i.next(t))}catch(t){s(t)}}function a(t){try{l(i.throw(t))}catch(t){s(t)}}function l(t){var e;t.done?r(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,a)}l((i=i.apply(t,e||[])).next())})},r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};const s=r(n(275)),o=r(n(93)),a=r(n(503)),l=r(n(334)),c=n(746),h=n(368),u=n(684);let d;const p="remotestorage:wireclient",f={"draft-dejong-remotestorage-00":2,"draft-dejong-remotestorage-01":3,"draft-dejong-remotestorage-02":4,"https://www.w3.org/community/rww/wiki/read-write-web-00#simple":1};class g extends u.RemoteBase{constructor(t){if(super(t),this._revisionCache={},d=(0,c.localStorageAvailable)(),this.addEvents(["connected","not-connected"]),d){const t=function(){const t=(0,c.getJSONFromLocalStorage)(p)||{},{userAddress:e,href:n,storageApi:i,token:r,properties:s}=t;return{userAddress:e,href:n,storageApi:i,token:r,properties:s}}();t&&setTimeout(()=>{this.configure(t)},0)}this.connected&&setTimeout(this._emit.bind(this),0,"connected")}get storageType(){if(this.storageApi){const t=this.storageApi.match(/draft-dejong-(remotestorage-\d\d)/);return t?t[1]:"2012.04"}}_request(t,e,n,r,o,u,d){return i(this,void 0,void 0,function*(){if(this.isForbiddenRequestMethod(t,e))return Promise.reject(`Don't use ${t} on directories!`);let i;return n!==s.default.IMPLIED_FAKE_TOKEN&&(r.Authorization="Bearer "+n),this.rs._emit("wire-busy",{method:t,isFolder:(0,c.isFolder)(e)}),(0,h.requestWithTimeout)(t,e,{body:o,headers:r,responseType:"arraybuffer"}).then(n=>{if(this.online||(this.online=!0,this.rs._emit("network-online")),this.rs._emit("wire-done",{method:t,isFolder:(0,c.isFolder)(e),success:!0}),r=n.status,[401,403,404,412].indexOf(r)>=0)return(0,l.default)("[WireClient] Error response status",n.status),i=u?this.stripQuotes(n.getResponseHeader("ETag")):void 0,401===n.status&&this.rs._emit("error",new a.default),Promise.resolve({statusCode:n.status,revision:i});if(function(t){return[201,204,304].indexOf(t)>=0}(n.status)||200===n.status&&"GET"!==t)return i=this.stripQuotes(n.getResponseHeader("ETag")),(0,l.default)("[WireClient] Successful request",i),Promise.resolve({statusCode:n.status,revision:i});{const t=n.getResponseHeader("Content-Type");i=u?this.stripQuotes(n.getResponseHeader("ETag")):200===n.status?d:void 0;const e=function(t){let e,n="utf-8";return t&&(e=t.match(/charset=(.+)$/),e&&(n=e[1])),n}(t);return(0,c.shouldBeTreatedAsBinary)(n.response,t)?((0,l.default)("[WireClient] Successful request with unknown or binary mime-type",i),Promise.resolve({statusCode:n.status,body:n.response,contentType:t,revision:i})):(0,c.getTextFromArrayBuffer)(n.response,e).then(e=>((0,l.default)("[WireClient] Successful request",i),Promise.resolve({statusCode:n.status,body:e,contentType:t,revision:i})))}var r},n=>(this.online&&(this.online=!1,this.rs._emit("network-offline")),this.rs._emit("wire-done",{method:t,isFolder:(0,c.isFolder)(e),success:!1}),Promise.reject(n)))})}configure(t){if("object"!=typeof t)throw new Error("WireClient configure settings parameter should be an object");if(void 0!==t.userAddress&&(this.userAddress=t.userAddress),void 0!==t.href&&(this.href=t.href),void 0!==t.storageApi&&(this.storageApi=t.storageApi),void 0!==t.token&&(this.token=t.token),void 0!==t.properties&&(this.properties=t.properties),"string"==typeof this.storageApi){const t=f[this.storageApi]||5;this.supportsRevs=t>=2}this.href&&this.token?(this.connected=!0,this.online=!0,this._emit("connected")):this.connected=!1,d&&localStorage.setItem(p,JSON.stringify({userAddress:this.userAddress,href:this.href,storageApi:this.storageApi,token:this.token,properties:this.properties}))}get(t,e={}){if(!this.connected)return Promise.reject("not connected (path: "+t+")");const n={};return this.supportsRevs&&e.ifNoneMatch&&(n["If-None-Match"]=this.addQuotes(e.ifNoneMatch)),this._request("GET",this.href+(0,c.cleanPath)(t),this.token,n,void 0,this.supportsRevs,this._revisionCache[t]).then(e=>{if(!(0,c.isFolder)(t))return Promise.resolve(e);let n={};if(void 0!==e.body)try{e.body=JSON.parse(e.body)}catch(e){return Promise.reject("Folder description at "+this.href+(0,c.cleanPath)(t)+" is not JSON")}if(200===e.statusCode&&"object"==typeof e.body){if(0===Object.keys(e.body).length)e.statusCode=404;else if("http://remotestorage.io/spec/folder-description"===(i=e.body)["@context"]&&"object"==typeof i.items){for(const n in e.body.items)this._revisionCache[t+n]=e.body.items[n].ETag;n=e.body.items}else Object.keys(e.body).forEach(i=>{this._revisionCache[t+i]=e.body[i],n[i]={ETag:e.body[i]}});return e.body=n,Promise.resolve(e)}return Promise.resolve(e);var i})}put(t,e,n,i={}){if(!this.connected)return Promise.reject("not connected (path: "+t+")");!n.match(/charset=/)&&(e instanceof ArrayBuffer||(0,h.isArrayBufferView)(e))&&(n+="; charset=binary");const r={"Content-Type":n};return this.supportsRevs&&(i.ifMatch&&(r["If-Match"]=this.addQuotes(i.ifMatch)),i.ifNoneMatch&&(r["If-None-Match"]=this.addQuotes(i.ifNoneMatch))),this._request("PUT",this.href+(0,c.cleanPath)(t),this.token,r,e,this.supportsRevs)}delete(t,e={}){if(!this.connected)throw new Error("not connected (path: "+t+")");e||(e={});const n={};return this.supportsRevs&&e.ifMatch&&(n["If-Match"]=this.addQuotes(e.ifMatch)),this._request("DELETE",this.href+(0,c.cleanPath)(t),this.token,n,void 0,this.supportsRevs)}static _rs_init(t){t.remote=new g(t),t.remote.online=!0}static _rs_supported(){return"function"==typeof fetch||"function"==typeof XMLHttpRequest}static _rs_cleanup(){d&&delete localStorage[p]}}(0,c.applyMixins)(g,[o.default]),t.exports=g},439:function(t,e){var n,i;n=function(){var t,e,n,i;Object.keys||(Object.keys=(t=Object.prototype.hasOwnProperty,e=!{toString:null}.propertyIsEnumerable("toString"),i=(n=["toString","toLocaleString","valueOf","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","constructor"]).length,function(r){if("object"!=typeof r&&"function"!=typeof r||null===r)throw new TypeError("Object.keys called on non-object");var s=[];for(var o in r)t.call(r,o)&&s.push(o);if(e)for(var a=0;a<i;a++)t.call(r,n[a])&&s.push(n[a]);return s})),Object.create||(Object.create=function(){function t(){}return function(e){if(1!==arguments.length)throw new Error("Object.create implementation only accepts one parameter.");return t.prototype=e,new t}}()),Array.isArray||(Array.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)}),Array.prototype.indexOf||(Array.prototype.indexOf=function(t){if(null===this)throw new TypeError;var e=Object(this),n=e.length>>>0;if(0===n)return-1;var i=0;if(arguments.length>1&&((i=Number(arguments[1]))!=i?i=0:0!==i&&i!==1/0&&i!==-1/0&&(i=(i>0||-1)*Math.floor(Math.abs(i)))),i>=n)return-1;for(var r=i>=0?i:Math.max(n-Math.abs(i),0);r<n;r++)if(r in e&&e[r]===t)return r;return-1}),Object.isFrozen||(Object.isFrozen=function(t){for(var e="tv4_test_frozen_key";t.hasOwnProperty(e);)e+=Math.random();try{return t[e]=!0,delete t[e],!1}catch(t){return!0}});var r={"+":!0,"#":!0,".":!0,"/":!0,";":!0,"?":!0,"&":!0},s={"*":!0};function o(t){return encodeURI(t).replace(/%25[0-9][0-9]/g,function(t){return"%"+t.substring(3)})}function a(t){var e="";r[t.charAt(0)]&&(e=t.charAt(0),t=t.substring(1));var n="",i="",a=!0,l=!1,c=!1;"+"===e?a=!1:"."===e?(i=".",n="."):"/"===e?(i="/",n="/"):"#"===e?(i="#",a=!1):";"===e?(i=";",n=";",l=!0,c=!0):"?"===e?(i="?",n="&",l=!0):"&"===e&&(i="&",n="&",l=!0);for(var h=[],u=t.split(","),d=[],p={},f=0;f<u.length;f++){var g=u[f],m=null;if(-1!==g.indexOf(":")){var y=g.split(":");g=y[0],m=parseInt(y[1],10)}for(var v={};s[g.charAt(g.length-1)];)v[g.charAt(g.length-1)]=!0,g=g.substring(0,g.length-1);var _={truncate:m,name:g,suffices:v};d.push(_),p[g]=_,h.push(g)}var b=function(t){for(var e="",r=0,s=0;s<d.length;s++){var h=d[s],u=t(h.name);if(null==u||Array.isArray(u)&&0===u.length||"object"==typeof u&&0===Object.keys(u).length)r++;else if(e+=s===r?i:n||",",Array.isArray(u)){l&&(e+=h.name+"=");for(var p=0;p<u.length;p++)p>0&&(e+=h.suffices["*"]&&n||",",h.suffices["*"]&&l&&(e+=h.name+"=")),e+=a?encodeURIComponent(u[p]).replace(/!/g,"%21"):o(u[p])}else if("object"==typeof u){l&&!h.suffices["*"]&&(e+=h.name+"=");var f=!0;for(var g in u)f||(e+=h.suffices["*"]&&n||","),f=!1,e+=a?encodeURIComponent(g).replace(/!/g,"%21"):o(g),e+=h.suffices["*"]?"=":",",e+=a?encodeURIComponent(u[g]).replace(/!/g,"%21"):o(u[g])}else l&&(e+=h.name,c&&""===u||(e+="=")),null!=h.truncate&&(u=u.substring(0,h.truncate)),e+=a?encodeURIComponent(u).replace(/!/g,"%21"):o(u)}return e};return b.varNames=h,{prefix:i,substitution:b}}function l(t){if(!(this instanceof l))return new l(t);for(var e=t.split("{"),n=[e.shift()],i=[],r=[],s=[];e.length>0;){var o=e.shift(),c=o.split("}")[0],h=o.substring(c.length+1),u=a(c);r.push(u.substitution),i.push(u.prefix),n.push(h),s=s.concat(u.substitution.varNames)}this.fill=function(t){for(var e=n[0],i=0;i<r.length;i++)e+=(0,r[i])(t),e+=n[i+1];return e},this.varNames=s,this.template=t}l.prototype={toString:function(){return this.template},fillFromObject:function(t){return this.fill(function(e){return t[e]})}};var c=function(t,e,n,i,r){if(this.missing=[],this.missingMap={},this.formatValidators=t?Object.create(t.formatValidators):{},this.schemas=t?Object.create(t.schemas):{},this.collectMultiple=e,this.errors=[],this.handleError=e?this.collectError:this.returnError,i&&(this.checkRecursive=!0,this.scanned=[],this.scannedFrozen=[],this.scannedFrozenSchemas=[],this.scannedFrozenValidationErrors=[],this.validatedSchemasKey="tv4_validation_id",this.validationErrorsKey="tv4_validation_errors_id"),r&&(this.trackUnknownProperties=!0,this.knownPropertyPaths={},this.unknownPropertyPaths={}),this.errorReporter=n||y("en"),"string"==typeof this.errorReporter)throw new Error("debug");if(this.definedKeywords={},t)for(var s in t.definedKeywords)this.definedKeywords[s]=t.definedKeywords[s].slice(0)};function h(t,e){if(t===e)return!0;if(t&&e&&"object"==typeof t&&"object"==typeof e){if(Array.isArray(t)!==Array.isArray(e))return!1;if(Array.isArray(t)){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!h(t[n],e[n]))return!1}else{var i;for(i in t)if(void 0===e[i]&&void 0!==t[i])return!1;for(i in e)if(void 0===t[i]&&void 0!==e[i])return!1;for(i in t)if(!h(t[i],e[i]))return!1}return!0}return!1}c.prototype.defineKeyword=function(t,e){this.definedKeywords[t]=this.definedKeywords[t]||[],this.definedKeywords[t].push(e)},c.prototype.createError=function(t,e,n,i,r,s,o){var a=new x(t,e,n,i,r);return a.message=this.errorReporter(a,s,o),a},c.prototype.returnError=function(t){return t},c.prototype.collectError=function(t){return t&&this.errors.push(t),null},c.prototype.prefixErrors=function(t,e,n){for(var i=t;i<this.errors.length;i++)this.errors[i]=this.errors[i].prefixWith(e,n);return this},c.prototype.banUnknownProperties=function(t,e){for(var n in this.unknownPropertyPaths){var i=this.createError(v.UNKNOWN_PROPERTY,{path:n},n,"",null,t,e),r=this.handleError(i);if(r)return r}return null},c.prototype.addFormat=function(t,e){if("object"==typeof t){for(var n in t)this.addFormat(n,t[n]);return this}this.formatValidators[t]=e},c.prototype.resolveRefs=function(t,e){if(void 0!==t.$ref){if((e=e||{})[t.$ref])return this.createError(v.CIRCULAR_REFERENCE,{urls:Object.keys(e).join(", ")},"","",null,void 0,t);e[t.$ref]=!0,t=this.getSchema(t.$ref,e)}return t},c.prototype.getSchema=function(t,e){var n;if(void 0!==this.schemas[t])return n=this.schemas[t],this.resolveRefs(n,e);var i=t,r="";if(-1!==t.indexOf("#")&&(r=t.substring(t.indexOf("#")+1),i=t.substring(0,t.indexOf("#"))),"object"==typeof this.schemas[i]){n=this.schemas[i];var s=decodeURIComponent(r);if(""===s)return this.resolveRefs(n,e);if("/"!==s.charAt(0))return;for(var o=s.split("/").slice(1),a=0;a<o.length;a++){var l=o[a].replace(/~1/g,"/").replace(/~0/g,"~");if(void 0===n[l]){n=void 0;break}n=n[l]}if(void 0!==n)return this.resolveRefs(n,e)}void 0===this.missing[i]&&(this.missing.push(i),this.missing[i]=i,this.missingMap[i]=i)},c.prototype.searchSchemas=function(t,e){if(Array.isArray(t))for(var n=0;n<t.length;n++)this.searchSchemas(t[n],e);else if(t&&"object"==typeof t)for(var i in"string"==typeof t.id&&function(t,e){if(e.substring(0,t.length)===t){var n=e.substring(t.length);if(e.length>0&&"/"===e.charAt(t.length-1)||"#"===n.charAt(0)||"?"===n.charAt(0))return!0}return!1}(e,t.id)&&void 0===this.schemas[t.id]&&(this.schemas[t.id]=t),t)if("enum"!==i)if("object"==typeof t[i])this.searchSchemas(t[i],e);else if("$ref"===i){var r=g(t[i]);r&&void 0===this.schemas[r]&&void 0===this.missingMap[r]&&(this.missingMap[r]=r)}},c.prototype.addSchema=function(t,e){if("string"!=typeof t||void 0===e){if("object"!=typeof t||"string"!=typeof t.id)return;t=(e=t).id}t===g(t)+"#"&&(t=g(t)),this.schemas[t]=e,delete this.missingMap[t],m(e,t),this.searchSchemas(e,t)},c.prototype.getSchemaMap=function(){var t={};for(var e in this.schemas)t[e]=this.schemas[e];return t},c.prototype.getSchemaUris=function(t){var e=[];for(var n in this.schemas)t&&!t.test(n)||e.push(n);return e},c.prototype.getMissingUris=function(t){var e=[];for(var n in this.missingMap)t&&!t.test(n)||e.push(n);return e},c.prototype.dropSchemas=function(){this.schemas={},this.reset()},c.prototype.reset=function(){this.missing=[],this.missingMap={},this.errors=[]},c.prototype.validateAll=function(t,e,n,i,r){var s;if(!(e=this.resolveRefs(e)))return null;if(e instanceof x)return this.errors.push(e),e;var o,a=this.errors.length,l=null,c=null;if(this.checkRecursive&&t&&"object"==typeof t){if(s=!this.scanned.length,t[this.validatedSchemasKey]){var h=t[this.validatedSchemasKey].indexOf(e);if(-1!==h)return this.errors=this.errors.concat(t[this.validationErrorsKey][h]),null}if(Object.isFrozen(t)&&-1!==(o=this.scannedFrozen.indexOf(t))){var u=this.scannedFrozenSchemas[o].indexOf(e);if(-1!==u)return this.errors=this.errors.concat(this.scannedFrozenValidationErrors[o][u]),null}if(this.scanned.push(t),Object.isFrozen(t))-1===o&&(o=this.scannedFrozen.length,this.scannedFrozen.push(t),this.scannedFrozenSchemas.push([])),l=this.scannedFrozenSchemas[o].length,this.scannedFrozenSchemas[o][l]=e,this.scannedFrozenValidationErrors[o][l]=[];else{if(!t[this.validatedSchemasKey])try{Object.defineProperty(t,this.validatedSchemasKey,{value:[],configurable:!0}),Object.defineProperty(t,this.validationErrorsKey,{value:[],configurable:!0})}catch(e){t[this.validatedSchemasKey]=[],t[this.validationErrorsKey]=[]}c=t[this.validatedSchemasKey].length,t[this.validatedSchemasKey][c]=e,t[this.validationErrorsKey][c]=[]}}var d=this.errors.length,p=this.validateBasic(t,e,r)||this.validateNumeric(t,e,r)||this.validateString(t,e,r)||this.validateArray(t,e,r)||this.validateObject(t,e,r)||this.validateCombinations(t,e,r)||this.validateHypermedia(t,e,r)||this.validateFormat(t,e,r)||this.validateDefinedKeywords(t,e,r)||null;if(s){for(;this.scanned.length;)delete this.scanned.pop()[this.validatedSchemasKey];this.scannedFrozen=[],this.scannedFrozenSchemas=[]}if(p||d!==this.errors.length)for(;n&&n.length||i&&i.length;){var f=n&&n.length?""+n.pop():null,g=i&&i.length?""+i.pop():null;p&&(p=p.prefixWith(f,g)),this.prefixErrors(d,f,g)}return null!==l?this.scannedFrozenValidationErrors[o][l]=this.errors.slice(a):null!==c&&(t[this.validationErrorsKey][c]=this.errors.slice(a)),this.handleError(p)},c.prototype.validateFormat=function(t,e){if("string"!=typeof e.format||!this.formatValidators[e.format])return null;var n=this.formatValidators[e.format].call(null,t,e);return"string"==typeof n||"number"==typeof n?this.createError(v.FORMAT_CUSTOM,{message:n},"","/format",null,t,e):n&&"object"==typeof n?this.createError(v.FORMAT_CUSTOM,{message:n.message||"?"},n.dataPath||"",n.schemaPath||"/format",null,t,e):null},c.prototype.validateDefinedKeywords=function(t,e,n){for(var i in this.definedKeywords)if(void 0!==e[i])for(var r=this.definedKeywords[i],s=0;s<r.length;s++){var o=(0,r[s])(t,e[i],e,n);if("string"==typeof o||"number"==typeof o)return this.createError(v.KEYWORD_CUSTOM,{key:i,message:o},"","",null,t,e).prefixWith(null,i);if(o&&"object"==typeof o){var a=o.code;if("string"==typeof a){if(!v[a])throw new Error("Undefined error code (use defineError): "+a);a=v[a]}else"number"!=typeof a&&(a=v.KEYWORD_CUSTOM);var l="object"==typeof o.message?o.message:{key:i,message:o.message||"?"},c=o.schemaPath||"/"+i.replace(/~/g,"~0").replace(/\//g,"~1");return this.createError(a,l,o.dataPath||null,c,null,t,e)}}return null},c.prototype.validateBasic=function(t,e,n){var i;return(i=this.validateType(t,e,n))||(i=this.validateEnum(t,e,n))?i.prefixWith(null,"type"):null},c.prototype.validateType=function(t,e){if(void 0===e.type)return null;var n=typeof t;null===t?n="null":Array.isArray(t)&&(n="array");var i=e.type;Array.isArray(i)||(i=[i]);for(var r=0;r<i.length;r++){var s=i[r];if(s===n||"integer"===s&&"number"===n&&t%1==0)return null}return this.createError(v.INVALID_TYPE,{type:n,expected:i.join("/")},"","",null,t,e)},c.prototype.validateEnum=function(t,e){if(void 0===e.enum)return null;for(var n=0;n<e.enum.length;n++)if(h(t,e.enum[n]))return null;return this.createError(v.ENUM_MISMATCH,{value:"undefined"!=typeof JSON?JSON.stringify(t):t},"","",null,t,e)},c.prototype.validateNumeric=function(t,e,n){return this.validateMultipleOf(t,e,n)||this.validateMinMax(t,e,n)||this.validateNaN(t,e,n)||null};var u=Math.pow(2,-51),d=1-u;function p(t){var e=String(t).replace(/^\s+|\s+$/g,"").match(/^([^:\/?#]+:)?(\/\/(?:[^:@]*(?::[^:@]*)?@)?(([^:\/?#]*)(?::(\d*))?))?([^?#]*)(\?[^#]*)?(#[\s\S]*)?/);return e?{href:e[0]||"",protocol:e[1]||"",authority:e[2]||"",host:e[3]||"",hostname:e[4]||"",port:e[5]||"",pathname:e[6]||"",search:e[7]||"",hash:e[8]||""}:null}function f(t,e){return e=p(e||""),t=p(t||""),e&&t?(e.protocol||t.protocol)+(e.protocol||e.authority?e.authority:t.authority)+(n=e.protocol||e.authority||"/"===e.pathname.charAt(0)?e.pathname:e.pathname?(t.authority&&!t.pathname?"/":"")+t.pathname.slice(0,t.pathname.lastIndexOf("/")+1)+e.pathname:t.pathname,i=[],n.replace(/^(\.\.?(\/|$))+/,"").replace(/\/(\.(\/|$))+/g,"/").replace(/\/\.\.$/,"/../").replace(/\/?[^\/]*/g,function(t){"/.."===t?i.pop():i.push(t)}),i.join("").replace(/^\//,"/"===n.charAt(0)?"/":""))+(e.protocol||e.authority||e.pathname?e.search:e.search||t.search)+e.hash:null;var n,i}function g(t){return t.split("#")[0]}function m(t,e){if(t&&"object"==typeof t)if(void 0===e?e=t.id:"string"==typeof t.id&&(e=f(e,t.id),t.id=e),Array.isArray(t))for(var n=0;n<t.length;n++)m(t[n],e);else for(var i in"string"==typeof t.$ref&&(t.$ref=f(e,t.$ref)),t)"enum"!==i&&m(t[i],e)}function y(t){var e=C[t=t||"en"];return function(t){var n=e[t.code]||w[t.code];if("string"!=typeof n)return"Unknown error code "+t.code+": "+JSON.stringify(t.messageParams);var i=t.params;return n.replace(/\{([^{}]*)\}/g,function(t,e){var n=i[e];return"string"==typeof n||"number"==typeof n?n:t})}}c.prototype.validateMultipleOf=function(t,e){var n=e.multipleOf||e.divisibleBy;if(void 0===n)return null;if("number"==typeof t){var i=t/n%1;if(i>=u&&i<d)return this.createError(v.NUMBER_MULTIPLE_OF,{value:t,multipleOf:n},"","",null,t,e)}return null},c.prototype.validateMinMax=function(t,e){if("number"!=typeof t)return null;if(void 0!==e.minimum){if(t<e.minimum)return this.createError(v.NUMBER_MINIMUM,{value:t,minimum:e.minimum},"","/minimum",null,t,e);if(e.exclusiveMinimum&&t===e.minimum)return this.createError(v.NUMBER_MINIMUM_EXCLUSIVE,{value:t,minimum:e.minimum},"","/exclusiveMinimum",null,t,e)}if(void 0!==e.maximum){if(t>e.maximum)return this.createError(v.NUMBER_MAXIMUM,{value:t,maximum:e.maximum},"","/maximum",null,t,e);if(e.exclusiveMaximum&&t===e.maximum)return this.createError(v.NUMBER_MAXIMUM_EXCLUSIVE,{value:t,maximum:e.maximum},"","/exclusiveMaximum",null,t,e)}return null},c.prototype.validateNaN=function(t,e){return"number"!=typeof t?null:!0===isNaN(t)||t===1/0||t===-1/0?this.createError(v.NUMBER_NOT_A_NUMBER,{value:t},"","/type",null,t,e):null},c.prototype.validateString=function(t,e,n){return this.validateStringLength(t,e,n)||this.validateStringPattern(t,e,n)||null},c.prototype.validateStringLength=function(t,e){return"string"!=typeof t?null:void 0!==e.minLength&&t.length<e.minLength?this.createError(v.STRING_LENGTH_SHORT,{length:t.length,minimum:e.minLength},"","/minLength",null,t,e):void 0!==e.maxLength&&t.length>e.maxLength?this.createError(v.STRING_LENGTH_LONG,{length:t.length,maximum:e.maxLength},"","/maxLength",null,t,e):null},c.prototype.validateStringPattern=function(t,e){if("string"!=typeof t||"string"!=typeof e.pattern&&!(e.pattern instanceof RegExp))return null;var n;if(e.pattern instanceof RegExp)n=e.pattern;else{var i,r="",s=e.pattern.match(/^\/(.+)\/([img]*)$/);s?(i=s[1],r=s[2]):i=e.pattern,n=new RegExp(i,r)}return n.test(t)?null:this.createError(v.STRING_PATTERN,{pattern:e.pattern},"","/pattern",null,t,e)},c.prototype.validateArray=function(t,e,n){return Array.isArray(t)&&(this.validateArrayLength(t,e,n)||this.validateArrayUniqueItems(t,e,n)||this.validateArrayItems(t,e,n))||null},c.prototype.validateArrayLength=function(t,e){var n;return void 0!==e.minItems&&t.length<e.minItems&&(n=this.createError(v.ARRAY_LENGTH_SHORT,{length:t.length,minimum:e.minItems},"","/minItems",null,t,e),this.handleError(n))||void 0!==e.maxItems&&t.length>e.maxItems&&(n=this.createError(v.ARRAY_LENGTH_LONG,{length:t.length,maximum:e.maxItems},"","/maxItems",null,t,e),this.handleError(n))?n:null},c.prototype.validateArrayUniqueItems=function(t,e){if(e.uniqueItems)for(var n=0;n<t.length;n++)for(var i=n+1;i<t.length;i++)if(h(t[n],t[i])){var r=this.createError(v.ARRAY_UNIQUE,{match1:n,match2:i},"","/uniqueItems",null,t,e);if(this.handleError(r))return r}return null},c.prototype.validateArrayItems=function(t,e,n){if(void 0===e.items)return null;var i,r;if(Array.isArray(e.items)){for(r=0;r<t.length;r++)if(r<e.items.length){if(i=this.validateAll(t[r],e.items[r],[r],["items",r],n+"/"+r))return i}else if(void 0!==e.additionalItems)if("boolean"==typeof e.additionalItems){if(!e.additionalItems&&(i=this.createError(v.ARRAY_ADDITIONAL_ITEMS,{},"/"+r,"/additionalItems",null,t,e),this.handleError(i)))return i}else if(i=this.validateAll(t[r],e.additionalItems,[r],["additionalItems"],n+"/"+r))return i}else for(r=0;r<t.length;r++)if(i=this.validateAll(t[r],e.items,[r],["items"],n+"/"+r))return i;return null},c.prototype.validateObject=function(t,e,n){return"object"!=typeof t||null===t||Array.isArray(t)?null:this.validateObjectMinMaxProperties(t,e,n)||this.validateObjectRequiredProperties(t,e,n)||this.validateObjectProperties(t,e,n)||this.validateObjectDependencies(t,e,n)||null},c.prototype.validateObjectMinMaxProperties=function(t,e){var n,i=Object.keys(t);return void 0!==e.minProperties&&i.length<e.minProperties&&(n=this.createError(v.OBJECT_PROPERTIES_MINIMUM,{propertyCount:i.length,minimum:e.minProperties},"","/minProperties",null,t,e),this.handleError(n))||void 0!==e.maxProperties&&i.length>e.maxProperties&&(n=this.createError(v.OBJECT_PROPERTIES_MAXIMUM,{propertyCount:i.length,maximum:e.maxProperties},"","/maxProperties",null,t,e),this.handleError(n))?n:null},c.prototype.validateObjectRequiredProperties=function(t,e){if(void 0!==e.required)for(var n=0;n<e.required.length;n++){var i=e.required[n];if(void 0===t[i]){var r=this.createError(v.OBJECT_REQUIRED,{key:i},"","/required/"+n,null,t,e);if(this.handleError(r))return r}}return null},c.prototype.validateObjectProperties=function(t,e,n){var i;for(var r in t){var s=n+"/"+r.replace(/~/g,"~0").replace(/\//g,"~1"),o=!1;if(void 0!==e.properties&&void 0!==e.properties[r]&&(o=!0,i=this.validateAll(t[r],e.properties[r],[r],["properties",r],s)))return i;if(void 0!==e.patternProperties)for(var a in e.patternProperties)if(new RegExp(a).test(r)&&(o=!0,i=this.validateAll(t[r],e.patternProperties[a],[r],["patternProperties",a],s)))return i;if(o)this.trackUnknownProperties&&(this.knownPropertyPaths[s]=!0,delete this.unknownPropertyPaths[s]);else if(void 0!==e.additionalProperties){if(this.trackUnknownProperties&&(this.knownPropertyPaths[s]=!0,delete this.unknownPropertyPaths[s]),"boolean"==typeof e.additionalProperties){if(!e.additionalProperties&&(i=this.createError(v.OBJECT_ADDITIONAL_PROPERTIES,{key:r},"","/additionalProperties",null,t,e).prefixWith(r,null),this.handleError(i)))return i}else if(i=this.validateAll(t[r],e.additionalProperties,[r],["additionalProperties"],s))return i}else this.trackUnknownProperties&&!this.knownPropertyPaths[s]&&(this.unknownPropertyPaths[s]=!0)}return null},c.prototype.validateObjectDependencies=function(t,e,n){var i;if(void 0!==e.dependencies)for(var r in e.dependencies)if(void 0!==t[r]){var s=e.dependencies[r];if("string"==typeof s){if(void 0===t[s]&&(i=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:r,missing:s},"","",null,t,e).prefixWith(null,r).prefixWith(null,"dependencies"),this.handleError(i)))return i}else if(Array.isArray(s))for(var o=0;o<s.length;o++){var a=s[o];if(void 0===t[a]&&(i=this.createError(v.OBJECT_DEPENDENCY_KEY,{key:r,missing:a},"","/"+o,null,t,e).prefixWith(null,r).prefixWith(null,"dependencies"),this.handleError(i)))return i}else if(i=this.validateAll(t,s,[],["dependencies",r],n))return i}return null},c.prototype.validateCombinations=function(t,e,n){return this.validateAllOf(t,e,n)||this.validateAnyOf(t,e,n)||this.validateOneOf(t,e,n)||this.validateNot(t,e,n)||null},c.prototype.validateAllOf=function(t,e,n){if(void 0===e.allOf)return null;for(var i,r=0;r<e.allOf.length;r++){var s=e.allOf[r];if(i=this.validateAll(t,s,[],["allOf",r],n))return i}return null},c.prototype.validateAnyOf=function(t,e,n){if(void 0===e.anyOf)return null;var i,r,s=[],o=this.errors.length;this.trackUnknownProperties&&(i=this.unknownPropertyPaths,r=this.knownPropertyPaths);for(var a=!0,l=0;l<e.anyOf.length;l++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var c=e.anyOf[l],h=this.errors.length,u=this.validateAll(t,c,[],["anyOf",l],n);if(null===u&&h===this.errors.length){if(this.errors=this.errors.slice(0,o),this.trackUnknownProperties){for(var d in this.knownPropertyPaths)r[d]=!0,delete i[d];for(var p in this.unknownPropertyPaths)r[p]||(i[p]=!0);a=!1;continue}return null}u&&s.push(u.prefixWith(null,""+l).prefixWith(null,"anyOf"))}return this.trackUnknownProperties&&(this.unknownPropertyPaths=i,this.knownPropertyPaths=r),a?(s=s.concat(this.errors.slice(o)),this.errors=this.errors.slice(0,o),this.createError(v.ANY_OF_MISSING,{},"","/anyOf",s,t,e)):void 0},c.prototype.validateOneOf=function(t,e,n){if(void 0===e.oneOf)return null;var i,r,s=null,o=[],a=this.errors.length;this.trackUnknownProperties&&(i=this.unknownPropertyPaths,r=this.knownPropertyPaths);for(var l=0;l<e.oneOf.length;l++){this.trackUnknownProperties&&(this.unknownPropertyPaths={},this.knownPropertyPaths={});var c=e.oneOf[l],h=this.errors.length,u=this.validateAll(t,c,[],["oneOf",l],n);if(null===u&&h===this.errors.length){if(null!==s)return this.errors=this.errors.slice(0,a),this.createError(v.ONE_OF_MULTIPLE,{index1:s,index2:l},"","/oneOf",null,t,e);if(s=l,this.trackUnknownProperties){for(var d in this.knownPropertyPaths)r[d]=!0,delete i[d];for(var p in this.unknownPropertyPaths)r[p]||(i[p]=!0)}}else u&&o.push(u)}return this.trackUnknownProperties&&(this.unknownPropertyPaths=i,this.knownPropertyPaths=r),null===s?(o=o.concat(this.errors.slice(a)),this.errors=this.errors.slice(0,a),this.createError(v.ONE_OF_MISSING,{},"","/oneOf",o,t,e)):(this.errors=this.errors.slice(0,a),null)},c.prototype.validateNot=function(t,e,n){if(void 0===e.not)return null;var i,r,s=this.errors.length;this.trackUnknownProperties&&(i=this.unknownPropertyPaths,r=this.knownPropertyPaths,this.unknownPropertyPaths={},this.knownPropertyPaths={});var o=this.validateAll(t,e.not,null,null,n),a=this.errors.slice(s);return this.errors=this.errors.slice(0,s),this.trackUnknownProperties&&(this.unknownPropertyPaths=i,this.knownPropertyPaths=r),null===o&&0===a.length?this.createError(v.NOT_PASSED,{},"","/not",null,t,e):null},c.prototype.validateHypermedia=function(t,e,n){if(!e.links)return null;for(var i,r=0;r<e.links.length;r++){var s=e.links[r];if("describedby"===s.rel){for(var o=new l(s.href),a=!0,c=0;c<o.varNames.length;c++)if(!(o.varNames[c]in t)){a=!1;break}if(a){var h={$ref:o.fillFromObject(t)};if(i=this.validateAll(t,h,[],["links",r],n))return i}}}};var v={INVALID_TYPE:0,ENUM_MISMATCH:1,ANY_OF_MISSING:10,ONE_OF_MISSING:11,ONE_OF_MULTIPLE:12,NOT_PASSED:13,NUMBER_MULTIPLE_OF:100,NUMBER_MINIMUM:101,NUMBER_MINIMUM_EXCLUSIVE:102,NUMBER_MAXIMUM:103,NUMBER_MAXIMUM_EXCLUSIVE:104,NUMBER_NOT_A_NUMBER:105,STRING_LENGTH_SHORT:200,STRING_LENGTH_LONG:201,STRING_PATTERN:202,OBJECT_PROPERTIES_MINIMUM:300,OBJECT_PROPERTIES_MAXIMUM:301,OBJECT_REQUIRED:302,OBJECT_ADDITIONAL_PROPERTIES:303,OBJECT_DEPENDENCY_KEY:304,ARRAY_LENGTH_SHORT:400,ARRAY_LENGTH_LONG:401,ARRAY_UNIQUE:402,ARRAY_ADDITIONAL_ITEMS:403,FORMAT_CUSTOM:500,KEYWORD_CUSTOM:501,CIRCULAR_REFERENCE:600,UNKNOWN_PROPERTY:1e3},_={};for(var b in v)_[v[b]]=b;var w={INVALID_TYPE:"Invalid type: {type} (expected {expected})",ENUM_MISMATCH:"No enum match for: {value}",ANY_OF_MISSING:'Data does not match any schemas from "anyOf"',ONE_OF_MISSING:'Data does not match any schemas from "oneOf"',ONE_OF_MULTIPLE:'Data is valid against more than one schema from "oneOf": indices {index1} and {index2}',NOT_PASSED:'Data matches schema from "not"',NUMBER_MULTIPLE_OF:"Value {value} is not a multiple of {multipleOf}",NUMBER_MINIMUM:"Value {value} is less than minimum {minimum}",NUMBER_MINIMUM_EXCLUSIVE:"Value {value} is equal to exclusive minimum {minimum}",NUMBER_MAXIMUM:"Value {value} is greater than maximum {maximum}",NUMBER_MAXIMUM_EXCLUSIVE:"Value {value} is equal to exclusive maximum {maximum}",NUMBER_NOT_A_NUMBER:"Value {value} is not a valid number",STRING_LENGTH_SHORT:"String is too short ({length} chars), minimum {minimum}",STRING_LENGTH_LONG:"String is too long ({length} chars), maximum {maximum}",STRING_PATTERN:"String does not match pattern: {pattern}",OBJECT_PROPERTIES_MINIMUM:"Too few properties defined ({propertyCount}), minimum {minimum}",OBJECT_PROPERTIES_MAXIMUM:"Too many properties defined ({propertyCount}), maximum {maximum}",OBJECT_REQUIRED:"Missing required property: {key}",OBJECT_ADDITIONAL_PROPERTIES:"Additional properties not allowed",OBJECT_DEPENDENCY_KEY:"Dependency failed - key must exist: {missing} (due to key: {key})",ARRAY_LENGTH_SHORT:"Array is too short ({length}), minimum {minimum}",ARRAY_LENGTH_LONG:"Array is too long ({length}), maximum {maximum}",ARRAY_UNIQUE:"Array items are not unique (indices {match1} and {match2})",ARRAY_ADDITIONAL_ITEMS:"Additional items not allowed",FORMAT_CUSTOM:"Format validation failed ({message})",KEYWORD_CUSTOM:"Keyword failed: {key} ({message})",CIRCULAR_REFERENCE:"Circular $refs: {urls}",UNKNOWN_PROPERTY:"Unknown property (not in schema)"};function x(t,e,n,i,r){if(Error.call(this),void 0===t)throw new Error("No error code supplied: "+i);this.message="",this.params=e,this.code=t,this.dataPath=n||"",this.schemaPath=i||"",this.subErrors=r||null;var s=new Error(this.message);if(this.stack=s.stack||s.stacktrace,!this.stack)try{throw s}catch(s){this.stack=s.stack||s.stacktrace}}x.prototype=Object.create(Error.prototype),x.prototype.constructor=x,x.prototype.name="ValidationError",x.prototype.prefixWith=function(t,e){if(null!==t&&(t=t.replace(/~/g,"~0").replace(/\//g,"~1"),this.dataPath="/"+t+this.dataPath),null!==e&&(e=e.replace(/~/g,"~0").replace(/\//g,"~1"),this.schemaPath="/"+e+this.schemaPath),null!==this.subErrors)for(var n=0;n<this.subErrors.length;n++)this.subErrors[n].prefixWith(t,e);return this};var C={},S=function t(){var e,n,i=new c,r={setErrorReporter:function(t){return"string"==typeof t?this.language(t):(n=t,!0)},addFormat:function(){i.addFormat.apply(i,arguments)},language:function(t){return t?(C[t]||(t=t.split("-")[0]),!!C[t]&&(e=t,t)):e},addLanguage:function(t,e){var n;for(n in v)e[n]&&!e[v[n]]&&(e[v[n]]=e[n]);var i=t.split("-")[0];if(C[i])for(n in C[t]=Object.create(C[i]),e)void 0===C[i][n]&&(C[i][n]=e[n]),C[t][n]=e[n];else C[t]=e,C[i]=e;return this},freshApi:function(e){var n=t();return e&&n.language(e),n},validate:function(t,r,s,o){var a=y(e),l=n?function(t,e,i){return n(t,e,i)||a(t,e,i)}:a,h=new c(i,!1,l,s,o);"string"==typeof r&&(r={$ref:r}),h.addSchema("",r);var u=h.validateAll(t,r,null,null,"");return!u&&o&&(u=h.banUnknownProperties(t,r)),this.error=u,this.missing=h.missing,this.valid=null===u,this.valid},validateResult:function(){var t={toString:function(){return this.valid?"valid":this.error.message}};return this.validate.apply(t,arguments),t},validateMultiple:function(t,r,s,o){var a=y(e),l=n?function(t,e,i){return n(t,e,i)||a(t,e,i)}:a,h=new c(i,!0,l,s,o);"string"==typeof r&&(r={$ref:r}),h.addSchema("",r),h.validateAll(t,r,null,null,""),o&&h.banUnknownProperties(t,r);var u={toString:function(){return this.valid?"valid":this.error.message}};return u.errors=h.errors,u.missing=h.missing,u.valid=0===u.errors.length,u},addSchema:function(){return i.addSchema.apply(i,arguments)},getSchema:function(){return i.getSchema.apply(i,arguments)},getSchemaMap:function(){return i.getSchemaMap.apply(i,arguments)},getSchemaUris:function(){return i.getSchemaUris.apply(i,arguments)},getMissingUris:function(){return i.getMissingUris.apply(i,arguments)},dropSchemas:function(){i.dropSchemas.apply(i,arguments)},defineKeyword:function(){i.defineKeyword.apply(i,arguments)},defineError:function(t,e,n){if("string"!=typeof t||!/^[A-Z]+(_[A-Z]+)*$/.test(t))throw new Error("Code name must be a string in UPPER_CASE_WITH_UNDERSCORES");if("number"!=typeof e||e%1!=0||e<1e4)throw new Error("Code number must be an integer > 10000");if(void 0!==v[t])throw new Error("Error already defined: "+t+" as "+v[t]);if(void 0!==_[e])throw new Error("Error code already used: "+_[e]+" as "+e);for(var i in v[t]=e,_[e]=t,w[t]=w[e]=n,C){var r=C[i];r[t]&&(r[e]=r[e]||r[t])}},reset:function(){i.reset(),this.error=null,this.missing=[],this.valid=!0},missing:[],error:null,valid:!0,normSchema:m,resolveUrl:f,getDocumentUri:g,errorCodes:v};return r.language("en"),r}();return S.addLanguage("en-gb",w),S.tv4=S,S},void 0===(i=n.apply(e,[]))||(t.exports=i)},199:function(t,e,n){var i;"function"!=typeof fetch&&"function"!=typeof XMLHttpRequest&&(XMLHttpRequest=n(317)),function(){var n={"http://webfist.org/spec/rel":"webfist","http://webfinger.net/rel/avatar":"avatar",remotestorage:"remotestorage","http://tools.ietf.org/id/draft-dejong-remotestorage":"remotestorage",remoteStorage:"remotestorage","http://www.packetizer.com/rel/share":"share","http://webfinger.net/rel/profile-page":"profile",me:"profile",vcard:"vcard",blog:"blog","http://packetizer.com/rel/blog":"blog","http://schemas.google.com/g/2010#updates-from":"updates","https://camlistore.org/rel/server":"camilstore"},r={avatar:[],remotestorage:[],blog:[],vcard:[],updates:[],share:[],profile:[],webfist:[],camlistore:[]},s=["webfinger","host-meta","host-meta.json"];function o(t){return t.toString=function(){return this.message},t}function a(t){"object"!=typeof t&&(t={}),this.config={tls_only:void 0===t.tls_only||t.tls_only,webfist_fallback:void 0!==t.webfist_fallback&&t.webfist_fallback,uri_fallback:void 0!==t.uri_fallback&&t.uri_fallback,request_timeout:void 0!==t.request_timeout?t.request_timeout:1e4}}a.prototype.__fetchJRD=function(t,e,n){if("function"==typeof fetch)return this.__fetchJRD_fetch(t,e,n);if("function"==typeof XMLHttpRequest)return this.__fetchJRD_XHR(t,e,n);throw new Error("add a polyfill for fetch or XMLHttpRequest")},a.prototype.__fetchJRD_fetch=function(t,e,n){var i,r=this;"function"==typeof AbortController&&(i=new AbortController);var s=fetch(t,{headers:{Accept:"application/jrd+json, application/json"},signal:i?i.signal:void 0}).then(function(e){if(e.ok)return e.text();throw 404===e.status?o({message:"resource not found",url:t,status:e.status}):o({message:"error during request",url:t,status:e.status})},function(e){throw o({message:"error during request",url:t,status:void 0,err:e})}).then(function(e){if(r.__isValidJSON(e))return e;throw o({message:"invalid json",url:t,status:void 0})}),a=new Promise(function(e,n){setTimeout(function(){n(o({message:"request timed out",url:t,status:void 0})),i&&i.abort()},r.config.request_timeout)});Promise.race([s,a]).then(function(t){n(t)}).catch(function(t){e(t)})},a.prototype.__fetchJRD_XHR=function(t,e,n){var i=this,r=!1,s=new XMLHttpRequest;function a(){if(!r)return r=!0,200===s.status?i.__isValidJSON(s.responseText)?n(s.responseText):e(o({message:"invalid json",url:t,status:s.status})):404===s.status?e(o({message:"resource not found",url:t,status:s.status})):s.status>=301&&s.status<=302?function(t){return"string"==typeof t&&"https"===t.split("://")[0]}(s.getResponseHeader("Location"))?l():e(o({message:"no redirect URL found",url:t,status:s.status})):e(o({message:"error during request",url:t,status:s.status}))}function l(){s.onreadystatechange=function(){4===s.readyState&&a()},s.onload=function(){a()},s.ontimeout=function(){return e(o({message:"request timed out",url:t,status:s.status}))},s.open("GET",t,!0),s.timeout=i.config.request_timeout,s.setRequestHeader("Accept","application/jrd+json, application/json"),s.send()}return l()},a.prototype.__isValidJSON=function(t){try{JSON.parse(t)}catch(t){return!1}return!0},a.prototype.__isLocalhost=function(t){return/^localhost(\.localdomain)?(\:[0-9]+)?$/.test(t)},a.prototype.__processJRD=function(t,e,i,s){var a=JSON.parse(e);if("object"!=typeof a||"object"!=typeof a.links)return void 0!==a.error?i(o({message:a.error,request:t})):i(o({message:"unknown response from server",request:t}));var l=a.links;Array.isArray(l)||(l=[]);var c={object:a,json:e,idx:{}};c.idx.properties={name:void 0},c.idx.links=JSON.parse(JSON.stringify(r)),l.map(function(t){if(n.hasOwnProperty(t.rel)&&c.idx.links[n[t.rel]]){var e={};Object.keys(t).map(function(n){e[n]=t[n]}),c.idx.links[n[t.rel]].push(e)}});var h=JSON.parse(e).properties;for(var u in h)h.hasOwnProperty(u)&&"http://packetizer.com/ns/name"===u&&(c.idx.properties.name=h[u]);return s(c)},a.prototype.lookup=function(t,e){if("string"!=typeof t)throw new Error("first parameter must be a user address");if("function"!=typeof e)throw new Error("second parameter must be a callback");var n=this,i="";i=t.indexOf("://")>-1?t.replace(/ /g,"").split("/")[2]:t.replace(/ /g,"").split("@")[1];var r=0,o="https";function a(){var e="";return t.split("://")[1]||(e="acct:"),o+"://"+i+"/.well-known/"+s[r]+"?resource="+e+t}function l(t){if(n.config.uri_fallback&&"webfist.org"!==i&&r!==s.length-1)return r+=1,c();if(!n.config.tls_only&&"https"===o)return r=0,o="http",c();if(!n.config.webfist_fallback||"webfist.org"===i)return e(t);r=0,o="http",i="webfist.org";var l=a();n.__fetchJRD(l,e,function(t){n.__processJRD(l,t,e,function(t){"object"==typeof t.idx.links.webfist&&"string"==typeof t.idx.links.webfist[0].href&&n.__fetchJRD(t.idx.links.webfist[0].href,e,function(t){n.__processJRD(l,t,e,function(){return e(null,e)})})})})}function c(){var t=a();n.__fetchJRD(t,l,function(i){n.__processJRD(t,i,e,function(t){e(null,t)})})}return n.__isLocalhost(i)&&(o="http"),setTimeout(c,0)},a.prototype.lookupLink=function(t,e,n){if(!r.hasOwnProperty(e))return n("unsupported rel "+e);this.lookup(t,function(t,i){var r=i.idx.links[e];return t?n(t):0===r.length?n('no links found with rel="'+e+'"'):n(null,r[0])})},void 0===(i=function(){return a}.apply(e,[]))||(t.exports=i)}()},317:function(t){t.exports=XMLHttpRequest}},e={};function n(i){var r=e[i];if(void 0!==r)return r.exports;var s=e[i]={exports:{}};return t[i].call(s.exports,s,s.exports,n),s.exports}return n.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),n(423).default}()),Xx.exports);
/*! For license information please see remotestorage.js.LICENSE.txt */const Qx=Kx(Jx),tC="0123456789bcdefghjkmnpqrstuvwxyz";class eC{static encode(t,e,n){if(void 0===n){for(let n=1;n<=12;n++){const i=eC.encode(t,e,n),r=eC.decode(i);if(r.lat==t&&r.lon==e)return i}n=12}if(t=Number(t),e=Number(e),n=Number(n),isNaN(t)||isNaN(e)||isNaN(n))throw new Error("Invalid geohash");let i=0,r=0,s=!0,o="",a=-90,l=90,c=-180,h=180;for(;o.length<n;){if(s){const t=(c+h)/2;e>=t?(i=2*i+1,c=t):(i*=2,h=t)}else{const e=(a+l)/2;t>=e?(i=2*i+1,a=e):(i*=2,l=e)}s=!s,5==++r&&(o+=tC.charAt(i),r=0,i=0)}return o}static decode(t){const e=eC.bounds(t),n=e.sw.lat,i=e.sw.lon,r=e.ne.lat,s=e.ne.lon;let o=(n+r)/2,a=(i+s)/2;return o=o.toFixed(Math.floor(2-Math.log(r-n)/Math.LN10)),a=a.toFixed(Math.floor(2-Math.log(s-i)/Math.LN10)),{lat:Number(o),lon:Number(a)}}static bounds(t){if(0==t.length)throw new Error("Invalid geohash");t=t.toLowerCase();let e=!0,n=-90,i=90,r=-180,s=180;for(let o=0;o<t.length;o++){const a=t.charAt(o),l=tC.indexOf(a);if(-1==l)throw new Error("Invalid geohash");for(let t=4;t>=0;t--){const o=l>>t&1;if(e){const t=(r+s)/2;1==o?r=t:s=t}else{const t=(n+i)/2;1==o?n=t:i=t}e=!e}}return{sw:{lat:n,lon:r},ne:{lat:i,lon:s}}}static adjacent(t,e){if(t=t.toLowerCase(),e=e.toLowerCase(),0==t.length)throw new Error("Invalid geohash");if(-1=="nsew".indexOf(e))throw new Error("Invalid direction");const n=t.slice(-1);let i=t.slice(0,-1);const r=t.length%2;return-1!={n:["prxz","bcfguvyz"],s:["028b","0145hjnp"],e:["bcfguvyz","prxz"],w:["0145hjnp","028b"]}[e][r].indexOf(n)&&""!=i&&(i=eC.adjacent(i,e)),i+tC.charAt({n:["p0r21436x8zb9dcf5h7kjnmqesgutwvy","bc01fg45238967deuvhjyznpkmstqrwx"],s:["14365h7k9dcfesgujnmqp0r2twvyx8zb","238967debc01fg45kmstqrwxuvhjyznp"],e:["bc01fg45238967deuvhjyznpkmstqrwx","p0r21436x8zb9dcf5h7kjnmqesgutwvy"],w:["238967debc01fg45kmstqrwxuvhjyznp","14365h7k9dcfesgujnmqp0r2twvyx8zb"]}[e][r].indexOf(n))}static neighbours(t){return{n:eC.adjacent(t,"n"),ne:eC.adjacent(eC.adjacent(t,"n"),"e"),e:eC.adjacent(t,"e"),se:eC.adjacent(eC.adjacent(t,"s"),"e"),s:eC.adjacent(t,"s"),sw:eC.adjacent(eC.adjacent(t,"s"),"w"),w:eC.adjacent(t,"w"),nw:eC.adjacent(eC.adjacent(t,"n"),"w")}}}const nC="0123456789ABCDEFGHJKMNPQRSTVWXYZ",iC=0xffffffffffff;var rC;!function(t){t.Base32IncorrectEncoding="B32_ENC_INVALID",t.DecodeTimeInvalidCharacter="DEC_TIME_CHAR",t.DecodeTimeValueMalformed="DEC_TIME_MALFORMED",t.EncodeTimeNegative="ENC_TIME_NEG",t.EncodeTimeSizeExceeded="ENC_TIME_SIZE_EXCEED",t.EncodeTimeValueMalformed="ENC_TIME_MALFORMED",t.PRNGDetectFailure="PRNG_DETECT",t.ULIDInvalid="ULID_INVALID",t.Unexpected="UNEXPECTED",t.UUIDInvalid="UUID_INVALID"}(rC||(rC={}));class sC extends Error{constructor(t,e){super(`${e} (${t})`),this.name="ULIDError",this.code=t}}function oC(t){const e=Math.floor(32*t())%32;return nC.charAt(e)}const aC={type:"object",properties:{id:{type:"string"},title:{type:"string"},lat:{type:"number"},lon:{type:"number"},geohash:{type:"string"},zoom:{type:"number"},url:{type:"string"},osmId:{type:"string"},osmType:{type:"string"},osmTags:{type:"object",additionalProperties:{type:"string"}},description:{type:"string"},tags:{type:"array",items:{type:"string"},default:[]},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","title","lat","lon","geohash","createdAt"]},lC={type:"object",properties:{id:{type:"string"},title:{type:"string"},color:{type:"string"},placeRefs:{type:"array",items:{type:"object",properties:{id:{type:"string"},geohash:{type:"string"}},required:["id","geohash"]},default:[]},createdAt:{type:"string",format:"date-time"},updatedAt:{type:"string",format:"date-time"}},required:["id","title","placeRefs","createdAt"]},cC={name:"places",builder:function(t){function e(t,e){return`${t.substring(0,2)}/${t.substring(2,4)}/${e}`}t.declareType("place",aC),t.declareType("list",lC);const n={async getAll(){const e=await t.getAll("_lists/");return e?Object.values(e):[]},async get(e){const n=`_lists/${e}`;return t.getObject(n)},async create(e,n,i){const r=`_lists/${e}`;let s=await t.getObject(r);const o=(new Date).toISOString();return s?(s.title=n,i&&(s.color=i),s.updatedAt=o):s={id:e,title:n,color:i,placeRefs:[],createdAt:o,updatedAt:o},await t.storeObject("list",r,s),s},async delete(e){await t.remove(`_lists/${e}`)},async addPlace(e,n,i){const r=`_lists/${e}`,s=await t.getObject(r);if(!s)throw new Error(`List not found: ${e}`);return-1===s.placeRefs.findIndex(t=>t.id===n)&&(s.placeRefs.push({id:n,geohash:i}),s.updatedAt=(new Date).toISOString(),await t.storeObject("list",r,s)),s},async removePlace(e,n){const i=`_lists/${e}`,r=await t.getObject(i);if(!r)throw new Error(`List not found: ${e}`);const s=r.placeRefs.findIndex(t=>t.id===n);return-1!==s&&(r.placeRefs.splice(s,1),r.updatedAt=(new Date).toISOString(),await t.storeObject("list",i,r)),r},async initDefaults(){const t=[{id:"to-go",title:"Want to go",color:"#2e9e4f"},{id:"to-do",title:"To do",color:"#2a7fff"}];for(const e of t)await this.get(e.id)||await this.create(e.id,e.title,e.color)}},i={lists:n,store:async function(n){const i=function(t){const e=(new Date).toISOString(),n=t.id||function(){const t=function(){const t="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:null,e=t&&(t.crypto||t.msCrypto)||null;if("function"==typeof e?.getRandomValues)return()=>{const t=new Uint8Array(1);return e.getRandomValues(t),t[0]/256};if("function"==typeof e?.randomBytes)return()=>e.randomBytes(1).readUInt8()/256;throw new sC(rC.PRNGDetectFailure,"Failed to find a reliable PRNG")}();return function(t,e=10){if(isNaN(t))throw new sC(rC.EncodeTimeValueMalformed,`Time must be a number: ${t}`);if(t>iC)throw new sC(rC.EncodeTimeSizeExceeded,`Cannot encode a time larger than ${iC}: ${t}`);if(t<0)throw new sC(rC.EncodeTimeNegative,`Time must be positive: ${t}`);if(!1===Number.isInteger(t))throw new sC(rC.EncodeTimeValueMalformed,`Time must be an integer: ${t}`);let n,i="";for(let r=e;r>0;r--)n=t%32,i=nC.charAt(n)+i,t=(t-n)/32;return i}(Date.now(),10)+function(t,e){let n="";for(;t>0;t--)n=oC(e)+n;return n}(16,t)}(),i="number"==typeof t.lat?t.lat:0,r="number"==typeof t.lon?t.lon:0,s=t.title||"Untitled Place",o=t.geohash||eC.encode(i,r,10),a={...t,id:n,lat:i,lon:r,geohash:o,title:s,tags:t.tags||[],createdAt:t.createdAt||e,updatedAt:t.id?e:void 0};return Object.keys(a).forEach(t=>{void 0===a[t]&&delete a[t]}),a}(n),r=e(i.geohash,i.id);return await t.storeObject("place",r,i),i},remove:async function(i,r){if(!i||!r)throw new Error("Both id and geohash are required to remove a place");const s=await n.getAll();await Promise.all(s.map(async e=>{const n=e.placeRefs.findIndex(t=>t.id===i);-1!==n&&(e.placeRefs.splice(n,1),e.updatedAt=(new Date).toISOString(),await t.storeObject("list",`_lists/${e.id}`,e))}));const o=e(r,i);return t.remove(o)},get:async function(n,i){if(!n||!i)throw new Error("Both id and geohash are required to get a place");const r=e(i,n);return t.getObject(r)},listByPrefix:async function(e){let n="";return e.length>=2&&(n+=e.substring(0,2)+"/"),e.length>=4&&(n+=e.substring(2,4)+"/"),t.getAll(n)},getPlaces:async function(e){const n=[],i=async e=>{const i=await t.getAll(e,!1);i&&Object.values(i).forEach(t=>{t&&"object"==typeof t&&!t.toString().endsWith("/")&&n.push(t)})};if(e&&e.length>0){const t=e.map(async t=>{if(t.length<4)return;const e=t.substring(0,2),n=t.substring(2,4);await i(`${e}/${n}/`)});await Promise.all(t)}else{const e=t=>{if(!t||"object"!=typeof t)return[];let e=t;return t.items&&"object"==typeof t.items&&(e=t.items),Object.keys(e).filter(t=>t.endsWith("/")&&!t.startsWith("@"))},n=await t.getListing("",!1),r=e(n);await Promise.all(r.map(async n=>{const r=await t.getListing(n,!1),s=e(r);await Promise.all(s.map(async t=>{await i(n+t)}))}))}return n}};return{exports:i}}};var hC,uC={exports:{}};const dC=Kx((hC||(hC=1,self,uC.exports=(()=>{var t={d:(e,n)=>{for(var i in n)t.o(n,i)&&!t.o(e,i)&&Object.defineProperty(e,i,{enumerable:!0,get:n[i]})},o:(t,e)=>Object.prototype.hasOwnProperty.call(t,e)},e={};t.d(e,{default:()=>i});var n=function(){function t(e){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.rs=e,this.leaveOpen=!!n.leaveOpen&&n.leaveOpen,this.autoCloseAfter=n.autoCloseAfter?n.autoCloseAfter:1500,this.skipInitial=!!n.skipInitial&&n.skipInitial,this.logging=!!n.logging&&n.logging,this.parentContainerEl=null,n.hasOwnProperty("modalBackdrop")){if("boolean"!=typeof n.modalBackdrop&&"onlySmallScreens"!==n.modalBackdrop)throw'options.modalBackdrop has to be true/false or "onlySmallScreens"';this.modalBackdrop=n.modalBackdrop}else this.modalBackdrop="onlySmallScreens";this.active=!1,this.online=!1,this.closed=!1,this.lastSynced=null,this.lastSyncedUpdateLoop=null}var e,n;return e=t,n=[{key:"log",value:function(){if(this.logging){for(var t,e=arguments.length,n=new Array(e),i=0;i<e;i++)n[i]=arguments[i];(t=console).debug.apply(t,["[RS-WIDGET] "].concat(n))}}},{key:"eventHandler",value:function(t,e){var n=this;switch(this.log("EVENT: ",t),t){case"ready":this.setState(this.state);break;case"sync-started":case"sync-req-done":this.handleSyncStarted();break;case"sync-done":if(this.online&&!e.completed)return;this.syncInProgress=!1,this.rsSyncButton.classList.remove("rs-rotate"),this.updateLastSyncedStatus(),!this.closed&&this.shouldCloseWhenSyncDone&&setTimeout(this.close.bind(this),this.autoCloseAfter);break;case"disconnected":this.active=!1,this.setOnline(),this.setBackendClass(),this.open(),this.setInitialState();break;case"connected":this.active=!0,this.online=!0,this.rs.hasFeature("Sync")?(this.shouldCloseWhenSyncDone=!0,this.rs.on("sync-req-done",function(t){return n.eventHandler("sync-req-done",t)}),this.rs.on("sync-done",function(t){return n.eventHandler("sync-done",t)})):(this.rsSyncButton.classList.add("rs-hidden"),setTimeout(this.close.bind(this),this.autoCloseAfter));var i=this.rs.remote.userAddress;this.rsConnectedUser.innerHTML=i,this.setBackendClass(this.rs.backend),this.rsConnectedLabel.textContent="Connected",this.setState("connected");break;case"network-offline":this.setOffline();break;case"network-online":this.setOnline();break;case"error":this.setBackendClass(this.rs.backend),"DiscoveryError"===e.name?this.handleDiscoveryError(e):"SyncError"===e.name?this.handleSyncError(e):"Unauthorized"===e.name?this.handleUnauthorized(e):console.debug('Encountered unhandled error: "'.concat(e,'"'))}}},{key:"setState",value:function(t){if(t){this.log("Setting state ",t);var e=this.parentContainerEl.querySelector(".rs-box.rs-selected");e&&(e.classList.remove("rs-selected"),e.setAttribute("aria-hidden","true"));var n=this.parentContainerEl.querySelector(".rs-box.rs-box-"+t);n&&(n.classList.add("rs-selected"),n.setAttribute("aria-hidden","false"));var i=this.rsWidget.className.match(/rs-state-\S+/g)[0];this.rsWidget.classList.remove(i),this.rsWidget.classList.add("rs-state-".concat(t||this.state)),this.state=t}}},{key:"setInitialState",value:function(){this.skipInitial?this.showChooseOrSignIn():this.setState("initial")}},{key:"createHtmlTemplate",value:function(){var t=document.createElement("div");t.id="remotestorage-widget",t.innerHTML='<div class="remotestorage-widget-modal-backdrop"></div> <div class="rs-widget rs-state-initial"> <div class="rs-widget-icon"> <svg class="rs-main-logo" id="rs-main-logo-remotestorage" xmlns="http://www.w3.org/2000/svg" version="1.1" xml:space="preserve" width="0.739008in" height="0.853339in" style="shape-rendering:geometricPrecision;text-rendering:geometricPrecision;image-rendering:optimizeQuality;fill-rule:evenodd;clip-rule:evenodd" viewBox="0 0 739 853" xmlns:xlink="http://www.w3.org/1999/xlink"> <g> <polygon class="rs-logo-shape" points="370,754 0,542 0,640 185,747 370,853 554,747 739,640 739,525 739,525 739,476 739,427 739,378 653,427 370,589 86,427 86,427 86,361 185,418 370,524 554,418 653,361 739,311 739,213 739,213 554,107 370,0 185,107 58,180 144,230 228,181 370,100 511,181 652,263 370,425 87,263 87,263 0,213 0,213 0,311 0,378 0,427 0,476 86,525 185,582 370,689 554,582 653,525 653,590 653,592 "/> </g> </svg> <svg class="rs-main-logo" id="rs-main-logo-dropbox" width="40" height="36" xml:space="preserve" stroke-miterlimit="1.4142" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 97" stroke-linejoin="round" version="1.1" clip-rule="evenodd"> <path d="m30.691 0l-30.691 20.039 21.221 16.994 30.946-19.108-21.476-17.925z" fill="#007ee5"/> <path d="m0 54.028l30.691 20.039 21.476-17.926-30.945-19.108-21.222 16.995z" fill="#007ee5"/> <path d="m52.167 56.142l21.477 17.926 30.696-20.039-21.227-16.995-30.946 19.108z" fill="#007ee5"/> <path d="m104.34 20.039l-30.696-20.039-21.477 17.925 30.946 19.108 21.227-16.994z" fill="#007ee5"/> <path d="m52.23 59.998l-21.538 17.873-9.218-6.018v6.747l30.756 18.443 30.756-18.443v-6.747l-9.216 6.018-21.54-17.873z" fill="#007ee5"/> </svg> <svg class="rs-main-logo" id="rs-main-logo-googledrive" width="40" height="40" version="1.1" stroke-miterlimit="1.4142" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" width="100%" stroke-linejoin="round" clip-rule="evenodd" viewBox="0 0 511 442" height="100%"> <path d="m166.23 0.10955l0.44-0.009998 0.04 0.49-0.56 0.02 0.08-0.5z" fill="#0ba25e"/> <path d="m164.52 3.3896c0.39-0.56 1.15-1.68 1.54-2.24l0.7-0.11c0.52 6.34 2.38 12.45 3.78 18.62 6.02 26.81 12.1 53.6 18.43 80.33 4.15 18.33 8.78 36.57 12.58 54.97 3.3 11.39 5.07 23.14 8.26 34.55 2.06 10.64 5.29 21.02 7.02 31.72-0.7 1.17-1.4 2.35-2.11 3.52-0.17 0.27-0.53 0.83-0.7 1.11l-0.26 0.45c-0.04 0.08-0.13 0.25-0.18 0.33-0.39 0.72-1.17 2.15-1.56 2.86-0.07 0.13-0.22 0.39-0.3 0.52l-0.71 1.26c-0.09 0.15-0.26 0.44-0.34 0.59l-0.83 1.45c-0.04 0.08-0.13 0.24-0.18 0.32l-1.03 1.8c-0.09 0.15-0.27 0.47-0.36 0.63-0.1 0.17-0.3 0.5-0.4 0.67l-1.01 1.74c-0.08 0.13-0.24 0.41-0.32 0.54l-0.62 1.05c-0.1 0.18-0.32 0.55-0.42 0.73-0.4 0.69-1.19 2.07-1.59 2.77-0.07 0.12-0.22 0.37-0.29 0.5l-0.63 1.05c-0.1 0.19-0.32 0.55-0.43 0.74-0.37 0.65-1.13 1.94-1.5 2.59-0.09 0.15-0.26 0.46-0.35 0.61l-0.75 1.35c-0.07 0.12-0.21 0.37-0.28 0.49l-0.77 1.35-0.32 0.56c-0.4 0.66-1.18 1.99-1.57 2.66-0.09 0.15-0.27 0.46-0.36 0.62l-0.71 1.28c-0.07 0.12-0.2 0.35-0.26 0.47l-0.82 1.42c-0.07 0.13-0.22 0.38-0.29 0.5-0.42 0.72-1.25 2.15-1.67 2.87-0.07 0.13-0.23 0.39-0.31 0.52l-0.6 0.99c-0.1 0.18-0.31 0.53-0.41 0.71-0.38 0.66-1.13 1.97-1.51 2.63-0.06 0.11-0.2 0.35-0.26 0.46l-0.82 1.46c-0.06 0.11-0.18 0.32-0.24 0.43l-0.84 1.47c-0.07 0.11-0.21 0.35-0.28 0.46-0.39 0.66-1.18 1.96-1.57 2.62-0.11 0.17-0.31 0.53-0.42 0.71l-0.59 1.1c-0.08 0.14-0.23 0.42-0.3 0.55l-1.03 1.78c-0.08 0.15-0.26 0.45-0.34 0.6-0.09 0.14-0.25 0.43-0.33 0.57-1.69 2.85-3.22 5.79-5.09 8.53-10.65 17.37-20.45 35.28-30.76 52.86-16.74 28.97-33.46 57.94-50.2 86.91-2.51 4.51-5.37 8.83-7.53 13.54-0.11 0.16-0.33 0.48-0.44 0.64-4.01-5.78-7.11-12.16-10.78-18.16-16.74-28.99-33.49-57.97-50.22-86.97-9.3-16.31-18.99-32.42-28.04-48.88 35.84-61.85 71.52-123.81 107.29-185.7 0.03-0.06 0.1-0.17 0.13-0.23l0.98-1.68c0.04-0.07 0.12-0.21 0.17-0.28l0.99-1.69c0.09-0.15 0.27-0.47 0.37-0.62 0.1-0.18 0.3-0.53 0.4-0.71l0.99-1.76 0.28-0.48 0.74-1.18c0.13-0.19 0.39-0.58 0.52-0.78 0.36-0.54 1.09-1.63 1.46-2.17 0.04-0.18 0.11-0.53 0.15-0.7l0.87-1.67 0.16-0.28 1-1.68c0.1-0.16 0.3-0.5 0.4-0.67 0.11-0.19 0.33-0.58 0.45-0.78l0.84-1.47c0.09-0.16 0.27-0.47 0.36-0.62l0.7-1.23c0.08-0.13 0.24-0.41 0.32-0.55 0.39-0.67 1.17-2.01 1.57-2.68l0.32-0.56 0.73-1.33c0.06-0.1 0.18-0.32 0.24-0.42l0.96-1.68c0.12-0.2 0.37-0.61 0.5-0.81l0.65-0.98c0.14-0.2 0.41-0.59 0.55-0.78 0.12-0.2 0.37-0.6 0.5-0.8l0.54-1.04c0.18-0.39 0.55-1.17 0.73-1.56l0.55-0.77c0.1-0.14 0.29-0.41 0.39-0.55 0.37-0.31 1.12-0.95 1.49-1.27l-0.07-1.17c0.06-0.14 0.2-0.42 0.27-0.56l0.85-1.69c0.07-0.12 0.21-0.37 0.28-0.49l0.75-1.22c0.14-0.2 0.41-0.6 0.55-0.8 0.34-0.56 1.03-1.66 1.37-2.21 0.1-0.2 0.28-0.59 0.38-0.79l0.53-1.15c0.16-0.3 0.5-0.91 0.67-1.22l0.66-0.94c0.14-0.19 0.42-0.57 0.56-0.76 0.12-0.2 0.37-0.6 0.49-0.8l0.49-1.03c0.11-0.23 0.34-0.7 0.45-0.93l0.86-1.66c0.13-0.2 0.38-0.62 0.5-0.83l0.66-0.98c0.14-0.2 0.42-0.58 0.56-0.78 0.13-0.2 0.38-0.61 0.5-0.81l0.51-1.04c0.15-0.29 0.44-0.86 0.58-1.15l0.68-1.12c0.12-0.19 0.36-0.57 0.49-0.76 0.36-0.56 1.09-1.68 1.46-2.23 0.04-0.17 0.13-0.51 0.17-0.68l0.87-1.66c0.03-0.07 0.11-0.2 0.15-0.27l1-1.71c0.1-0.17 0.29-0.5 0.39-0.67 0.1-0.16 0.29-0.5 0.39-0.66l1-1.75c0.04-0.07 0.12-0.21 0.16-0.29l0.94-1.63c0.05-0.07 0.14-0.22 0.18-0.3l1.01-1.7c0.09-0.16 0.27-0.46 0.36-0.62 0.1-0.17 0.3-0.52 0.4-0.7l0.96-1.69c0.06-0.11 0.18-0.32 0.24-0.42l0.81-1.31c0.13-0.19 0.39-0.58 0.51-0.77 0.37-0.55 1.09-1.65 1.46-2.2 0.03-0.17 0.11-0.51 0.15-0.68l0.85-1.63c0.07-0.12 0.22-0.37 0.29-0.5l0.76-1.19c0.14-0.19 0.4-0.58 0.54-0.78 0.35-0.56 1.05-1.67 1.4-2.23 0.05-0.16 0.14-0.48 0.19-0.64l0.88-1.65c0.04-0.08 0.12-0.22 0.16-0.3l1.02-1.7204c0.08-0.15 0.26-0.45 0.35-0.6 0.09-0.17 0.27-0.49 0.36-0.65l1-1.78c0.05-0.07 0.13-0.22 0.17-0.29l0.95-1.61c0.03-0.05 0.1-0.16 0.13-0.21z" fill="#0ba25e"/> <path id="#fccd48ff" fill="#fccd48" d="m166.67 0.099552c32.48-0.15 64.97-0.02 97.46-0.07 26.88 0.099998 53.78-0.21 80.65 0.15 0.53 1.02 1.07 2.03 1.64 3.04 0.08 0.13 0.23 0.41 0.31 0.55 2.6 4.53 5.24 9.0404 7.81 13.58 0.05 0.08 0.13 0.23 0.18 0.3 4.98 8.55 9.94 17.11 14.83 25.71 0.04 0.07 0.13 0.21 0.17 0.29 0.89 1.53 1.81 3.06 2.72 4.6 0.08 0.13 0.23 0.4 0.31 0.54 1.25 2.2 2.51 4.39 3.78 6.58 0.05 0.07 0.13 0.21 0.17 0.29 1.27 2.18 2.52 4.38 3.78 6.58 0.08 0.13 0.23 0.39 0.31 0.52 1.27 2.14 2.5 4.3 3.72 6.46 0.08 0.13 0.23 0.4 0.31 0.53 11.94 20.62 23.85 41.25 35.75 61.9-1.36 5.99 1.93 11.95 0.1 17.97-1.11 16.45-7.32 32.46-17.56 45.38-3.33 3.61-0.1 8.62-0.46 12.9-3.59 4.35-8.21 7.6-12.57 11.11 0.01 3.28 0.02 6.56-0.13 9.85-3.89 2.57-8.35 4.06-12.3 6.54-0.42 1.33-0.85 2.67-1.26 4.02-3.17 1.5-6.56 2.47-9.73 3.99-12.55-3.6-24.97-7.61-37.49-11.32-11.65-3.85-23.58-6.87-35.11-11.11l-0.66-1.18c-0.06-0.09-0.16-0.27-0.21-0.36l-0.95-1.61-0.4-0.68c-0.09-0.15-0.25-0.44-0.34-0.59-0.71-1.26-1.36-2.55-1.94-3.87l-0.06-0.13-0.07-0.1c-0.44-0.7-1.33-2.11-1.78-2.81-0.05-0.08-0.15-0.24-0.2-0.33l-0.29-0.46c-0.17-0.29-0.52-0.86-0.69-1.15-0.43-0.73-1.3-2.19-1.73-2.92-0.11-0.18-0.32-0.55-0.43-0.73l-0.61-1.04c-0.08-0.14-0.24-0.41-0.32-0.55l-0.97-1.67c-0.04-0.07-0.13-0.21-0.17-0.29l-1.02-1.75c-0.09-0.16-0.27-0.48-0.36-0.63-0.1-0.18-0.31-0.55-0.41-0.73l-0.83-1.46c-0.1-0.17-0.3-0.53-0.4-0.7l-0.64-1.13c-0.09-0.15-0.26-0.45-0.35-0.6-0.39-0.72-1.18-2.15-1.58-2.87-0.04-0.08-0.14-0.25-0.18-0.33l-0.27-0.47c-0.19-0.28-0.56-0.84-0.75-1.12-0.99-1.66-1.92-3.36-2.81-5.07-0.05-0.08-0.14-0.25-0.18-0.33l-0.26-0.46c-0.19-0.27-0.57-0.81-0.76-1.07-0.44-0.79-1.32-2.37-1.76-3.16-0.05-0.08-0.15-0.25-0.19-0.34l-0.27-0.48c-0.2-0.33-0.59-0.98-0.79-1.31l-0.86-1.45c-0.08-0.14-0.25-0.42-0.34-0.57-0.38-0.66-1.15-1.99-1.54-2.65-0.09-0.15-0.26-0.46-0.35-0.62-0.68-1.13-1.33-2.27-1.97-3.41-0.05-0.09-0.16-0.27-0.21-0.36l-0.95-1.63c-0.1-0.16-0.29-0.48-0.38-0.65-0.09-0.15-0.26-0.45-0.35-0.6l-1.01-1.76c-0.05-0.08-0.14-0.25-0.19-0.33l-0.82-1.47c-0.07-0.12-0.2-0.35-0.27-0.47-0.38-0.67-1.15-2-1.53-2.67-0.08-0.14-0.24-0.41-0.32-0.54-0.62-1.03-1.24-2.07-1.84-3.1-27.73-48.12-55.5-96.21-83.29-144.3-1.74-3.0004-3.32-6.1204-5.45-8.8804l-0.05-0.45005-0.04-0.49z"/> <path d="m166.15 0.60955l0.56-0.02 0.05 0.45005-0.7 0.11 0.09-0.54005z" fill="#089156"/> <path d="m166.76 1.0396c2.13 2.76 3.71 5.88 5.45 8.88 27.79 48.09 55.56 96.18 83.29 144.3-12.84 22.36-25.78 44.67-38.67 67.01-1.73-10.7-4.96-21.08-7.02-31.72-3.19-11.41-4.96-23.16-8.26-34.55-3.8-18.4-8.43-36.64-12.58-54.97-6.33-26.73-12.41-53.52-18.43-80.33-1.4-6.17-3.26-12.28-3.78-18.62z" fill="#089156"/> <path d="m164.39 3.5996c0.03-0.05 0.1-0.16 0.13-0.21-0.03 0.05-0.1 0.16-0.13 0.21z" fill="#089156"/> <path d="m163.27 5.4996c0.05-0.07 0.13-0.22 0.17-0.29-0.04 0.07-0.12 0.22-0.17 0.29z" fill="#089156"/> <path d="m161.91 7.9296c0.09-0.17 0.27-0.49 0.36-0.65-0.09 0.16-0.27 0.48-0.36 0.65z" fill="#089156"/> <path d="m161.56 8.5296c0.08-0.15 0.26-0.45 0.35-0.6-0.09 0.15-0.27 0.45-0.35 0.6z" fill="#089156"/> <path d="m160.38 10.55c0.04-0.08 0.12-0.22 0.16-0.3-0.04 0.08-0.12 0.22-0.16 0.3z" fill="#089156"/> <path d="m159.31 12.84c0.05-0.16 0.14-0.48 0.19-0.64-0.05 0.16-0.14 0.48-0.19 0.64z" fill="#089156"/> <path d="m157.91 15.07c0.35-0.56 1.05-1.67 1.4-2.23-0.35 0.56-1.05 1.67-1.4 2.23z" fill="#089156"/> <path d="m157.37 15.85c0.14-0.19 0.4-0.58 0.54-0.78-0.14 0.2-0.4 0.59-0.54 0.78z" fill="#089156"/> <path d="m156.32 17.54c0.07-0.12 0.22-0.37 0.29-0.5-0.07 0.13-0.22 0.38-0.29 0.5z" fill="#089156"/> <path d="m155.32 19.85c0.03-0.17 0.11-0.51 0.15-0.68-0.04 0.17-0.12 0.51-0.15 0.68z" fill="#089156"/> <path d="m153.86 22.05c0.37-0.55 1.09-1.65 1.46-2.2-0.37 0.55-1.09 1.65-1.46 2.2z" fill="#089156"/> <path d="m153.35 22.82c0.13-0.19 0.39-0.58 0.51-0.77-0.12 0.19-0.38 0.58-0.51 0.77z" fill="#089156"/> <path d="m152.3 24.55c0.06-0.11 0.18-0.32 0.24-0.42-0.06 0.1-0.18 0.31-0.24 0.42z" fill="#089156"/> <path d="m150.94 26.94c0.1-0.17 0.3-0.52 0.4-0.7-0.1 0.18-0.3 0.53-0.4 0.7z" fill="#089156"/> <path d="m150.58 27.56c0.09-0.16 0.27-0.46 0.36-0.62-0.09 0.16-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m149.39 29.56c0.05-0.07 0.14-0.22 0.18-0.3-0.04 0.08-0.13 0.23-0.18 0.3z" fill="#089156"/> <path d="m148.29 31.48c0.04-0.07 0.12-0.21 0.16-0.29-0.04 0.08-0.12 0.22-0.16 0.29z" fill="#089156"/> <path d="m146.9 33.89c0.1-0.16 0.29-0.5 0.39-0.66-0.1 0.16-0.29 0.5-0.39 0.66z" fill="#089156"/> <path d="m146.51 34.56c0.1-0.17 0.29-0.5 0.39-0.67-0.1 0.17-0.29 0.5-0.39 0.67z" fill="#089156"/> <path d="m145.36 36.54c0.03-0.07 0.11-0.2 0.15-0.27-0.04 0.07-0.12 0.2-0.15 0.27z" fill="#089156"/> <path d="m144.32 38.88c0.04-0.17 0.13-0.51 0.17-0.68-0.04 0.17-0.13 0.51-0.17 0.68z" fill="#089156"/> <path d="m142.86 41.11c0.36-0.56 1.09-1.68 1.46-2.23-0.37 0.55-1.1 1.67-1.46 2.23z" fill="#089156"/> <path d="m142.37 41.87c0.12-0.19 0.36-0.57 0.49-0.76-0.13 0.19-0.37 0.57-0.49 0.76z" fill="#089156"/> <path d="m141.11 44.14c0.15-0.29 0.44-0.86 0.58-1.15-0.14 0.29-0.43 0.86-0.58 1.15z" fill="#089156"/> <path d="m140.1 45.99c0.13-0.2 0.38-0.61 0.5-0.81-0.12 0.2-0.37 0.61-0.5 0.81z" fill="#089156"/> <path d="m139.54 46.77c0.14-0.2 0.42-0.58 0.56-0.78-0.14 0.2-0.42 0.58-0.56 0.78z" fill="#089156"/> <path d="m138.38 48.58c0.13-0.2 0.38-0.62 0.5-0.83-0.12 0.21-0.37 0.63-0.5 0.83z" fill="#089156"/> <path d="m137.07 51.17c0.11-0.23 0.34-0.7 0.45-0.93-0.11 0.23-0.34 0.7-0.45 0.93z" fill="#089156"/> <path d="m136.09 53c0.12-0.2 0.37-0.6 0.49-0.8-0.12 0.2-0.37 0.6-0.49 0.8z" fill="#089156"/> <path d="m135.53 53.76c0.14-0.19 0.42-0.57 0.56-0.76-0.14 0.19-0.42 0.57-0.56 0.76z" fill="#089156"/> <path d="m134.2 55.92c0.16-0.3 0.5-0.91 0.67-1.22-0.17 0.31-0.51 0.92-0.67 1.22z" fill="#089156"/> <path d="m133.29 57.86c0.1-0.2 0.28-0.59 0.38-0.79-0.1 0.2-0.28 0.59-0.38 0.79z" fill="#089156"/> <path d="m131.92 60.07c0.34-0.56 1.03-1.66 1.37-2.21-0.34 0.55-1.03 1.65-1.37 2.21z" fill="#089156"/> <path d="m131.37 60.87c0.14-0.2 0.41-0.6 0.55-0.8-0.14 0.2-0.41 0.6-0.55 0.8z" fill="#089156"/> <path d="m130.34 62.58c0.07-0.12 0.21-0.37 0.28-0.49-0.07 0.12-0.21 0.37-0.28 0.49z" fill="#089156"/> <path d="m129.22 64.83c0.06-0.14 0.2-0.42 0.27-0.56-0.07 0.14-0.21 0.42-0.27 0.56z" fill="#089156"/> <path d="m127.8 67.27c0.35-0.61 1.06-1.83 1.42-2.44l0.07 1.17c-0.37 0.32-1.12 0.96-1.49 1.27z" fill="#089156"/> <path d="m127.41 67.82c0.1-0.14 0.29-0.41 0.39-0.55-0.1 0.14-0.29 0.41-0.39 0.55z" fill="#089156"/> <path d="m126.13 70.15c0.18-0.39 0.55-1.17 0.73-1.56-0.18 0.39-0.55 1.17-0.73 1.56z" fill="#089156"/> <path d="m125.09 71.99c0.12-0.2 0.37-0.6 0.5-0.8-0.13 0.2-0.38 0.6-0.5 0.8z" fill="#089156"/> <path d="m124.54 72.77c0.14-0.2 0.41-0.59 0.55-0.78-0.14 0.19-0.41 0.58-0.55 0.78z" fill="#089156"/> <path d="m123.39 74.56c0.12-0.2 0.37-0.61 0.5-0.81-0.13 0.2-0.38 0.61-0.5 0.81z" fill="#089156"/> <path d="m122.19 76.66c0.06-0.1 0.18-0.32 0.24-0.42-0.06 0.1-0.18 0.32-0.24 0.42z" fill="#089156"/> <path d="m121.14 78.55l0.32-0.56-0.32 0.56z" fill="#089156"/> <path d="m119.25 81.78c0.08-0.13 0.24-0.41 0.32-0.55-0.08 0.14-0.24 0.42-0.32 0.55z" fill="#089156"/> <path d="m118.19 83.63c0.09-0.16 0.27-0.47 0.36-0.62-0.09 0.15-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m116.9 85.88c0.11-0.19 0.33-0.58 0.45-0.78-0.12 0.2-0.34 0.59-0.45 0.78z" fill="#089156"/> <path d="m116.5 86.55c0.1-0.16 0.3-0.5 0.4-0.67-0.1 0.17-0.3 0.51-0.4 0.67z" fill="#089156"/> <path d="m115.34 88.51l0.16-0.28-0.16 0.28z" fill="#089156"/> <path d="m114.32 90.88c0.04-0.18 0.11-0.53 0.15-0.7-0.04 0.17-0.11 0.52-0.15 0.7z" fill="#089156"/> <path d="m112.86 93.05c0.36-0.54 1.09-1.63 1.46-2.17-0.37 0.54-1.1 1.63-1.46 2.17z" fill="#089156"/> <path d="m112.34 93.83c0.13-0.19 0.39-0.58 0.52-0.78-0.13 0.2-0.39 0.59-0.52 0.78z" fill="#089156"/> <path d="m111.32 95.49l0.28-0.48-0.28 0.48z" fill="#089156"/> <path d="m109.93 97.96c0.1-0.18 0.3-0.53 0.4-0.71-0.1 0.18-0.3 0.53-0.4 0.71z" fill="#089156"/> <path d="m109.56 98.58c0.09-0.15 0.27-0.47 0.37-0.62-0.1 0.15-0.28 0.47-0.37 0.62z" fill="#089156"/> <path d="m108.4 100.55c0.04-0.07 0.12-0.21 0.17-0.28-0.05 0.07-0.13 0.21-0.17 0.28z" fill="#089156"/> <path d="m107.29 102.46c0.03-0.06 0.1-0.17 0.13-0.23-0.03 0.06-0.1 0.17-0.13 0.23z" fill="#089156"/> <path d="m214.02 225.86c0.17-0.28 0.53-0.84 0.7-1.11-0.17 0.27-0.53 0.83-0.7 1.11z" fill="#089156"/> <path d="m213.58 226.64c0.05-0.08 0.14-0.25 0.18-0.33-0.04 0.08-0.13 0.25-0.18 0.33z" fill="#089156"/> <path d="m211.72 230.02c0.08-0.13 0.23-0.39 0.3-0.52-0.07 0.13-0.22 0.39-0.3 0.52z" fill="#089156"/> <path d="m210.67 231.87c0.08-0.15 0.25-0.44 0.34-0.59-0.09 0.15-0.26 0.44-0.34 0.59z" fill="#089156"/> <path d="m209.66 233.64c0.05-0.08 0.14-0.24 0.18-0.32-0.04 0.08-0.13 0.24-0.18 0.32z" fill="#089156"/> <path d="m208.27 236.07c0.09-0.16 0.27-0.48 0.36-0.63-0.09 0.15-0.27 0.47-0.36 0.63z" fill="#089156"/> <path d="m207.87 236.74c0.1-0.17 0.3-0.5 0.4-0.67-0.1 0.17-0.3 0.5-0.4 0.67z" fill="#089156"/> <path d="m206.54 239.02c0.08-0.13 0.24-0.41 0.32-0.54-0.08 0.13-0.24 0.41-0.32 0.54z" fill="#089156"/> <path d="m205.5 240.8c0.1-0.18 0.32-0.55 0.42-0.73-0.1 0.18-0.32 0.55-0.42 0.73z" fill="#089156"/> <path d="m203.62 244.07c0.07-0.13 0.22-0.38 0.29-0.5-0.07 0.12-0.22 0.37-0.29 0.5z" fill="#089156"/> <path d="m202.56 245.86c0.11-0.19 0.33-0.55 0.43-0.74-0.1 0.19-0.32 0.55-0.43 0.74z" fill="#089156"/> <path d="m200.71 249.06c0.09-0.15 0.26-0.46 0.35-0.61-0.09 0.15-0.26 0.46-0.35 0.61z" fill="#089156"/> <path d="m199.68 250.9c0.07-0.12 0.21-0.37 0.28-0.49-0.07 0.12-0.21 0.37-0.28 0.49z" fill="#089156"/> <path d="m198.59 252.81l0.32-0.56-0.32 0.56z" fill="#089156"/> <path d="m196.66 256.09c0.09-0.16 0.27-0.47 0.36-0.62-0.09 0.15-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m195.69 257.84c0.06-0.12 0.19-0.35 0.26-0.47-0.07 0.12-0.2 0.35-0.26 0.47z" fill="#089156"/> <path d="m194.58 259.76c0.07-0.12 0.22-0.37 0.29-0.5-0.07 0.13-0.22 0.38-0.29 0.5z" fill="#089156"/> <path d="m192.6 263.15c0.08-0.13 0.24-0.39 0.31-0.52-0.07 0.13-0.23 0.39-0.31 0.52z" fill="#089156"/> <path d="m191.59 264.85c0.1-0.18 0.31-0.53 0.41-0.71-0.1 0.18-0.31 0.53-0.41 0.71z" fill="#089156"/> <path d="m189.82 267.94c0.06-0.11 0.2-0.35 0.26-0.46-0.06 0.11-0.2 0.35-0.26 0.46z" fill="#089156"/> <path d="m188.76 269.83c0.06-0.11 0.18-0.32 0.24-0.43-0.06 0.11-0.18 0.32-0.24 0.43z" fill="#089156"/> <path d="m187.64 271.76c0.07-0.11 0.21-0.35 0.28-0.46-0.07 0.11-0.21 0.35-0.28 0.46z" fill="#089156"/> <path d="m185.65 275.09c0.11-0.18 0.31-0.54 0.42-0.71-0.11 0.17-0.31 0.53-0.42 0.71z" fill="#089156"/> <path d="m184.76 276.74c0.07-0.13 0.22-0.41 0.3-0.55-0.08 0.14-0.23 0.42-0.3 0.55z" fill="#089156"/> <path d="m183.39 279.12c0.08-0.15 0.26-0.45 0.34-0.6-0.08 0.15-0.26 0.45-0.34 0.6z" fill="#089156"/> <path d="m183.06 279.69c0.08-0.14 0.24-0.43 0.33-0.57-0.09 0.14-0.25 0.43-0.33 0.57z" fill="#089156"/> <path d="m346.42 3.2196c0.08 0.13 0.23 0.41 0.31 0.55-0.08-0.14-0.23-0.42-0.31-0.55z" fill="#10985b"/> <path d="m354.54 17.35c0.05 0.08 0.13 0.23 0.18 0.3-0.05-0.07-0.13-0.22-0.18-0.3z" fill="#10985b"/> <path d="m369.55 43.36c0.04 0.07 0.13 0.21 0.17 0.29-0.04-0.08-0.13-0.22-0.17-0.29z" fill="#10985b"/> <path d="m372.44 48.25c0.08 0.13 0.23 0.4 0.31 0.54-0.08-0.14-0.23-0.41-0.31-0.54z" fill="#10985b"/> <path d="m376.53 55.37c0.05 0.07 0.13 0.21 0.17 0.29-0.04-0.08-0.12-0.22-0.17-0.29z" fill="#10985b"/> <path d="m380.48 62.24c0.08 0.13 0.23 0.39 0.31 0.52-0.08-0.13-0.23-0.39-0.31-0.52z" fill="#10985b"/> <path d="m384.51 69.22c0.08 0.13 0.23 0.4 0.31 0.53-0.08-0.13-0.23-0.4-0.31-0.53z" fill="#10985b"/> <path d="m420.57 131.65c17.39 30.13 34.89 60.21 52.14 90.43 0.08 0.13 0.24 0.41 0.32 0.54 0.4 0.66 1.2 1.97 1.59 2.62 0.08 0.13 0.24 0.4 0.32 0.53l0.8 1.37c0.05 0.09 0.15 0.28 0.21 0.37l1 1.74c0.1 0.17 0.29 0.52 0.39 0.69 0.09 0.15 0.27 0.46 0.36 0.62l0.98 1.7 0.16 0.28 0.98 1.68c0.04 0.07 0.12 0.2 0.16 0.27l0.98 1.7c0.1 0.17 0.29 0.5 0.39 0.67 0.09 0.17 0.28 0.5 0.37 0.66l1.01 1.78c0.14 0.35 0.42 1.03 0.56 1.37l0.28 0.55 0.13 0.29 0.22 0.29 0.59 0.89c0.21 0.33 0.62 0.99 0.83 1.32 0.12 0.2 0.38 0.6 0.5 0.8l0.66 1.05c0.2 0.45 0.6 1.36 0.8 1.81l0.3 0.54 0.11 0.21 0.09 0.13c0.44 0.65 1.31 1.96 1.75 2.61 0.11 0.18 0.33 0.54 0.45 0.72l0.6 1c0.09 0.16 0.27 0.47 0.36 0.62l1.01 1.77c0.09 0.16 0.27 0.48 0.36 0.64s0.27 0.47 0.36 0.63l1 1.71c0.04 0.08 0.13 0.23 0.18 0.3l0.91 1.6c0.06 0.1 0.18 0.31 0.24 0.41l0.92 1.61c0.11 0.18 0.32 0.55 0.43 0.73 0.09 0.16 0.28 0.48 0.37 0.64 0.74 1.23 1.45 2.48 2.11 3.76 0.1 0.21 0.3 0.63 0.39 0.84l0.46 1.04c0.12 0.2 0.36 0.61 0.47 0.81 0.15 0.2 0.44 0.58 0.59 0.77l0.69 0.98c0.12 0.19 0.36 0.57 0.49 0.77l1.01 1.75c0.09 0.16 0.27 0.48 0.36 0.64s0.27 0.47 0.37 0.63l1 1.72c0.04 0.08 0.12 0.22 0.16 0.29l0.95 1.66c0.04 0.07 0.12 0.2 0.16 0.27l0.97 1.69c0.1 0.17 0.3 0.51 0.4 0.69 0.1 0.17 0.3 0.51 0.39 0.68l1 1.72c0.04 0.07 0.11 0.21 0.15 0.28l1.06 1.98-0.01 0.9c-25.02-7.19-49.64-15.72-74.73-22.65-22.77-7.35-45.75-14.04-68.52-21.35 3.17-1.52 6.56-2.49 9.73-3.99 0.41-1.35 0.84-2.69 1.26-4.02 3.95-2.48 8.41-3.97 12.3-6.54 0.15-3.29 0.14-6.57 0.13-9.85 4.36-3.51 8.98-6.76 12.57-11.11 0.36-4.28-2.87-9.29 0.46-12.9 10.24-12.92 16.45-28.93 17.56-45.38 1.83-6.02-1.46-11.98-0.1-17.97z" fill="#f9c941"/> <path d="m509.91 287.41l0.52 0.02 0.29 0.76-0.59 0.04-0.22-0.82z" fill="#f9c941"/> <path d="m257.34 157.32c0.08 0.13 0.24 0.4 0.32 0.54-0.08-0.14-0.24-0.41-0.32-0.54z" fill="#e3b73a"/> <path d="m259.19 160.53c0.07 0.12 0.2 0.35 0.27 0.47-0.07-0.12-0.2-0.35-0.27-0.47z" fill="#e3b73a"/> <path d="m260.28 162.47c0.05 0.08 0.14 0.25 0.19 0.33-0.05-0.08-0.14-0.25-0.19-0.33z" fill="#e3b73a"/> <path d="m261.48 164.56c0.09 0.15 0.26 0.45 0.35 0.6-0.09-0.15-0.26-0.45-0.35-0.6z" fill="#e3b73a"/> <path d="m261.83 165.16c0.09 0.17 0.28 0.49 0.38 0.65-0.1-0.16-0.29-0.48-0.38-0.65z" fill="#e3b73a"/> <path d="m263.16 167.44c0.05 0.09 0.16 0.27 0.21 0.36-0.05-0.09-0.16-0.27-0.21-0.36z" fill="#e3b73a"/> <path d="m265.34 171.21c0.09 0.16 0.26 0.47 0.35 0.62-0.09-0.15-0.26-0.46-0.35-0.62z" fill="#e3b73a"/> <path d="m267.23 174.48c0.09 0.15 0.26 0.43 0.34 0.57-0.08-0.14-0.25-0.42-0.34-0.57z" fill="#e3b73a"/> <path d="m268.43 176.5c0.2 0.33 0.59 0.98 0.79 1.31-0.2-0.33-0.59-0.98-0.79-1.31z" fill="#e3b73a"/> <path d="m269.49 178.29c0.04 0.09 0.14 0.26 0.19 0.34-0.05-0.08-0.15-0.25-0.19-0.34z" fill="#e3b73a"/> <path d="m271.44 181.79c0.19 0.26 0.57 0.8 0.76 1.07-0.19-0.27-0.57-0.81-0.76-1.07z" fill="#e3b73a"/> <path d="m272.46 183.32c0.04 0.08 0.13 0.25 0.18 0.33-0.05-0.08-0.14-0.25-0.18-0.33z" fill="#e3b73a"/> <path d="m275.45 188.72c0.19 0.28 0.56 0.84 0.75 1.12-0.19-0.28-0.56-0.84-0.75-1.12z" fill="#e3b73a"/> <path d="m276.47 190.31c0.04 0.08 0.14 0.25 0.18 0.33-0.04-0.08-0.14-0.25-0.18-0.33z" fill="#e3b73a"/> <path d="m278.23 193.51c0.09 0.15 0.26 0.45 0.35 0.6-0.09-0.15-0.26-0.45-0.35-0.6z" fill="#e3b73a"/> <path d="m279.22 195.24c0.1 0.17 0.3 0.53 0.4 0.7-0.1-0.17-0.3-0.53-0.4-0.7z" fill="#e3b73a"/> <path d="m280.45 197.4c0.1 0.18 0.31 0.55 0.41 0.73-0.1-0.18-0.31-0.55-0.41-0.73z" fill="#e3b73a"/> <path d="m280.86 198.13c0.09 0.15 0.27 0.47 0.36 0.63-0.09-0.16-0.27-0.48-0.36-0.63z" fill="#e3b73a"/> <path d="m282.24 200.51c0.04 0.08 0.13 0.22 0.17 0.29-0.04-0.07-0.13-0.21-0.17-0.29z" fill="#e3b73a"/> <path d="m283.38 202.47c0.08 0.14 0.24 0.41 0.32 0.55-0.08-0.14-0.24-0.41-0.32-0.55z" fill="#e3b73a"/> <path d="m284.31 204.06c0.11 0.18 0.32 0.55 0.43 0.73-0.11-0.18-0.32-0.55-0.43-0.73z" fill="#e3b73a"/> <path d="m286.47 207.71c0.17 0.29 0.52 0.86 0.69 1.15-0.17-0.29-0.52-0.86-0.69-1.15z" fill="#e3b73a"/> <path d="m287.45 209.32c0.05 0.09 0.15 0.25 0.2 0.33-0.05-0.08-0.15-0.24-0.2-0.33z" fill="#e3b73a"/> <path d="m289.43 212.46l0.07 0.1 0.06 0.13c-0.03-0.06-0.1-0.17-0.13-0.23z" fill="#e3b73a"/> <path d="m291.5 216.56c0.09 0.15 0.25 0.44 0.34 0.59-0.09-0.15-0.25-0.44-0.34-0.59z" fill="#e3b73a"/> <path d="m291.84 217.15l0.4 0.68-0.4-0.68z" fill="#e3b73a"/> <path d="m293.19 219.44c0.05 0.09 0.15 0.27 0.21 0.36-0.06-0.09-0.16-0.27-0.21-0.36z" fill="#e3b73a"/> <path d="m294.06 220.98c11.53 4.24 23.46 7.26 35.11 11.11 12.52 3.71 24.94 7.72 37.49 11.32 22.77 7.31 45.75 14 68.52 21.35-0.34 4.87 0.62 9.86-0.59 14.64-0.93 4.65-6.49 5.38-8.78 9.09-30.77 0.01-61.53 0.1-92.29-0.03l-0.66-0.05c-12.71-22.6-25.93-44.92-38.8-67.43z" fill="#e3b73a"/> <path d="m472.71 222.08c0.08 0.13 0.24 0.41 0.32 0.54-0.08-0.13-0.24-0.41-0.32-0.54z" fill="#e8b835"/> <path d="m474.62 225.24c0.08 0.13 0.24 0.4 0.32 0.53-0.08-0.13-0.24-0.4-0.32-0.53z" fill="#e8b835"/> <path d="m475.74 227.14c0.05 0.09 0.15 0.28 0.21 0.37-0.06-0.09-0.16-0.28-0.21-0.37z" fill="#e8b835"/> <path d="m476.95 229.25c0.1 0.17 0.29 0.52 0.39 0.69-0.1-0.17-0.29-0.52-0.39-0.69z" fill="#e8b835"/> <path d="m477.34 229.94c0.09 0.15 0.27 0.46 0.36 0.62-0.09-0.16-0.27-0.47-0.36-0.62z" fill="#e8b835"/> <path d="m478.68 232.26l0.16 0.28-0.16-0.28z" fill="#e8b835"/> <path d="m479.82 234.22c0.04 0.07 0.12 0.2 0.16 0.27-0.04-0.07-0.12-0.2-0.16-0.27z" fill="#e8b835"/> <path d="m480.96 236.19c0.1 0.17 0.29 0.5 0.39 0.67-0.1-0.17-0.29-0.5-0.39-0.67z" fill="#e8b835"/> <path d="m481.35 236.86c0.09 0.17 0.28 0.5 0.37 0.66-0.09-0.16-0.28-0.49-0.37-0.66z" fill="#e8b835"/> <path d="m482.73 239.3c0.14 0.35 0.42 1.03 0.56 1.37-0.14-0.34-0.42-1.02-0.56-1.37z" fill="#e8b835"/> <path d="m483.57 241.22c0.09 0.15 0.26 0.44 0.35 0.58l-0.22-0.29-0.13-0.29z" fill="#e8b835"/> <path d="m484.51 242.69c0.21 0.33 0.62 0.99 0.83 1.32-0.21-0.33-0.62-0.99-0.83-1.32z" fill="#e8b835"/> <path d="m485.34 244.01c0.12 0.2 0.38 0.6 0.5 0.8-0.12-0.2-0.38-0.6-0.5-0.8z" fill="#e8b835"/> <path d="m486.5 245.86c0.2 0.45 0.6 1.36 0.8 1.81-0.2-0.45-0.6-1.36-0.8-1.81z" fill="#e8b835"/> <path d="m487.6 248.21c0.05 0.09 0.15 0.26 0.2 0.34l-0.09-0.13-0.11-0.21z" fill="#e8b835"/> <path d="m489.55 251.16c0.11 0.18 0.33 0.54 0.45 0.72-0.12-0.18-0.34-0.54-0.45-0.72z" fill="#e8b835"/> <path d="m490.6 252.88c0.09 0.16 0.27 0.47 0.36 0.62-0.09-0.15-0.27-0.46-0.36-0.62z" fill="#e8b835"/> <path d="m491.97 255.27c0.09 0.16 0.27 0.48 0.36 0.64-0.09-0.16-0.27-0.48-0.36-0.64z" fill="#e8b835"/> <path d="m492.33 255.91c0.09 0.16 0.27 0.47 0.36 0.63-0.09-0.16-0.27-0.47-0.36-0.63z" fill="#e8b835"/> <path d="m493.69 258.25c0.04 0.08 0.13 0.23 0.18 0.3-0.05-0.07-0.14-0.22-0.18-0.3z" fill="#e8b835"/> <path d="m494.78 260.15c0.06 0.1 0.18 0.31 0.24 0.41-0.06-0.1-0.18-0.31-0.24-0.41z" fill="#e8b835"/> <path d="m495.94 262.17c0.11 0.18 0.32 0.55 0.43 0.73-0.11-0.18-0.32-0.55-0.43-0.73z" fill="#e8b835"/> <path d="m496.37 262.9c0.09 0.16 0.28 0.48 0.37 0.64-0.09-0.16-0.28-0.48-0.37-0.64z" fill="#e8b835"/> <path d="m435.18 264.76c25.09 6.93 49.71 15.46 74.73 22.65l0.22 0.82c-28.09 0.64-56.22 0.11-84.32 0.26 2.29-3.71 7.85-4.44 8.78-9.09 1.21-4.78 0.25-9.77 0.59-14.64z" fill="#e8b835"/> <path d="m498.85 267.3c0.1 0.21 0.3 0.63 0.39 0.84-0.09-0.21-0.29-0.63-0.39-0.84z" fill="#e8b835"/> <path d="m499.7 269.18c0.12 0.2 0.36 0.61 0.47 0.81-0.11-0.2-0.35-0.61-0.47-0.81z" fill="#e8b835"/> <path d="m500.17 269.99c0.15 0.2 0.44 0.58 0.59 0.77-0.15-0.19-0.44-0.57-0.59-0.77z" fill="#e8b835"/> <path d="m501.45 271.74c0.12 0.19 0.36 0.57 0.49 0.77-0.13-0.2-0.37-0.58-0.49-0.77z" fill="#e8b835"/> <path d="m502.95 274.26c0.09 0.16 0.27 0.48 0.36 0.64-0.09-0.16-0.27-0.48-0.36-0.64z" fill="#e8b835"/> <path d="m503.31 274.9c0.09 0.16 0.27 0.47 0.37 0.63-0.1-0.16-0.28-0.47-0.37-0.63z" fill="#e8b835"/> <path d="m504.68 277.25c0.04 0.08 0.12 0.22 0.16 0.29-0.04-0.07-0.12-0.21-0.16-0.29z" fill="#e8b835"/> <path d="m505.79 279.2c0.04 0.07 0.12 0.2 0.16 0.27-0.04-0.07-0.12-0.2-0.16-0.27z" fill="#e8b835"/> <path d="m506.92 281.16c0.1 0.17 0.3 0.51 0.4 0.69-0.1-0.18-0.3-0.52-0.4-0.69z" fill="#e8b835"/> <path d="m507.32 281.85c0.1 0.17 0.3 0.51 0.39 0.68-0.09-0.17-0.29-0.51-0.39-0.68z" fill="#e8b835"/> <path d="m508.71 284.25c0.04 0.07 0.11 0.21 0.15 0.28-0.04-0.07-0.11-0.21-0.15-0.28z" fill="#e8b835"/> <path d="m509.92 286.51c0.13 0.23 0.38 0.69 0.51 0.92l-0.52-0.02 0.01-0.9z" fill="#e8b835"/> <path d="m147.21 341.08c10.31-17.58 20.11-35.49 30.76-52.86 51.63 0.19 103.27-0.29 154.89 0.19l0.66 0.05c-26.11 0.84-52.29-0.22-78.4 0.44-4.98 3.21-8.3 8.41-13.07 11.91-4.43 3.23-7.69 7.73-11.92 11.18-5.93 4.37-10.34 10.43-16.36 14.71-6.96 7.37-14.99 13.58-22.01 20.91-5.26 4.04-9.66 9.03-14.56 13.48-5.39 3.91-9.52 9.21-14.56 13.53-0.13 0.11-0.38 0.33-0.51 0.45-0.27 0.21-0.8 0.65-1.07 0.86-0.13 0.11-0.37 0.31-0.5 0.42-3.97 3.07-7.01 7.12-10.91 10.27-0.13 0.11-0.38 0.32-0.5 0.42-0.13 0.11-0.38 0.32-0.51 0.42-5.69 4.67-10.25 10.58-16.22 14.93-6.01 5.96-12.79 11.08-18.5 17.36-8.44 6.94-15.74 15.13-24.44 21.78 2.16-4.71 5.02-9.03 7.53-13.54 16.74-28.97 33.46-57.94 50.2-86.91z" fill="#296ad9"/> <path d="m89.04 442.17c0.11-0.16 0.33-0.48 0.44-0.64l-0.03 0.65-0.41-0.01z" fill="#296ad9"/> <path id="#2a71e9ff" fill="#2a71e9" d="m333.52 288.46c30.76 0.13 61.52 0.04 92.29 0.03 28.1-0.15 56.23 0.38 84.32-0.26l0.59-0.04 0.4 0.11v0.08c-29.66 51.27-59.23 102.6-88.89 153.88-110.93-0.03-221.86 0.1-332.78-0.08l0.03-0.65c8.7-6.65 16-14.84 24.44-21.78 5.71-6.28 12.49-11.4 18.5-17.36 5.97-4.35 10.53-10.26 16.22-14.93 0.13-0.1 0.38-0.31 0.51-0.42 0.12-0.1 0.37-0.31 0.5-0.42 3.9-3.15 6.94-7.2 10.91-10.27 0.13-0.11 0.37-0.31 0.5-0.42 0.27-0.21 0.8-0.65 1.07-0.86 0.13-0.12 0.38-0.34 0.51-0.45 5.04-4.32 9.17-9.62 14.56-13.53 4.9-4.45 9.3-9.44 14.56-13.48 7.02-7.33 15.05-13.54 22.01-20.91 6.02-4.28 10.43-10.34 16.36-14.71 4.23-3.45 7.49-7.95 11.92-11.18 4.77-3.5 8.09-8.7 13.07-11.91 26.11-0.66 52.29 0.4 78.4-0.44z"/> <path d="m162.13 375.07c0.13-0.12 0.38-0.34 0.51-0.45-0.13 0.11-0.38 0.33-0.51 0.45z" fill="#286ee6"/> <path d="m161.06 375.93c0.27-0.21 0.8-0.65 1.07-0.86-0.27 0.21-0.8 0.65-1.07 0.86z" fill="#286ee6"/> <path d="m160.56 376.35c0.13-0.11 0.37-0.31 0.5-0.42-0.13 0.11-0.37 0.31-0.5 0.42z" fill="#286ee6"/> <path d="m149.15 387.04c0.12-0.1 0.37-0.31 0.5-0.42-0.13 0.11-0.38 0.32-0.5 0.42z" fill="#286ee6"/> <path d="m148.64 387.46c0.13-0.1 0.38-0.31 0.51-0.42-0.13 0.11-0.38 0.32-0.51 0.42z" fill="#286ee6"/> </svg> </div> <div class="rs-box rs-box-initial" aria-hidden="false"> <h3 class="rs-small-headline">Connect your storage</h3> <span class="rs-sub-headline">To sync data with your account</span> </div> <div class="rs-box rs-box-connected" aria-hidden="true"> <div class="rs-connected-text"> <h1 class="rs-user rs-small-headline">user@provider.com</h1> <span class="rs-sub-headline">Connected</span> </div> <div class="rs-connected-buttons"> <button class="rs-button rs-button-small rs-sync" title="Sync now"> <svg class="rs-icon rs-loop-icon" xml:space="preserve" version="1.1" x="0px" y="0px" height="16" width="16" viewBox="0 0 512 512" style="enable-background:new 0 0 512 512" xmlns="http://www.w3.org/2000/svg"> <path d="m273.4 300.5l-0.3 58c48.9-8.2 86.3-51 86.3-102.5 0-15.9-3.6-31-10-44.5-2.8-5.8-6-11.3-9.8-16.5l47.1-43.5c1.1 1.3 2.1 2.7 3.1 4 20.9 28 33.2 62.8 33.2 100.5v3.7c-1.5 71.5-47.6 132-111.4 154.6-12.3 4.3-25.2 7.3-38.5 8.7l-0.1 57-76.2-67-26.2-23 44.4-38.7 58.4-50.8z"/> <path d="m89 252.3c1.6-72.1 48.3-133 112.9-155.2 11.7-4 24-6.8 36.8-8.1l0.1-57 76.1 66.9 26.2 23.1-44.3 38.6-58.4 50.9 0.2-57.9c-48.8 8.3-86 51.1-86 102.4 0 16 3.6 31.1 10.1 44.7 2.7 5.8 6 11.2 9.7 16.3l-47 43.6c-1.3-1.6-2.6-3.3-3.8-5-20.5-27.9-32.6-62.3-32.6-99.6v-3.7z"/> </svg> </button> <button class="rs-button rs-button-small rs-disconnect" title="Disconnect"> <svg class="rs-icon rs-power-icon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" style="enable-background:new 0 0 512 512" xml:space="preserve" viewBox="0 0 512 512" version="1.1"> <path d="m256 256c-17.7 0-32-14.3-32-32v-160c0-17.7 14.3-32 32-32s32 14.3 32 32v160c0 17.7-14.3 32-32 32z"/> <path d="m379 68.8c-5-3-10.8-4.8-17-4.8-17.7 0-32 14.3-32 32 0 6.2 1.8 12 4.8 16.9 2 3.2 4.6 6.1 7.6 8.4 1.2 0.9 2.4 1.7 3.7 2.5 8.1 5.6 15.8 11.9 23 19.1 30.3 30.2 46.9 70.4 46.9 113.1s-16.6 82.9-46.9 113.1c-30.2 30.3-70.4 46.9-113.1 46.9s-82.9-16.6-113.1-46.9c-30.3-30.2-46.9-70.4-46.9-113.1s16.6-82.9 46.9-113.1c7.1-7.1 14.8-13.5 22.9-19 1.4-0.8 2.6-1.6 3.9-2.6 3-2.3 5.5-5.1 7.5-8.3 3.1-4.9 4.8-10.7 4.8-16.9 0-17.7-14.3-32-32-32-6.2 0-12 1.8-16.9 4.8l-0.1-0.1c-60.8 40-101 108.9-101 187.2 0 123.7 100.3 224 224 224s224-100.3 224-224c0-78.3-40.2-147.2-101-187.2z"/> </svg> </button> </div> </div> <div class="rs-box rs-box-error" aria-hidden="true"> <div class="rs-error-message"></div> <div class="rs-error-buttons"> <a href="#" class="rs-reconnect rs-hidden">Renew</a> <button class="rs-button rs-button-small rs-disconnect" title="Disconnect"> <svg class="rs-icon rs-power-icon" xmlns="http://www.w3.org/2000/svg" x="0px" y="0px" width="16" height="16" style="enable-background:new 0 0 512 512" xml:space="preserve" viewBox="0 0 512 512" version="1.1"> <path d="m256 256c-17.7 0-32-14.3-32-32v-160c0-17.7 14.3-32 32-32s32 14.3 32 32v160c0 17.7-14.3 32-32 32z"/> <path d="m379 68.8c-5-3-10.8-4.8-17-4.8-17.7 0-32 14.3-32 32 0 6.2 1.8 12 4.8 16.9 2 3.2 4.6 6.1 7.6 8.4 1.2 0.9 2.4 1.7 3.7 2.5 8.1 5.6 15.8 11.9 23 19.1 30.3 30.2 46.9 70.4 46.9 113.1s-16.6 82.9-46.9 113.1c-30.2 30.3-70.4 46.9-113.1 46.9s-82.9-16.6-113.1-46.9c-30.3-30.2-46.9-70.4-46.9-113.1s16.6-82.9 46.9-113.1c7.1-7.1 14.8-13.5 22.9-19 1.4-0.8 2.6-1.6 3.9-2.6 3-2.3 5.5-5.1 7.5-8.3 3.1-4.9 4.8-10.7 4.8-16.9 0-17.7-14.3-32-32-32-6.2 0-12 1.8-16.9 4.8l-0.1-0.1c-60.8 40-101 108.9-101 187.2 0 123.7 100.3 224 224 224s224-100.3 224-224c0-78.3-40.2-147.2-101-187.2z"/> </svg> </button> </div> </div> <div class="rs-box rs-box-choose" aria-hidden="true"> <div class="rs-content"> <h1 class="rs-big-headline">Connect your storage</h1> <p class="rs-short-desc"> This app allows you to sync data with a <a class="rs-help" href="https://remotestorage.io/" target="_blank" rel="noopener">storage provider of your choice</a>. </p> <div class="rs-button-wrap"> <button class="rs-button rs-button-big rs-choose-rs"> <svg class="rs-logo" fill-rule="evenodd" height="40" width="40" xmlns="http://www.w3.org/2000/svg" version="1.1" style="shape-rendering:geometricPrecision;image-rendering:optimizeQuality;text-rendering:geometricPrecision" clip-rule="evenodd" xml:space="preserve" viewBox="0 0 739 853"> <g> <polygon class="rs-logo-shape" points="370 754 0 542 0 640 185 747 370 853 554 747 739 640 739 525 739 525 739 476 739 427 739 378 653 427 370 589 86 427 86 427 86 361 185 418 370 524 554 418 653 361 739 311 739 213 739 213 554 107 370 0 185 107 58 180 144 230 228 181 370 100 511 181 652 263 370 425 87 263 87 263 0 213 0 213 0 311 0 378 0 427 0 476 86 525 185 582 370 689 554 582 653 525 653 590 653 592"/> </g> </svg> <div>RemoteStorage</div> </button> <button class="rs-button rs-button-big rs-choose-dropbox"> <svg class="dropbox-logo" width="40" height="40" xml:space="preserve" stroke-miterlimit="1.4142" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 104 97" stroke-linejoin="round" version="1.1" clip-rule="evenodd"> <path d="m30.691 0l-30.691 20.039 21.221 16.994 30.946-19.108-21.476-17.925z" fill="#007ee5"/> <path d="m0 54.028l30.691 20.039 21.476-17.926-30.945-19.108-21.222 16.995z" fill="#007ee5"/> <path d="m52.167 56.142l21.477 17.926 30.696-20.039-21.227-16.995-30.946 19.108z" fill="#007ee5"/> <path d="m104.34 20.039l-30.696-20.039-21.477 17.925 30.946 19.108 21.227-16.994z" fill="#007ee5"/> <path d="m52.23 59.998l-21.538 17.873-9.218-6.018v6.747l30.756 18.443 30.756-18.443v-6.747l-9.216 6.018-21.54-17.873z" fill="#007ee5"/> </svg> <div>Dropbox</div> </button> <button class="rs-button rs-button-big rs-choose-googledrive"> <svg class="googledrive-logo" width="40" height="40" version="1.1" stroke-miterlimit="1.4142" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" width="100%" stroke-linejoin="round" clip-rule="evenodd" viewBox="0 0 511 442" height="100%"> <path d="m166.23 0.10955l0.44-0.009998 0.04 0.49-0.56 0.02 0.08-0.5z" fill="#0ba25e"/> <path d="m164.52 3.3896c0.39-0.56 1.15-1.68 1.54-2.24l0.7-0.11c0.52 6.34 2.38 12.45 3.78 18.62 6.02 26.81 12.1 53.6 18.43 80.33 4.15 18.33 8.78 36.57 12.58 54.97 3.3 11.39 5.07 23.14 8.26 34.55 2.06 10.64 5.29 21.02 7.02 31.72-0.7 1.17-1.4 2.35-2.11 3.52-0.17 0.27-0.53 0.83-0.7 1.11l-0.26 0.45c-0.04 0.08-0.13 0.25-0.18 0.33-0.39 0.72-1.17 2.15-1.56 2.86-0.07 0.13-0.22 0.39-0.3 0.52l-0.71 1.26c-0.09 0.15-0.26 0.44-0.34 0.59l-0.83 1.45c-0.04 0.08-0.13 0.24-0.18 0.32l-1.03 1.8c-0.09 0.15-0.27 0.47-0.36 0.63-0.1 0.17-0.3 0.5-0.4 0.67l-1.01 1.74c-0.08 0.13-0.24 0.41-0.32 0.54l-0.62 1.05c-0.1 0.18-0.32 0.55-0.42 0.73-0.4 0.69-1.19 2.07-1.59 2.77-0.07 0.12-0.22 0.37-0.29 0.5l-0.63 1.05c-0.1 0.19-0.32 0.55-0.43 0.74-0.37 0.65-1.13 1.94-1.5 2.59-0.09 0.15-0.26 0.46-0.35 0.61l-0.75 1.35c-0.07 0.12-0.21 0.37-0.28 0.49l-0.77 1.35-0.32 0.56c-0.4 0.66-1.18 1.99-1.57 2.66-0.09 0.15-0.27 0.46-0.36 0.62l-0.71 1.28c-0.07 0.12-0.2 0.35-0.26 0.47l-0.82 1.42c-0.07 0.13-0.22 0.38-0.29 0.5-0.42 0.72-1.25 2.15-1.67 2.87-0.07 0.13-0.23 0.39-0.31 0.52l-0.6 0.99c-0.1 0.18-0.31 0.53-0.41 0.71-0.38 0.66-1.13 1.97-1.51 2.63-0.06 0.11-0.2 0.35-0.26 0.46l-0.82 1.46c-0.06 0.11-0.18 0.32-0.24 0.43l-0.84 1.47c-0.07 0.11-0.21 0.35-0.28 0.46-0.39 0.66-1.18 1.96-1.57 2.62-0.11 0.17-0.31 0.53-0.42 0.71l-0.59 1.1c-0.08 0.14-0.23 0.42-0.3 0.55l-1.03 1.78c-0.08 0.15-0.26 0.45-0.34 0.6-0.09 0.14-0.25 0.43-0.33 0.57-1.69 2.85-3.22 5.79-5.09 8.53-10.65 17.37-20.45 35.28-30.76 52.86-16.74 28.97-33.46 57.94-50.2 86.91-2.51 4.51-5.37 8.83-7.53 13.54-0.11 0.16-0.33 0.48-0.44 0.64-4.01-5.78-7.11-12.16-10.78-18.16-16.74-28.99-33.49-57.97-50.22-86.97-9.3-16.31-18.99-32.42-28.04-48.88 35.84-61.85 71.52-123.81 107.29-185.7 0.03-0.06 0.1-0.17 0.13-0.23l0.98-1.68c0.04-0.07 0.12-0.21 0.17-0.28l0.99-1.69c0.09-0.15 0.27-0.47 0.37-0.62 0.1-0.18 0.3-0.53 0.4-0.71l0.99-1.76 0.28-0.48 0.74-1.18c0.13-0.19 0.39-0.58 0.52-0.78 0.36-0.54 1.09-1.63 1.46-2.17 0.04-0.18 0.11-0.53 0.15-0.7l0.87-1.67 0.16-0.28 1-1.68c0.1-0.16 0.3-0.5 0.4-0.67 0.11-0.19 0.33-0.58 0.45-0.78l0.84-1.47c0.09-0.16 0.27-0.47 0.36-0.62l0.7-1.23c0.08-0.13 0.24-0.41 0.32-0.55 0.39-0.67 1.17-2.01 1.57-2.68l0.32-0.56 0.73-1.33c0.06-0.1 0.18-0.32 0.24-0.42l0.96-1.68c0.12-0.2 0.37-0.61 0.5-0.81l0.65-0.98c0.14-0.2 0.41-0.59 0.55-0.78 0.12-0.2 0.37-0.6 0.5-0.8l0.54-1.04c0.18-0.39 0.55-1.17 0.73-1.56l0.55-0.77c0.1-0.14 0.29-0.41 0.39-0.55 0.37-0.31 1.12-0.95 1.49-1.27l-0.07-1.17c0.06-0.14 0.2-0.42 0.27-0.56l0.85-1.69c0.07-0.12 0.21-0.37 0.28-0.49l0.75-1.22c0.14-0.2 0.41-0.6 0.55-0.8 0.34-0.56 1.03-1.66 1.37-2.21 0.1-0.2 0.28-0.59 0.38-0.79l0.53-1.15c0.16-0.3 0.5-0.91 0.67-1.22l0.66-0.94c0.14-0.19 0.42-0.57 0.56-0.76 0.12-0.2 0.37-0.6 0.49-0.8l0.49-1.03c0.11-0.23 0.34-0.7 0.45-0.93l0.86-1.66c0.13-0.2 0.38-0.62 0.5-0.83l0.66-0.98c0.14-0.2 0.42-0.58 0.56-0.78 0.13-0.2 0.38-0.61 0.5-0.81l0.51-1.04c0.15-0.29 0.44-0.86 0.58-1.15l0.68-1.12c0.12-0.19 0.36-0.57 0.49-0.76 0.36-0.56 1.09-1.68 1.46-2.23 0.04-0.17 0.13-0.51 0.17-0.68l0.87-1.66c0.03-0.07 0.11-0.2 0.15-0.27l1-1.71c0.1-0.17 0.29-0.5 0.39-0.67 0.1-0.16 0.29-0.5 0.39-0.66l1-1.75c0.04-0.07 0.12-0.21 0.16-0.29l0.94-1.63c0.05-0.07 0.14-0.22 0.18-0.3l1.01-1.7c0.09-0.16 0.27-0.46 0.36-0.62 0.1-0.17 0.3-0.52 0.4-0.7l0.96-1.69c0.06-0.11 0.18-0.32 0.24-0.42l0.81-1.31c0.13-0.19 0.39-0.58 0.51-0.77 0.37-0.55 1.09-1.65 1.46-2.2 0.03-0.17 0.11-0.51 0.15-0.68l0.85-1.63c0.07-0.12 0.22-0.37 0.29-0.5l0.76-1.19c0.14-0.19 0.4-0.58 0.54-0.78 0.35-0.56 1.05-1.67 1.4-2.23 0.05-0.16 0.14-0.48 0.19-0.64l0.88-1.65c0.04-0.08 0.12-0.22 0.16-0.3l1.02-1.7204c0.08-0.15 0.26-0.45 0.35-0.6 0.09-0.17 0.27-0.49 0.36-0.65l1-1.78c0.05-0.07 0.13-0.22 0.17-0.29l0.95-1.61c0.03-0.05 0.1-0.16 0.13-0.21z" fill="#0ba25e"/> <path id="#fccd48ff" fill="#fccd48" d="m166.67 0.099552c32.48-0.15 64.97-0.02 97.46-0.07 26.88 0.099998 53.78-0.21 80.65 0.15 0.53 1.02 1.07 2.03 1.64 3.04 0.08 0.13 0.23 0.41 0.31 0.55 2.6 4.53 5.24 9.0404 7.81 13.58 0.05 0.08 0.13 0.23 0.18 0.3 4.98 8.55 9.94 17.11 14.83 25.71 0.04 0.07 0.13 0.21 0.17 0.29 0.89 1.53 1.81 3.06 2.72 4.6 0.08 0.13 0.23 0.4 0.31 0.54 1.25 2.2 2.51 4.39 3.78 6.58 0.05 0.07 0.13 0.21 0.17 0.29 1.27 2.18 2.52 4.38 3.78 6.58 0.08 0.13 0.23 0.39 0.31 0.52 1.27 2.14 2.5 4.3 3.72 6.46 0.08 0.13 0.23 0.4 0.31 0.53 11.94 20.62 23.85 41.25 35.75 61.9-1.36 5.99 1.93 11.95 0.1 17.97-1.11 16.45-7.32 32.46-17.56 45.38-3.33 3.61-0.1 8.62-0.46 12.9-3.59 4.35-8.21 7.6-12.57 11.11 0.01 3.28 0.02 6.56-0.13 9.85-3.89 2.57-8.35 4.06-12.3 6.54-0.42 1.33-0.85 2.67-1.26 4.02-3.17 1.5-6.56 2.47-9.73 3.99-12.55-3.6-24.97-7.61-37.49-11.32-11.65-3.85-23.58-6.87-35.11-11.11l-0.66-1.18c-0.06-0.09-0.16-0.27-0.21-0.36l-0.95-1.61-0.4-0.68c-0.09-0.15-0.25-0.44-0.34-0.59-0.71-1.26-1.36-2.55-1.94-3.87l-0.06-0.13-0.07-0.1c-0.44-0.7-1.33-2.11-1.78-2.81-0.05-0.08-0.15-0.24-0.2-0.33l-0.29-0.46c-0.17-0.29-0.52-0.86-0.69-1.15-0.43-0.73-1.3-2.19-1.73-2.92-0.11-0.18-0.32-0.55-0.43-0.73l-0.61-1.04c-0.08-0.14-0.24-0.41-0.32-0.55l-0.97-1.67c-0.04-0.07-0.13-0.21-0.17-0.29l-1.02-1.75c-0.09-0.16-0.27-0.48-0.36-0.63-0.1-0.18-0.31-0.55-0.41-0.73l-0.83-1.46c-0.1-0.17-0.3-0.53-0.4-0.7l-0.64-1.13c-0.09-0.15-0.26-0.45-0.35-0.6-0.39-0.72-1.18-2.15-1.58-2.87-0.04-0.08-0.14-0.25-0.18-0.33l-0.27-0.47c-0.19-0.28-0.56-0.84-0.75-1.12-0.99-1.66-1.92-3.36-2.81-5.07-0.05-0.08-0.14-0.25-0.18-0.33l-0.26-0.46c-0.19-0.27-0.57-0.81-0.76-1.07-0.44-0.79-1.32-2.37-1.76-3.16-0.05-0.08-0.15-0.25-0.19-0.34l-0.27-0.48c-0.2-0.33-0.59-0.98-0.79-1.31l-0.86-1.45c-0.08-0.14-0.25-0.42-0.34-0.57-0.38-0.66-1.15-1.99-1.54-2.65-0.09-0.15-0.26-0.46-0.35-0.62-0.68-1.13-1.33-2.27-1.97-3.41-0.05-0.09-0.16-0.27-0.21-0.36l-0.95-1.63c-0.1-0.16-0.29-0.48-0.38-0.65-0.09-0.15-0.26-0.45-0.35-0.6l-1.01-1.76c-0.05-0.08-0.14-0.25-0.19-0.33l-0.82-1.47c-0.07-0.12-0.2-0.35-0.27-0.47-0.38-0.67-1.15-2-1.53-2.67-0.08-0.14-0.24-0.41-0.32-0.54-0.62-1.03-1.24-2.07-1.84-3.1-27.73-48.12-55.5-96.21-83.29-144.3-1.74-3.0004-3.32-6.1204-5.45-8.8804l-0.05-0.45005-0.04-0.49z"/> <path d="m166.15 0.60955l0.56-0.02 0.05 0.45005-0.7 0.11 0.09-0.54005z" fill="#089156"/> <path d="m166.76 1.0396c2.13 2.76 3.71 5.88 5.45 8.88 27.79 48.09 55.56 96.18 83.29 144.3-12.84 22.36-25.78 44.67-38.67 67.01-1.73-10.7-4.96-21.08-7.02-31.72-3.19-11.41-4.96-23.16-8.26-34.55-3.8-18.4-8.43-36.64-12.58-54.97-6.33-26.73-12.41-53.52-18.43-80.33-1.4-6.17-3.26-12.28-3.78-18.62z" fill="#089156"/> <path d="m164.39 3.5996c0.03-0.05 0.1-0.16 0.13-0.21-0.03 0.05-0.1 0.16-0.13 0.21z" fill="#089156"/> <path d="m163.27 5.4996c0.05-0.07 0.13-0.22 0.17-0.29-0.04 0.07-0.12 0.22-0.17 0.29z" fill="#089156"/> <path d="m161.91 7.9296c0.09-0.17 0.27-0.49 0.36-0.65-0.09 0.16-0.27 0.48-0.36 0.65z" fill="#089156"/> <path d="m161.56 8.5296c0.08-0.15 0.26-0.45 0.35-0.6-0.09 0.15-0.27 0.45-0.35 0.6z" fill="#089156"/> <path d="m160.38 10.55c0.04-0.08 0.12-0.22 0.16-0.3-0.04 0.08-0.12 0.22-0.16 0.3z" fill="#089156"/> <path d="m159.31 12.84c0.05-0.16 0.14-0.48 0.19-0.64-0.05 0.16-0.14 0.48-0.19 0.64z" fill="#089156"/> <path d="m157.91 15.07c0.35-0.56 1.05-1.67 1.4-2.23-0.35 0.56-1.05 1.67-1.4 2.23z" fill="#089156"/> <path d="m157.37 15.85c0.14-0.19 0.4-0.58 0.54-0.78-0.14 0.2-0.4 0.59-0.54 0.78z" fill="#089156"/> <path d="m156.32 17.54c0.07-0.12 0.22-0.37 0.29-0.5-0.07 0.13-0.22 0.38-0.29 0.5z" fill="#089156"/> <path d="m155.32 19.85c0.03-0.17 0.11-0.51 0.15-0.68-0.04 0.17-0.12 0.51-0.15 0.68z" fill="#089156"/> <path d="m153.86 22.05c0.37-0.55 1.09-1.65 1.46-2.2-0.37 0.55-1.09 1.65-1.46 2.2z" fill="#089156"/> <path d="m153.35 22.82c0.13-0.19 0.39-0.58 0.51-0.77-0.12 0.19-0.38 0.58-0.51 0.77z" fill="#089156"/> <path d="m152.3 24.55c0.06-0.11 0.18-0.32 0.24-0.42-0.06 0.1-0.18 0.31-0.24 0.42z" fill="#089156"/> <path d="m150.94 26.94c0.1-0.17 0.3-0.52 0.4-0.7-0.1 0.18-0.3 0.53-0.4 0.7z" fill="#089156"/> <path d="m150.58 27.56c0.09-0.16 0.27-0.46 0.36-0.62-0.09 0.16-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m149.39 29.56c0.05-0.07 0.14-0.22 0.18-0.3-0.04 0.08-0.13 0.23-0.18 0.3z" fill="#089156"/> <path d="m148.29 31.48c0.04-0.07 0.12-0.21 0.16-0.29-0.04 0.08-0.12 0.22-0.16 0.29z" fill="#089156"/> <path d="m146.9 33.89c0.1-0.16 0.29-0.5 0.39-0.66-0.1 0.16-0.29 0.5-0.39 0.66z" fill="#089156"/> <path d="m146.51 34.56c0.1-0.17 0.29-0.5 0.39-0.67-0.1 0.17-0.29 0.5-0.39 0.67z" fill="#089156"/> <path d="m145.36 36.54c0.03-0.07 0.11-0.2 0.15-0.27-0.04 0.07-0.12 0.2-0.15 0.27z" fill="#089156"/> <path d="m144.32 38.88c0.04-0.17 0.13-0.51 0.17-0.68-0.04 0.17-0.13 0.51-0.17 0.68z" fill="#089156"/> <path d="m142.86 41.11c0.36-0.56 1.09-1.68 1.46-2.23-0.37 0.55-1.1 1.67-1.46 2.23z" fill="#089156"/> <path d="m142.37 41.87c0.12-0.19 0.36-0.57 0.49-0.76-0.13 0.19-0.37 0.57-0.49 0.76z" fill="#089156"/> <path d="m141.11 44.14c0.15-0.29 0.44-0.86 0.58-1.15-0.14 0.29-0.43 0.86-0.58 1.15z" fill="#089156"/> <path d="m140.1 45.99c0.13-0.2 0.38-0.61 0.5-0.81-0.12 0.2-0.37 0.61-0.5 0.81z" fill="#089156"/> <path d="m139.54 46.77c0.14-0.2 0.42-0.58 0.56-0.78-0.14 0.2-0.42 0.58-0.56 0.78z" fill="#089156"/> <path d="m138.38 48.58c0.13-0.2 0.38-0.62 0.5-0.83-0.12 0.21-0.37 0.63-0.5 0.83z" fill="#089156"/> <path d="m137.07 51.17c0.11-0.23 0.34-0.7 0.45-0.93-0.11 0.23-0.34 0.7-0.45 0.93z" fill="#089156"/> <path d="m136.09 53c0.12-0.2 0.37-0.6 0.49-0.8-0.12 0.2-0.37 0.6-0.49 0.8z" fill="#089156"/> <path d="m135.53 53.76c0.14-0.19 0.42-0.57 0.56-0.76-0.14 0.19-0.42 0.57-0.56 0.76z" fill="#089156"/> <path d="m134.2 55.92c0.16-0.3 0.5-0.91 0.67-1.22-0.17 0.31-0.51 0.92-0.67 1.22z" fill="#089156"/> <path d="m133.29 57.86c0.1-0.2 0.28-0.59 0.38-0.79-0.1 0.2-0.28 0.59-0.38 0.79z" fill="#089156"/> <path d="m131.92 60.07c0.34-0.56 1.03-1.66 1.37-2.21-0.34 0.55-1.03 1.65-1.37 2.21z" fill="#089156"/> <path d="m131.37 60.87c0.14-0.2 0.41-0.6 0.55-0.8-0.14 0.2-0.41 0.6-0.55 0.8z" fill="#089156"/> <path d="m130.34 62.58c0.07-0.12 0.21-0.37 0.28-0.49-0.07 0.12-0.21 0.37-0.28 0.49z" fill="#089156"/> <path d="m129.22 64.83c0.06-0.14 0.2-0.42 0.27-0.56-0.07 0.14-0.21 0.42-0.27 0.56z" fill="#089156"/> <path d="m127.8 67.27c0.35-0.61 1.06-1.83 1.42-2.44l0.07 1.17c-0.37 0.32-1.12 0.96-1.49 1.27z" fill="#089156"/> <path d="m127.41 67.82c0.1-0.14 0.29-0.41 0.39-0.55-0.1 0.14-0.29 0.41-0.39 0.55z" fill="#089156"/> <path d="m126.13 70.15c0.18-0.39 0.55-1.17 0.73-1.56-0.18 0.39-0.55 1.17-0.73 1.56z" fill="#089156"/> <path d="m125.09 71.99c0.12-0.2 0.37-0.6 0.5-0.8-0.13 0.2-0.38 0.6-0.5 0.8z" fill="#089156"/> <path d="m124.54 72.77c0.14-0.2 0.41-0.59 0.55-0.78-0.14 0.19-0.41 0.58-0.55 0.78z" fill="#089156"/> <path d="m123.39 74.56c0.12-0.2 0.37-0.61 0.5-0.81-0.13 0.2-0.38 0.61-0.5 0.81z" fill="#089156"/> <path d="m122.19 76.66c0.06-0.1 0.18-0.32 0.24-0.42-0.06 0.1-0.18 0.32-0.24 0.42z" fill="#089156"/> <path d="m121.14 78.55l0.32-0.56-0.32 0.56z" fill="#089156"/> <path d="m119.25 81.78c0.08-0.13 0.24-0.41 0.32-0.55-0.08 0.14-0.24 0.42-0.32 0.55z" fill="#089156"/> <path d="m118.19 83.63c0.09-0.16 0.27-0.47 0.36-0.62-0.09 0.15-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m116.9 85.88c0.11-0.19 0.33-0.58 0.45-0.78-0.12 0.2-0.34 0.59-0.45 0.78z" fill="#089156"/> <path d="m116.5 86.55c0.1-0.16 0.3-0.5 0.4-0.67-0.1 0.17-0.3 0.51-0.4 0.67z" fill="#089156"/> <path d="m115.34 88.51l0.16-0.28-0.16 0.28z" fill="#089156"/> <path d="m114.32 90.88c0.04-0.18 0.11-0.53 0.15-0.7-0.04 0.17-0.11 0.52-0.15 0.7z" fill="#089156"/> <path d="m112.86 93.05c0.36-0.54 1.09-1.63 1.46-2.17-0.37 0.54-1.1 1.63-1.46 2.17z" fill="#089156"/> <path d="m112.34 93.83c0.13-0.19 0.39-0.58 0.52-0.78-0.13 0.2-0.39 0.59-0.52 0.78z" fill="#089156"/> <path d="m111.32 95.49l0.28-0.48-0.28 0.48z" fill="#089156"/> <path d="m109.93 97.96c0.1-0.18 0.3-0.53 0.4-0.71-0.1 0.18-0.3 0.53-0.4 0.71z" fill="#089156"/> <path d="m109.56 98.58c0.09-0.15 0.27-0.47 0.37-0.62-0.1 0.15-0.28 0.47-0.37 0.62z" fill="#089156"/> <path d="m108.4 100.55c0.04-0.07 0.12-0.21 0.17-0.28-0.05 0.07-0.13 0.21-0.17 0.28z" fill="#089156"/> <path d="m107.29 102.46c0.03-0.06 0.1-0.17 0.13-0.23-0.03 0.06-0.1 0.17-0.13 0.23z" fill="#089156"/> <path d="m214.02 225.86c0.17-0.28 0.53-0.84 0.7-1.11-0.17 0.27-0.53 0.83-0.7 1.11z" fill="#089156"/> <path d="m213.58 226.64c0.05-0.08 0.14-0.25 0.18-0.33-0.04 0.08-0.13 0.25-0.18 0.33z" fill="#089156"/> <path d="m211.72 230.02c0.08-0.13 0.23-0.39 0.3-0.52-0.07 0.13-0.22 0.39-0.3 0.52z" fill="#089156"/> <path d="m210.67 231.87c0.08-0.15 0.25-0.44 0.34-0.59-0.09 0.15-0.26 0.44-0.34 0.59z" fill="#089156"/> <path d="m209.66 233.64c0.05-0.08 0.14-0.24 0.18-0.32-0.04 0.08-0.13 0.24-0.18 0.32z" fill="#089156"/> <path d="m208.27 236.07c0.09-0.16 0.27-0.48 0.36-0.63-0.09 0.15-0.27 0.47-0.36 0.63z" fill="#089156"/> <path d="m207.87 236.74c0.1-0.17 0.3-0.5 0.4-0.67-0.1 0.17-0.3 0.5-0.4 0.67z" fill="#089156"/> <path d="m206.54 239.02c0.08-0.13 0.24-0.41 0.32-0.54-0.08 0.13-0.24 0.41-0.32 0.54z" fill="#089156"/> <path d="m205.5 240.8c0.1-0.18 0.32-0.55 0.42-0.73-0.1 0.18-0.32 0.55-0.42 0.73z" fill="#089156"/> <path d="m203.62 244.07c0.07-0.13 0.22-0.38 0.29-0.5-0.07 0.12-0.22 0.37-0.29 0.5z" fill="#089156"/> <path d="m202.56 245.86c0.11-0.19 0.33-0.55 0.43-0.74-0.1 0.19-0.32 0.55-0.43 0.74z" fill="#089156"/> <path d="m200.71 249.06c0.09-0.15 0.26-0.46 0.35-0.61-0.09 0.15-0.26 0.46-0.35 0.61z" fill="#089156"/> <path d="m199.68 250.9c0.07-0.12 0.21-0.37 0.28-0.49-0.07 0.12-0.21 0.37-0.28 0.49z" fill="#089156"/> <path d="m198.59 252.81l0.32-0.56-0.32 0.56z" fill="#089156"/> <path d="m196.66 256.09c0.09-0.16 0.27-0.47 0.36-0.62-0.09 0.15-0.27 0.46-0.36 0.62z" fill="#089156"/> <path d="m195.69 257.84c0.06-0.12 0.19-0.35 0.26-0.47-0.07 0.12-0.2 0.35-0.26 0.47z" fill="#089156"/> <path d="m194.58 259.76c0.07-0.12 0.22-0.37 0.29-0.5-0.07 0.13-0.22 0.38-0.29 0.5z" fill="#089156"/> <path d="m192.6 263.15c0.08-0.13 0.24-0.39 0.31-0.52-0.07 0.13-0.23 0.39-0.31 0.52z" fill="#089156"/> <path d="m191.59 264.85c0.1-0.18 0.31-0.53 0.41-0.71-0.1 0.18-0.31 0.53-0.41 0.71z" fill="#089156"/> <path d="m189.82 267.94c0.06-0.11 0.2-0.35 0.26-0.46-0.06 0.11-0.2 0.35-0.26 0.46z" fill="#089156"/> <path d="m188.76 269.83c0.06-0.11 0.18-0.32 0.24-0.43-0.06 0.11-0.18 0.32-0.24 0.43z" fill="#089156"/> <path d="m187.64 271.76c0.07-0.11 0.21-0.35 0.28-0.46-0.07 0.11-0.21 0.35-0.28 0.46z" fill="#089156"/> <path d="m185.65 275.09c0.11-0.18 0.31-0.54 0.42-0.71-0.11 0.17-0.31 0.53-0.42 0.71z" fill="#089156"/> <path d="m184.76 276.74c0.07-0.13 0.22-0.41 0.3-0.55-0.08 0.14-0.23 0.42-0.3 0.55z" fill="#089156"/> <path d="m183.39 279.12c0.08-0.15 0.26-0.45 0.34-0.6-0.08 0.15-0.26 0.45-0.34 0.6z" fill="#089156"/> <path d="m183.06 279.69c0.08-0.14 0.24-0.43 0.33-0.57-0.09 0.14-0.25 0.43-0.33 0.57z" fill="#089156"/> <path d="m346.42 3.2196c0.08 0.13 0.23 0.41 0.31 0.55-0.08-0.14-0.23-0.42-0.31-0.55z" fill="#10985b"/> <path d="m354.54 17.35c0.05 0.08 0.13 0.23 0.18 0.3-0.05-0.07-0.13-0.22-0.18-0.3z" fill="#10985b"/> <path d="m369.55 43.36c0.04 0.07 0.13 0.21 0.17 0.29-0.04-0.08-0.13-0.22-0.17-0.29z" fill="#10985b"/> <path d="m372.44 48.25c0.08 0.13 0.23 0.4 0.31 0.54-0.08-0.14-0.23-0.41-0.31-0.54z" fill="#10985b"/> <path d="m376.53 55.37c0.05 0.07 0.13 0.21 0.17 0.29-0.04-0.08-0.12-0.22-0.17-0.29z" fill="#10985b"/> <path d="m380.48 62.24c0.08 0.13 0.23 0.39 0.31 0.52-0.08-0.13-0.23-0.39-0.31-0.52z" fill="#10985b"/> <path d="m384.51 69.22c0.08 0.13 0.23 0.4 0.31 0.53-0.08-0.13-0.23-0.4-0.31-0.53z" fill="#10985b"/> <path d="m420.57 131.65c17.39 30.13 34.89 60.21 52.14 90.43 0.08 0.13 0.24 0.41 0.32 0.54 0.4 0.66 1.2 1.97 1.59 2.62 0.08 0.13 0.24 0.4 0.32 0.53l0.8 1.37c0.05 0.09 0.15 0.28 0.21 0.37l1 1.74c0.1 0.17 0.29 0.52 0.39 0.69 0.09 0.15 0.27 0.46 0.36 0.62l0.98 1.7 0.16 0.28 0.98 1.68c0.04 0.07 0.12 0.2 0.16 0.27l0.98 1.7c0.1 0.17 0.29 0.5 0.39 0.67 0.09 0.17 0.28 0.5 0.37 0.66l1.01 1.78c0.14 0.35 0.42 1.03 0.56 1.37l0.28 0.55 0.13 0.29 0.22 0.29 0.59 0.89c0.21 0.33 0.62 0.99 0.83 1.32 0.12 0.2 0.38 0.6 0.5 0.8l0.66 1.05c0.2 0.45 0.6 1.36 0.8 1.81l0.3 0.54 0.11 0.21 0.09 0.13c0.44 0.65 1.31 1.96 1.75 2.61 0.11 0.18 0.33 0.54 0.45 0.72l0.6 1c0.09 0.16 0.27 0.47 0.36 0.62l1.01 1.77c0.09 0.16 0.27 0.48 0.36 0.64s0.27 0.47 0.36 0.63l1 1.71c0.04 0.08 0.13 0.23 0.18 0.3l0.91 1.6c0.06 0.1 0.18 0.31 0.24 0.41l0.92 1.61c0.11 0.18 0.32 0.55 0.43 0.73 0.09 0.16 0.28 0.48 0.37 0.64 0.74 1.23 1.45 2.48 2.11 3.76 0.1 0.21 0.3 0.63 0.39 0.84l0.46 1.04c0.12 0.2 0.36 0.61 0.47 0.81 0.15 0.2 0.44 0.58 0.59 0.77l0.69 0.98c0.12 0.19 0.36 0.57 0.49 0.77l1.01 1.75c0.09 0.16 0.27 0.48 0.36 0.64s0.27 0.47 0.37 0.63l1 1.72c0.04 0.08 0.12 0.22 0.16 0.29l0.95 1.66c0.04 0.07 0.12 0.2 0.16 0.27l0.97 1.69c0.1 0.17 0.3 0.51 0.4 0.69 0.1 0.17 0.3 0.51 0.39 0.68l1 1.72c0.04 0.07 0.11 0.21 0.15 0.28l1.06 1.98-0.01 0.9c-25.02-7.19-49.64-15.72-74.73-22.65-22.77-7.35-45.75-14.04-68.52-21.35 3.17-1.52 6.56-2.49 9.73-3.99 0.41-1.35 0.84-2.69 1.26-4.02 3.95-2.48 8.41-3.97 12.3-6.54 0.15-3.29 0.14-6.57 0.13-9.85 4.36-3.51 8.98-6.76 12.57-11.11 0.36-4.28-2.87-9.29 0.46-12.9 10.24-12.92 16.45-28.93 17.56-45.38 1.83-6.02-1.46-11.98-0.1-17.97z" fill="#f9c941"/> <path d="m509.91 287.41l0.52 0.02 0.29 0.76-0.59 0.04-0.22-0.82z" fill="#f9c941"/> <path d="m257.34 157.32c0.08 0.13 0.24 0.4 0.32 0.54-0.08-0.14-0.24-0.41-0.32-0.54z" fill="#e3b73a"/> <path d="m259.19 160.53c0.07 0.12 0.2 0.35 0.27 0.47-0.07-0.12-0.2-0.35-0.27-0.47z" fill="#e3b73a"/> <path d="m260.28 162.47c0.05 0.08 0.14 0.25 0.19 0.33-0.05-0.08-0.14-0.25-0.19-0.33z" fill="#e3b73a"/> <path d="m261.48 164.56c0.09 0.15 0.26 0.45 0.35 0.6-0.09-0.15-0.26-0.45-0.35-0.6z" fill="#e3b73a"/> <path d="m261.83 165.16c0.09 0.17 0.28 0.49 0.38 0.65-0.1-0.16-0.29-0.48-0.38-0.65z" fill="#e3b73a"/> <path d="m263.16 167.44c0.05 0.09 0.16 0.27 0.21 0.36-0.05-0.09-0.16-0.27-0.21-0.36z" fill="#e3b73a"/> <path d="m265.34 171.21c0.09 0.16 0.26 0.47 0.35 0.62-0.09-0.15-0.26-0.46-0.35-0.62z" fill="#e3b73a"/> <path d="m267.23 174.48c0.09 0.15 0.26 0.43 0.34 0.57-0.08-0.14-0.25-0.42-0.34-0.57z" fill="#e3b73a"/> <path d="m268.43 176.5c0.2 0.33 0.59 0.98 0.79 1.31-0.2-0.33-0.59-0.98-0.79-1.31z" fill="#e3b73a"/> <path d="m269.49 178.29c0.04 0.09 0.14 0.26 0.19 0.34-0.05-0.08-0.15-0.25-0.19-0.34z" fill="#e3b73a"/> <path d="m271.44 181.79c0.19 0.26 0.57 0.8 0.76 1.07-0.19-0.27-0.57-0.81-0.76-1.07z" fill="#e3b73a"/> <path d="m272.46 183.32c0.04 0.08 0.13 0.25 0.18 0.33-0.05-0.08-0.14-0.25-0.18-0.33z" fill="#e3b73a"/> <path d="m275.45 188.72c0.19 0.28 0.56 0.84 0.75 1.12-0.19-0.28-0.56-0.84-0.75-1.12z" fill="#e3b73a"/> <path d="m276.47 190.31c0.04 0.08 0.14 0.25 0.18 0.33-0.04-0.08-0.14-0.25-0.18-0.33z" fill="#e3b73a"/> <path d="m278.23 193.51c0.09 0.15 0.26 0.45 0.35 0.6-0.09-0.15-0.26-0.45-0.35-0.6z" fill="#e3b73a"/> <path d="m279.22 195.24c0.1 0.17 0.3 0.53 0.4 0.7-0.1-0.17-0.3-0.53-0.4-0.7z" fill="#e3b73a"/> <path d="m280.45 197.4c0.1 0.18 0.31 0.55 0.41 0.73-0.1-0.18-0.31-0.55-0.41-0.73z" fill="#e3b73a"/> <path d="m280.86 198.13c0.09 0.15 0.27 0.47 0.36 0.63-0.09-0.16-0.27-0.48-0.36-0.63z" fill="#e3b73a"/> <path d="m282.24 200.51c0.04 0.08 0.13 0.22 0.17 0.29-0.04-0.07-0.13-0.21-0.17-0.29z" fill="#e3b73a"/> <path d="m283.38 202.47c0.08 0.14 0.24 0.41 0.32 0.55-0.08-0.14-0.24-0.41-0.32-0.55z" fill="#e3b73a"/> <path d="m284.31 204.06c0.11 0.18 0.32 0.55 0.43 0.73-0.11-0.18-0.32-0.55-0.43-0.73z" fill="#e3b73a"/> <path d="m286.47 207.71c0.17 0.29 0.52 0.86 0.69 1.15-0.17-0.29-0.52-0.86-0.69-1.15z" fill="#e3b73a"/> <path d="m287.45 209.32c0.05 0.09 0.15 0.25 0.2 0.33-0.05-0.08-0.15-0.24-0.2-0.33z" fill="#e3b73a"/> <path d="m289.43 212.46l0.07 0.1 0.06 0.13c-0.03-0.06-0.1-0.17-0.13-0.23z" fill="#e3b73a"/> <path d="m291.5 216.56c0.09 0.15 0.25 0.44 0.34 0.59-0.09-0.15-0.25-0.44-0.34-0.59z" fill="#e3b73a"/> <path d="m291.84 217.15l0.4 0.68-0.4-0.68z" fill="#e3b73a"/> <path d="m293.19 219.44c0.05 0.09 0.15 0.27 0.21 0.36-0.06-0.09-0.16-0.27-0.21-0.36z" fill="#e3b73a"/> <path d="m294.06 220.98c11.53 4.24 23.46 7.26 35.11 11.11 12.52 3.71 24.94 7.72 37.49 11.32 22.77 7.31 45.75 14 68.52 21.35-0.34 4.87 0.62 9.86-0.59 14.64-0.93 4.65-6.49 5.38-8.78 9.09-30.77 0.01-61.53 0.1-92.29-0.03l-0.66-0.05c-12.71-22.6-25.93-44.92-38.8-67.43z" fill="#e3b73a"/> <path d="m472.71 222.08c0.08 0.13 0.24 0.41 0.32 0.54-0.08-0.13-0.24-0.41-0.32-0.54z" fill="#e8b835"/> <path d="m474.62 225.24c0.08 0.13 0.24 0.4 0.32 0.53-0.08-0.13-0.24-0.4-0.32-0.53z" fill="#e8b835"/> <path d="m475.74 227.14c0.05 0.09 0.15 0.28 0.21 0.37-0.06-0.09-0.16-0.28-0.21-0.37z" fill="#e8b835"/> <path d="m476.95 229.25c0.1 0.17 0.29 0.52 0.39 0.69-0.1-0.17-0.29-0.52-0.39-0.69z" fill="#e8b835"/> <path d="m477.34 229.94c0.09 0.15 0.27 0.46 0.36 0.62-0.09-0.16-0.27-0.47-0.36-0.62z" fill="#e8b835"/> <path d="m478.68 232.26l0.16 0.28-0.16-0.28z" fill="#e8b835"/> <path d="m479.82 234.22c0.04 0.07 0.12 0.2 0.16 0.27-0.04-0.07-0.12-0.2-0.16-0.27z" fill="#e8b835"/> <path d="m480.96 236.19c0.1 0.17 0.29 0.5 0.39 0.67-0.1-0.17-0.29-0.5-0.39-0.67z" fill="#e8b835"/> <path d="m481.35 236.86c0.09 0.17 0.28 0.5 0.37 0.66-0.09-0.16-0.28-0.49-0.37-0.66z" fill="#e8b835"/> <path d="m482.73 239.3c0.14 0.35 0.42 1.03 0.56 1.37-0.14-0.34-0.42-1.02-0.56-1.37z" fill="#e8b835"/> <path d="m483.57 241.22c0.09 0.15 0.26 0.44 0.35 0.58l-0.22-0.29-0.13-0.29z" fill="#e8b835"/> <path d="m484.51 242.69c0.21 0.33 0.62 0.99 0.83 1.32-0.21-0.33-0.62-0.99-0.83-1.32z" fill="#e8b835"/> <path d="m485.34 244.01c0.12 0.2 0.38 0.6 0.5 0.8-0.12-0.2-0.38-0.6-0.5-0.8z" fill="#e8b835"/> <path d="m486.5 245.86c0.2 0.45 0.6 1.36 0.8 1.81-0.2-0.45-0.6-1.36-0.8-1.81z" fill="#e8b835"/> <path d="m487.6 248.21c0.05 0.09 0.15 0.26 0.2 0.34l-0.09-0.13-0.11-0.21z" fill="#e8b835"/> <path d="m489.55 251.16c0.11 0.18 0.33 0.54 0.45 0.72-0.12-0.18-0.34-0.54-0.45-0.72z" fill="#e8b835"/> <path d="m490.6 252.88c0.09 0.16 0.27 0.47 0.36 0.62-0.09-0.15-0.27-0.46-0.36-0.62z" fill="#e8b835"/> <path d="m491.97 255.27c0.09 0.16 0.27 0.48 0.36 0.64-0.09-0.16-0.27-0.48-0.36-0.64z" fill="#e8b835"/> <path d="m492.33 255.91c0.09 0.16 0.27 0.47 0.36 0.63-0.09-0.16-0.27-0.47-0.36-0.63z" fill="#e8b835"/> <path d="m493.69 258.25c0.04 0.08 0.13 0.23 0.18 0.3-0.05-0.07-0.14-0.22-0.18-0.3z" fill="#e8b835"/> <path d="m494.78 260.15c0.06 0.1 0.18 0.31 0.24 0.41-0.06-0.1-0.18-0.31-0.24-0.41z" fill="#e8b835"/> <path d="m495.94 262.17c0.11 0.18 0.32 0.55 0.43 0.73-0.11-0.18-0.32-0.55-0.43-0.73z" fill="#e8b835"/> <path d="m496.37 262.9c0.09 0.16 0.28 0.48 0.37 0.64-0.09-0.16-0.28-0.48-0.37-0.64z" fill="#e8b835"/> <path d="m435.18 264.76c25.09 6.93 49.71 15.46 74.73 22.65l0.22 0.82c-28.09 0.64-56.22 0.11-84.32 0.26 2.29-3.71 7.85-4.44 8.78-9.09 1.21-4.78 0.25-9.77 0.59-14.64z" fill="#e8b835"/> <path d="m498.85 267.3c0.1 0.21 0.3 0.63 0.39 0.84-0.09-0.21-0.29-0.63-0.39-0.84z" fill="#e8b835"/> <path d="m499.7 269.18c0.12 0.2 0.36 0.61 0.47 0.81-0.11-0.2-0.35-0.61-0.47-0.81z" fill="#e8b835"/> <path d="m500.17 269.99c0.15 0.2 0.44 0.58 0.59 0.77-0.15-0.19-0.44-0.57-0.59-0.77z" fill="#e8b835"/> <path d="m501.45 271.74c0.12 0.19 0.36 0.57 0.49 0.77-0.13-0.2-0.37-0.58-0.49-0.77z" fill="#e8b835"/> <path d="m502.95 274.26c0.09 0.16 0.27 0.48 0.36 0.64-0.09-0.16-0.27-0.48-0.36-0.64z" fill="#e8b835"/> <path d="m503.31 274.9c0.09 0.16 0.27 0.47 0.37 0.63-0.1-0.16-0.28-0.47-0.37-0.63z" fill="#e8b835"/> <path d="m504.68 277.25c0.04 0.08 0.12 0.22 0.16 0.29-0.04-0.07-0.12-0.21-0.16-0.29z" fill="#e8b835"/> <path d="m505.79 279.2c0.04 0.07 0.12 0.2 0.16 0.27-0.04-0.07-0.12-0.2-0.16-0.27z" fill="#e8b835"/> <path d="m506.92 281.16c0.1 0.17 0.3 0.51 0.4 0.69-0.1-0.18-0.3-0.52-0.4-0.69z" fill="#e8b835"/> <path d="m507.32 281.85c0.1 0.17 0.3 0.51 0.39 0.68-0.09-0.17-0.29-0.51-0.39-0.68z" fill="#e8b835"/> <path d="m508.71 284.25c0.04 0.07 0.11 0.21 0.15 0.28-0.04-0.07-0.11-0.21-0.15-0.28z" fill="#e8b835"/> <path d="m509.92 286.51c0.13 0.23 0.38 0.69 0.51 0.92l-0.52-0.02 0.01-0.9z" fill="#e8b835"/> <path d="m147.21 341.08c10.31-17.58 20.11-35.49 30.76-52.86 51.63 0.19 103.27-0.29 154.89 0.19l0.66 0.05c-26.11 0.84-52.29-0.22-78.4 0.44-4.98 3.21-8.3 8.41-13.07 11.91-4.43 3.23-7.69 7.73-11.92 11.18-5.93 4.37-10.34 10.43-16.36 14.71-6.96 7.37-14.99 13.58-22.01 20.91-5.26 4.04-9.66 9.03-14.56 13.48-5.39 3.91-9.52 9.21-14.56 13.53-0.13 0.11-0.38 0.33-0.51 0.45-0.27 0.21-0.8 0.65-1.07 0.86-0.13 0.11-0.37 0.31-0.5 0.42-3.97 3.07-7.01 7.12-10.91 10.27-0.13 0.11-0.38 0.32-0.5 0.42-0.13 0.11-0.38 0.32-0.51 0.42-5.69 4.67-10.25 10.58-16.22 14.93-6.01 5.96-12.79 11.08-18.5 17.36-8.44 6.94-15.74 15.13-24.44 21.78 2.16-4.71 5.02-9.03 7.53-13.54 16.74-28.97 33.46-57.94 50.2-86.91z" fill="#296ad9"/> <path d="m89.04 442.17c0.11-0.16 0.33-0.48 0.44-0.64l-0.03 0.65-0.41-0.01z" fill="#296ad9"/> <path id="#2a71e9ff" fill="#2a71e9" d="m333.52 288.46c30.76 0.13 61.52 0.04 92.29 0.03 28.1-0.15 56.23 0.38 84.32-0.26l0.59-0.04 0.4 0.11v0.08c-29.66 51.27-59.23 102.6-88.89 153.88-110.93-0.03-221.86 0.1-332.78-0.08l0.03-0.65c8.7-6.65 16-14.84 24.44-21.78 5.71-6.28 12.49-11.4 18.5-17.36 5.97-4.35 10.53-10.26 16.22-14.93 0.13-0.1 0.38-0.31 0.51-0.42 0.12-0.1 0.37-0.31 0.5-0.42 3.9-3.15 6.94-7.2 10.91-10.27 0.13-0.11 0.37-0.31 0.5-0.42 0.27-0.21 0.8-0.65 1.07-0.86 0.13-0.12 0.38-0.34 0.51-0.45 5.04-4.32 9.17-9.62 14.56-13.53 4.9-4.45 9.3-9.44 14.56-13.48 7.02-7.33 15.05-13.54 22.01-20.91 6.02-4.28 10.43-10.34 16.36-14.71 4.23-3.45 7.49-7.95 11.92-11.18 4.77-3.5 8.09-8.7 13.07-11.91 26.11-0.66 52.29 0.4 78.4-0.44z"/> <path d="m162.13 375.07c0.13-0.12 0.38-0.34 0.51-0.45-0.13 0.11-0.38 0.33-0.51 0.45z" fill="#286ee6"/> <path d="m161.06 375.93c0.27-0.21 0.8-0.65 1.07-0.86-0.27 0.21-0.8 0.65-1.07 0.86z" fill="#286ee6"/> <path d="m160.56 376.35c0.13-0.11 0.37-0.31 0.5-0.42-0.13 0.11-0.37 0.31-0.5 0.42z" fill="#286ee6"/> <path d="m149.15 387.04c0.12-0.1 0.37-0.31 0.5-0.42-0.13 0.11-0.38 0.32-0.5 0.42z" fill="#286ee6"/> <path d="m148.64 387.46c0.13-0.1 0.38-0.31 0.51-0.42-0.13 0.11-0.38 0.32-0.51 0.42z" fill="#286ee6"/> </svg> <div>Google Drive</div> </button> </div> </div> </div> <div class="rs-box rs-box-sign-in" aria-hidden="true"> <div class="rs-content"> <form name="rs-sign-in-form" class="rs-sign-in-form"> <h1 class="rs-big-headline">Connect your storage</h1> <input type="text" name="rs-user-address" placeholder="user@provider.com" autocapitalize="off"> <div class="rs-sign-in-error rs-hidden"></div> <button type="submit" class="rs-connect">Connect</button> <a href="https://remotestorage.io/get/" class="rs-help" target="_blank" rel="noopener">Need help?</a> </form> </div> </div> </div> ';var e=document.createElement("style");return e.innerHTML='#remotestorage-widget {\n z-index: 21000000;\n}\n\n.rs-widget {\n box-sizing: border-box;\n overflow: hidden;\n max-width: 350px;\n padding: 10px;\n margin: 10px;\n border-radius: 3px;\n background-color: #fff;\n box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1), 0 3px 8px 0 rgba(0,0,0,0.2);\n font-family: arial, sans-serif;\n font-size: 16px;\n color: #333;\n will-change: max-height, height, width, opacity, max-width, background, box-shadow;\n transition-property: width, height, opacity, max-width, max-height, background, box-shadow;\n transition-duration: 300ms;\n}\n\n.rs-widget * {\n box-sizing: border-box;\n}\n\n.rs-widget .rs-hidden {\n display: none;\n}\n\n.rs-box {\n overflow: hidden;\n will-change: height;\n transition-property: height, width, max-height;\n transition-duration: 300ms;\n transition-timing-function: ease-in;\n opacity: 0;\n max-height: 0px;\n}\n\n.rs-box.rs-selected:not([aria-hidden=true]) {\n opacity: 1;\n max-height: 420px;\n}\n\n/* Main logo */\n.rs-main-logo {\n float: left;\n height: 36px;\n width: 36px;\n margin-top: 1px;\n margin-right: 0.625em;\n transition: margin-left 300ms ease-out, transform 300ms ease-out;\n cursor: pointer;\n}\n.rs-widget .rs-backend-remotestorage svg#rs-main-logo-remotestorage {\n display: block;\n}\n.rs-widget[class*="rs-backend-"]:not(.rs-backend-remotestorage) svg#rs-main-logo-remotestorage {\n display: none;\n}\n.rs-widget.rs-backend-dropbox svg#rs-main-logo-dropbox {\n display: block;\n}\n.rs-widget:not(.rs-backend-dropbox) svg#rs-main-logo-dropbox {\n display: none;\n}\n.rs-widget.rs-backend-googledrive svg#rs-main-logo-googledrive {\n display: block;\n}\n.rs-widget:not(.rs-backend-googledrive) svg#rs-main-logo-googledrive {\n display: none;\n}\n\npolygon.rs-logo-shape {\n fill: #FF4B03;\n}\n\npolygon.rs-logo-shape,\n#rs-main-logo-dropbox path,\n#rs-main-logo-googledrive path {\n transition-property: fill;\n transition-duration: 0.5s;\n}\n\n.rs-offline polygon.rs-logo-shape,\n.rs-offline #rs-main-logo-dropbox path,\n.rs-offline #rs-main-logo-googledrive path {\n fill: #888;\n transition-property: fill;\n transition-duration: 0.5s;\n}\n\n/* Hide everything except logo when connected and clicked outside of box */\n.rs-closed {\n max-width: 56px;\n background-color: transparent;\n box-shadow: none;\n opacity: 0.5;\n\n transition: max-height 100ms ease-out 0ms, max-width 300ms ease-out 300ms, background 300ms ease-in 200ms, opacity 300ms ease 200ms;\n}\n\n.rs-closed:hover {\n cursor: pointer;\n opacity: 1;\n}\n\n.rs-box-initial {\n transition-duration: 0ms;\n}\n\n.rs-box-initial:hover {\n cursor: pointer;\n}\n\n.rs-widget a {\n color: #0093cc;\n}\n\n/* HEADLINE */\n.rs-small-headline {\n font-size: 1em;\n font-weight: bold;\n margin: 0;\n margin-bottom: 2px;\n height: 1.2em;\n word-break: break-all;\n overflow: hidden;\n line-height: 1em;\n}\n\n.rs-sub-headline {\n word-break: break-all;\n overflow: hidden;\n color: #666;\n font-size: 0.92em;\n height: 1.2em;\n}\n.rs-big-headline {\n font-size: 1.625em;\n font-weight: normal;\n text-align: center;\n margin-top: 20px;\n margin-bottom: 20px;\n}\n\n/* BUTTONS */\n.rs-button {\n font: inherit;\n color: inherit;\n background-color: transparent;\n border: 1px solid #dcdcdc;\n border-radius: 3px;\n cursor: pointer;\n}\n.rs-button-small {\n padding: 0.6em 0.7em;\n margin-left: 0.2em;\n transition: border-color 300ms ease-out;\n}\n.rs-button-small svg {\n vertical-align: top;\n}\n.rs-button-wrap {\n margin-top: 10px;\n}\n\n.rs-button-wrap img,\n.rs-button-wrap svg {\n float: left;\n margin-right: 0.6em;\n width: 40px;\n height: 40px;\n}\n\n.rs-button-big {\n padding: 15px 10px;\n margin-bottom: 10px;\n display: block;\n width: 100%;\n text-align: left;\n transition: box-shadow 200ms;\n}\n.rs-button-big > div {\n font-size: 1.125em;\n padding: 10px 0;\n}\n.rs-button-big:hover {\n box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1), 0 3px 8px 0 rgba(0,0,0,0.2);\n}\n.rs-button-big:active {\n background-color: #eee;\n box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1), 0 3px 8px 0 rgba(0,0,0,0.2);\n}\n.rs-button-big:last-child {\n margin-bottom: 0;\n}\n\n.rs-content {\n padding: 0 10px 10px 10px;\n}\n\n\n.rs-state-choose .rs-main-logo,\n.rs-state-sign-in .rs-main-logo {\n margin-left: 45%;\n float: none;\n}\n\n.rs-sign-in-form input[type=text] {\n padding: 15px 10px;\n display: block;\n width: 100%;\n font: inherit;\n height: 52px;\n border: 1px solid #aaa;\n border-radius: 0;\n box-shadow: none;\n}\n.rs-sign-in-form button.rs-connect {\n padding: 15px 10px;\n margin-top: 20px;\n margin-bottom: 15px;\n display: block;\n width: 100%;\n border: none;\n border-radius: 3px;\n background-color: #3fb34f;\n font: inherit;\n color: #fff;\n transition: box-shadow 200ms, background-color 200ms;\n}\n\n.rs-sign-in-form button.rs-connect:hover {\n cursor: pointer;\n background-color: #4BCB5D;\n box-shadow: 0 1px 2px 0 rgba(0,0,0,0.1), 0 3px 8px 0 rgba(0,0,0,0.2);\n}\n\n.rs-sign-in-form button.rs-connect:active {\n background-color: #3fb34f;\n}\n\n.rs-sign-in-form button.rs-connect:disabled,\n.rs-sign-in-form button.rs-connect:disabled:hover {\n background-color: #aaa;\n}\n\n.rs-sign-in-form button.rs-connecting svg {\n height: 1em;\n width: auto;\n vertical-align: middle;\n margin-left: 0.5em;\n animation: rs-spin 1s linear infinite;\n}\n\n.rs-sign-in-error.rs-hidden,\n.rs-box-error.rs-hidden {\n height: 0;\n}\n\n.rs-sign-in-error.rs-visible,\n.rs-box-error.rs-visible {\n height: auto;\n border-radius: 3px;\n padding: 0.5em 0.5em;\n margin-top: 0.5em;\n text-align: center;\n background-color: rgba(255,0,0,0.1);\n color: darkred;\n}\n\n.rs-box-error {\n display: flex;\n flex-direction: row;\n}\n\n.rs-box-error .rs-error-message {\n flex: auto;\n}\n\n /*Choose provider box */\n.rs-box-choose {\n text-align: center;\n overflow: hidden;\n}\n\n.rs-box-choose p {\n margin-top: 0;\n margin-bottom: 20px;\n line-height: 1.4em;\n}\n\n/*Connected box */\n.rs-box-connected {\n display: flex;\n flex-direction: row;\n height: 40px;\n transition: height 0s;\n}\n.rs-connected-text {\n flex: auto;\n min-width: 0;\n}\n.rs-box-connected .rs-user {\n font-weight: bold;\n text-overflow: ellipsis;\n overflow: hidden;\n word-break: keep-all;\n}\n.rs-connected-buttons, .rs-error-buttons {\n flex: none;\n}\n.rs-disconnect:hover {\n border-color: #FF2D2D;\n}\n.rs-disconnect:hover .rs-icon{\n fill: #FF2D2D;\n}\n.rs-sync:hover {\n border-color: #FFBB0C;\n}\n.rs-sync:hover .rs-icon {\n fill: #FFBB0C;\n}\n.rs-sync.rs-rotate {\n border-color: #FFBB0C;\n}\n.rs-sync.rs-rotate .rs-icon {\n fill: #FFBB0C;\n animation: rs-spin 1s linear infinite;\n}\n\n/* Floating widget styles (top right corner) */\n.rs-floating {\n position: fixed;\n top: 0;\n right: 0;\n}\n\n@keyframes rs-spin {\n 100% {\n transform: rotate(360deg);\n transform: rotate(360deg);\n }\n}\n\n/* Small/mobile screens */\n@media screen and (max-width: 420px) {\n .rs-widget {\n font-size: 100%;\n transition: all 300ms ease-out;\n max-width: 400px;\n }\n .rs-floating {\n position: relative;\n top: auto;\n right: auto\n }\n .rs-closed {\n max-width: 56px;\n }\n .rs-state-choose,\n .rs-state-sign-in {\n position: fixed;\n top: 0;\n left: 0;\n right: 0;\n max-width: 100%;\n }\n}\n\n/* remove dotted outline border on Firefox */\n.rs-widget a:focus,\n.rs-widget a:active,\n.rs-widget button:focus,\n.rs-widget input:focus {\n outline:none;\n}\n.rs-widget button::-moz-focus-inner,\n.rs-widget input[type="button"]::-moz-focus-inner {\n border:0;\n}\n\n/* prevent rounded buttons on mobile Safari */\n.rs-widget button,\n.rs-widget input[type="button"] {\n -webkit-appearance: none;\n}\n\n.remotestorage-widget-modal-backdrop {\n display: none;\n position: fixed;\n top: 0;\n bottom: 0;\n left: 0;\n right: 0;\n background-color: rgba(0, 0, 0, 0.5);\n opacity: 0;\n transition: opacity 0.3s linear;\n}\n\n.remotestorage-widget-modal-backdrop.visible {\n opacity: 1;\n transition: opacity 0.3s linear;\n}\n',t.appendChild(e),t}},{key:"setModalClass",value:function(){if(this.modalBackdrop){if("onlySmallScreens"===this.modalBackdrop&&!this.isSmallScreen())return;this.rsWidget.classList.add("rs-modal")}}},{key:"setupElements",value:function(){if(!this.parentContainerEl)throw new Error("Parent container element not found");this.rsWidget=this.parentContainerEl.querySelector(".rs-widget"),this.rsBackdrop=this.parentContainerEl.querySelector(".remotestorage-widget-modal-backdrop"),this.rsInitial=this.parentContainerEl.querySelector(".rs-box-initial"),this.rsChoose=this.parentContainerEl.querySelector(".rs-box-choose"),this.rsConnected=this.parentContainerEl.querySelector(".rs-box-connected"),this.rsSignIn=this.parentContainerEl.querySelector(".rs-box-sign-in"),this.rsConnectedLabel=this.parentContainerEl.querySelector(".rs-box-connected .rs-sub-headline"),this.rsChooseRemoteStorageButton=this.parentContainerEl.querySelector("button.rs-choose-rs"),this.rsChooseDropboxButton=this.parentContainerEl.querySelector("button.rs-choose-dropbox"),this.rsChooseGoogleDriveButton=this.parentContainerEl.querySelector("button.rs-choose-googledrive"),this.rsErrorBox=this.parentContainerEl.querySelector(".rs-box-error .rs-error-message"),this.rs.apiKeys.hasOwnProperty("googledrive")||this.rsChooseGoogleDriveButton.parentNode.removeChild(this.rsChooseGoogleDriveButton),this.rs.apiKeys.hasOwnProperty("dropbox")||this.rsChooseDropboxButton.parentNode.removeChild(this.rsChooseDropboxButton),this.rsSignInForm=this.parentContainerEl.querySelector(".rs-sign-in-form"),this.rsAddressInput=this.rsSignInForm.querySelector("input[name=rs-user-address]"),this.rsConnectButton=this.parentContainerEl.querySelector(".rs-connect"),this.rsDisconnectButton=this.parentContainerEl.querySelector(".rs-disconnect"),this.rsSyncButton=this.parentContainerEl.querySelector(".rs-sync"),this.rsLogo=this.parentContainerEl.querySelector(".rs-widget-icon"),this.rsErrorReconnectLink=this.parentContainerEl.querySelector(".rs-box-error a.rs-reconnect"),this.rsErrorDisconnectButton=this.parentContainerEl.querySelector(".rs-box-error button.rs-disconnect"),this.rsConnectedUser=this.parentContainerEl.querySelector(".rs-connected-text h1.rs-user")}},{key:"setupHandlers",value:function(){var t=this;this.rs.on("connected",function(){return t.eventHandler("connected")}),this.rs.on("ready",function(){return t.eventHandler("ready")}),this.rs.on("disconnected",function(){return t.eventHandler("disconnected")}),this.rs.on("network-online",function(){return t.eventHandler("network-online")}),this.rs.on("network-offline",function(){return t.eventHandler("network-offline")}),this.rs.on("error",function(e){return t.eventHandler("error",e)}),this.setEventListeners(),this.setClickHandlers()}},{key:"attach",value:function(t){var e=this.createHtmlTemplate(t);if(this.parentContainerEl,t instanceof HTMLElement)this.parentContainerEl=t;else if("string"==typeof t){if(this.parentContainerEl=document.getElementById(t),!this.parentContainerEl)throw new Error('Failed to find target DOM element with id="'+t+'"')}else{if(t)throw new Error("Unknown element type. Expected instance of HTMLElement or type of string.");this.parentContainerEl=document.body}this.parentContainerEl.appendChild(e),this.setupElements(),this.setupHandlers(),this.setInitialState(),this.setModalClass()}},{key:"setEventListeners",value:function(){var t=this;this.rsSignInForm.addEventListener("submit",function(e){e.preventDefault();var n=t.parentContainerEl.querySelector("input[name=rs-user-address]").value;t.disableConnectButton(),t.rs.connect(n)})}},{key:"showChooseOrSignIn",value:function(){this.rsWidget.classList.contains("rs-modal")&&(this.rsBackdrop.style.display="block",this.rsBackdrop.classList.add("visible")),this.rs.apiKeys&&Object.keys(this.rs.apiKeys).length>0?this.setState("choose"):this.setState("sign-in")}},{key:"setClickHandlers",value:function(){var t=this;this.rsInitial.addEventListener("click",function(){return t.showChooseOrSignIn()}),this.rsChooseRemoteStorageButton.addEventListener("click",function(){t.setState("sign-in"),t.rsAddressInput.focus()}),this.rsChooseDropboxButton.addEventListener("click",function(){return t.rs.dropbox.connect()}),this.rsChooseGoogleDriveButton.addEventListener("click",function(){return t.rs.googledrive.connect()}),this.rsDisconnectButton.addEventListener("click",function(){return t.rs.disconnect()}),this.rsErrorReconnectLink.addEventListener("click",function(){return t.rs.reconnect()}),this.rsErrorDisconnectButton.addEventListener("click",function(){return t.rs.disconnect()}),this.rs.hasFeature("Sync")&&this.rsSyncButton.addEventListener("click",function(){t.rsSyncButton.classList.contains("rs-rotate")?(t.rs.stopSync(),t.rsSyncButton.classList.remove("rs-rotate")):(t.rsConnectedLabel.textContent="Synchronizing",t.rs.startSync(),t.rsSyncButton.classList.add("rs-rotate"))}),document.addEventListener("click",function(){return t.close()}),this.rsWidget.addEventListener("click",function(t){return t.stopPropagation()}),this.rsLogo.addEventListener("click",function(){return t.toggle()})}},{key:"toggle",value:function(){this.closed?this.open():"initial"===this.state?this.showChooseOrSignIn():this.close()}},{key:"open",value:function(){this.closed=!1,this.rsWidget.classList.remove("rs-closed"),this.shouldCloseWhenSyncDone=!1;var t=this.parentContainerEl.querySelector(".rs-box.rs-selected");t&&t.setAttribute("aria-hidden","false")}},{key:"close",value:function(){var t=this;if("error"!==this.state){if(!this.leaveOpen&&this.active){this.closed=!0,this.rsWidget.classList.add("rs-closed");var e=this.parentContainerEl.querySelector(".rs-box.rs-selected");e&&e.setAttribute("aria-hidden","true")}else this.active?this.setState("connected"):this.setInitialState();this.rsWidget.classList.contains("rs-modal")&&(this.rsBackdrop.classList.remove("visible"),setTimeout(function(){t.rsBackdrop.style.display="none"},300))}}},{key:"disableConnectButton",value:function(){this.rsConnectButton.disabled=!0,this.rsConnectButton.classList.add("rs-connecting"),this.rsConnectButton.innerHTML="Connecting ".concat('<svg width="38" height="38" viewBox="0 0 38 38" xmlns="http://www.w3.org/2000/svg" stroke="#fff">\n <g fill="none" fill-rule="evenodd">\n <g transform="translate(1 1)" stroke-width="2">\n <circle stroke-opacity=".5" cx="18" cy="18" r="18"/>\n <path d="M36 18c0-9.94-8.06-18-18-18"></path>\n </g>\n </g>\n</svg>\n')}},{key:"enableConnectButton",value:function(){this.rsConnectButton.disabled=!1,this.rsConnectButton.textContent="Connect",this.rsConnectButton.classList.remove("rs-connecting")}},{key:"setOffline",value:function(){this.online&&(this.rsWidget.classList.add("rs-offline"),this.rsConnectedLabel.textContent="Offline",this.online=!1)}},{key:"setOnline",value:function(){this.online||(this.rsWidget.classList.remove("rs-offline"),this.active&&(this.rsConnectedLabel.textContent="Connected")),this.online=!0}},{key:"setBackendClass",value:function(t){this.rsWidget.classList.remove("rs-backend-remotestorage"),this.rsWidget.classList.remove("rs-backend-dropbox"),this.rsWidget.classList.remove("rs-backend-googledrive"),t&&this.rsWidget.classList.add("rs-backend-".concat(t))}},{key:"showErrorBox",value:function(t){this.rsErrorBox.innerHTML=t,this.setState("error")}},{key:"hideErrorBox",value:function(){this.rsErrorBox.innerHTML="",this.close()}},{key:"handleSyncStarted",value:function(){var t=this;this.syncInProgress=!0,this.rsSyncButton.classList.add("rs-rotate"),setTimeout(function(){t.syncInProgress&&(t.rsConnectedLabel.textContent="Synchronizing")},1e3)}},{key:"handleDiscoveryError",value:function(t){var e=this.parentContainerEl.querySelector(".rs-sign-in-error");e.innerHTML=t.message,e.classList.remove("rs-hidden"),e.classList.add("rs-visible"),this.enableConnectButton()}},{key:"handleSyncError",value:function(){this.setOffline()}},{key:"handleUnauthorized",value:function(t){t.code&&"access_denied"===t.code?this.rs.disconnect():(this.open(),this.showErrorBox(t.message+" "),this.rsErrorBox.appendChild(this.rsErrorReconnectLink),this.rsErrorReconnectLink.classList.remove("rs-hidden"))}},{key:"updateLastSyncedStatus",value:function(){var t=new Date;this.online?(this.lastSynced=t,this.rsConnectedLabel.textContent="Synced"):this.rsWidget.classList.contains("rs-state-unauthorized")||(this.rsConnectedLabel.textContent="Offline")}},{key:"isSmallScreen",value:function(){return window.innerWidth<421}}],n&&function(t,e){for(var n=0;n<e.length;n++){var i=e[n];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(t,i.key,i)}}(e.prototype,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();const i=n;return e.default})()),uC.exports));function pC(t){const{minLat:e,minLon:n,maxLat:i,maxLon:r}=t,s=new Set;if(Math.abs(i-e)>20||Math.abs(r-n)>20)return console.warn("BBox too large for 4-char geohash scanning, aborting fine scan."),[];for(let a=e;a<=i+.1;a+=.1)for(let t=n;t<=r+.1;t+=.1){const e=Math.min(a,i),n=Math.min(t,r);try{const t=eC.encode(e,n,4);s.add(t)}catch(o){}}try{s.add(eC.encode(e,n,4))}catch(o){}try{s.add(eC.encode(i,r,4))}catch(o){}try{s.add(eC.encode(e,r,4))}catch(o){}try{s.add(eC.encode(i,n,4))}catch(o){}return Array.from(s)}const fC=Object.freeze(Object.defineProperty({__proto__:null,getGeohashPrefixesInBbox:pC},Symbol.toStringTag,{value:"Module"})),gC=Object.assign({},g.FEATURES);function mC(t){let e=gC[t];return!0===e||!1===e?e:!!g.ENABLE_OPTIONAL_FEATURES}function yC(t){return kf(t)||"string"==typeof t&&!1===/\S/.test(t)}function vC(t){return!yC(t)}function _C(t,e){return t&&"function"==typeof t.isEqual?t.isEqual(e):t instanceof Date&&e instanceof Date?t.getTime()===e.getTime():t===e}let bC={};function wC(t){bC=t}function xC(){return bC}function CC(t,e){return Wi(t,e)}function SC(t,e){if(Symbol.iterator in t)for(let n of t)e(n);else t.forEach,t.forEach(e)}class kC{recordCaches=new Map;added=[];updated=[];removed=[];getCacheForItem(t){let e=this.recordCaches.get(t);if(!e){let n=!1;e=qe(()=>{n?this.updated.push(this.wrapRecord(t)):(this.added.push(this.wrapRecord(t)),n=!0)}),this.recordCaches.set(t,e)}return e}constructor(t,e,n,i,r,s){this.wrapRecord=r,this.release=s,this.recordArrayCache=qe(()=>{let s=new Set;je(on(t,"[]")),SC(t,t=>{Ve(this.getCacheForItem(t)),s.add(t)}),We(()=>{this.recordCaches.forEach((t,e)=>{s.has(e)||(this.removed.push(r(e)),this.recordCaches.delete(e))})}),this.added.length>0&&(e(this.added),this.added=[]),this.updated.length>0&&(n(this.updated),this.updated=[]),this.removed.length>0&&(i(this.removed),this.removed=[])})}revalidate(){Ve(this.recordArrayCache)}}class EC{constructor(t,e,n){this.release=n;let i=!1;this.cache=qe(()=>{SC(t,()=>{}),je(on(t,"[]")),!0===i?Sa(e):i=!0}),this.release=n}revalidate(){Ve(this.cache)}}class TC extends Mh{releaseMethods=sd();recordsWatchers=new Map;typeWatchers=new Map;flushWatchers=null;constructor(t){super(t),this.containerDebugAdapter=hr(this).lookup("container-debug-adapter:main")}attributeLimit=3;acceptsModelName=!0;getFilters(){return sd()}watchModelTypes(t,e){let n,i=this.getModelTypes(),r=sd();n=i.map(t=>{let n=t.klass,i=this.wrapModelType(n,t.name);return r.push(this.observeModelType(t.name,e)),i}),t(n);let s=()=>{r.forEach(t=>t()),this.releaseMethods.removeObject(s)};return this.releaseMethods.pushObject(s),s}_nameToClass(t){if("string"==typeof t){let e=hr(this).factoryFor(`model:${t}`);t=e&&e.class}return t}watchRecords(t,e,n,i){let r=this._nameToClass(t),s=this.getRecords(r,t),{recordsWatchers:o}=this,a=o.get(s);return a||(a=new kC(s,e,n,i,t=>this.wrapRecord(t),()=>{o.delete(s),this.updateFlushWatchers()}),o.set(s,a),this.updateFlushWatchers(),a.revalidate()),a.release}updateFlushWatchers(){null===this.flushWatchers?(this.typeWatchers.size>0||this.recordsWatchers.size>0)&&(this.flushWatchers=()=>{this.typeWatchers.forEach(t=>t.revalidate()),this.recordsWatchers.forEach(t=>t.revalidate())},ma.on("end",this.flushWatchers)):0===this.typeWatchers.size&&0===this.recordsWatchers.size&&(ma.off("end",this.flushWatchers),this.flushWatchers=null)}willDestroy(){this._super(...arguments),this.typeWatchers.forEach(t=>t.release()),this.recordsWatchers.forEach(t=>t.release()),this.releaseMethods.forEach(t=>t()),this.flushWatchers&&ma.off("end",this.flushWatchers)}detect(t){return!1}columnsForType(t){return sd()}observeModelType(t,e){let n=this._nameToClass(t),i=this.getRecords(n,t),{typeWatchers:r}=this,s=r.get(i);return s||(s=new EC(i,()=>{e([this.wrapModelType(n,t)])},()=>{r.delete(i),this.updateFlushWatchers()}),r.set(i,s),this.updateFlushWatchers(),s.revalidate()),s.release}wrapModelType(t,e){return{name:e,count:Cs(this.getRecords(t,e),"length"),columns:this.columnsForType(t),object:t}}getModelTypes(){let t=this.containerDebugAdapter,e=(t.canCatalogEntriesByType("model")?t.catalogEntriesByType("model"):this._getObjectsOnNamespaces()).map(t=>({klass:this._nameToClass(t),name:t}));return e.filter(t=>this.detect(t.klass))}_getObjectsOnNamespaces(){let t=Kw.NAMESPACES,e=[];return t.forEach(t=>{for(let n in t){if(!Object.prototype.hasOwnProperty.call(t,n))continue;if(!this.detect(t[n]))continue;let i=zf(n);e.push(i)}}),e}getRecords(t,e){return sd()}wrapRecord(t){return{object:t,columnValues:this.getRecordColumnValues(t),searchKeywords:this.getRecordKeywords(t),filterValues:this.getRecordFilterValues(t),color:this.getRecordColor(t)}}getRecordColumnValues(t){return{}}getRecordKeywords(t){return sd()}getRecordFilterValues(t){return{}}getRecordColor(t){return null}}const LC={willChange:"_arrangedContentArrayWillChange",didChange:"_arrangedContentArrayDidChange"};function MC(t,e){return"[]"===e?(t._revalidate(),t._arrTag):"length"===e?(t._revalidate(),t._lengthTag):on(t,e)}class RC extends Mh{_objectsDirtyIndex=0;_objects=null;_lengthDirty=!0;_length=0;_arrangedContent=null;_arrangedContentIsUpdating=!1;_arrangedContentTag=null;_arrangedContentRevision=null;_lengthTag=null;_arrTag=null;init(t){super.init(t),li(this,MC)}[is](){this._revalidate()}willDestroy(){this._removeArrangedContentArrayObserver()}objectAtContent(t){return dr(Cs(this,"arrangedContent"),t)}replace(t,e,n){this.replaceContent(t,e,n)}replaceContent(t,e,n){Ws(Cs(this,"content"),t,e,n)}objectAt(t){if(this._revalidate(),null===this._objects&&(this._objects=[]),-1!==this._objectsDirtyIndex&&t>=this._objectsDirtyIndex){let t=Cs(this,"arrangedContent");if(t){let e=this._objects.length=Cs(t,"length");for(let t=this._objectsDirtyIndex;t<e;t++)this._objects[t]=this.objectAtContent(t)}else this._objects.length=0;this._objectsDirtyIndex=-1}return this._objects[t]}get length(){if(this._revalidate(),this._lengthDirty){let t=Cs(this,"arrangedContent");this._length=t?Cs(t,"length"):0,this._lengthDirty=!1}return je(this._lengthTag),this._length}set length(t){let e,n=this.length-t;if(0===n)return;n<0&&(e=new Array(-n),n=0);let i=Cs(this,"content");i&&(Ws(i,t,n,e),this._invalidate())}_updateArrangedContentArray(t){let e=null===this._objects?0:this._objects.length,n=t?Cs(t,"length"):0;this._removeArrangedContentArrayObserver(),Vs(this,0,e,n),this._invalidate(),$s(this,0,e,n,!1),this._addArrangedContentArrayObserver(t)}_addArrangedContentArrayObserver(t){t&&!t.isDestroyed&&(Ys(t,this,LC),this._arrangedContent=t)}_removeArrangedContentArrayObserver(){this._arrangedContent&&Xs(this._arrangedContent,this,LC)}_arrangedContentArrayWillChange(){}_arrangedContentArrayDidChange(t,e,n,i){Vs(this,e,n,i);let r=e;r<0&&(r+=Cs(this._arrangedContent,"length")+n-i),(-1===this._objectsDirtyIndex||this._objectsDirtyIndex>r)&&(this._objectsDirtyIndex=r),this._lengthDirty=!0,$s(this,e,n,i,!1)}_invalidate(){this._objectsDirtyIndex=0,this._lengthDirty=!0}_revalidate(){if(!0!==this._arrangedContentIsUpdating&&(null===this._arrangedContentTag||!de(this._arrangedContentTag,this._arrangedContentRevision))){let t=this.get("arrangedContent");null===this._arrangedContentTag?this._addArrangedContentArrayObserver(t):(this._arrangedContentIsUpdating=!0,this._updateArrangedContentArray(t),this._arrangedContentIsUpdating=!1);let e=this._arrangedContentTag=on(this,"arrangedContent");this._arrangedContentRevision=ue(this._arrangedContentTag),H(t)?(this._lengthTag=ke([e,fr(t,"length")]),this._arrTag=ke([e,fr(t,"[]")])):this._lengthTag=this._arrTag=e}}}RC.reopen(nd,{arrangedContent:Ds("content")});const PC=Object.freeze(Object.defineProperty({__proto__:null,default:RC},Symbol.toStringTag,{value:"Module"}));class IC extends ru{}IC.PrototypeMixin.reopen(tc);const OC=Object.freeze(Object.defineProperty({__proto__:null,default:IC},Symbol.toStringTag,{value:"Module"})),AC=Vl.create({reason:null,isPending:ps("isSettled",function(){return!Cs(this,"isSettled")}).readOnly(),isSettled:ps("isRejected","isFulfilled",function(){return Cs(this,"isRejected")||Cs(this,"isFulfilled")}).readOnly(),isRejected:!1,isFulfilled:!1,promise:ps({get(){throw new Error("PromiseProxy's promise must be set")},set(t,e){return function(t,e){return Qs(t,{isFulfilled:!1,isRejected:!1}),e.then(e=>(t.isDestroyed||t.isDestroying||Qs(t,{content:e,isFulfilled:!0}),e),e=>{throw t.isDestroyed||t.isDestroying||Qs(t,{reason:e,isRejected:!0}),e},"Ember: PromiseProxy")}(this,e)}}),then:zC("then"),catch:zC("catch"),finally:zC("finally")});function zC(t){return function(...e){return Cs(this,"promise")[t](...e)}}const FC=Object.freeze(Object.defineProperty({__proto__:null,default:AC},Symbol.toStringTag,{value:"Module"}));function jC(t,e,n){return t.lookup(`controller:${e}`,n)}let DC;!function(t){function e(){}t.isNamespace=!0,t.toString=function(){return"Ember"},t.Container=gl,t.Registry=El,t._setComponentManager=CC,t._componentManagerCapabilities=Ni,t._modifierManagerCapabilities=$i,t.meta=ae,t._createCache=qe,t._cacheGetValue=Ve,t._cacheIsConst=$e,t._descriptor=Cr,t._getPath=ks,t._setClassicDecorator=Or,t._tracked=Ps,t.beginPropertyChanges=os,t.changeProperties=ls,t.endPropertyChanges=as,t.hasListeners=Ur,t.libraries=Ls,t._ContainerProxyMixin=Kl,t._ProxyMixin=tc,t._RegistryProxyMixin=Hl,t.ActionHandler=Xl,t.Comparable=Yl,t.ComponentLookup=ex,t.EventDispatcher=eu,t._Cache=sr,t.GUID_KEY=Q,t.canInvoke=Zw,t.generateGuid=tt,t.guidFor=et,t.uuid=K,t.wrap=mt,t.getOwner=cx,t.onLoad=pl,t.runLoadHooks=fl,t.setOwner=hx,t.Application=ux,t.ApplicationInstance=Ww,t.Namespace=Kw,t.A=sd,t.Array=ed,t.NativeArray=id,t.isArray=Ju,t.makeArray=mh,t.MutableArray=nd,t.ArrayProxy=RC,t.FEATURES={isEnabled:mC,...gC},t._Input=V_,t.Component=Eb,t.Helper=Mb,t.Controller=cd,t.ControllerMixin=ld,t._captureRenderTree=O,t.assert=y,t.warn=F,t.debug=j,t.deprecate=$,t.deprecateFunc=V,t.runInDebug=B,t.inspect=R,t.Debug={registerDeprecationHandler:v,registerWarnHandler:x,isComputed:gs},t.ContainerDebugAdapter=tx,t.DataAdapter=TC,t._assertDestroyablesDestroyed=Dt,t._associateDestroyableChild=Gt,t._enableDestroyableTracking=jt,t._isDestroying=Kt,t._isDestroyed=Yt,t._registerDestructor=wx,t._unregisterDestructor=xx,t.destroy=Ht,t.Engine=ox,t.EngineInstance=fd,t.Enumerable=ec,t.MutableEnumerable=nc,t.instrument=lu,t.subscribe=du,t.Instrumentation={instrument:lu,subscribe:du,unsubscribe:pu,reset:fu},t.Object=Mh,t._action=Ih,t.computed=ps,t.defineProperty=ms,t.get=Cs,t.getProperties=Js,t.notifyPropertyChange=ss,t.observer=Oh,t.set=zs,t.trySet=js,t.setProperties=Qs,t.cacheFor=As,t._dependentKeyCompat=md,t.ComputedProperty=hs,t.expandProperties=zr,t.CoreObject=Sh,t.Evented=nu,t.on=qr,t.addListener=Dr,t.removeListener=Nr,t.sendEvent=Br,t.Mixin=Vl,t.mixin=Ul,t.Observable=Th,t.addObserver=Wr,t.removeObserver=Hr,t.PromiseProxyMixin=AC,t.ObjectProxy=IC,t.RouterDSL=zp,t.controllerFor=jC,t.generateController=fp,t.generateControllerFactory=pp,t.HashLocation=_f,t.HistoryLocation=xf,t.NoneLocation=Cf,t.Route=kp,t.Router=af,t.run=ya,t.Service=Vf,t.compare=Nu,t.isBlank=yC,t.isEmpty=kf,t.isEqual=_C,t.isNone=Sf,t.isPresent=vC,t.typeOf=Fu,t.VERSION=or,t.ViewUtils={getChildViews:Zh,getElementView:Uh,getRootViews:jh,getViewBounds:Yh,getViewBoundingClientRect:Qh,getViewClientRects:Jh,getViewElement:qh,isSimpleClick:zh,isSerializationFirstNode:u_},t._getComponentTemplate=Ji,t._helperManagerCapabilities=vi,t._setComponentTemplate=Xi,t._setHelperManager=Zi,t._setModifierManager=Hi,t._templateOnlyComponent=Dy,t._invokeHelper=gv,t._hash=dv,t._array=av,t._concat=cv,t._get=uv,t._on=bv,t._fn=hv,t._Backburner=ua,t.inject=e,e.controller=hd,e.service=qf,t.__loader={get require(){return globalThis.require},get define(){return globalThis.define},get registry(){let t=globalThis;return t.requirejs?.entries??t.require.entries}}}(DC||(DC={})),Reflect.set(DC,"RSVP",ph),Object.defineProperty(DC,"ENV",{get:m,enumerable:!1}),Object.defineProperty(DC,"lookup",{get:p,set:f,enumerable:!1}),Object.defineProperty(DC,"onerror",{get:ko,set:function(t){Co=t},enumerable:!1}),Object.defineProperty(DC,"testing",{get:b,set:w,enumerable:!1}),Object.defineProperty(DC,"BOOTED",{configurable:!1,enumerable:!1,get:mo,set:yo}),Object.defineProperty(DC,"TEMPLATES",{get:xC,set:wC,configurable:!1,enumerable:!1}),Object.defineProperty(DC,"TEMPLATES",{get:xC,set:wC,configurable:!1,enumerable:!1}),Object.defineProperty(DC,"testing",{get:b,set:w,enumerable:!1}),fl("Ember.Application",ux);let NC={template:em,Utils:{}},BC={template:em};function UC(t){Object.defineProperty(DC,t,{configurable:!0,enumerable:!0,get:()=>"Handlebars"===t?NC:BC})}function qC(t){Object.defineProperty(DC,t,{configurable:!0,enumerable:!0,get(){}})}UC("HTMLBars"),UC("Handlebars"),qC("Test"),qC("setupForTesting"),fl("Ember"),new Proxy(DC,{get:(t,e,n)=>("string"==typeof e&&Uf(`importing ${e} from the 'ember' barrel file is deprecated.`,Bf.DEPRECATE_IMPORT_EMBER(e)),Reflect.get(t,e,n)),getOwnPropertyDescriptor:(t,e)=>("string"==typeof e&&Uf(`importing ${e} from the 'ember' barrel file is deprecated.`,Bf.DEPRECATE_IMPORT_EMBER(e)),Object.getOwnPropertyDescriptor(t,e))});const VC=new WeakMap;function $C(t,e,...n){if(t[e],t.isDestroying)return;"boolean"==typeof n[n.length-1]&&n[n.length-2];let i=VC.get(t);var r;let s;i||(i=new Map,VC.set(t,i),wx(t,(r=i,function(){0!==r.size&&r.forEach(t=>ka(t.cancelId))}))),s=i.has(e)?i.get(e).debouncedTask:(...n)=>{i.delete(e),t[e](...n)};let o=Ea(t,s,...n);i.set(e,{debouncedTask:s,cancelId:o})}class GC extends Vf{static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");rs;widget;static{Mx(this.prototype,"placesInView",[Ps],function(){return[]})}#Z=void Px(this,"placesInView");static{Mx(this.prototype,"savedPlaces",[Ps],function(){return[]})}#K=void Px(this,"savedPlaces");static{Mx(this.prototype,"loadedPrefixes",[Ps],function(){return[]})}#Y=void Px(this,"loadedPrefixes");static{Mx(this.prototype,"currentBbox",[Ps],function(){return null})}#X=void Px(this,"currentBbox");static{Mx(this.prototype,"lists",[Ps],function(){return[]})}#J=void Px(this,"lists");static{Mx(this.prototype,"version",[Ps],function(){return 0})}#Q=void Px(this,"version");static{Mx(this.prototype,"initialSyncDone",[Ps],function(){return!1})}#tt=void Px(this,"initialSyncDone");static{Mx(this.prototype,"connected",[Ps],function(){return!1})}#et=void Px(this,"connected");static{Mx(this.prototype,"userAddress",[Ps],function(){return null})}#nt=void Px(this,"userAddress");static{Mx(this.prototype,"isWidgetOpen",[Ps],function(){return!1})}#it=void Px(this,"isWidgetOpen");constructor(){super(...arguments),this.rs=new Qx({modules:[cC]}),this.rs.access.claim("places","rw"),this.rs.caching.enable("/places/"),window.remoteStorage=this.rs,this.widget=new dC(this.rs,{leaveOpen:!0,skipInitial:!0}),this.rs.on("ready",()=>{}),this.rs.on("connected",()=>{this.connected=!0,this.userAddress=this.rs.remote.userAddress,this.loadLists()}),this.rs.on("not-connected",()=>{this.loadLists()}),this.rs.on("disconnected",()=>{this.connected=!1,this.userAddress=null,this.placesInView=[],this.savedPlaces=[],this.loadedPrefixes=[],this.lists=[],this.initialSyncDone=!1}),this.rs.on("sync-done",()=>{this.initialSyncDone||(this.initialSyncDone=!0,this.loadLists())}),this.rs.scope("/places/").on("change",t=>{t.relativePath.startsWith("_lists/")?this.loadLists():(this.handlePlaceChange(t),$C(this,"reloadCurrentView",200))})}handlePlaceChange(t){const{newValue:e,relativePath:n}=t,i=n.split("/"),r=i[i.length-1];if(e){const t={...e,id:r},n=this.savedPlaces.findIndex(t=>t.id===r);if(-1!==n){const e=[...this.savedPlaces];e[n]=t,this.savedPlaces=e}else this.savedPlaces=[...this.savedPlaces,t]}else this.savedPlaces=this.savedPlaces.filter(t=>t.id!==r)}get places(){return this.rs.places}notifyChange(){this.version++,$C(this,"reloadCurrentView",200)}reloadCurrentView(){if(!this.currentBbox)return;const t=pC(this.currentBbox);console.debug("Reloading view due to changes, prefixes:",t),this.loadAllPlaces(t)}async loadLists(){try{if(!this.places.lists)return;await this.places.lists.initDefaults();const t=await this.places.lists.getAll();this.lists=t||[],this.lists.forEach(t=>{"to-go"===t.id?t.icon="bookmark":"to-do"===t.id&&(t.icon="check-square")}),this.refreshPlaceListAssociations()}catch(t){console.error("Failed to load lists:",t)}}refreshPlaceListAssociations(){const t=new Map;this.lists.forEach(e=>{e.placeRefs&&Array.isArray(e.placeRefs)&&e.placeRefs.forEach(n=>{n.id&&(t.has(n.id)||t.set(n.id,[]),t.get(n.id).push(e.id))})});const e=e=>{const n=t.get(e.id)||[];return e._listIds=n,e};this.savedPlaces=this.savedPlaces.map(t=>e({...t})),this.placesInView=this.placesInView.map(t=>e({...t}))}async togglePlaceList(t,e,n){if(!t)return;let i=t;if(!t.id||!t.geohash){if(!n)return;i=await this.storePlace(t)}try{return n?await this.places.lists.addPlace(e,i.id,i.geohash):await this.places.lists.removePlace(e,i.id),await this.loadLists(),this.findPlaceById(i.id)}catch(r){throw console.error("Failed to toggle place in list:",r),r}}async loadPlacesInBounds(t){const e=pC(t).filter(t=>!this.loadedPrefixes.includes(t));0!==e.length&&(console.debug("Loading new prefixes:",e),await this.loadAllPlaces(e),this.loadedPrefixes=[...this.loadedPrefixes,...e],this.currentBbox=t)}async loadAllPlaces(t=null){try{const e=await this.places.getPlaces(t);if(e&&Array.isArray(e)){if(t){const n=new Set(t),i=this.placesInView.filter(t=>{if(!t.lat||!t.lon)return!1;try{const e=eC.encode(t.lat,t.lon,4);return!n.has(e)}catch{return!0}});this.placesInView=[...i,...e]}else this.placesInView=e;this.refreshPlaceListAssociations()}else t||(this.placesInView=[]);console.debug("Loaded saved places:",this.placesInView.length)}catch(e){console.error("Failed to load places:",e)}}findPlaceById(t){if(!t)return;const e=String(t);let n=this.savedPlaces.find(t=>t.id&&String(t.id)===e);return n||(n=this.placesInView.find(t=>t.id&&String(t.id)===e),n||(n=this.savedPlaces.find(t=>t.osmId&&String(t.osmId)===e),n||(n=this.placesInView.find(t=>t.osmId&&String(t.osmId)===e),n)))}isPlaceSaved(t){return!!this.findPlaceById(t)}async storePlace(t){const e=await this.places.store(t);return this.savedPlaces.some(t=>t.id===e.id)?this.savedPlaces=this.savedPlaces.map(t=>t.id===e.id?e:t):this.savedPlaces=[...this.savedPlaces,e],this.placesInView.some(t=>t.id===e.id)?this.placesInView=this.placesInView.map(t=>t.id===e.id?e:t):this.placesInView=[...this.placesInView,e],e}async updatePlace(t){const e=await this.places.store(t),n=this.savedPlaces.findIndex(t=>t.id===e.id);if(-1!==n){const t=[...this.savedPlaces];t[n]=e,this.savedPlaces=t}return this.placesInView=this.placesInView.map(t=>t.id===e.id?e:t),e}async removePlace(t){await this.places.remove(t.id,t.geohash),this.savedPlaces=this.savedPlaces.filter(e=>e.id!==t.id),this.placesInView.length>0&&(this.placesInView=this.placesInView.filter(e=>e.id!==t.id))}async refreshPlace(t){if(!(t&&t.id&&t.osmId&&t.osmType))return null;try{console.debug(`Checking for updates for ${t.title} (${t.osmId})`);const e=await this.osm.fetchOsmObject(t.osmId,t.osmType);if(!e)return console.warn("Could not fetch fresh data for",t.osmId),null;let n=!1;const i={},r=Math.abs(t.lat-e.lat),s=Math.abs(t.lon-e.lon);(r>1e-5||s>1e-5)&&(n=!0,i.lat=e.lat,i.lon=e.lon);const o=t.osmTags||{},a=e.osmTags||{},l=new Set([...Object.keys(o),...Object.keys(a)]);for(const t of l)if(o[t]!==a[t]){n=!0,i.osmTags=a;break}if(!n)return console.debug("No changes detected for",t.title),null;console.debug("Changes detected:",i);const c={...t,...i},h=Fx(o),u=Fx(a);return t.title===h&&h!==u&&(c.title=u),await this.updatePlace(c)}catch(e){return console.error("Failed to refresh place:",e),null}}connect(){this.isWidgetOpen=!0,document.querySelector(".rs-widget")||this.widget.attach("rs-widget-container")}static{Rx(this.prototype,"connect",[Ih])}closeWidget(){this.isWidgetOpen=!1}static{Rx(this.prototype,"closeWidget",[Ih])}disconnect(){this.rs.disconnect(),this.isWidgetOpen=!1}static{Rx(this.prototype,"disconnect",[Ih])}}const WC=Object.freeze(Object.defineProperty({__proto__:null,default:GC},Symbol.toStringTag,{value:"Module"}));class HC extends Vf{static{Mx(this.prototype,"message",[Ps],function(){return null})}#rt=void Px(this,"message");static{Mx(this.prototype,"isVisible",[Ps],function(){return!1})}#st=void Px(this,"isVisible");timeoutId=null;show(t,e=3e3){this.message=t,this.isVisible=!0,this.timeoutId&&clearTimeout(this.timeoutId),this.timeoutId=setTimeout(()=>{this.isVisible=!1},e)}}const ZC=Object.freeze(Object.defineProperty({__proto__:null,default:HC},Symbol.toStringTag,{value:"Module"}));function KC(t,e,n,i){const r=t*Math.PI/180,s=n*Math.PI/180,o=(n-t)*Math.PI/180,a=(i-e)*Math.PI/180,l=Math.sin(o/2)*Math.sin(o/2)+Math.cos(r)*Math.cos(s)*Math.sin(a/2)*Math.sin(a/2);return 2*Math.atan2(Math.sqrt(l),Math.sqrt(1-l))*6371e3}const YC=Object.freeze(Object.defineProperty({__proto__:null,getDistance:KC},Symbol.toStringTag,{value:"Module"})),XC={activity:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-activity"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg>',angelfish:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M14.94 8.78C13.95 5.9 10.78 1 4.65 1C1.57 1 0 2.18 0 2.18L0.56 2.19C1.42 2.23 3.04 2.33 3.93 2.71C4.02 2.75 4.1 2.82 4.15 2.9L4.22 3.04C4.46 3.55 4.88 4.73 4.28 5.96C4.16 6.18 3.9 6.28 3.67 6.2L3.33 6.09C2.71 5.88 1.79 5.5 1.07 4.97C0.81 4.78 0.44 4.85 0.37 5.16C0.07 6.42 0.07 8.58 0.37 9.84C0.44 10.15 0.81 10.22 1.07 10.03C1.94 9.39 3.08 8.98 3.67 8.8C3.9 8.72 4.16 8.82 4.28 9.04C4.94 10.4 4.37 11.68 4.15 12.1C4.1 12.18 4.02 12.25 3.93 12.29C2.68 12.82 0 12.82 0 12.82C0.58 13.21 2.56 14 5.81 14C11.01 14 13.91 10.86 14.8 9.7C15 9.44 15.06 9.08 14.94 8.78ZM10.46 9.13C9.65 9.13 9 8.48 9 7.68C9 6.88 9.65 6.23 10.46 6.23C11.26 6.23 11.91 6.88 11.91 7.68C11.91 8.48 11.26 9.13 10.46 9.13Z"/>\n</svg>',"arrow-left":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-arrow-left"><line x1="19" y1="12" x2="5" y2="12"></line><polyline points="12 19 5 12 12 5"></polyline></svg>',barbell:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4 3.5c-0.5 0 -1 0.5 -1 1v2.5h-0.5v-1.25c0 -0.41 -0.4 -0.75 -0.75 -0.75s-0.75 0.34 -0.75 0.75v1.25h-0.5c-0.28 0 -0.5 0.26 -0.5 0.5s0.22 0.5 0.5 0.5h0.5v1.25c0 0.41 0.4 0.75 0.75 0.75s0.75 -0.34 0.75 -0.75v-1.25h0.5v2.5c0 0.5 0.5 1 1 1s1 -0.5 1 -1v-2.5h5v2.5c0 0.5 0.5 1 1 1s1 -0.5 1 -1v-2.5h0.5v1.25c0 0.41 0.4 0.75 0.75 0.75s0.75 -0.34 0.75 -0.75v-1.25h0.5c0.28 0 0.5 -0.26 0.5 -0.5s-0.22 -0.5 -0.5 -0.5h-0.5v-1.25c0 -0.41 -0.4 -0.75 -0.75 -0.75s-0.75 0.34 -0.75 0.75v1.25h-0.5v-2.5c0 -0.5 -0.5 -1 -1 -1s-1 0.5 -1 1v2.5h-5v-2.5c0 -0.48 -0.5 -1 -1 -1z"/>\n</svg>',banknote:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1 3C0.45 3 0 3.45 0 4v7c0 0.55 0.45 1 1 1h13c0.55 0 1 -0.45 1 -1V4c0 -0.55 -0.45 -1 -1 -1H1zM1 4h1.5C2.78 4 3 4.22 3 4.5S2.78 5 2.5 5S2 4.78 2 4.5L1.5 5C1.78 5 2 5.22 2 5.5S1.78 6 1.5 6S1 5.78 1 5.5V4zM7.5 4C8.88 4 10 5.57 10 7.5l0 0C10 9.43 8.88 11 7.5 11S5 9.43 5 7.5S6.12 4 7.5 4zM12.5 4H14v1.5C14 5.78 13.78 6 13.5 6S13 5.78 13 5.5S13.22 5 13.5 5L13 4.5C13 4.78 12.78 5 12.5 5S12 4.78 12 4.5S12.22 4 12.5 4zM7.5 5.5c-0.32 0 -0.53 0.11 -0.68 0.25h1.36C8.03 5.61 7.82 5.5 7.5 5.5zM6.63 6C6.58 6.09 6.56 6.17 6.54 6.25h1.91C8.44 6.17 8.42 6.09 8.38 6H6.63zM6.5 6.5v0.25h2V6.5H6.5zM6.5 7v0.25h2V7H6.5zM6.5 7.5v0.25h2V7.5H6.5zM6.5 8L6.25 8.25h2L8.5 8H6.5zM6 8.5c0 0 0.04 0.1 0.1 0.25H8.38L8 8.5H6zM1.5 9C1.78 9 2 9.22 2 9.5S1.78 10 1.5 10L2 10.5C2 10.22 2.22 10 2.5 10S3 10.22 3 10.5S2.78 11 2.5 11H1V9.5C1 9.22 1.22 9 1.5 9zM6.24 9C6.28 9.09 6.31 9.16 6.38 9.25h2.27C8.71 9.11 8.75 9 8.75 9H6.24zM13.5 9C13.78 9 14 9.22 14 9.5V11h-1.5c-0.28 0 -0.5 -0.22 -0.5 -0.5s0.22 -0.5 0.5 -0.5s0.5 0.22 0.5 0.5l0.5 -0.5C13.22 10 13 9.78 13 9.5S13.22 9 13.5 9zM6.57 9.5c0.08 0.09 0.16 0.18 0.26 0.25h1.42C8.35 9.67 8.43 9.59 8.5 9.5H6.57z"/>\n</svg>',"badge-shield-with-fire":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M11.5 0L14.5 2.76C14.02 3.54 12.92 4.69 12.92 5.71C12.92 6.45 13.21 7.15 13.47 7.77C13.69 8.31 14.13 8.92 14.13 9.56C14.13 11.85 12.25 12.57 10.47 13.47L9.83 13.8C8.98 14.23 8.22 14.25 7.5 15C6.78 14.25 6.02 14.23 5.17 13.8L4.53 13.47C2.75 12.57 0.87 11.85 0.87 9.56C0.87 8.92 1.3 8.31 1.53 7.77C1.79 7.15 2.08 6.45 2.08 5.71C2.08 4.69 1.05 3.47 0.5 2.76L3.5 0C3.87 0.39 4.74 1.29 5.5 1.29C6.26 1.29 7.12 0.41 7.5 0C7.86 0.39 8.74 1.29 9.5 1.29C10.26 1.29 11.1 0.43 11.5 0ZM7.5 2.5C4.64 3.39 3.5 6.07 3.5 8.21C3.5 10.36 4.9 11.97 6.7 12.5C5.1 10.17 5.1 8.21 7.5 6.79C7.1 7.75 7.5 9.64 8.3 10.36C8.65 10.07 9.1 9.34 9.1 8.93C10.7 10.36 9.55 11.52 9.1 12.5C9.97 12.1 11.5 11.07 11.5 8.93C11.5 6.79 9.9 6.07 9.9 3.93C8.79 4.36 8.3 5.36 8.3 6.07C7.54 5.67 6.7 4.1 7.5 2.5Z"/>\n</svg>',"beach-umbrella-in-ground":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.36 1.67l-0.01 4.02a4.45 4.45 0 0 0 -1.1 -0.11c-0.37 0.1 -0.74 0.63 -1.1 0.76A4.2 4.2 0 0 1 5.36 1.67Zm2.41 -0.64l2.03 3.45a3.18 3.18 0 0 1 0.84 -0.61c0.36 -0.1 0.94 0.17 1.34 0.11A4.2 4.2 0 0 0 7.77 1.03ZM1 13h13c-0.66 -0.66 -2.64 -1.11 -4.34 -1.33l-1.87 -7c0.52 -0.05 1.15 0.03 1.53 0l-2.11 -3.6h-0.01a6.17 6.17 0 0 0 -0.7 0.14a4.38 4.38 0 0 0 -0.64 0.22l-0.01 4.15c0.35 -0.17 0.84 -0.54 1.3 -0.74l1.8 6.74c-0.58 -0.05 -1.09 -0.08 -1.45 -0.08C6.03 11.5 2 12 1 13Z"/>\n</svg>',"beer-mug-with-foam":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3.21 0C2.14 0 1.07 1.07 1.07 2.14L1.07 12.86C1.07 13.93 0 15 0 15L11.79 15C11.79 15 10.71 13.93 10.71 12.86L13.93 12.86C15 12.86 15 11.79 15 11.79L15 5.36C15 4.29 13.93 3.21 12.86 3.21L10.71 3.21L10.71 2.14C10.71 0.81 9.93 0 8.57 0L3.21 0ZM4.29 1.07L7.5 1.07C8.98 1.07 9.64 1.45 9.64 2.14C6.43 2.14 4.13 2.35 4.29 5.36C4.29 7.5 2.14 7.5 2.14 5.36L2.14 3.21C2.14 1.6 2.67 1.07 4.29 1.07ZM10.71 4.82L11.79 4.82C12.53 4.82 13.39 4.85 13.39 6.43L13.39 11.25L10.71 11.25L10.71 4.82ZM2.14 12.86L9.64 12.86L9.64 13.93L2.14 13.93L2.14 12.86Z"/>\n</svg>',bookmark:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-bookmark"><path d="M19 21l-7-5-7 5V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2z"></path></svg>',"boxing-glove-up":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.63 0.01C4.37 0.1 3.36 1.31 3.46 2.56C3.47 3.03 3.44 3.5 3.48 3.96C3.69 4.42 4.35 4.06 4.72 4.3C5.69 4.56 6.15 5.64 6.08 6.57C6.05 6.84 6.18 7.23 5.83 7.34C5.37 7.46 5.34 6.93 5.38 6.62C5.41 6.03 5.33 5.37 4.78 5.04C4 4.51 2.76 4.92 2.56 5.87C2.47 6.6 2.53 7.34 2.52 8.07C2.47 9.38 3.66 10.56 4.97 10.49C6.75 10.48 8.53 10.51 10.31 10.48C11.59 10.39 12.6 9.16 12.48 7.89C12.48 6 12.5 4.1 12.47 2.21C12.39 1 11.27 0 9.92 0.01C8.57 0.01 7.1 -0.02 5.63 0.01ZM4.04 11.61V15H10.81V11.61Z"/>\n</svg>',"burger-and-drink-cup-with-straw":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M14.67 4.55L13.49 13.8L9.5 13.8L8.32 4.5L13.19 4.5L14.16 1.18L14.7 1.34L13.78 4.54L14.67 4.55L14.67 4.55ZM7.76 9.9C7.76 9.9 7.91 8.7 5.84 8.7L2.55 8.7C0.49 8.7 0.63 9.9 0.63 9.9L7.76 9.9L7.76 9.9ZM0.63 12.6C0.63 12.6 0.48 13.8 2.55 13.8L5.84 13.8C7.91 13.8 7.76 12.6 7.76 12.6L0.63 12.6L0.63 12.6ZM7.45 12C7.79 12 8.06 11.67 8.06 11.25C8.06 10.83 7.79 10.5 7.45 10.5L0.91 10.5C0.58 10.5 0.3 10.83 0.3 11.25C0.3 11.67 0.58 12 0.91 12L7.45 12Z"/>\n</svg>',bus:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M2 3C2 1.9 2.9 1 4 1L11 1C12.1 1 13 1.9 13 3L13 11C13 12 12 12 12 12L12 13C12 13 12 14 11 14C10 14 10 13 10 13L10 12L5 12L5 13C5 13 5 14 4 14C3 14 3 13 3 13L3 12C2 12 2 11 2 11L2 7.2L2 3ZM3.5 2.5C3.22 2.5 3 2.72 3 3L3 7C3 7.28 3.22 7.5 3.5 7.5L11.5 7.5C11.78 7.5 12 7.28 12 7L12 3C12 2.72 11.78 2.5 11.5 2.5L3.5 2.5ZM4 9C3.45 9 3 9.45 3 10C3 10.55 3.45 11 4 11C4.55 11 5 10.55 5 10C5 9.45 4.55 9 4 9ZM11 9C10.45 9 10 9.45 10 10C10 10.55 10.45 11 11 11C11.55 11 12 10.55 12 10C12 9.45 11.55 9 11 9Z"/>\n</svg>',camera:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M6 2C5.45 2 5.25 2.5 5 3L4.5 4h-2C1.67 4 1 4.67 1 5.5v5C1 11.33 1.67 12 2.5 12h10c0.83 0 1.5 -0.67 1.5 -1.5v-5C14 4.67 13.33 4 12.5 4h-2L10 3C9.75 2.5 9.55 2 9 2H6zM2.5 5C2.78 5 3 5.22 3 5.5S2.78 6 2.5 6S2 5.78 2 5.5S2.22 5 2.5 5zM7.5 5c1.66 0 3 1.34 3 3s-1.34 3 -3 3s-3 -1.34 -3 -3S5.84 5 7.5 5zM7.5 6.5C6.67 6.5 6 7.17 6 8l0 0c0 0.83 0.67 1.5 1.5 1.5l0 0C8.33 9.5 9 8.83 9 8l0 0C9 7.17 8.33 6.5 7.5 6.5L7.5 6.5z"/>\n</svg>',"check-square":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-check-square"><polyline points="9 11 12 14 22 4"></polyline><path d="M21 12v7a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h11"></path></svg>',"cigarette-with-smoke-curl":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M13 12L12 12L12 15L13 15L13 12ZM13.93 10.71C13.21 9.64 11.79 8.57 11.79 7.5C11.79 6.43 15 5.36 15 3.21C15 1.07 12.86 1.07 10.71 0C11.07 1.43 12.86 2.14 12.86 3.21C11.79 4.29 9.64 5.36 9.64 7.5C9.64 9.64 10.71 9.64 13.93 10.71ZM15 12L14 12L14 15L15 15L15 12ZM0 15L11 15L11 12L0 12L0 15Z"/>\n</svg>',"classical-building":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.5 0L1 3.5V4h13V3.5L7.5 0zM2 5v5l-1 1.6V13h13v-1.4L13 10V5H2zM4 6h1v5.5H4V6zM7 6h1v5.5H7V6zM10 6h1v5.5h-1V6z"/>\n</svg>',"classical-building-with-dome-and-flag":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7 1L9 0L11 1L13 0L13 3L11 4L9 3L8 3.5L8 5L7 5L7 1ZM2.5 9L12.5 9L12.5 15L2.5 15L2.5 9ZM4 10L4 14L5 14L5 10L4 10ZM7 10L7 14L8 14L8 10L7 10ZM10 10L10 14L11 14L11 10L10 10ZM2.5 8.5C2.75 5.97 4.89 4 7.5 4C10.11 4 12.25 5.97 12.5 8.5L2.5 8.5Z"/>\n</svg>',"classical-building-with-flag":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7 4.17L7 1L9 0L11 1L13 0L13 3L11 4L9 3L8 3.5L8 4.17L13.5 6L13.5 7L1.5 7L1.5 6L7 4.17ZM2.5 7.5L12.5 7.5L12.5 12L13.5 13L13.5 14L1.5 14L1.5 13L2.5 12L2.5 7.5ZM4 8.5L4 12.5L5 12.5L5 8.5L4 8.5ZM7 8.5L7 12.5L8 12.5L8 8.5L7 8.5ZM10 8.5L10 12.5L11 12.5L11 8.5L10 8.5Z"/>\n</svg>',"commercial-building":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M14 6h-13c0.09 -1.38 0.43 -2.74 1 -4h11c0.57 1.26 0.91 2.62 1 4zm-11 1h9v6h-1v-5h-3v5h-5zm1 3h3v-2h-3z"/>\n</svg>',"clothes-hanger":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M6.75 7.14L6.75 5.5C6.75 5.09 7.09 4.75 7.5 4.75C8.19 4.75 8.75 4.19 8.75 3.5C8.75 2.81 8.19 2.25 7.5 2.25C6.81 2.25 6.25 2.81 6.25 3.5C6.25 3.91 5.91 4.25 5.5 4.25C5.09 4.25 4.75 3.91 4.75 3.5C4.75 1.98 5.98 0.75 7.5 0.75C9.02 0.75 10.25 1.98 10.25 3.5C10.25 4.76 9.4 5.82 8.25 6.15L8.25 7.14L14.3 12.03C14.59 12.26 14.76 12.62 14.76 13C14.76 13.69 14.2 14.25 13.51 14.25L1.49 14.25C1.11 14.25 0.75 14.08 0.51 13.79C0.08 13.25 0.16 12.46 0.7 12.03L6.75 7.14ZM12.81 12.75L7.5 8.46L2.19 12.75L12.81 12.75Z"/>\n</svg>',cleaver:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M12.44 4.2L13.28 4.74C12.92 6.09 12.46 7.19 11.92 8.03C11.24 9.08 10.14 10.15 8.63 11.26L9.47 11.8C10.98 10.7 12.07 9.62 12.75 8.57C13.44 7.52 13.97 6.09 14.37 4.26L9.33 0.99L8.79 0.63C8.33 0.33 7.71 0.46 7.4 0.93C7.35 1.01 7.31 1.09 7.28 1.19C6.98 2.22 6.65 3.08 6.3 3.78C5.81 4.76 4.9 6.16 3.57 7.98L7.79 10.71C9.3 9.61 10.4 8.53 11.08 7.48C11.62 6.64 12.08 5.54 12.44 4.2ZM9.42 2.23C9.88 2.53 10.01 3.15 9.71 3.62C9.41 4.08 8.79 4.21 8.33 3.91C7.87 3.61 7.73 2.99 8.04 2.53C8.34 2.06 8.96 1.93 9.42 2.23ZM3.33 8.41L0.88 12.19C0.42 12.88 0.62 13.81 1.32 14.26C1.97 14.68 2.82 14.53 3.29 13.94L3.38 13.82L3.65 13.39C3.31 12.81 3.33 12.07 3.7 11.5L5 9.5L3.33 8.41Z"/>\n</svg>',cloth:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M12.98 2.1C8.07 2.06 7.02 0.78 4.93 0.78C2.45 0.78 0.99 1.46 0.37 1.85C-0.1 2.1 0.01 1.62 0.01 1.45C0.01 1.28 0.29 1.12 0.29 1.12C0.86 0.75 2.34 0 4.93 0C7.02 0 8.08 1.28 13 1.32C13 1.32 13.37 1.28 13.37 1.62C13.37 1.95 13.35 2.1 12.98 2.1ZM13.37 14.52C13.37 14.18 13 14.22 13 14.22C8.08 14.19 7.02 12.9 4.93 12.9C2.34 12.9 0.86 13.65 0.29 14.02C0.29 14.02 0.01 14.18 0.01 14.35C0.01 14.52 -0.1 15 0.37 14.75C0.99 14.37 2.45 13.68 4.93 13.68C7.02 13.68 8.07 14.96 12.98 15C13.35 15 13.37 14.85 13.37 14.52ZM13.37 3.21C13.37 2.87 13 2.91 13 2.91C8.08 2.88 7.02 1.59 4.93 1.59C2.34 1.59 0.86 2.34 0.29 2.71C0.29 2.71 0.01 2.87 0.01 3.04L0.01 12.74C0.01 12.91 -0.1 13.39 0.37 13.14C0.99 12.75 2.45 12.07 4.93 12.07C7.02 12.07 8.07 13.35 12.98 13.39C13.35 13.39 13.37 13.24 13.37 12.91L13.37 3.21Z"/>\n</svg>',cocktail:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.5 1c-2 0 -7 0.25 -6.5 0.75L7 8v4c0 1 -3 0.5 -3 2h7c0 -1.5 -3 -1 -3 -2V8l6 -6.25C14.5 1.25 9.5 1 7.5 1zM7.5 2c2.5 0 4.75 0.25 4.75 0.25L11.5 3h-8L2.75 2.25C2.75 2.25 5 2 7.5 2z"/>\n</svg>',clock:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-clock"><circle cx="12" cy="12" r="10"></circle><polyline points="12 6 12 12 16 14"></polyline></svg>',"coffee-bean":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M13.5 1C14 0.5 6.5 0 3 3.5C1 5.5 0 8.5 0 10C0 12 1 15 3 15C10 15 12.5 9.5 13.5 7.5C14.5 5.5 15 1.5 14 1.5C13.5 1.5 11 3 10 4C9 5 9 7 8 8C7 9 5.5 9 4.5 10C3.5 11 2 12.5 2 12.5C2 12.5 2.5 10 3.5 9C4.5 8 5.5 8 6.5 7C7.5 6 8 4 9 3C10 2 13 1.5 13.5 1z"/>\n</svg>',"comedy-mask-and-tragedy-mask":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M2 1c0 0 -1 0 -1 1v5.16C1 8.89 1.35 11 4.5 11H5V8L2.5 9c0 0 0 -2.5 2.5 -2.5V5c0 -0.71 0.09 -1.32 0.5 -1.78C5.88 2.81 6.5 1.97 8.16 2.75L9 3.3V2c0 0 0 -1 -1 -1C7.29 1 6.02 2 5 2S2.79 1 2 1zM3 3c0.55 0 1 0.45 1 1S3.55 5 3 5S2 4.55 2 4S2.45 3 3 3zM7 4c0 0 -1 0 -1 1v5c0 2 1 4 4 4s4 -2 4 -4V5c0 -1 -1 -1 -1 -1c-0.71 0 -1.98 1 -3 1S7.79 4 7 4zM8 6c0.55 0 1 0.45 1 1S8.55 8 8 8S7 7.55 7 7S7.45 6 8 6zM12 6c0.55 0 1 0.45 1 1s-0.45 1 -1 1s-1 -0.45 -1 -1S11.45 6 12 6zM7.5 10H10h2.5c0 0 0 2.5 -2.5 2.5S7.5 10 7.5 10z"/>\n</svg>',croissant:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.29 4.38L6 9.5a0.98 0.98 0 0 0 1 1H8a0.98 0.98 0 0 0 1 -1l0.71 -5.12C9.71 3 7.5 3 7.5 3S5.29 3 5.29 4.38ZM3.5 5C2 5 2 6 2 6l1 4H4.5a0.79 0.79 0 0 0 0.79 -0.76L4.5 5Zm-2 2.5a1.53 1.53 0 0 0 -1.06 0.41A1.37 1.37 0 0 0 0 8.79V11H0.88A1.02 1.02 0 0 0 2 10ZM11.5 5C13 5 13 6 13 6l-1 4H10.5a0.79 0.79 0 0 1 -0.79 -0.76L10.5 5Zm2 2.5a1.53 1.53 0 0 1 1.06 0.41A1.37 1.37 0 0 1 15 8.79V11h-0.88A1.02 1.02 0 0 1 13 10Z"/>\n</svg>',"cup-and-saucer":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M12 5h-2V3H2v4c0.01 2.21 1.81 3.99 4.02 3.98C7.43 10.97 8.74 10.22 9.45 9H12c1.1 0 2 -0.9 2 -2S13.1 5 12 5zM12 8H9.86C9.95 7.67 10 7.34 10 7V6h2c0.55 0 1 0.45 1 1S12.55 8 12 8zM10 12.5c0 0.28 -0.22 0.5 -0.5 0.5h-7C2.22 13 2 12.78 2 12.5S2.22 12 2.5 12h7C9.78 12 10 12.22 10 12.5z"/>\n</svg>',donut:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.5 0C11.64 0 15 3.36 15 7.5C15 11.64 11.64 15 7.5 15C3.36 15 0 11.64 0 7.5C0 3.36 3.36 0 7.5 0zM7.21 11.12C7.12 10.88 6.35 11.16 6.42 11.38C6.48 11.61 6.83 12.78 6.93 13.04C7.02 13.3 7.83 13.04 7.75 12.78C7.67 12.53 7.3 11.35 7.21 11.12zM3.51 11.31C3.24 11.22 3 12.06 3.23 12.16C3.47 12.27 4.67 12.65 4.88 12.7C5.09 12.75 5.39 11.98 5.15 11.88C4.99 11.8 3.77 11.4 3.51 11.31zM9.7 10.98C9.47 10.89 9.12 11.66 9.39 11.79C9.69 11.92 10.75 12.33 11 12.41C11.25 12.48 11.61 11.73 11.31 11.6C11.02 11.47 9.93 11.07 9.7 10.98zM11.32 9.23C11.05 9.19 10.91 10.04 11.2 10.09C11.48 10.14 12.67 10.32 12.91 10.33C13.16 10.34 13.29 9.51 13.03 9.47C12.78 9.44 11.59 9.28 11.32 9.23zM7.5 5.19C6.23 5.19 5.19 6.23 5.19 7.5C5.19 8.78 6.23 9.81 7.5 9.81C8.78 9.81 9.81 8.78 9.81 7.5C9.81 6.23 8.78 5.19 7.5 5.19zM2.64 8.65C2.42 8.64 2.31 9.49 2.55 9.52C2.8 9.55 3.99 9.68 4.27 9.7C4.56 9.72 4.59 8.86 4.37 8.84C4.14 8.81 2.86 8.67 2.64 8.65zM12.74 6.37C12.65 6.64 12.2 7.86 12.12 8.07C12.05 8.28 12.86 8.54 12.95 8.31C13.05 8.08 13.42 6.94 13.5 6.67C13.58 6.41 12.83 6.11 12.74 6.37zM2.74 5.57C2.54 5.73 1.6 6.61 1.42 6.77C1.25 6.93 1.8 7.58 1.97 7.44C2.14 7.3 3.03 6.46 3.24 6.26C3.44 6.06 2.93 5.41 2.74 5.57zM11.71 3.53C11.59 3.35 10.86 3.69 10.99 3.94C11.13 4.19 11.71 5.25 11.83 5.45C11.95 5.66 12.71 5.24 12.59 5.03C12.47 4.83 11.84 3.72 11.71 3.53zM7.96 3.47C7.77 3.41 7.46 4.2 7.69 4.29C7.92 4.39 9.08 4.75 9.34 4.83C9.59 4.91 9.84 4.09 9.61 4.01C9.38 3.92 8.15 3.54 7.96 3.47zM2.66 3.53C2.28 3.52 2.31 4.39 2.57 4.41C2.83 4.42 4.07 4.52 4.3 4.53C4.56 4.53 4.69 3.64 4.41 3.63C4.21 3.61 3.03 3.55 2.66 3.53zM5.09 1.48C4.94 1.38 4.34 1.99 4.55 2.16C4.77 2.33 5.71 3.09 5.92 3.22C6.13 3.36 6.65 2.72 6.45 2.54C6.25 2.36 5.25 1.59 5.09 1.48zM9.44 1.16C9.19 1.19 7.97 1.39 7.73 1.43C7.48 1.47 7.61 2.31 7.86 2.28C8.11 2.25 9.34 2.07 9.57 2.01C9.8 1.95 9.68 1.13 9.44 1.16z"/>\n</svg>',edit:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-edit"><path d="M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"></path><path d="M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z"></path></svg>',eyeglasses:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1.78 3.81C2.03 3.31 2.54 3 3.1 3C3.49 3 3.86 3.15 4.14 3.43L4.85 4.15C5.05 4.34 5.05 4.66 4.85 4.85C4.66 5.05 4.34 5.05 4.15 4.85L3.43 4.14C3.34 4.05 3.22 4 3.1 4C2.92 4 2.76 4.1 2.68 4.26L1.31 7H5.25C6.07 7 6.75 7.57 6.94 8.32C7.11 8.28 7.3 8.25 7.5 8.25C7.7 8.25 7.89 8.28 8.06 8.32C8.25 7.57 8.93 7 9.75 7H13.69L12.32 4.26C12.24 4.1 12.08 4 11.9 4C11.78 4 11.66 4.05 11.57 4.14L10.85 4.85C10.66 5.05 10.34 5.05 10.15 4.85C9.95 4.66 9.95 4.34 10.15 4.15L10.86 3.43C11.14 3.15 11.51 3 11.9 3C12.46 3 12.97 3.31 13.22 3.81L14.94 7.26L14.94 7.26C14.98 7.33 15 7.41 15 7.5V8.5C15 8.78 14.78 9 14.5 9H14V9.5C14 11.09 13 12 11.25 12H10.75C9 12 8 11.09 8 9.5V9.34C7.85 9.29 7.67 9.25 7.5 9.25C7.33 9.25 7.15 9.29 7 9.34V9.5C7 11.09 6 12 4.25 12H3.75C2 12 1 11.09 1 9.5V9H0.5C0.22 9 0 8.78 0 8.5V7.5C0 7.41 0.02 7.33 0.06 7.26L0.06 7.26L1.78 3.81ZM9.75 8C9.34 8 9 8.34 9 8.75V9.5C9 10.2 9.2 11 10.75 11H11.25C12.8 11 13 10.2 13 9.5V8.75C13 8.34 12.66 8 12.25 8H9.75ZM2.75 8C2.34 8 2 8.34 2 8.75V9.5C2 10.2 2.2 11 3.75 11H4.25C5.8 11 6 10.2 6 9.5V8.75C6 8.34 5.66 8 5.25 8H2.75Z"/>\n</svg>',facebook:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-facebook"><path d="M18 2h-3a5 5 0 0 0-5 5v3H7v4h3v8h4v-8h3l1-4h-4V7a1 1 0 0 1 1-1h3z"></path></svg>',"fancy-mirror-with-reflection-and-stars":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.54 0C6.14 0 4.99 0.86 4.31 2.04C3.49 2.19 2.71 2.54 2.13 3.18C1.5 3.89 1.14 4.91 1.17 6.17C1.21 7.51 1.86 8.59 2.45 9.59C3.05 10.58 3.58 11.48 3.66 12.45C3.68 12.73 3.9 12.97 4.18 13.01C4.18 13.02 4.21 13.04 4.26 13.11C4.36 13.26 4.52 13.53 4.75 13.82C5.22 14.4 6.09 15.02 7.55 15C8.99 14.98 9.83 14.37 10.27 13.81C10.49 13.53 10.63 13.27 10.74 13.14C10.84 13.01 10.84 13.02 10.89 13.01C11.19 12.97 11.42 12.71 11.42 12.4C11.42 11.35 11.94 10.38 12.53 9.38C13.12 8.39 13.81 7.38 13.83 6.16C13.86 4.06 12.52 2.48 10.78 2.07C10.11 0.87 8.95 0 7.54 0ZM7.62 1.24C8.59 1.27 9.44 1.9 9.88 2.85C9.97 3.03 10.14 3.16 10.34 3.2C11.62 3.41 12.62 4.46 12.59 6.15C12.58 6.87 12.08 7.74 11.47 8.75C10.92 9.69 10.35 10.79 10.25 12.08C10.09 12.19 9.86 12.26 9.76 12.38C9.57 12.63 9.45 12.86 9.3 13.05C9 13.43 8.69 13.75 7.53 13.77C6.38 13.78 6.03 13.44 5.71 13.05C5.56 12.85 5.43 12.63 5.25 12.39C5.15 12.24 4.98 12.09 4.78 11.97C4.59 10.82 4.04 9.83 3.51 8.95C2.93 7.97 2.43 7.08 2.41 6.14C2.38 5.12 2.65 4.46 3.05 4.01C3.45 3.55 4.03 3.28 4.72 3.19C4.93 3.16 5.11 3.03 5.2 2.84C5.64 1.9 6.48 1.28 7.44 1.24L7.16 1.77L6.36 1.86L6.92 2.44L6.76 3.23L7.48 2.87L8.18 3.27L8.07 2.47L8.66 1.93L7.87 1.79L7.62 1.24ZM7.54 3.9C6.34 3.9 6.25 4.24 5.36 6.58C4.8 8.08 5.36 9.02 6.16 9.49C5.68 9.88 5.31 10.46 5.12 11.16C7.11 13.76 8.56 12.67 9.95 11.17C9.77 10.45 9.38 9.86 8.89 9.47C9.64 8.98 10.18 8.03 9.71 6.58C8.99 4.31 8.74 3.9 7.54 3.9ZM4.1 4.63L3.77 5.04L3.24 5L3.53 5.44L3.34 5.93L3.84 5.79L4.24 6.12L4.27 5.6L4.71 5.32L4.22 5.14L4.1 4.63ZM10.64 6.06L10.59 6.42L10.26 6.59L10.59 6.74L10.65 7.11L10.91 6.84L11.27 6.9L11.09 6.57L11.26 6.25L10.9 6.31L10.64 6.06Z"/>\n</svg>',"family-restroom-symbol":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4 3L2 3L0.5 11L2 11L2 15L4 15L4 11L5.5 11L4 3ZM14 3.5L13 3L11 3L10 3.5L10 9.5L11 9.5L11 15L13 15L13 9.5L14 9.5L14 3.5ZM12.25 2.5L11.75 2.5C11.13 2.5 10.75 2.13 10.75 1.5L10.75 1C10.75 0.38 11.13 0 11.75 0L12.38 0C12.88 0 13.25 0.38 13.25 1L13.25 1.63C13.25 2.13 12.88 2.5 12.25 2.5ZM3.25 2.5L2.75 2.5C2.13 2.5 1.75 2.13 1.75 1.5L1.75 1C1.75 0.38 2.13 0 2.75 0L3.38 0C3.88 0 4.25 0.38 4.25 1L4.25 1.63C4.25 2.13 3.88 2.5 3.25 2.5ZM7.73 7.31L7.27 7.31C6.68 7.31 6.33 6.96 6.33 6.38L6.33 5.92C6.33 5.35 6.68 5 7.27 5L7.85 5C8.32 5 8.67 5.35 8.67 5.92L8.67 6.5C8.67 6.96 8.32 7.31 7.73 7.31ZM9 8.75L8 7.75L7 7.75L6 8.75L6 12.5L7 15L8 15L9 12.5L9 8.75Z"/>\n</svg>',film:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M2 1C1.45 1 1 1.45 1 2L1 13C1 13.55 1.45 14 2 14L13 14C13.55 14 14 13.55 14 13L14 2C14 1.45 13.55 1 13 1L2 1ZM2.25 2L2.75 2C2.89 2 3 2.11 3 2.25L3 2.75C3 2.89 2.89 3 2.75 3L2.25 3C2.11 3 2 2.89 2 2.75L2 2.25C2 2.11 2.11 2 2.25 2ZM4 2L11 2L11 7L4 7L4 2ZM12.25 2L12.75 2C12.89 2 13 2.11 13 2.25L13 2.75C13 2.89 12.89 3 12.75 3L12.25 3C12.11 3 12 2.89 12 2.75L12 2.25C12 2.11 12.11 2 12.25 2ZM2.25 4L2.75 4C2.89 4 3 4.11 3 4.25L3 4.75C3 4.89 2.89 5 2.75 5L2.25 5C2.11 5 2 4.89 2 4.75L2 4.25C2 4.11 2.11 4 2.25 4ZM12.25 4L12.75 4C12.89 4 13 4.11 13 4.25L13 4.75C13 4.89 12.89 5 12.75 5L12.25 5C12.11 5 12 4.89 12 4.75L12 4.25C12 4.11 12.11 4 12.25 4ZM2.25 6L2.75 6C2.89 6 3 6.11 3 6.25L3 6.75C3 6.89 2.89 7 2.75 7L2.25 7C2.11 7 2 6.89 2 6.75L2 6.25C2 6.11 2.11 6 2.25 6ZM12.25 6L12.75 6C12.89 6 13 6.11 13 6.25L13 6.75C13 6.89 12.89 7 12.75 7L12.25 7C12.11 7 12 6.89 12 6.75L12 6.25C12 6.11 12.11 6 12.25 6ZM2.25 8L2.75 8C2.89 8 3 8.11 3 8.25L3 8.75C3 8.89 2.89 9 2.75 9L2.25 9C2.11 9 2 8.89 2 8.75L2 8.25C2 8.11 2.11 8 2.25 8ZM4 8L11 8L11 13L4 13L4 8ZM12.25 8L12.75 8C12.89 8 13 8.11 13 8.25L13 8.75C13 8.89 12.89 9 12.75 9L12.25 9C12.11 9 12 8.89 12 8.75L12 8.25C12 8.11 12.11 8 12.25 8ZM2.25 10L2.75 10C2.89 10 3 10.11 3 10.25L3 10.75C3 10.89 2.89 11 2.75 11L2.25 11C2.11 11 2 10.89 2 10.75L2 10.25C2 10.11 2.11 10 2.25 10ZM12.25 10L12.75 10C12.89 10 13 10.11 13 10.25L13 10.75C13 10.89 12.89 11 12.75 11L12.25 11C12.11 11 12 10.89 12 10.75L12 10.25C12 10.11 12.11 10 12.25 10ZM2.25 12L2.75 12C2.89 12 3 12.11 3 12.25L3 12.75C3 12.89 2.89 13 2.75 13L2.25 13C2.11 13 2 12.89 2 12.75L2 12.25C2 12.11 2.11 12 2.25 12ZM12.25 12L12.75 12C12.89 12 13 12.11 13 12.25L13 12.75C13 12.89 12.89 13 12.75 13L12.25 13C12.11 13 12 12.89 12 12.75L12 12.25C12 12.11 12.11 12 12.25 12Z"/>\n</svg>',"fingernail-polished":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M11 6.5C11.5 9 12 11 12 15L11 15C11 12 10.5 9.5 10.5 9.5C10.5 9.5 10.5 12 7.5 12C4.5 12 4.5 9.5 4.5 9.5C4.5 9.5 4 12 4 15C4 15 3 15 3 15C3 11 3.5 9 4 6.5C4 2 4 0 7.5 0C11 0 11 2 11 6.5zM7.5 1C5 1 5 2.5 5 7C5.5 4 5.5 2 7.5 1z"/>\n</svg>',fish:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M8.57 3.21C11.79 3.21 15 5.36 15 7.5C15 9.64 11.79 11.79 8.57 11.79C6.17 11.76 3.21 9.64 3.21 7.5C3.21 5.36 6.43 3.21 8.57 3.21ZM3.21 7.5C3.21 9.64 1.46 11.01 0 11.79C0 9.64 0.71 8.93 1.07 7.5C0.71 6.07 0 5.36 0 3.21C1.32 3.93 3.21 5.36 3.21 7.5ZM11.8 5.36C11.22 5.35 10.73 5.81 10.71 6.4L10.71 6.43C10.71 7.02 11.19 7.5 11.78 7.5C12.37 7.5 12.85 7.03 12.86 6.44C12.86 5.89 12.45 5.43 11.92 5.37L11.8 5.36Z"/>\n</svg>',"flag-checkered":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4.99 1.58C5.04 1.31 4.85 1.05 4.58 1.01C4.31 0.96 4.05 1.15 4.01 1.42L2.01 13.42C1.96 13.69 2.15 13.95 2.42 13.99C2.69 14.04 2.95 13.85 2.99 13.58L3.66 9.56C4.47 9.68 5.34 9.72 6.03 10.2C6.45 10.51 6.94 10.7 7.46 10.78C8.42 10.93 9.29 10.4 10.24 10.55L11.53 10.74C11.79 10.78 12.06 10.58 12.1 10.32L12.98 4.39L12.99 4.38C13.02 4.12 12.82 3.86 12.56 3.82L11.27 3.63C10.31 3.48 9.44 4 8.49 3.86C8.06 3.79 7.65 3.63 7.3 3.38C6.56 2.86 5.68 2.78 4.81 2.66L4.99 1.58ZM4.4 5.12L4.73 3.15C5.33 3.23 5.97 3.28 6.52 3.52L6.23 5.48C5.66 5.25 5.01 5.2 4.4 5.12ZM3.75 9.07L4.07 7.1C4.69 7.18 5.35 7.22 5.93 7.46L6.23 5.49C6.89 5.76 7.39 6.22 8.13 6.33L8.43 4.35C9.16 4.46 9.77 4.17 10.48 4.11L10.18 6.08C9.47 6.14 8.86 6.44 8.12 6.33L7.84 8.31C7.1 8.2 6.6 7.73 5.94 7.46L5.64 9.44C5.04 9.2 4.38 9.16 3.75 9.07ZM7.84 8.31C8.57 8.42 9.19 8.12 9.9 8.06L10.18 6.08C10.84 6.02 11.51 6.19 12.15 6.29L11.87 8.26C11.23 8.17 10.56 8 9.9 8.06L9.6 10.03C8.89 10.08 8.27 10.39 7.54 10.28L7.84 8.31Z"/>\n</svg>',"flower-bouquet":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1.5 1A2.7 2.7 0 0 1 4 3l0.5 -3L5 3A2.7 2.7 0 0 1 7.5 1c-0.2 0.03 -1 0.26 -1 2v0.08A1.96 1.96 0 0 1 4.5 5H4.42A1.96 1.96 0 0 1 2.5 3C2.5 1.26 1.7 1.03 1.5 1ZM12.01 11l3 -0.5l-3 -0.5A2.69 2.69 0 0 0 14 7.5c-0.03 0.2 -0.25 1 -1.99 1a2 2 0 0 0 0 4c1.74 0 1.96 0.8 1.99 1A2.69 2.69 0 0 0 12.01 11ZM9.69 5.55a1 1 0 0 1 0 -2a1 1 0 0 1 0 -2a0.99 0.99 0 0 1 0.85 0.51l0.02 -0.01a0.98 0.98 0 0 1 -0.12 -0.44a1 1 0 1 1 2 0a0.98 0.98 0 0 1 -0.12 0.44l0.02 0.01a0.99 0.99 0 0 1 0.85 -0.5a1 1 0 0 1 0.03 2a1 1 0 0 1 -0.02 2a0.99 0.99 0 0 1 -0.85 -0.5l-0.02 0.01a0.98 0.98 0 0 1 0.11 0.44a1 1 0 0 1 -2 0a0.98 0.98 0 0 1 0.11 -0.44l-0.02 -0.01a0.99 0.99 0 0 1 -0.85 0.51Zm0.71 -1.99A1.05 1.05 0 1 0 11.45 2.5A1.05 1.05 0 0 0 10.4 3.55v0ZM4.95 11.44l-0.52 -0.51L8.89 6.48A1.75 1.75 0 0 1 8.44 6.22L4.08 10.58l-0.52 -0.52A16.05 16.05 0 0 0 4.91 6a3.37 3.37 0 0 1 -0.41 0.04c-0.04 0 -0.07 -0.01 -0.11 -0.01A16.95 16.95 0 0 1 3.13 9.63L2.76 9.26a0.25 0.25 0 0 0 -0.4 0.08L0.23 14.45a0.29 0.29 0 0 0 -0.02 0.09a0.25 0.25 0 0 0 0.25 0.25a0.29 0.29 0 0 0 0.1 -0.02l5.1 -2.12a0.25 0.25 0 0 0 0.08 -0.4l-0.37 -0.37a16.87 16.87 0 0 1 3.61 -1.26c0 -0.06 -0.01 -0.11 -0.01 -0.17A3.35 3.35 0 0 1 9 10.09A16.08 16.08 0 0 0 4.95 11.44Z"/>\n</svg>',"fork-and-knife":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3.5 0l-1 5.5c-0.15 0.81 1.78 1.18 1.75 2L4 14c-0.04 1 1 1 1 1s1.04 0 1 -1L5.75 7.5c-0.03 -0.82 1.73 -1.18 1.75 -2L6.5 0H6l0.25 4L5.5 4.5L5.25 0h-0.5L4.5 4.5L3.75 4L4 0H3.5zM12 0c-0.74 0 -1.96 0.65 -2.46 1.64C9.14 2.37 9 4.02 9 5v2.5c0 0.82 1.09 1 1.5 1L10 14c-0.09 1 1 1 1 1s1 0 1 -1V0z"/>\n</svg>',fort:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1.07 1.07L1.07 3.21L6.43 3.21L6.43 1.07L5.36 1.07L5.36 2.14L4.29 2.14L4.29 1.07L3.21 1.07L3.21 2.14L2.14 2.14L2.14 1.07L1.07 1.07ZM8.57 1.07L8.57 3.21L13.93 3.21L13.93 1.07L12.86 1.07L12.86 2.14L11.79 2.14L11.79 1.07L10.71 1.07L10.71 2.14L9.64 2.14L9.64 1.07L8.57 1.07ZM1.07 4.29L1.07 10.71L13.93 10.71L13.93 4.29L8.57 4.29L8.57 6.43L6.43 6.43L6.43 4.29L1.07 4.29ZM3.21 6.43L4.29 6.43L4.29 7.5L3.75 8.57L3.21 7.5L3.21 6.43ZM10.71 6.43L11.79 6.43L11.79 7.5L11.25 8.57L10.71 7.5L10.71 6.43ZM1.07 11.79L0 15L15 15L13.93 11.79L1.07 11.79Z"/>\n</svg>',gift:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-gift"><polyline points="20 12 20 22 4 22 4 12"></polyline><rect x="2" y="7" width="20" height="5"></rect><line x1="12" y1="22" x2="12" y2="7"></line><path d="M12 7H7.5a2.5 2.5 0 0 1 0-5C11 2 12 7 12 7z"></path><path d="M12 7h4.5a2.5 2.5 0 0 0 0-5C13 2 12 7 12 7z"></path></svg>',globe:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-globe"><circle cx="12" cy="12" r="10"></circle><line x1="2" y1="12" x2="22" y2="12"></line><path d="M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z"></path></svg>',gravestone:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M11.46 12h-0.68L12 3.55c0.02 -0.29 -0.2 -0.53 -0.49 -0.55C11.49 3 11.46 3 11.44 3h-1.18c0 -0.92 -1.23 -2 -2.75 -2S4.77 2.08 4.77 3H3.54C3.25 2.99 3.01 3.21 3 3.5C3 3.52 3 3.53 3 3.55L4.2 12H3.55C3.26 11.99 3.02 12.21 3 12.5V14h9v-1.51C11.98 12.21 11.74 11.99 11.46 12zM4.5 5h6v1h-6V5z"/>\n</svg>',"grecian-vase":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3.21 0L3.21 1.07L4.29 1.07C4.93 1.07 5.19 2.19 5.29 3.11C4.25 2.3 3.24 2.01 2.38 2.18C1.27 2.38 0.54 3.4 0.54 4.55C0.54 5.46 0.87 6.25 1.44 7.06C1.94 7.78 2.64 8.61 3.52 9.61C3.91 11.07 4.63 12.4 5.36 13.13L5.36 13.93L4.29 14.46L4.29 15L10.71 15L10.71 14.46L9.64 13.93L9.64 13.13C10.37 12.4 11.09 11.07 11.48 9.61C12.36 8.61 13.06 7.78 13.56 7.06C14.13 6.25 14.46 5.46 14.46 4.55C14.46 3.4 13.73 2.38 12.62 2.18C11.76 2.01 10.75 2.3 9.71 3.11C9.81 2.19 10.07 1.07 10.71 1.07L11.79 1.07L11.79 0L3.21 0ZM2.54 3.25C3.09 3.15 4 3.36 5.06 4.32C3.86 4.47 3.21 5.52 3.21 7.5C3.21 7.53 3.21 7.57 3.21 7.6C2.85 7.18 2.55 6.8 2.31 6.46C1.81 5.74 1.61 5.21 1.61 4.55C1.61 3.8 1.94 3.36 2.54 3.25ZM11.92 3.25C12.12 3.22 12.3 3.22 12.46 3.25C13.06 3.36 13.39 3.8 13.39 4.55C13.39 5.21 13.19 5.74 12.69 6.46C12.45 6.8 12.15 7.18 11.79 7.6C11.79 7.57 11.79 7.53 11.79 7.5C11.79 5.52 11.14 4.47 9.94 4.32C10.71 3.62 11.39 3.32 11.92 3.25Z"/>\n</svg>',"greek-cross":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7 1C6.4 1 6 1.4 6 2v4H2C1.4 6 1 6.4 1 7v1c0 0.6 0.4 1 1 1h4v4c0 0.6 0.4 1 1 1h1c0.6 0 1 -0.4 1 -1V9h4c0.6 0 1 -0.4 1 -1V7c0 -0.6 -0.4 -1 -1 -1H9V2c0 -0.6 -0.4 -1 -1 -1H7z"/>\n</svg>',heart:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-heart"><path d="M20.84 4.61a5.5 5.5 0 0 0-7.78 0L12 5.67l-1.06-1.06a5.5 5.5 0 0 0-7.78 7.78l1.06 1.06L12 21.23l7.78-7.78 1.06-1.06a5.5 5.5 0 0 0 0-7.78z"></path></svg>',home:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-home"><path d="M3 9l9-7 9 7v11a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z"></path><polyline points="9 22 9 12 15 12 15 22"></polyline></svg>',"ice-cream-on-cone":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.44 8.17a3.47 3.47 0 0 0 2 -0.63A3.5 3.5 0 0 0 9 8.14h0.44L8 13.7a0.5 0.5 0 0 1 -0.92 0Zm6 -3.47a2 2 0 0 1 -4 0h0a2 2 0 1 1 -2 -2h0.12a2 2 0 1 1 3.75 0h0.13A2 2 0 0 1 11.44 4.7Z"/>\n</svg>',info:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-info"><circle cx="12" cy="12" r="10"></circle><line x1="12" y1="16" x2="12" y2="12"></line><line x1="12" y1="8" x2="12.01" y2="8"></line></svg>',instagram:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-instagram"><rect x="2" y="2" width="20" height="20" rx="5" ry="5"></rect><path d="M16 11.37A4 4 0 1 1 12.63 8 4 4 0 0 1 16 11.37z"></path><line x1="17.5" y1="6.5" x2="17.51" y2="6.5"></line></svg>',jewel:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M15 5.5C15 5.5 11.5 1.5 11.5 1.5C11.5 1.5 3.5 1.5 3.5 1.5C3.5 1.5 0 5.5 0 5.5C0 5.5 7.5 14 7.5 14C7.5 14 15 5.5 15 5.5zM10.75 5.5L11.5 2.5L14 5.5L10.75 5.5zM10.5 6.25L13.25 6.25L8.5 12L10.5 6.25zM10 5.5L8 2.25L10.75 2.25L10 5.5zM5.5 6.25L9.5 6.25L7.5 12.5L5.5 6.25zM5.75 5.5L7.5 2.5L9.25 5.5L5.75 5.5zM5 5.5L4.25 2.25L7 2.25L5 5.5zM6.5 12L1.5 6.25L4.5 6.25L6.5 12zM3.5 2.5L4.25 5.5L1 5.5L3.5 2.5z"/>\n</svg>',"log-in":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-in"><path d="M15 3h4a2 2 0 0 1 2 2v14a2 2 0 0 1-2 2h-4"></path><polyline points="10 17 15 12 10 7"></polyline><line x1="15" y1="12" x2="3" y2="12"></line></svg>',"log-out":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-log-out"><path d="M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"></path><polyline points="16 17 21 12 16 7"></polyline><line x1="21" y1="12" x2="9" y2="12"></line></svg>',"lowrise-building":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3 2v11h5v-3h3v3h1V2H3zM7 12H4v-2h3V12zM7 9H4V7h3V9zM7 6H4V4h3V6zM11 9H8V7h3V9zM11 6H8V4h3V6z"/>\n</svg>',mail:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-mail"><path d="M4 4h16c1.1 0 2 .9 2 2v12c0 1.1-.9 2-2 2H4c-1.1 0-2-.9-2-2V6c0-1.1.9-2 2-2z"></path><polyline points="22,6 12,13 2,6"></polyline></svg>',map:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-map"><polygon points="1 6 1 22 8 18 16 22 23 18 23 2 16 6 8 2 1 6"></polygon><line x1="8" y1="2" x2="8" y2="18"></line><line x1="16" y1="6" x2="16" y2="22"></line></svg>',"map-pin":'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-map-pin"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3"></circle></svg>',"market-stall":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1 1L1 1.93L1 2.86C1 3.88 1.83 4.71 2.86 4.71C3.88 4.71 4.71 3.88 4.71 2.86L5.64 2.86C5.64 3.88 6.47 4.71 7.5 4.71C8.53 4.71 9.36 3.88 9.36 2.86L10.29 2.86C10.29 3.88 11.12 4.71 12.14 4.71C13.17 4.71 14 3.88 14 2.86L14 1.93L14 1L12.14 1L1 1ZM1 5.64L1 9.36L1 11.21L1 14L2.86 14L2.86 11.21L12.14 11.21L12.14 14L14 14L14 11.21L14 9.36L14 5.64L12.14 5.64L12.14 9.36L2.86 9.36L2.86 5.64L1 5.64Z"/>\n</svg>',"memorial-stone-with-inscription":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M13 12.5L14 14L1.14 14L2 12.5L13 12.5ZM8.5 1C10.43 1 12 2.57 12 4.5L12 12L3 12L3 4.5C3 2.57 4.57 1 6.5 1ZM9.5 8L5.5 8L5.5 9L9.5 9L9.5 8ZM10.5 6L4.5 6L4.5 7L10.5 7L10.5 6ZM9 4L6 4L6 5L9 5L9 4Z"/>\n</svg>',menu:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-menu"><line x1="3" y1="12" x2="21" y2="12"></line><line x1="3" y1="6" x2="21" y2="6"></line><line x1="3" y1="18" x2="21" y2="18"></line></svg>',"mobile-phone-with-keypad-and-antenna":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10.5 0C10.78 0 11 0.22 11 0.5L11 13.18C11 13.82 10.6 14.4 10 14.63C9.34 14.87 8.64 15 7.93 15L7.07 15C6.36 15 5.66 14.87 5 14.63C4.4 14.4 4 13.82 4 13.18L4 3.82C4 3.18 4.4 2.6 5 2.38C5.66 2.13 6.36 2 7.07 2L7.93 2C8.64 2 9.34 2.13 10 2.38L10 0.5C10 0.22 10.22 0 10.5 0ZM5.75 12L5.25 12C5.11 12 5 12.11 5 12.25L5 12.75C5 12.89 5.11 13 5.25 13L5.75 13C5.89 13 6 12.89 6 12.75L6 12.25C6 12.11 5.89 12 5.75 12ZM7.75 12L7.25 12C7.11 12 7 12.11 7 12.25L7 12.75C7 12.89 7.11 13 7.25 13L7.75 13C7.89 13 8 12.89 8 12.75L8 12.25C8 12.11 7.89 12 7.75 12ZM9.75 12L9.25 12C9.11 12 9 12.11 9 12.25L9 12.75C9 12.89 9.11 13 9.25 13L9.75 13C9.89 13 10 12.89 10 12.75L10 12.25C10 12.11 9.89 12 9.75 12ZM5.75 10L5.25 10C5.11 10 5 10.11 5 10.25L5 10.75C5 10.89 5.11 11 5.25 11L5.75 11C5.89 11 6 10.89 6 10.75L6 10.25C6 10.11 5.89 10 5.75 10ZM7.75 10L7.25 10C7.11 10 7 10.11 7 10.25L7 10.75C7 10.89 7.11 11 7.25 11L7.75 11C7.89 11 8 10.89 8 10.75L8 10.25C8 10.11 7.89 10 7.75 10ZM9.75 10L9.25 10C9.11 10 9 10.11 9 10.25L9 10.75C9 10.89 9.11 11 9.25 11L9.75 11C9.89 11 10 10.89 10 10.75L10 10.25C10 10.11 9.89 10 9.75 10ZM5.75 8L5.25 8C5.11 8 5 8.11 5 8.25L5 8.75C5 8.89 5.11 9 5.25 9L5.75 9C5.89 9 6 8.89 6 8.75L6 8.25C6 8.11 5.89 8 5.75 8ZM7.75 8L7.25 8C7.11 8 7 8.11 7 8.25L7 8.75C7 8.89 7.11 9 7.25 9L7.75 9C7.89 9 8 8.89 8 8.75L8 8.25C8 8.11 7.89 8 7.75 8ZM9.75 8L9.25 8C9.11 8 9 8.11 9 8.25L9 8.75C9 8.89 9.11 9 9.25 9L9.75 9C9.89 9 10 8.89 10 8.75L10 8.25C10 8.11 9.89 8 9.75 8ZM9.5 5L5.5 5C5.22 5 5 5.22 5 5.5L5 6.5C5 6.78 5.22 7 5.5 7L9.5 7C9.78 7 10 6.78 10 6.5L10 5.5C10 5.22 9.78 5 9.5 5ZM8.5 3L6.5 3C6.22 3 6 3.22 6 3.5C6 3.78 6.22 4 6.5 4L8.5 4C8.78 4 9 3.78 9 3.5C9 3.22 8.78 3 8.5 3Z"/>\n</svg>',"molar-tooth":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4.36 14c-1 0 -0.56 -2.67 -0.86 -5c-0.1 -0.76 -1 -1.49 -1.12 -2.06C2 5 1.39 1.44 3.66 1S6 3 7.54 3s1.57 -2.36 3.85 -2s1.59 3.9 1.29 5.9c-0.1 0.45 -1.1 1.48 -1.18 2.06c-0.33 2.4 0.32 5 -0.8 5c-0.93 0 -1.32 -2.72 -2 -4.5C8.43 8.63 8.06 8 7.54 8C6 8 5.75 14 4.36 14z"/>\n</svg>',navigation:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-navigation"><polygon points="3 11 22 2 13 21 11 13 3 11"></polygon></svg>',"needle-and-spool-of-thread":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.87 1.98L5.13 1.97C4.97 1.97 4.83 1.97 4.68 1.97C3.24 2 2.41 2.16 2.1 2.71C1.65 3.5 2.47 4.27 4.54 5.33L5.23 5.68C5.72 5.93 6.09 6.14 6.35 6.32C6.4 6.35 6.45 6.38 6.49 6.41L6.29 6.46L5.62 6.58L5 6.71C3.41 7.09 2.5 7.73 2.5 9L2.5 13L7.5 13L7.5 9L3.5 9C3.5 8.39 3.99 8.02 5.03 7.74L5.23 7.69C5.36 7.66 5.49 7.63 5.65 7.6L6.37 7.46L6.68 7.39C6.91 7.34 7.08 7.29 7.22 7.22C7.61 7.04 7.84 6.71 7.69 6.28C7.53 5.83 6.88 5.4 5.46 4.67L5.22 4.55C4.25 4.06 3.59 3.66 3.23 3.35L3.07 3.21C3.03 3.17 3.01 3.16 2.99 3.17L2.98 3.19C3.1 3.12 3.69 3.01 4.51 2.98L4.7 2.97C5.09 2.96 5.48 2.97 6.02 2.98L6.37 3C6.39 3 6.41 3 6.43 3L7.54 4.58C8.97 6.6 11.46 10.04 15 14.92L11.07 6.14C9.65 3 8.86 1.28 8.68 0.98C8.24 0.21 7.37 -0.3 6.5 0.2C5.81 0.6 5.68 1.32 5.87 1.98ZM9 13.5L9 8.5C9 8.22 8.78 8 8.5 8C8.22 8 8 8.22 8 8.5L8 13.5C8 13.78 8.22 14 8.5 14C8.78 14 9 13.78 9 13.5ZM2 13.5L2 8.5C2 8.22 1.78 8 1.5 8C1.22 8 1 8.22 1 8.5L1 13.5C1 13.78 1.22 14 1.5 14C1.78 14 2 13.78 2 13.5ZM7.82 3.48L6.82 1.75C6.68 1.51 6.76 1.2 7 1.06C7.24 0.93 7.54 1.01 7.68 1.25L8.68 2.98C8.82 3.22 8.74 3.52 8.5 3.66C8.29 3.78 8.03 3.74 7.87 3.55L7.82 3.48Z"/>\n</svg>',"open-book":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M0.09 10.16C-0.01 10.08 0 9.94 0 9.94L0.61 2.77C0.61 2.77 0.62 2.69 0.66 2.66C0.67 2.62 0.7 2.59 0.75 2.57C1.36 2.33 4.67 0.54 6.35 2.2C6.62 2.52 6.92 2.99 6.92 3.35L6.92 9.41C6.92 9.41 6.93 9.54 6.81 9.62C6.78 9.64 6.67 9.69 6.53 9.62C3.96 8.35 1.1 9.79 0.37 10.18C0.23 10.25 0.12 10.17 0.09 10.16ZM14.63 10.18C13.9 9.8 11.04 8.35 8.47 9.62C8.33 9.69 8.22 9.63 8.19 9.62C8.07 9.54 8.08 9.41 8.08 9.41L8.08 3.35C8.08 2.99 8.38 2.52 8.65 2.2C10.33 0.54 13.62 2.33 14.23 2.57C14.28 2.59 14.31 2.62 14.33 2.65C14.37 2.69 14.38 2.77 14.38 2.77L15 9.94C15 9.94 15.01 10.08 14.91 10.16C14.88 10.17 14.77 10.25 14.63 10.18ZM9.07 13.31C9.12 13.3 9.18 13.27 9.21 13.22C9.23 13.18 9.25 13.15 9.25 13.09C9.31 12.02 11.12 11.02 14.62 13.06C14.71 13.11 14.82 13.11 14.9 13.04C15 12.97 15 12.85 15 12.85L15 12.22C15 12.22 15 12.13 14.97 12.09C14.94 12.05 14.91 12.02 14.86 11.98C12.52 10.48 9.57 9.8 8.07 11.8C8.04 11.84 8.02 11.87 7.98 11.9C7.93 11.95 7.85 11.95 7.85 11.95L7.17 11.95C7.17 11.95 7.08 11.95 7.02 11.9C6.97 11.87 6.96 11.84 6.93 11.8C5.43 9.8 2.48 10.45 0.14 11.95C0.09 11.97 0.06 12.01 0.03 12.05C0 12.1 0 12.19 0 12.19L0 12.82C0 12.82 0 12.95 0.09 13.01C0.18 13.08 0.29 13.08 0.37 13.04C3.85 11 5.68 12.03 5.73 13.11C5.73 13.16 5.76 13.19 5.78 13.23C5.8 13.27 5.87 13.31 5.92 13.32C6.76 13.52 7.97 13.6 9.07 13.31Z"/>\n</svg>',palace:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M12.86 2.14L11.79 3.75L11.79 4.29L15 4.29L15 3.75L13.93 2.14L12.86 2.14ZM1.07 2.14L0 3.75L0 4.29L3.21 4.29L3.21 3.75L2.14 2.14L1.07 2.14ZM4.29 4.29L10.71 4.29L10.71 3.21L7.5 0L4.29 3.21L4.29 4.29ZM0 5.36L0 13.93L5.36 13.93C5.36 12.86 5.36 10.71 7.5 10.71C9.64 10.71 9.64 12.86 9.64 13.93L15 13.93L15 5.36L11.81 5.36L11.79 6.43L10.71 6.43L10.75 5.36L4.33 5.36L4.29 6.43L3.21 6.43L3.21 5.36L0 5.36ZM3.21 8.57C4.29 8.57 4.29 9.64 4.29 10.71L2.14 10.71C2.14 9.64 2.14 8.57 3.21 8.57ZM11.79 8.57C12.86 8.57 12.86 9.35 12.86 10.71L10.71 10.74C10.68 9.37 10.71 8.57 11.79 8.57Z"/>\n</svg>',"person-cricket-batting-at-cricket-ball":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M8 1.5C8 2.33 7.33 3 6.5 3S5 2.33 5 1.5S5.67 0 6.5 0S8 0.67 8 1.5zM10.88 7.18L10.88 7.18l-2 -2l0 0l0 0C8.78 5.06 8.63 5 8.48 5H3.75C3.37 4.99 3.05 5.27 3 5.64l0 0l-1 7.7l0 0c-0.01 0.05 -0.01 0.09 0 0.14c0 0.28 0.22 0.5 0.5 0.5c0.23 0.02 0.43 -0.13 0.5 -0.34l0 0l1.2 -3.89l0 0l0.26 -0.83l0.4 0.44l0 0L6 10.6v2.9C6 13.78 6.22 14 6.5 14S7 13.78 7 13.5v-3l0 0l0 0c-0.01 -0.08 -0.04 -0.15 -0.08 -0.22l0 0L5.48 8.5l1 -2.5h1.71l2 1.84l0 0c0.09 0.11 0.23 0.17 0.37 0.17C10.82 7.98 11.01 7.76 11 7.5C11 7.38 10.96 7.27 10.88 7.18zM14 11.27c-0.41 0 -0.75 0.34 -0.75 0.75s0.34 0.75 0.75 0.75s0.75 -0.34 0.75 -0.75S14.41 11.27 14 11.27zM10.76 9.74V9c0 -0.14 -0.11 -0.25 -0.25 -0.25S10.26 8.86 10.26 9v0.74c-0.15 0.09 -0.25 0.25 -0.25 0.42v3.34c0 0.28 0.22 0.5 0.5 0.5s0.5 -0.22 0.5 -0.5v-3.34C11.01 9.99 10.91 9.83 10.76 9.74z"/>\n</svg>',"person-boarding-tram-with-destination-display-and-pantograph-on-tram-track":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.5 7.51C5.5 7.64 5.45 7.76 5.35 7.85L4.35 8.85C4.2 9.01 3.96 9.05 3.76 8.94L3.5 8.8L3.5 9.94L4.72 10.55C4.89 10.64 5 10.81 5 11L5 12.5C5 12.78 4.78 13 4.5 13C4.22 13 4 12.78 4 12.5L4 11.31L3.05 10.83C3.03 10.85 3.02 10.86 3 10.87L3 12L2.97 12.16L2.47 13.66C2.39 13.92 2.1 14.06 1.84 13.97C1.58 13.89 1.44 13.6 1.53 13.34L2 11.92L2 10.87C1.7 10.69 1.5 10.37 1.5 10L1.5 8.25C1.5 7.7 1.95 7.25 2.5 7.25C2.71 7.25 2.9 7.31 3.07 7.43L3.91 7.88L4.65 7.15C4.84 6.95 5.16 6.95 5.35 7.15C5.45 7.24 5.5 7.36 5.5 7.49L5.5 4.83C5.5 4.3 5.71 3.79 6.09 3.41L7.5 2L9 2L9 1L7.5 1C7.22 1 7 0.78 7 0.5C7 0.22 7.22 0 7.5 0L11.5 0C11.78 0 12 0.22 12 0.5C12 0.78 11.78 1 11.5 1L10 1L10 2L11.5 2L12.91 3.41C13.29 3.79 13.5 4.3 13.5 4.83L13.5 11C13.5 12.1 12.6 13 11.5 13L7.5 13C6.4 13 5.5 12.1 5.5 11L5.5 7.51ZM8.25 13.5L7.5 15L6 15L6.75 13.5L8.25 13.5ZM12.25 13.5L13 15L11.5 15L10.75 13.5L12.25 13.5ZM10.5 12L11.5 12C12.05 12 12.5 11.55 12.5 11L12.5 10C11.4 10 10.5 10.9 10.5 12ZM8.5 12C8.5 10.9 7.6 10 6.5 10L6.5 11C6.5 11.55 6.95 12 7.5 12L8.5 12ZM6.5 5.5L6.5 8.5C6.5 8.78 6.72 9 7 9L12 9C12.28 9 12.5 8.78 12.5 8.5L12.5 5.5C12.5 5.22 12.28 5 12 5L7 5C6.72 5 6.5 5.22 6.5 5.5ZM7.5 3.5C7.5 3.78 7.72 4 8 4L11 4C11.28 4 11.5 3.78 11.5 3.5C11.5 3.22 11.28 3 11 3L8 3C7.72 3 7.5 3.22 7.5 3.5ZM2.5 7C1.95 7 1.5 6.55 1.5 6C1.5 5.45 1.95 5 2.5 5C3.05 5 3.5 5.45 3.5 6C3.5 6.55 3.05 7 2.5 7Z"/>\n</svg>',"person-jockeying-racehorse":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10 1C9.73 1 9.48 1.11 9.29 1.29C9.11 1.48 9 1.73 9 2C9 2.27 9.11 2.52 9.29 2.71C9.48 2.89 9.73 3 10 3C10.27 3 10.52 2.89 10.71 2.71C10.89 2.52 11 2.27 11 2C11 1.73 10.89 1.48 10.71 1.29C10.52 1.11 10.27 1 10 1ZM5.5 3C5.25 3 4.5 3 5 3.75L6.25 6H4.5C4.22 6 3.98 6.1 3.75 6.25C2.94 5.12 2.24 5.55 1.51 6C1.11 6.25 0.69 6.5 0.25 6.5C0.18 6.5 0.12 6.53 0.08 6.58C0.03 6.62 0 6.68 0 6.75C0 6.82 0.03 6.88 0.08 6.92C0.12 6.97 0.18 7 0.25 7C0.63 7.02 1.06 6.91 1.49 6.79C2.14 6.62 2.8 6.45 3.25 6.75C3.16 6.94 3 7.5 3 8L3 9.51C2.79 9.71 2.62 9.63 2.44 9.55C2.3 9.49 2.16 9.42 2 9.5L1 12.45C1 12.7 1.39 12.75 1.5 12.5L2.25 10.74C3 10.74 4.5 10 5 9L9 10L11.5 12.5C11.7 12.7 12.12 12.36 11.96 12.12L10 9L12 6.5C12.25 7 12.5 7 12.99 7H13L13.6 7.75C13.99 8.24 14.82 7.74 14.5 7.25L12.83 4.79L13 4.5C13.06 4.31 12.64 3.92 12.5 4L10.5 5.5L8.89 3.19C8.84 3.13 8.78 3.08 8.72 3.05C8.65 3.02 8.57 3 8.5 3H5.5ZM9 5.25L9.5 6L6.78 7.92C6.72 7.95 6.66 7.98 6.6 8C6.53 8.01 6.46 8.01 6.4 8C6.33 7.99 6.27 7.96 6.21 7.93C6.16 7.89 6.11 7.84 6.07 7.79C6.03 7.73 6.01 7.67 6 7.6C5.98 7.54 5.98 7.47 6 7.4C6.01 7.34 6.04 7.28 6.08 7.22C6.12 7.17 6.17 7.12 6.22 7.08L9 5.25Z"/>\n</svg>',"person-playing-tennis":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M13.27 7.26C13.57 7.26 13.82 7.51 13.82 7.82C13.82 8.12 13.57 8.36 13.27 8.36C12.96 8.36 12.72 8.12 12.72 7.82C12.72 7.51 12.96 7.27 13.27 7.27L13.27 7.26ZM5.62 2.69C4.96 2.69 4.43 2.15 4.43 1.49C4.43 0.83 4.96 0.3 5.62 0.3C6.28 0.3 6.82 0.83 6.82 1.49C6.82 2.15 6.28 2.69 5.62 2.69ZM0.48 13.31L2.42 11.02L3.03 7.48L3.56 5.09L2.96 5.43L1.94 7.39C1.86 7.53 1.73 7.64 1.58 7.68C1.42 7.73 1.25 7.72 1.11 7.64C0.97 7.57 0.86 7.44 0.82 7.28C0.77 7.13 0.78 6.96 0.86 6.82L1.99 4.68C2.01 4.65 2.03 4.61 2.07 4.57C2.15 4.49 2.33 4.39 2.33 4.39L4.49 3.17C4.76 3.03 5.06 2.98 5.37 3.05C5.49 3.08 5.61 3.12 5.74 3.2L5.77 3.21C5.88 3.27 6.27 3.5 6.51 4.06L7.62 6.29L9.37 6.63L9.41 6.64L10.99 5.53C11.34 5.28 11.39 4.54 11.39 4.51C11.43 4 11.73 3.52 12.2 3.19C12.62 2.89 13.13 2.76 13.6 2.84C13.97 2.9 14.27 3.09 14.47 3.36C14.63 3.58 14.71 3.84 14.71 4.11L14.69 4.35C14.6 4.82 14.32 5.26 13.89 5.56C13.47 5.87 12.96 5.99 12.49 5.91L12.38 5.89C12.37 5.89 11.67 5.67 11.32 5.9L9.83 6.96L9.87 7.05C9.9 7.1 9.92 7.17 9.91 7.24C9.91 7.28 9.91 7.31 9.9 7.35C9.84 7.68 9.52 7.9 9.19 7.83L7.09 7.42C7.09 7.42 6.91 7.37 6.84 7.31C6.77 7.27 6.72 7.19 6.69 7.14L6.11 5.99L5.73 7.79C5.73 7.81 5.73 7.82 5.73 7.82L7.45 9.63L7.51 9.67C7.67 9.82 7.8 10.01 7.8 10.22L7.8 13.98C7.8 14.39 7.45 14.71 7.05 14.71C6.65 14.71 6.3 14.39 6.3 13.98L6.3 10.85C6 10.69 4.85 9.33 4.5 8.98L4.13 11.09C4.11 11.23 4.04 11.36 3.96 11.46L1.58 14.26C1.46 14.4 1.28 14.5 1.09 14.51C0.89 14.53 0.71 14.47 0.56 14.34C0.39 14.2 0.3 13.99 0.3 13.79C0.3 13.65 0.33 13.52 0.41 13.41L0.48 13.31ZM12 5.12C12.13 5.3 12.33 5.41 12.57 5.45C12.92 5.51 13.3 5.42 13.62 5.18C13.94 4.95 14.16 4.62 14.22 4.28L14.24 4.11C14.24 3.93 14.19 3.77 14.09 3.63C13.77 3.19 13.05 3.16 12.47 3.57C11.94 3.95 11.72 4.58 11.94 5.03L12 5.12Z"/>\n</svg>',"person-running":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10.48 2.31C11.12 2.31 11.63 1.79 11.63 1.15C11.63 0.52 11.12 0 10.48 0C9.85 0 9.33 0.52 9.33 1.15C9.33 1.79 9.85 2.31 10.48 2.31ZM1.83 10.38L4.71 10.38L5.87 6.92L7.02 4.9L5.87 4.62L3.21 5.77C2.89 5.9 2.53 5.75 2.4 5.42C2.29 5.14 2.4 4.82 2.65 4.67L2.75 4.62L5.87 3.46L8.17 3.46L10.48 4.62L11.63 5.77L13.37 5.77C13.69 5.77 13.94 6.02 13.94 6.35C13.94 6.67 13.69 6.92 13.37 6.92L10.48 6.92L9.33 5.77L8.17 8.08L10.48 10.38L10.48 14.42C10.48 14.75 10.23 15 9.9 15C9.58 15 9.33 14.75 9.33 14.42L9.33 10.83L7.02 9.23L5.87 11.54L1.83 11.54C1.5 11.54 1.25 11.28 1.25 10.96C1.25 10.64 1.5 10.38 1.83 10.38Z"/>\n</svg>',"person-sleeping-in-bed":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M0.5 2.5C0.2 2.5 0 2.7 0 3L0 10.5L0 12.5C0 12.8 0.2 13 0.5 13C0.8 13 1 12.8 1 12.5L1 11L14 11L14 12.5C14 12.8 14.2 13 14.5 13C14.8 13 15 12.8 15 12.5L15 10.5C15 10.2 14.8 10 14.5 10L1 10L1 3C1 2.7 0.8 2.5 0.5 2.5ZM3.5 3C2.7 3 2 3.7 2 4.5L2 4.5C2 5.3 2.7 6 3.5 6L3.5 6C4.3 6 5 5.3 5 4.5L5 4.5C5 3.7 4.3 3 3.5 3L3.5 3ZM7 4C5.5 4 5.5 5.5 5.5 5.5L5.5 7L3 7C2.45 7 2 7.45 2 8C2 8.55 2.45 9 3 9L6 9L6 9L15 9L15 6.5C15 4 12.5 4 12.5 4L7 4Z"/>\n</svg>',"person-swimming-in-water":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10.11 2C10 2 9.68 2.15 9.68 2.15L6.35 3.83C5.91 4 5.74 4.71 6 5.06l0.97 1.41L3 8.5L5 10l2.5 -1.5l2.5 1.5l1 -1l-3 -4l2.56 -1.53c0.53 -0.27 0.44 -0.7 0.44 -0.97C11 2.29 10.64 2 10.11 2zM12.25 5C11.28 5 10.5 5.78 10.5 6.75s0.78 1.75 1.75 1.75s1.75 -0.78 1.75 -1.75S13.22 5 12.25 5zM2.5 10L0 11.5V13l2.5 -1.5L5 13l2.5 -1.5l2.5 1.5L12 11.5l3 1.5v-1.5L12 10l-2 1.5l-2.5 -1.5L5 11.5L2.5 10z"/>\n</svg>',"person-swinging-golf-club":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3.4 1.1c0 0.1 0 0.2 0 0.2c0 0.4 0.3 0.7 0.7 0.7c0.3 0 0.5 -0.2 0.6 -0.5l0 0L4.9 1l5.6 2.3L6.6 6C6.2 6.3 6.2 6.7 6.3 7.1l0.9 2.1l-1.3 3.9C5.7 13.6 6.1 14 6.5 14c0.3 0 0.5 -0.1 0.6 -0.5l1.4 -4l0.1 0.3v3.5c0 0 0 0.7 0.7 0.7s0.7 -0.7 0.7 -0.7V10c0 -0.2 0 -0.3 -0.1 -0.5L8.5 6.1l2.7 -1.9c0.2 -0.2 0.4 -0.3 0.4 -0.6s-0.2 -0.5 -0.4 -0.6L4 0.1c-0.09 0 -0.12 0.02 -0.2 0.1L3.4 1.1zM5.5 3C4.7 3 4 3.7 4 4.5S4.7 6 5.5 6S7 5.3 7 4.5S6.3 3 5.5 3z"/>\n</svg>',phone:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-phone"><path d="M22 16.92v3a2 2 0 0 1-2.18 2 19.79 19.79 0 0 1-8.63-3.07 19.5 19.5 0 0 1-6-6 19.79 19.79 0 0 1-3.07-8.67A2 2 0 0 1 4.11 2h3a2 2 0 0 1 2 1.72 12.84 12.84 0 0 0 .7 2.81 2 2 0 0 1-.45 2.11L8.09 9.91a16 16 0 0 0 6 6l1.27-1.27a2 2 0 0 1 2.11-.45 12.84 12.84 0 0 0 2.81.7A2 2 0 0 1 22 16.92z"></path></svg>',"plane-top-right":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M14.12 0.88C14.48 1.24 14.12 3 13.06 4.07L12 5.13L12 13.61L11.3 14.32L9 8.13L6.7 10.43L6.69 13.25L5.98 13.95L4.39 10.59L1.03 9L1.74 8.3L4.58 8.31L6.88 6.01L0.69 3.71L1.4 3L9.88 3L10.94 1.94C12 0.88 13.77 0.53 14.12 0.88Z"/>\n</svg>',"plant-in-raised-planter":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M12 12L12 10.5C12 10.22 12.22 10 12.5 10L13.5 10C13.78 10 14 10.22 14 10.5L14 12L14 13.5C14 13.78 13.78 14 13.5 14L1.5 14C1.22 14 1 13.78 1 13.5L1 12L1 10.5C1 10.22 1.22 10 1.5 10L2.5 10C2.78 10 3 10.22 3 10.5L3 12L12 12ZM7 5.5L5.66 4.83C4.64 4.32 4 3.28 4 2.15L4 1C5.6 1.53 6.87 2.73 7.5 4.26C8.13 2.73 9.4 1.53 11 1L11 2.15C11 3.28 10.36 4.32 9.34 4.83L8 5.5L8 7.96C8.94 6.55 10.35 5.5 12 5C12 7.42 10.28 9.44 8 9.9L8 11.5L7 11.5L7 9.9C4.72 9.44 3 7.42 3 5C4.65 5.5 6.06 6.55 7 7.96L7 5.5Z"/>\n</svg>',"place-of-worship-building":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.5 0l-2 2v2h4V2L7.5 0zM5.5 4.5L4 6h7L9.5 4.5H5.5zM2 6.5c-0.55 0 -1 0.45 -1 1V13h2V7.5C3 6.95 2.55 6.5 2 6.5zM4 6.5V13h7V6.5H4zM13 6.5c-0.55 0 -1 0.45 -1 1V13h2V7.5C14 6.95 13.55 6.5 13 6.5z"/>\n</svg>',"play-structure-with-slide":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M6 10L6 10.01L6 14L5 14L5 11.13L2.75 13.66C2.38 14.08 1.75 14.11 1.34 13.75C0.92 13.38 0.89 12.75 1.25 12.34L5 8.12L5 4L4 4L4 3L7.5 1L11 3L11 4L10 4L10 8L12.5 12L13 12C13.55 12 14 12.45 14 13L14 13C14 13.55 13.55 14 13 14C13 14 13 14 13 14L11.5 14L10 11.6L10 14L9 14L9 10L6 10ZM6.59 7.69C6.6 7.7 6.6 7.7 6.61 7.71C6.86 7.89 7.17 8 7.5 8C8.33 8 9 7.33 9 6.5C9 5.67 8.33 5 7.5 5C6.67 5 6 5.67 6 6.5C6 6.99 6.23 7.42 6.59 7.69L6.59 7.69Z"/>\n</svg>',"police-officer-with-stop-arm":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M14 7L14 13.5C14 13.5 14 13.5 14 13.5C14 13.78 13.77 14 13.5 14L8 13.98L14 7ZM7 13.5L7 9L2 9C1.45 9 1 8.55 1 8C1 7.45 1.45 7 2 7L12.5 7L7 13.5ZM13 4C13.09 4.43 12.99 6.5 10.5 6.5C8 6.5 7.98 4.44 8.07 4L10.5 5L13 4ZM14 2.75L10.5 4.25L7 2.75L7 1C7.92 0.95 8.59 0.87 9 0.75C9.41 0.63 9.9 0.38 10.46 0C11.04 0.37 11.55 0.62 12 0.75C12.45 0.88 13.11 0.96 14 1L14 2.75ZM11.5 2.01C11.44 1.94 11.38 1.88 11.3 1.82C10.75 1.38 9.94 1.46 9.5 2.01L9.5 2.01L10.11 2.77C10.13 2.8 10.16 2.83 10.19 2.85C10.4 3.02 10.72 2.99 10.89 2.77L11.5 2.01Z"/>\n</svg>',plus:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-plus"><line x1="12" y1="5" x2="12" y2="19"></line><line x1="5" y1="12" x2="19" y2="12"></line></svg>',"round-structure-with-flag":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7 1v2v1.5v0.51C4.17 5.1 2 5.97 2 7v4.5c0 1.1 2.46 2 5.5 2s5.5 -0.9 5.5 -2V7c0 -1.03 -2.17 -1.9 -5 -1.99V4.06L11 2.75L7 1zM3 8.15c0.51 0.27 1.2 0.48 2 0.63v2.97C3.79 11.48 3 11.02 3 10.5V8.15zM12 8.15V10.5c0 0.52 -0.79 0.98 -2 1.25V8.78C10.8 8.63 11.49 8.42 12 8.15zM6 8.92C6.49 8.97 6.99 9 7.5 9C8.01 9 8.51 8.97 9 8.92v2.98C8.53 11.96 8.03 12 7.5 12S6.47 11.96 6 11.91V8.92z"/>\n</svg>',"sailing-ship-in-water":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M7.48 0C7.43 0 7.4 0.04 7.4 0.09L7.4 0.09C7.38 0.1 7.37 0.11 7.36 0.12C7.18 0.32 7.08 0.47 6.99 0.55C6.9 0.63 6.81 0.66 6.57 0.62C6.36 0.58 6.24 0.43 6.07 0.29C5.99 0.22 5.89 0.15 5.77 0.12C5.64 0.09 5.5 0.11 5.33 0.18C5.28 0.2 5.26 0.25 5.26 0.3C5.26 0.34 5.28 0.39 5.33 0.41C5.54 0.5 5.62 0.6 5.7 0.75C5.78 0.9 5.85 1.09 6.01 1.3C6.18 1.52 6.42 1.65 6.67 1.7C6.91 1.76 7.17 1.75 7.37 1.68C7.38 1.68 7.39 1.68 7.39 1.67C7.39 1.91 7.39 2.4 7.39 2.76L5.2 1.43C5.18 1.42 5.15 1.41 5.13 1.41C5.08 1.41 5.04 1.43 5.01 1.47C4.99 1.51 4.98 1.57 4.99 1.61C5.66 3.84 5.11 6.07 3.65 8.32C3.61 8.29 3.57 8.27 3.53 8.26L0.72 7.62C0.63 7.59 0.53 7.63 0.46 7.7C0.09 8.1 -0.04 8.65 0.01 9.18C0.06 9.7 0.28 10.22 0.63 10.61C0.66 10.66 0.71 10.69 0.76 10.7L2.05 11.09C2.02 12.3 2.13 13.04 2.35 13.53C2.59 14.05 2.9 14.28 3.11 14.61C3.16 14.68 3.23 14.73 3.32 14.74C3.4 14.75 3.48 14.72 3.54 14.67C3.83 14.4 4.07 14.22 4.4 14.14C4.38 14.28 4.3 14.46 4.34 14.59C4.39 14.74 4.52 14.88 4.65 14.92C4.78 14.96 4.9 14.94 5 14.91C5.37 14.82 5.8 14.54 6.25 14.31C6.32 14.49 6.36 14.72 6.48 14.83C6.58 14.93 6.71 14.99 6.84 15C6.96 15.01 7.08 14.97 7.18 14.93C7.49 14.79 7.79 14.52 8.11 14.3C8.18 14.48 8.23 14.71 8.35 14.83C8.55 15.02 8.86 15.04 9.08 14.95C9.38 14.83 9.68 14.54 9.98 14.28C10.04 14.42 10.11 14.56 10.21 14.62C10.47 14.79 10.73 14.75 10.9 14.74C10.94 14.74 10.98 14.72 11.01 14.71C12.23 14.03 12.81 13.07 13 12.04C13.17 11.07 13.03 10.05 12.87 9.06L14.87 7.61C14.98 7.53 15.03 7.38 14.98 7.24C14.94 7.11 14.82 7.02 14.69 7.02C14.68 7.02 14.66 7.03 14.64 7.03L11.6 7.74C11.45 7.78 11.35 7.92 11.36 8.08C11.36 8.08 11.41 8.67 10.98 9.31C10.57 9.92 9.7 10.57 7.77 10.65L7.72 8.35C8.33 8.45 8.9 8.63 9.4 8.94C9.46 8.98 9.54 8.96 9.58 8.89C10.08 8.12 10.23 7.34 10.21 6.58C10.19 5.81 10.01 5.06 9.85 4.32C9.84 4.28 9.82 4.24 9.78 4.22L7.62 2.9L7.56 0.09L7.56 0.09C7.56 0.07 7.55 0.04 7.54 0.03C7.52 0.01 7.5 0 7.48 0ZM7.4 0.48C7.39 0.54 7.39 1.25 7.39 1.43C7.21 1.15 7.19 0.97 7.22 0.82C7.25 0.72 7.32 0.61 7.4 0.48ZM8.73 2.56C8.71 2.56 8.7 2.57 8.7 2.59C8.69 2.61 8.71 2.63 8.72 2.63C9.7 3.03 10.26 3.47 10.58 3.93C10.91 4.38 10.99 4.84 11 5.3C11.01 5.75 10.94 6.2 10.97 6.6C11 7 11.12 7.36 11.51 7.64C11.52 7.64 11.54 7.64 11.55 7.64C11.56 7.63 11.57 7.61 11.57 7.6C11.55 7.49 11.61 7.35 11.73 7.2C11.85 7.06 12.03 6.91 12.24 6.78C12.66 6.52 13.19 6.34 13.61 6.42C13.63 6.42 13.64 6.41 13.65 6.39C13.66 6.38 13.65 6.36 13.63 6.35C13.26 6.14 13.09 5.83 12.97 5.46C12.86 5.08 12.78 4.66 12.6 4.24C12.41 3.83 12.1 3.43 11.51 3.13C10.92 2.83 10.05 2.62 8.75 2.56C8.74 2.56 8.74 2.56 8.74 2.56C8.73 2.56 8.73 2.56 8.73 2.56C8.73 2.56 8.73 2.56 8.73 2.56L8.73 2.56ZM6.84 8.26C7.02 8.27 7.19 8.29 7.36 8.3C7.36 9.35 7.36 10.03 7.35 10.66C5.38 10.65 4.5 10.09 4.11 9.59C3.7 9.08 3.76 8.61 3.76 8.61C3.76 8.61 3.76 8.61 3.76 8.61C4.85 8.38 5.89 8.24 6.84 8.26ZM10.7 10.98C11.04 10.99 11.33 11.27 11.33 11.63C11.33 11.98 11.04 12.27 10.7 12.27C10.53 12.27 10.37 12.2 10.25 12.08C10.13 11.96 10.07 11.8 10.07 11.63C10.07 11.46 10.13 11.29 10.25 11.17C10.37 11.05 10.53 10.98 10.7 10.98ZM4.36 11.12C4.53 11.12 4.69 11.19 4.8 11.31C4.92 11.43 4.99 11.59 4.99 11.77C4.99 11.94 4.92 12.1 4.8 12.22C4.69 12.34 4.53 12.41 4.36 12.41C4.01 12.41 3.73 12.12 3.73 11.77C3.73 11.6 3.8 11.43 3.91 11.31C4.03 11.19 4.19 11.12 4.36 11.12ZM7.55 11.58C7.72 11.58 7.88 11.65 8 11.77C8.11 11.89 8.18 12.05 8.18 12.22C8.18 12.4 8.11 12.56 8 12.68C7.88 12.8 7.72 12.87 7.55 12.87C7.2 12.87 6.92 12.58 6.92 12.22C6.92 12.05 6.99 11.89 7.11 11.77C7.22 11.65 7.38 11.58 7.55 11.58L7.55 11.58Z"/>\n</svg>',"scissors-open":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M15 3c0 0 -2 -0.6 -3.5 0.5l-4.3 3C6.4 5.9 5.2 5.2 4 4.8V4c0 -1.1 -0.9 -2 -2 -2C0.9 2 0 2.9 0 4v1.5C0 6 0.5 6 0.5 6H2h0.5C4.5 6 6 7.5 6 7.5S4.5 9 2.5 9H2H0.5C0.5 9 0 9 0 9.5V11c0 1.1 0.9 2 2 2c1.1 0 2 -0.9 2 -2v-0.8c1.2 -0.4 2.4 -1.1 3.2 -1.7l4.3 3C13 12.6 15 12 15 12L8.5 7.5L15 3zM3 5H2H1V4c0 -0.6 0.4 -1 1 -1c0.6 0 1 0.4 1 1V5zM3 11c0 0.6 -0.4 1 -1 1c-0.6 0 -1 -0.4 -1 -1v-1h1h1V11zM7.25 8c-0.28 0 -0.5 -0.22 -0.5 -0.5S6.97 7 7.25 7s0.5 0.22 0.5 0.5S7.53 8 7.25 8z"/>\n</svg>',"shipwreck-in-water":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M15 13.18C14.68 13.18 14.36 13.07 14.04 12.96C13.82 12.86 13.5 12.86 13.18 12.86C12.86 12.86 12.54 12.96 12.21 13.07C11.89 13.18 11.57 13.29 11.25 13.29C10.93 13.29 10.61 13.18 10.29 13.07C10.07 12.86 9.75 12.86 9.43 12.86C9.11 12.86 8.79 12.96 8.46 13.07C8.14 13.18 7.82 13.29 7.5 13.29C7.18 13.29 6.86 13.18 6.54 13.07C6.32 12.86 6 12.86 5.57 12.86C5.25 12.86 4.93 12.96 4.61 13.07C4.29 13.18 3.96 13.29 3.64 13.29C3.32 13.29 3 13.18 2.68 13.07C2.57 12.86 2.25 12.86 1.82 12.86C1.5 12.86 1.18 12.96 0.86 13.07C0.54 13.18 0.21 13.29 -0.11 13.29L-0.11 11.89C0.21 11.89 0.54 11.79 0.86 11.68C1.18 11.57 1.5 11.46 1.82 11.46C2.14 11.46 2.46 11.57 2.79 11.68C3.11 11.79 3.43 11.89 3.75 11.89C4.07 11.89 4.39 11.79 4.71 11.68C5.04 11.57 5.36 11.46 5.68 11.46C6 11.46 6.32 11.57 6.64 11.68C6.86 11.79 7.18 11.89 7.5 11.89C7.82 11.89 8.14 11.79 8.46 11.68C8.79 11.57 9.11 11.46 9.43 11.46C9.75 11.46 10.07 11.57 10.39 11.68C10.71 11.79 11.04 11.89 11.36 11.89C11.68 11.89 12 11.79 12.32 11.68C12.64 11.57 12.96 11.46 13.29 11.46C13.61 11.46 13.93 11.57 14.25 11.68C14.57 11.79 14.89 11.89 15.21 11.89L15.21 13.18L15 13.18ZM8.04 7.5L6.64 4.29L8.04 3.75L7.71 2.79L6.75 3.21C6.75 3.21 6.54 3.32 6.32 3.43L5.68 1.82L4.82 2.14L5.46 3.75C4.82 4.07 4.07 4.39 4.07 4.39L4.39 5.25L5.89 4.61L7.29 7.82C4.5 9 1.82 10.18 1.93 10.18C2.25 10.18 2.57 10.29 2.89 10.39C3.21 10.5 3.54 10.61 3.86 10.61C4.18 10.61 4.5 10.5 4.82 10.39C5.14 10.29 5.46 10.18 5.79 10.18C6.11 10.18 6.43 10.29 6.75 10.39C6.86 10.5 7.18 10.5 7.5 10.5C7.82 10.5 8.14 10.39 8.46 10.29C8.79 10.18 9.11 10.07 9.43 10.07C9.75 10.07 10.07 10.18 10.39 10.29C10.71 10.39 11.04 10.5 11.36 10.5C11.46 10.5 11.57 10.5 11.68 10.5C11.89 10.5 12 10.5 12.21 10.39C12.21 10.39 12.21 10.39 12.21 10.39C12.32 8.79 12.96 5.36 12.96 5.36C12.96 5.36 10.61 6.43 8.04 7.5Z"/>\n</svg>',"shopping-bag":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M13.33 5h-1.83l-0.39 -2.33c-0.16 -0.72 -0.7 -1.29 -1.41 -1.49c-0.35 -0.11 -0.71 -0.17 -1.08 -0.18h-2.24c-0.37 0.01 -0.73 0.07 -1.08 0.18c-0.71 0.2 -1.25 0.77 -1.41 1.49l-0.39 2.33h-1.83c-0.28 0 -0.5 0.22 -0.5 0.5c0 0.05 0.01 0.1 0.02 0.15l1.88 6.3c0.2 0.62 0.78 1.05 1.43 1.05h6c0.65 0 1.22 -0.43 1.42 -1.05l1.88 -6.3c0.08 -0.26 -0.06 -0.54 -0.33 -0.63c-0.05 -0.01 -0.09 -0.02 -0.14 -0.02zm-8.81 0l0.36 -2.17c0.08 -0.36 0.37 -0.64 0.74 -0.7c0.25 -0.08 0.5 -0.12 0.76 -0.13h2.24c0.26 0.01 0.52 0.05 0.77 0.13c0.37 0.06 0.66 0.34 0.74 0.7l0.35 2.17h-6z"/>\n</svg>',search:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-search"><circle cx="11" cy="11" r="8"></circle><line x1="21" y1="21" x2="16.65" y2="16.65"></line></svg>',server:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-server"><rect x="2" y="2" width="20" height="8" rx="2" ry="2"></rect><rect x="2" y="14" width="20" height="8" rx="2" ry="2"></rect><line x1="6" y1="6" x2="6.01" y2="6"></line><line x1="6" y1="18" x2="6.01" y2="18"></line></svg>',settings:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-settings"><circle cx="12" cy="12" r="3"></circle><path d="M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 0 1 0 2.83 2 2 0 0 1-2.83 0l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-2 2 2 2 0 0 1-2-2v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 0 1-2.83 0 2 2 0 0 1 0-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1-2-2 2 2 0 0 1 2-2h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 0 1 0-2.83 2 2 0 0 1 2.83 0l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 2-2 2 2 0 0 1 2 2v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 0 1 2.83 0 2 2 0 0 1 0 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 2 2 2 2 0 0 1-2 2h-.09a1.65 1.65 0 0 0-1.51 1z"></path></svg>',"shopping-basket":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M3 3.07s0.19 -1.06 1 -1.06H5V1.73a0.5 0.5 0 0 1 0.5 -0.5H9.49a0.5 0.5 0 0 1 0.5 0.5v0.28h1.01a0.83 0.83 0 0 1 0.64 0.29a1.76 1.76 0 0 1 0.36 0.77s0.31 1.57 0.59 2.92h-0.94L11 3L3.98 3L3.33 5.99H2.38Zm11 4.91a1 1 0 0 1 -1 1l-1 3.97s-0.19 1.04 -1 1.04h-7c-0.81 0 -1 -1.04 -1 -1.04L1.98 8.98a1 1 0 0 1 0.02 -2h11A1 1 0 0 1 14 7.98ZM5.03 12.13L5.03 11.01L4.64 9.47a0.54 0.54 0 1 0 -1.06 0.14L3.78 11.01l0.19 1.27A0.54 0.54 0 1 0 5.03 12.13Zm2 -2.6A0.53 0.53 0 0 0 6.5 9l0 0L6.49 9a0.5 0.5 0 0 0 -0.36 0.15a0.53 0.53 0 0 0 -0.16 0.38v2.68a0.53 0.53 0 1 0 1.07 0Zm2 0A0.53 0.53 0 0 0 8.69 9.04a0.5 0.5 0 0 0 -0.39 0a0.53 0.53 0 0 0 -0.34 0.49v2.68a0.53 0.53 0 1 0 1.07 0Zm2.39 0.08a0.54 0.54 0 1 0 -1.06 -0.14L9.96 10.99L9.96 12.13a0.54 0.54 0 1 0 1.06 0.14Z"/>\n</svg>',"shopping-cart":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M1.75 1.5L1.98 1.5C2.38 1.51 3.31 1.58 3.75 2C4.28 2.52 4.5 2.92 4.5 4L13.8 4L12.41 8.81L12.39 8.84C12.16 9.49 11.55 9.97 10.81 9.99C10.81 10 10.8 10 10.8 10L4.3 10L4.3 10.23C4.31 10.31 4.33 10.52 4.45 10.78L4.5 10.9C4.7 11.3 4.8 11.5 5.6 11.5L12.1 11.5C13.1 11.5 13.1 13 12.1 13L5.7 13C4.5 13 3.6 12.3 3.3 11.6C3 10.9 3 10.3 3 10.3L3 4C3 3.48 2.77 3 2.3 3L1.75 3C1.34 3 1 2.66 1 2.25C1 1.84 1.34 1.5 1.75 1.5ZM5.8 13C6.4 13 6.8 13.4 6.8 14C6.8 14.6 6.4 15 5.8 15C5.2 15 4.8 14.6 4.8 14C4.8 13.4 5.2 13 5.8 13ZM10.8 13C11.4 13 11.8 13.4 11.8 14C11.8 14.6 11.4 15 10.8 15C10.2 15 9.8 14.6 9.8 14C9.8 13.4 10.2 13 10.8 13Z"/>\n</svg>',"table-tennis-paddle":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M11.97 10.23a3.81 3.81 0 0 1 -1.91 0.98L3.77 4.93A4.03 4.03 0 0 1 4.77 3.03C7.03 0.77 9.98 0.22 12.38 2.62S14.23 7.97 11.97 10.23Zm-6.99 1.61A3.84 3.84 0 0 1 6.15 11.28A4.53 4.53 0 0 1 8 11.45L3.55 7a4.41 4.41 0 0 1 0.16 1.92a3.66 3.66 0 0 1 -0.52 1.12c-1.07 1.26 -2.13 1.73 -2.13 2.19A1.84 1.84 0 0 0 2.77 13.95C3.23 13.95 3.69 12.94 4.98 11.84Z"/>\n</svg>',"tattoo-machine":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M6.41 2.03C5.43 0.69 3.56 0.39 2.22 1.36C1.99 1.53 1.94 1.84 2.11 2.06C2.26 2.26 2.52 2.33 2.73 2.22L2.8 2.17C3.7 1.52 4.95 1.72 5.6 2.62L0.34 6.44C0.12 6.6 0.07 6.91 0.23 7.13C0.39 7.36 0.7 7.41 0.93 7.25L1.33 6.95L3.1 9.38L3.5 9.08L4.09 9.89L3.28 10.48C3.06 10.64 3.01 10.96 3.17 11.18C3.33 11.4 3.64 11.45 3.87 11.29L9.12 7.47L9.71 8.28L9.31 8.57C9.08 8.74 9.04 9.05 9.2 9.27L11.55 12.51C11.71 12.73 12.02 12.78 12.25 12.62L12.65 12.32L13.24 13.13L14.82 14.46L14.05 12.55L13.46 11.74L13.87 11.44C14.09 11.28 14.14 10.97 13.98 10.74L11.62 7.51C11.46 7.28 11.15 7.24 10.93 7.4L10.52 7.69L9.93 6.88L11.55 5.71L11.85 6.11C12.01 6.33 12.32 6.38 12.54 6.22L13.35 5.63C13.58 5.47 13.63 5.16 13.46 4.94L12.29 3.32C12.13 3.09 11.81 3.04 11.59 3.21L10.78 3.79C10.56 3.96 10.51 4.27 10.67 4.49L10.96 4.9L9.35 6.07L6.99 2.84L7.4 2.54C7.62 2.38 7.67 2.07 7.51 1.84C7.35 1.62 7.04 1.57 6.81 1.73L6.41 2.03ZM6.19 3.42L8.54 6.66L7.32 7.54L6.74 6.73L7.14 6.44L5.38 4.01L6.19 3.42ZM2.95 5.78L3.76 5.19L5.52 7.62L5.93 7.32L6.51 8.13L4.9 9.31L4.31 8.5L4.71 8.2L2.95 5.78Z"/>\n</svg>',toolbox:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10.64 4.51C10.57 4.51 10.5 4.46 10.5 4.39L10.5 2.53C10.5 2.46 10.46 2.4 10.39 2.4L4.62 2.4C4.54 2.4 4.5 2.46 4.5 2.53L4.5 4.39C4.5 4.46 4.42 4.5 4.35 4.5L0.44 4.5C0.36 4.5 0.3 4.58 0.3 4.65L0.3 6.71C0.3 6.79 0.36 6.9 0.44 6.9L6.74 6.9C6.81 6.9 6.9 6.79 6.9 6.71L6.9 6.28C6.9 6.2 6.93 6 7.01 6L8 6C8.08 6 8.1 6.2 8.1 6.28L8.1 6.72C8.1 6.79 8.2 6.9 8.27 6.9L14.57 6.9C14.64 6.9 14.7 6.79 14.7 6.72L14.7 4.66C14.7 4.58 14.64 4.5 14.57 4.5L10.66 4.5L10.65 4.51L10.64 4.51ZM5.43 4.5C5.35 4.5 5.4 4.46 5.4 4.39L5.4 3.33C5.4 3.26 5.36 3.3 5.43 3.3L9.57 3.3C9.65 3.3 9.6 3.26 9.6 3.33L9.6 4.39C9.6 4.46 9.65 4.5 9.57 4.5L5.43 4.5ZM8.12 8.91C8.12 8.99 8.07 9 8 9L7 9C6.93 9 6.9 9.03 6.9 8.96L6.9 7.48C6.9 7.41 6.8 7.2 6.73 7.2L0.44 7.2C0.36 7.2 0.3 7.41 0.3 7.48L0.3 11.87C0.3 11.94 0.36 12 0.44 12L14.57 12C14.64 12 14.7 11.94 14.7 11.87L14.7 7.48C14.7 7.41 14.64 7.2 14.57 7.2L8.27 7.2C8.19 7.2 8.1 7.41 8.1 7.48L8.1 8.96L8.12 8.92L8.12 8.91Z"/>\n</svg>',target:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-target"><circle cx="12" cy="12" r="10"></circle><circle cx="12" cy="12" r="6"></circle><circle cx="12" cy="12" r="2"></circle></svg>',"tree-and-bench-with-backrest":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4 10.94L4 14L3 14L3 10.95C1.93 10.73 1.12 9.77 1.12 8.63C1.12 8.5 1.13 8.37 1.15 8.24C1.97 3.41 2.77 1 3.56 1C4.34 1 5.11 3.41 5.86 8.23L5.86 8.23C6.05 9.49 5.23 10.68 4 10.94ZM6 11L14 11L14 14L13 14L13 12L7 12L7 14L6 14L6 11ZM7 8L13 8L13 10.5L7 10.5L7 8Z"/>\n</svg>',user:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-user"><path d="M20 21v-2a4 4 0 0 0-4-4H8a4 4 0 0 0-4 4v2"></path><circle cx="12" cy="7" r="4"></circle></svg>',"village-buildings":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M6.18 1.18a0.25 0.25 0 0 0 -0.35 0l-4.4 4.4A0.25 0.25 0 0 0 1.6 6H3v6.75a0.25 0.25 0 0 0 0.25 0.25h3.5A0.25 0.25 0 0 0 7 12.75v-7.43c0 -0.07 0.03 -0.13 0.07 -0.18L8.5 3.5L6.18 1.18ZM6 11H5v-1h1v1Zm0 -2H5V8h1v1Zm0 -3v1H5V6h1ZM12.75 3h-0.5a0.25 0.25 0 0 0 -0.25 0.25V5l-1.32 -1.82a0.25 0.25 0 0 0 -0.35 0L8.06 5.93A0.25 0.25 0 0 0 8 6.09v6.66a0.25 0.25 0 0 0 0.25 0.25h1.5a0.25 0.25 0 0 0 0.25 -0.25V11h1v1.75a0.25 0.25 0 0 0 0.25 0.25h1.5a0.25 0.25 0 0 0 0.25 -0.25V3.25a0.25 0.25 0 0 0 -0.25 -0.25ZM10 8H9V7h1v1Zm2 0h-1V7h1v1Zm-2 2H9V9h1v1Zm2 0h-1V9h1v1Z"/>\n</svg>',"wall-hanging-with-mountains-and-sun":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M10.71 3l-2.86 -2.85c-0.19 -0.2 -0.51 -0.2 -0.71 0c0 0 0 0 0 0l-2.85 2.85h-2.79c-0.28 0 -0.5 0.22 -0.5 0.5v9c0 0.28 0.22 0.5 0.5 0.5h12c0.28 0 0.5 -0.22 0.5 -0.5v-9c0 -0.28 -0.22 -0.5 -0.5 -0.5zm-3.21 -1.79l1.79 1.79h-3.58zm5.5 10.79h-11v-8h11zm-8 -5c-0.55 0 -1 -0.45 -1 -1s0.45 -1 1 -1s1 0.45 1 1s-0.45 1 -1 1zm7 4h-7.5l1.5 -3l1.25 2.5l2.25 -4.5z"/>\n</svg>',"womens-and-mens-restroom-symbol":'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M5.67 3.46L3.33 3.46L1 11.54L3.33 11.54L3.33 15L5.67 15L5.67 11.54L8 11.54L5.67 3.46ZM4.73 2.31L4.27 2.31C3.68 2.31 3.33 1.96 3.33 1.38L3.33 0.92C3.33 0.35 3.68 0 4.27 0L4.85 0C5.32 0 5.67 0.35 5.67 0.92L5.67 1.5C5.67 1.96 5.32 2.31 4.73 2.31ZM12.83 3.53L8.21 3.53L8.21 9.3L9.36 9.3L9.36 15.07L11.67 15.07L11.67 9.3L12.83 9.3L12.83 3.53ZM10.73 2.31L10.27 2.31C9.68 2.31 9.33 1.96 9.33 1.38L9.33 0.92C9.33 0.35 9.68 0 10.27 0L10.85 0C11.32 0 11.67 0.35 11.67 0.92L11.67 1.5C11.67 1.96 11.32 2.31 10.73 2.31Z"/>\n</svg>',wikipedia:'<?xml version="1.0" encoding="UTF-8"?>\n<svg xmlns="http://www.w3.org/2000/svg" width="128" height="128" viewBox="7.15 7.15 113.7 113.7" fill="currentColor">\n<path d="M 120.85,29.21 C 120.85,29.62 120.72,29.99 120.47,30.33 C 120.21,30.66 119.94,30.83 119.63,30.83 C 117.14,31.07 115.09,31.87 113.51,33.24 C 111.92,34.6 110.29,37.21 108.6,41.05 L 82.8,99.19 C 82.63,99.73 82.16,100 81.38,100 C 80.77,100 80.3,99.73 79.96,99.19 L 65.49,68.93 L 48.85,99.19 C 48.51,99.73 48.04,100 47.43,100 C 46.69,100 46.2,99.73 45.96,99.19 L 20.61,41.05 C 19.03,37.44 17.36,34.92 15.6,33.49 C 13.85,32.06 11.4,31.17 8.27,30.83 C 8,30.83 7.74,30.69 7.51,30.4 C 7.27,30.12 7.15,29.79 7.15,29.42 C 7.15,28.47 7.42,28 7.96,28 C 10.22,28 12.58,28.1 15.05,28.3 C 17.34,28.51 19.5,28.61 21.52,28.61 C 23.58,28.61 26.01,28.51 28.81,28.3 C 31.74,28.1 34.34,28 36.6,28 C 37.14,28 37.41,28.47 37.41,29.42 C 37.41,30.36 37.24,30.83 36.91,30.83 C 34.65,31 32.87,31.58 31.57,32.55 C 30.27,33.53 29.62,34.81 29.62,36.4 C 29.62,37.21 29.89,38.22 30.43,39.43 L 51.38,86.74 L 63.27,64.28 L 52.19,41.05 C 50.2,36.91 48.56,34.23 47.28,33.03 C 46,31.84 44.06,31.1 41.46,30.83 C 41.22,30.83 41,30.69 40.78,30.4 C 40.56,30.12 40.45,29.79 40.45,29.42 C 40.45,28.47 40.68,28 41.16,28 C 43.42,28 45.49,28.1 47.38,28.3 C 49.2,28.51 51.14,28.61 53.2,28.61 C 55.22,28.61 57.36,28.51 59.62,28.3 C 61.95,28.1 64.24,28 66.5,28 C 67.04,28 67.31,28.47 67.31,29.42 C 67.31,30.36 67.15,30.83 66.81,30.83 C 62.29,31.14 60.03,32.42 60.03,34.68 C 60.03,35.69 60.55,37.26 61.6,39.38 L 68.93,54.26 L 76.22,40.65 C 77.23,38.73 77.74,37.11 77.74,35.79 C 77.74,32.69 75.48,31.04 70.96,30.83 C 70.55,30.83 70.35,30.36 70.35,29.42 C 70.35,29.08 70.45,28.76 70.65,28.46 C 70.86,28.15 71.06,28 71.26,28 C 72.88,28 74.87,28.1 77.23,28.3 C 79.49,28.51 81.35,28.61 82.8,28.61 C 83.84,28.61 85.38,28.52 87.4,28.35 C 89.96,28.12 92.11,28 93.83,28 C 94.23,28 94.43,28.4 94.43,29.21 C 94.43,30.29 94.06,30.83 93.32,30.83 C 90.69,31.1 88.57,31.83 86.97,33.01 C 85.37,34.19 83.37,36.87 80.98,41.05 L 71.26,59.02 L 84.42,85.83 L 103.85,40.65 C 104.52,39 104.86,37.48 104.86,36.1 C 104.86,32.79 102.6,31.04 98.08,30.83 C 97.67,30.83 97.47,30.36 97.47,29.42 C 97.47,28.47 97.77,28 98.38,28 C 100.03,28 101.99,28.1 104.25,28.3 C 106.34,28.51 108.1,28.61 109.51,28.61 C 111,28.61 112.72,28.51 114.67,28.3 C 116.7,28.1 118.52,28 120.14,28 C 120.61,28 120.85,28.4 120.85,29.21 z" />\n</svg>',parking_p:'<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15 15">\n <path d="M4 2V13H6V9H8.5C10.43 9 12 7.43 12 5.5C12 3.57 10.43 2 8.5 2H4ZM6 7V4H8.5C9.33 4 10 4.67 10 5.5C10 6.33 9.33 7 8.5 7H6Z"/>\n</svg>',x:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-x"><line x1="18" y1="6" x2="6" y2="18"></line><line x1="6" y1="6" x2="18" y2="18"></line></svg>',zap:'<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-zap"><polygon points="13 2 3 14 12 14 11 22 21 10 12 10 13 2"></polygon></svg>',"loading-ring":'<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" data-ember-extension="1"><path d="M10.72,19.9a8,8,0,0,1-6.5-9.79A7.77,7.77,0,0,1,10.4,4.16a8,8,0,0,1,9.49,6.52A1.54,1.54,0,0,0,21.38,12h.13a1.37,1.37,0,0,0,1.38-1.54,11,11,0,1,0-12.7,12.39A1.54,1.54,0,0,0,12,21.34h0A1.47,1.47,0,0,0,10.72,19.9Z"><animateTransform attributeName="transform" type="rotate" dur="0.75s" values="0 12 12;360 12 12" repeatCount="indefinite"/></path></svg>'},JC=["fork-and-knife","wikipedia","cup-and-saucer","coffee-bean","shopping-basket","camera","person-sleeping-in-bed","loading-ring"];function QC(t){return XC[t]}function tS(t){return JC.includes(t)}const eS=Object.freeze(Object.defineProperty({__proto__:null,getIcon:QC,isIconFilled:tS},Symbol.toStringTag,{value:"Module"})),nS=[{tags:{cuisine:"donut"},icon:"donut"},{tags:{cuisine:"doughnut"},icon:"donut"},{tags:{cuisine:"coffee_shop"},icon:"coffee-bean"},{tags:{cuisine:"coffee"},icon:"coffee-bean"},{tags:{amenity:"ice_cream"},icon:"ice-cream-on-cone"},{tags:{cuisine:"ice_cream"},icon:"ice-cream-on-cone"},{tags:{shop:"ice_cream"},icon:"ice-cream-on-cone"},{tags:{amenity:"cafe"},icon:"cup-and-saucer"},{tags:{amenity:"restaurant"},icon:"fork-and-knife"},{tags:{amenity:"fast_food"},icon:"burger-and-drink-cup-with-straw"},{tags:{amenity:"pub"},icon:"beer-mug-with-foam"},{tags:{amenity:"bar"},icon:"cocktail"},{tags:{amenity:"food_court"},icon:"fork-and-knife"},{tags:{amenity:"childcare"},icon:"family-restroom-symbol"},{tags:{amenity:"community_centre"},icon:"family-restroom-symbol"},{tags:{amenity:"social_centre"},icon:"family-restroom-symbol"},{tags:{amenity:"social_facility"},icon:"family-restroom-symbol"},{tags:{amenity:"bank"},icon:"banknote"},{tags:{amenity:"place_of_worship"},icon:"place-of-worship-building"},{tags:{amenity:"fire_station"},icon:"badge-shield-with-fire"},{tags:{amenity:"police"},icon:"police-officer-with-stop-arm"},{tags:{amenity:"toilets"},icon:"womens-and-mens-restroom-symbol"},{tags:{amenity:"school"},icon:"open-book"},{tags:{shop:"coffee"},icon:"coffee-bean"},{tags:{shop:"tea"},icon:"coffee-bean"},{tags:{shop:"pastry"},icon:"donut"},{tags:{shop:"supermarket"},icon:"shopping-cart"},{tags:{shop:"convenience"},icon:"shopping-basket"},{tags:{shop:"grocery"},icon:"shopping-basket"},{tags:{shop:"greengrocer"},icon:"shopping-basket"},{tags:{shop:"bakery"},icon:"croissant"},{tags:{shop:"butcher"},icon:"cleaver"},{tags:{shop:"seafood"},icon:"fish"},{tags:{shop:"deli"},icon:"shopping-basket"},{tags:{shop:"clothes"},icon:"clothes-hanger"},{tags:{shop:"clothing"},icon:"clothes-hanger"},{tags:{shop:"hairdresser"},icon:"scissors-open"},{tags:{shop:"optician"},icon:"eyeglasses"},{tags:{shop:"fabric"},icon:"cloth"},{tags:{shop:"flea_market"},icon:"market-stall"},{tags:{shop:"kiosk"},icon:"shopping-basket"},{tags:{shop:"leather"},icon:"shopping-bag"},{tags:{shop:"tailor"},icon:"needle-and-spool-of-thread"},{tags:{shop:"jewelry"},icon:"jewel"},{tags:{shop:"jewellery"},icon:"jewel"},{tags:{shop:"tobacco"},icon:"cigarette-with-smoke-curl"},{tags:{shop:"cannabis"},icon:"cigarette-with-smoke-curl"},{tags:{shop:"florist"},icon:"flower-bouquet"},{tags:{shop:"garden_centre"},icon:"plant-in-raised-planter"},{tags:{shop:"estate_agent"},icon:"village-buildings"},{tags:{shop:"mobile_phone"},icon:"mobile-phone-with-keypad-and-antenna"},{tags:{beauty:"nails"},icon:"fingernail-polished"},{tags:{shop:"tattoo"},icon:"tattoo-machine"},{tags:{shop:"beauty"},icon:"fancy-mirror-with-reflection-and-stars"},{tags:{craft:"tailor"},icon:"needle-and-spool-of-thread"},{tags:{office:"estate_agent"},icon:"village-buildings"},{tags:{office:!0},icon:"commercial-building"},{tags:{craft:!0},icon:"toolbox"},{tags:{shop:!0},icon:"shopping-bag"},{tags:{natural:"beach"},icon:"beach-umbrella-in-ground"},{tags:{leisure:"park"},icon:"tree-and-bench-with-backrest"},{tags:{leisure:"playground"},icon:"play-structure-with-slide"},{tags:{aeroway:"aerodrome"},icon:"plane-top-right"},{tags:{aeroway:"heliport"},icon:"plane-top-right"},{tags:{aeroway:"helipad"},icon:"plane-top-right"},{tags:{highway:"bus_stop"},icon:"bus"},{tags:{bus:!0},icon:"bus"},{tags:{railway:"tram_stop"},icon:"person-boarding-tram-with-destination-display-and-pantograph-on-tram-track"},{tags:{tourism:"museum"},icon:"classical-building"},{tags:{tourism:"gallery"},icon:"wall-hanging-with-mountains-and-sun"},{tags:{tourism:"aquarium"},icon:"angelfish"},{tags:{tourism:"theme_park"},icon:"camera"},{tags:{tourism:"attraction"},icon:"camera"},{tags:{tourism:"viewpoint"},icon:"camera"},{tags:{tourism:"zoo"},icon:"camera"},{tags:{tourism:"artwork"},icon:"camera"},{tags:{amenity:"cinema"},icon:"film"},{tags:{amenity:"theatre"},icon:"camera"},{tags:{amenity:"arts_centre"},icon:"comedy-mask-and-tragedy-mask"},{tags:{amenity:"arts_center"},icon:"comedy-mask-and-tragedy-mask"},{tags:{historic:"fort"},icon:"fort"},{tags:{historic:"castle"},icon:"palace"},{tags:{historic:"building"},icon:"classical-building-with-flag"},{tags:{historic:"archaeological_site"},icon:"grecian-vase"},{tags:{historic:"memorial"},icon:"memorial-stone-with-inscription"},{tags:{historic:"tomb"},icon:"gravestone"},{tags:{historic:"monument"},icon:"classical-building-with-dome-and-flag"},{tags:{historic:"ship"},icon:"sailing-ship-in-water"},{tags:{historic:"wreck"},icon:"shipwreck-in-water"},{tags:{historic:"ruins"},icon:"camera"},{tags:{historic:"ruin"},icon:"camera"},{tags:{historic:"yes"},icon:"camera"},{tags:{tourism:"hotel"},icon:"person-sleeping-in-bed"},{tags:{tourism:"hostel"},icon:"person-sleeping-in-bed"},{tags:{tourism:"motel"},icon:"person-sleeping-in-bed"},{tags:{tourism:"guest_house"},icon:"person-sleeping-in-bed"},{tags:{sport:"motor"},icon:"flag-checkered"},{tags:{sport:"karting"},icon:"flag-checkered"},{tags:{sport:"motocross"},icon:"flag-checkered"},{tags:{sport:"cricket"},icon:"person-cricket-batting-at-cricket-ball"},{tags:{sport:"boxing"},icon:"boxing-glove-up"},{tags:{sport:"martial_arts"},icon:"boxing-glove-up"},{tags:{sport:"tennis"},icon:"person-playing-tennis"},{tags:{sport:"squash"},icon:"person-playing-tennis"},{tags:{sport:"padel"},icon:"person-playing-tennis"},{tags:{sport:"table_tennis"},icon:"table-tennis-paddle"},{tags:{leisure:"water_park"},icon:"person-swimming-in-water"},{tags:{sport:"swimming"},icon:"person-swimming-in-water"},{tags:{sport:"golf"},icon:"person-swinging-golf-club"},{tags:{leisure:"golf_course"},icon:"person-swinging-golf-club"},{tags:{sport:"horse_racing"},icon:"person-jockeying-racehorse"},{tags:{sport:"fitness"},icon:"barbell"},{tags:{sport:"fitness_centre"},icon:"barbell"},{tags:{leisure:"fitness_centre"},icon:"barbell"},{tags:{sport:"stadium"},icon:"round-structure-with-flag"},{tags:{leisure:"stadium"},icon:"round-structure-with-flag"},{tags:{leisure:"sports_centre"},icon:"person-running"},{tags:{leisure:"pitch"},icon:"person-running"},{tags:{sport:!0},icon:"person-running"},{tags:{amenity:"dentist"},icon:"molar-tooth"},{tags:{healthcare:"dentist"},icon:"molar-tooth"},{tags:{healthcare:!0},icon:"greek-cross"},{tags:{amenity:"parking"},icon:"parking_p"},{tags:{building:"commercial"},icon:"commercial-building"},{tags:{building:"apartments"},icon:"lowrise-building"}];function iS(t){if(!t)return null;for(const e of nS){let n=!0;for(const[i,r]of Object.entries(e.tags)){const e=t[i];if(!e){n=!1;break}const s=e.split(";").map(t=>t.trim());if(!0!==r&&!s.includes(r)){n=!1;break}}if(n)return e.icon}return null}const rS=Object.freeze(Object.defineProperty({__proto__:null,POI_ICON_RULES:nS,getIconNameForTags:iS,getIconSvgForTags:function(t){const e=iS(t);return e?QC(e):null}},Symbol.toStringTag,{value:"Module"}));function sS(t){return{title:t.title||Fx(t.osmTags,"Untitled Place"),lat:t.lat,lon:t.lon,tags:[],url:t.osmTags?.website,osmId:String(t.osmId||t.id),osmType:t.osmType,osmTags:t.osmTags||{},description:t.description}}const oS=Object.freeze(Object.defineProperty({__proto__:null,mapToStorageSchema:sS},Symbol.toStringTag,{value:"Module"}));function aS(t,e){if(!t)return null;const n=`${e}.com`,i=((t,...e)=>{for(const n of e)if(t[n])return t[n];return null})(t,`contact:${e}`,e);if(!i)return null;if(i.startsWith("http"))try{const t=new URL(i);return"facebook"===e&&"/profile.php"===t.pathname&&t.searchParams.has("id")?{url:i,username:t.searchParams.get("id")}:{url:i,username:t.pathname.replace(/^\/|\/$/g,"")||i}}catch{return{url:i,username:i}}const r=i.replace(/^@/,"");return{url:`https://${n}/${r}`,username:r}}const lS=Object.freeze(Object.defineProperty({__proto__:null,getSocialInfo:aS},Symbol.toStringTag,{value:"Module"}));function cS(t,e,n){return(e="symbol"==typeof(i=function(t){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,"string");if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(e))?i:String(i))in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t;var i}function hS(t,e,n,i){n&&Object.defineProperty(t,e,{enumerable:n.enumerable,configurable:n.configurable,writable:n.writable,value:n.initializer?n.initializer.call(i):void 0})}function uS(t,e,n,i){var r={};return Object.keys(i).forEach(function(t){r[t]=i[t]}),r.enumerable=!!r.enumerable,r.configurable=!!r.configurable,("value"in r||r.initializer)&&(r.writable=!0),void 0===(r=n.slice().reverse().reduce(function(n,i){return i(t,e,n)||n},r)).initializer&&(Object.defineProperty(t,e,r),r=null),r}var dS,pS,fS,gS,mS;const yS="undefined"!=typeof FastBoot,vS="routeDidChange",_S=["separator","prepend","replace"];let bS=(dS=qf("router"),pS=qf("-document"),fS=class extends Vf{constructor(t){if(super(t),hS(this,"router",gS,this),hS(this,"document",mS,this),cS(this,"tokens",[]),cS(this,"_defaultConfig",{separator:" | ",prepend:!0,replace:null}),cS(this,"scheduleTitleUpdate",()=>{Ca("afterRender",this,this._updateTitle)}),this._validateExistingTitleElement(),function(t){return"resolveRegistration"in t}(t)){const n=t.resolveRegistration("config:environment");"object"==typeof(e=n)&&null!==e&&"pageTitle"in e&&_S.forEach(t=>{if(!kf(n.pageTitle[t])){const e=n.pageTitle[t];this._defaultConfig[t]=e}})}var e;this.router.on(vS,this.scheduleTitleUpdate)}applyTokenDefaults(t){const e=this._defaultConfig.separator,n=this._defaultConfig.prepend,i=this._defaultConfig.replace;t.previous??=null,t.next??=null,null==t.separator&&(t.separator=e),null==t.prepend&&null!=n&&(t.prepend=n),null==t.replace&&null!=i&&(t.replace=i)}inheritFromPrevious(t){const e=t.previous;e&&(null==t.separator&&(t.separator=e.separator),null==t.prepend&&(t.prepend=e.prepend))}push(t){const e=this._findTokenById(t.id);if(e){const n=this.tokens.indexOf(e),i=[...this.tokens],r=e.previous;return t.previous=r,t.next=e.next,this.inheritFromPrevious(t),this.applyTokenDefaults(t),i.splice(n,1,t),void(this.tokens=i)}const n=this.tokens.slice(-1)[0];n&&(t.previous=n??null,n.next=t,this.inheritFromPrevious(t)),this.applyTokenDefaults(t),this.tokens=[...this.tokens,t]}remove(t){const e=this._findTokenById(t);if(!e)return;const{next:n,previous:i}=e;n&&(n.previous=i),i&&(i.next=n),e.previous=e.next=null;const r=[...this.tokens];r.splice(r.indexOf(e),1),this.tokens=r}get visibleTokens(){const t=this.tokens;let e=t?t.length:0;const n=[];for(;e--;){const i=t[e];if(i){if(i.replace){n.unshift(i);break}n.unshift(i)}}return n}get sortedTokens(){const t=this.visibleTokens;if(!t)return[];let e=!0,n=[];const i=[n],r=[];return t.forEach(t=>{t.front?r.unshift(t):t.prepend?(e&&(e=!1,n=[],i.push(n)),n.unshift(t)):(e||(e=!0,n=[],i.push(n)),n.push(t))}),r.concat(i.reduce((t,e)=>t.concat(e),[]))}toString(){const t=this.sortedTokens,e=[];for(let n=0,i=t.length;n<i;n++){const r=t[n];r&&r.title&&(e.push(r.title),n+1<i&&e.push(r.separator))}return e.join("")}willDestroy(){super.willDestroy(),this.router.off(vS,this.scheduleTitleUpdate)}_updateTitle(){const t=this.toString();yS?this.updateFastbootTitle(t):this.document.title=t,this.titleDidUpdate(t)}_validateExistingTitleElement(){yS||document.head.querySelectorAll("title").length}_findTokenById(t){return this.tokens.find(e=>e.id===t)}updateFastbootTitle(t){if(!yS)return;const e=this.document.head,n=e.childNodes;for(let s=0;s<n.length;s++){const t=n[s];t&&"title"===t.nodeName.toLowerCase()&&e.removeChild(t)}const i=this.document.createElement("title"),r=this.document.createTextNode(t);i.appendChild(r),e.appendChild(i)}titleDidUpdate(t){}},gS=uS(fS.prototype,"router",[dS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),mS=uS(fS.prototype,"document",[pS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),fS);const wS=Object.freeze(Object.defineProperty({__proto__:null,default:bS},Symbol.toStringTag,{value:"Module"})),xS=new WeakMap,CS=new WeakMap;let SS=class{constructor(t,e){this.args=e,xS.set(this,!1),CS.set(this,!1)}args;get isDestroying(){return xS.get(this)||!1}get isDestroyed(){return CS.get(this)||!1}willDestroy(){}};class kS{owner;constructor(t){this.owner=t}createComponent(t,e){return new t(this.owner,e.named)}getContext(t){return t}}const ES=Ni(0,{destructor:!0,asyncLifecycleCallbacks:!1,updateHook:!1});function TS(t){t.isDestroyed||(Ht(t),function(t){CS.set(t,!0)}(t))}class LS extends kS{capabilities=ES;destroyComponent(t){t.isDestroying||(function(t){xS.set(t,!0)}(t),ba("actions",t,t.willDestroy),ba("destroy",this,TS,t))}}class MS extends SS{constructor(t,e){super(t,e),ur(this,t)}}CC(t=>new LS(t),MS);const RS=Object.freeze(Object.defineProperty({__proto__:null,default:MS},Symbol.toStringTag,{value:"Module"})),PS=Hi,IS=hv;function OS(t){return"object"==typeof t&&t&&"isTruthy"in t&&"boolean"==typeof t.isTruthy?t.isTruthy:Ju(t)?0!==t.length:!!t}class AS extends Mb{compute(t){for(let e=0,n=t.length;e<n;e++)if(!0===OS(t[e]))return t[e];return t[t.length-1]}}function zS(t,e){return t===e}class FS extends MS{get svg(){return QC(this.args.name)}get size(){return this.args.size||16}get color(){return this.args.color||"#898989"}get style(){return Fb(`width:${this.size}px;height:${this.size}px;color:${this.color}`)}get title(){return this.args.title||""}get isFilled(){return this.args.filled||tS(this.args.name)}static{Xi(em({id:null,block:'[[[41,[30,0,["svg"]],[[[1," "],[10,1],[15,0,[29,["icon ",[52,[30,0,["isFilled"]],"icon-filled"]]]],[15,5,[30,0,["style"]]],[15,"title",[30,0,["title"]]],[12],[1,"\\n "],[1,[28,[32,0],[[30,0,["svg"]]],null]],[1,"\\n "],[13],[1,"\\n"]],[]],null]],[],["if"]]',moduleName:"/home/basti/src/marco/app/components/icon.gjs",scope:()=>[Fb],isStrictMode:!0}),this)}}class jS extends MS{static{Mx(this.prototype,"title",[Ps],function(){return""})}#ot=void Px(this,"title");static{Mx(this.prototype,"description",[Ps],function(){return""})}#at=void Px(this,"description");constructor(){super(...arguments),this.title=this.args.place?.title||"",this.description=this.args.place?.description||""}get shouldAutofocus(){return"undefined"!=typeof window&&window.innerWidth>768}handleSubmit(t){t.preventDefault(),this.args.onSave&&this.args.onSave({title:this.title,description:this.description})}static{Rx(this.prototype,"handleSubmit",[Ih])}updateTitle(t){this.title=t.target.value}static{Rx(this.prototype,"updateTitle",[Ih])}updateDescription(t){this.description=t.target.value}static{Rx(this.prototype,"updateDescription",[Ih])}static{Xi(em({id:null,block:'[[[11,"form"],[24,0,"edit-form"],[4,[32,0],["submit",[30,0,["handleSubmit"]]],null],[12],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","edit-title"],[12],[1,"Title"],[13],[1,"\\n"],[1," "],[11,"input"],[24,1,"edit-title"],[16,2,[30,0,["title"]]],[24,0,"form-control"],[24,"placeholder","Name of the place"],[16,"autofocus",[30,0,["shouldAutofocus"]]],[24,4,"text"],[4,[32,0],["input",[30,0,["updateTitle"]]],null],[12],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","edit-desc"],[12],[1,"Description"],[13],[1,"\\n "],[11,"textarea"],[24,1,"edit-desc"],[16,2,[30,0,["description"]]],[24,0,"form-control"],[24,"rows","3"],[24,"placeholder","Add some details..."],[4,[32,0],["input",[30,0,["updateDescription"]]],null],[12],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"edit-actions"],[12],[1,"\\n "],[10,"button"],[14,0,"btn btn-blue"],[14,4,"submit"],[12],[1,"Save"],[13],[1,"\\n "],[11,"button"],[24,0,"btn btn-outline"],[24,4,"button"],[4,[32,0],["click",[30,1]],null],[12],[1,"Cancel"],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@onCancel"],[]]',moduleName:"/home/basti/src/marco/app/components/place-edit-form.gjs",scope:()=>[S_],isStrictMode:!0}),this)}}class DS{capabilities=$i();constructor(t){this.owner=t}createModifier(t,e){return{instance:new t(this.owner,e),element:null}}installModifier(t,e,n){const i=function(t,e){const n=t;return n.element=e,n}(t,e);i.instance.modify(e,n.positional,n.named)}updateModifier(t,e){t.instance.modify(t.element,e.positional,e.named)}destroyModifier({instance:t}){Ht(t)}}PS(t=>new DS(t),class{constructor(t,e){hx(this,t)}modify(t,e,n){}});const NS=new class{capabilities=$i();createModifier(t){return{element:null,instance:t}}installModifier(t,e,n){const i=function(t,e){const n=t;return n.element=e,n}(t,e),{positional:r,named:s}=n,o=t.instance(e,r,s);"function"==typeof o&&(i.teardown=o)}updateModifier(t,e){"function"==typeof t.teardown&&t.teardown();const n=t.instance(t.element,e.positional,e.named);"function"==typeof n&&(t.teardown=n)}destroyModifier(t){"function"==typeof t.teardown&&t.teardown()}getDebugName(t){return t.instance.toString()}getDebugInstance(t){return t}};function BS(t){return t.toString=()=>t.name,PS(()=>NS,t)}const US=BS((t,[e])=>{const n=n=>{t&&!t.contains(n.target)&&e(n)},i=setTimeout(()=>{document.addEventListener("click",n)},0);return()=>{clearTimeout(i),document.removeEventListener("click",n)}});class qS extends MS{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"_forceClear",[Ps],function(){return!1})}#ht=void Px(this,"_forceClear");get isSaved(){return this.args.isSaved}get placeListIds(){return this._forceClear?[]:this.args.place._listIds||[]}styleFor(t){return Fb(`background-color: ${t}`)}isInList(t){return!!this.placeListIds&&this.placeListIds.includes(t.id)}static{Rx(this.prototype,"isInList",[Ih])}async toggleSaved(){if(this.isSaved){const{osmId:t,osmType:e}=this.args.place;if(await this.storage.removePlace(this.args.place),this.args.place&&(this.args.place.id=null,this.args.place.createdAt=null,this.args.place._listIds=[],this._forceClear=!0),t&&e){const t={...this.args.place};delete t.id,delete t.createdAt,delete t._listIds,this.router.transitionTo("place",t)}else this.router.transitionTo("index");this.args.onClose&&this.args.onClose()}else await this.storage.storePlace(this.args.place)}static{Rx(this.prototype,"toggleSaved",[Ih])}async toggleList(t){const e=!this.placeListIds.includes(t.id);e&&!this.isSaved&&await this.storage.storePlace(this.args.place);try{await this.storage.togglePlaceList(this.args.place,t.id,e)}catch(n){console.error(n),alert("Failed to update list: "+n.message)}}static{Rx(this.prototype,"toggleList",[Ih])}static{Xi(em({id:null,block:'[[[11,0],[24,0,"place-lists-manager"],[4,[32,0],[[30,1]],null],[12],[1,"\\n "],[10,0],[14,0,"list-item master-toggle"],[12],[1,"\\n "],[10,"label"],[12],[1,"\\n "],[11,"input"],[16,"checked",[30,0,["isSaved"]]],[24,4,"checkbox"],[4,[32,1],["change",[30,0,["toggleSaved"]]],null],[12],[13],[1,"\\n "],[10,1],[14,0,"list-color"],[12],[13],[1,"\\n "],[10,1],[14,0,"list-name"],[12],[1,"Saved places"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"divider"],[12],[13],[1,"\\n\\n "],[10,0],[14,0,"lists-container"],[12],[1,"\\n"],[42,[28,[31,1],[[28,[31,1],[[30,0,["storage","lists"]]],null]],null],null,[[[1," "],[10,0],[14,0,"list-item"],[12],[1,"\\n "],[10,"label"],[12],[1,"\\n "],[11,"input"],[16,"checked",[28,[30,0,["isInList"]],[[30,2]],null]],[16,"disabled",[52,[51,[30,0,["isSaved"]]],true]],[24,4,"checkbox"],[4,[32,1],["change",[28,[32,2],[[30,0,["toggleList"]],[30,2]],null]],null],[12],[13],[1,"\\n"],[1," "],[10,1],[14,0,"list-color"],[15,5,[28,[30,0,["styleFor"]],[[30,2,["color"]]],null]],[12],[13],[1,"\\n "],[10,1],[14,0,"list-name"],[12],[1,[30,2,["title"]]],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[2]],null],[1," "],[13],[1,"\\n"],[13]],["@onClose","list"],["each","-track-array","unless"]]',moduleName:"/home/basti/src/marco/app/components/place-lists-manager.gjs",scope:()=>[US,S_,IS],isStrictMode:!0}),this)}}class VS extends MS{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"isEditing",[Ps],function(){return!1})}#ut=void Px(this,"isEditing");static{Mx(this.prototype,"showLists",[Ps],function(){return!1})}#dt=void Px(this,"showLists");get isSaved(){return this.storage.isPlaceSaved(this.place.id||this.place.osmId)}get place(){return this.args.place||{}}get saveablePlace(){return this.place.createdAt?this.place:sS(this.place)}get tags(){return this.place.osmTags||{}}get name(){return this.place.title||Fx(this.tags)||"Unnamed Place"}startEditing(){this.isSaved&&(this.isEditing=!0)}static{Rx(this.prototype,"startEditing",[Ih])}cancelEditing(){this.isEditing=!1}static{Rx(this.prototype,"cancelEditing",[Ih])}toggleLists(t){t&&t.stopPropagation(),this.showLists=!this.showLists}static{Rx(this.prototype,"toggleLists",[Ih])}closeLists(){this.showLists=!1}static{Rx(this.prototype,"closeLists",[Ih])}async saveChanges(t){this.args.onSave&&await this.args.onSave({...this.place,...t}),this.isEditing=!1}static{Rx(this.prototype,"saveChanges",[Ih])}get type(){return Dx(this.tags)}get address(){const t=this.tags,e=[],n=(...e)=>{for(const n of e)if(t[n])return t[n];return null};let i=n("addr:street","street");const r=n("addr:housenumber","housenumber");i&&(r&&(i=`${i} ${r}`),e.push(i));let s=n("addr:city","city");const o=n("addr:postcode","postcode");s&&(o&&(s=`${o} ${s}`),e.push(s));const a=n("addr:state","state"),l=n("addr:country","country");return a&&a!==s&&e.push(a),l&&e.push(l),0===e.length?null:e.join(", ")}formatMultiLine(t,e){if(!t)return null;const n=t.split(";").map(t=>t.trim()).filter(Boolean);return 0===n.length?null:Fb("phone"===e?n.map(t=>`<a href="tel:${t}">${t}</a>`).join("<br>"):"email"===e?n.map(t=>`<a href="mailto:${t}">${t}</a>`).join("<br>"):"url"===e?n.map(t=>`<a href="${t}" target="_blank" rel="noopener noreferrer">${this.getDomain(t)}</a>`).join("<br>"):n.join("<br>"))}get phone(){const t=this.tags.phone||this.tags["contact:phone"];return this.formatMultiLine(t,"phone")}get email(){const t=this.tags.email||this.tags["contact:email"];return this.formatMultiLine(t,"email")}get website(){const t=this.place.url||this.tags.website||this.tags["contact:website"];return this.formatMultiLine(t,"url")}getDomain(t){try{return new URL(t).hostname}catch{return t}}get openingHours(){const t=this.tags.opening_hours;return this.formatMultiLine(t)}get cuisine(){return this.tags.cuisine?this.tags.cuisine.split(";").map(t=>Ax(t)).join(", "):null}get facebook(){return aS(this.tags,"facebook")}get instagram(){return aS(this.tags,"instagram")}get wikipedia(){const t=this.tags.wikipedia;return t?t.split(";").map(t=>t.trim()).filter(Boolean)[0]:null}get geoLink(){const t=this.place.lat,e=this.place.lon;return t&&e?`geo:${t},${e}?q=${t},${e}(${encodeURIComponent(this.name)})`:"#"}get visibleGeoLink(){const t=this.place.lat,e=this.place.lon;return t&&e?`${Number(t).toFixed(6)}, ${Number(e).toFixed(6)}`:""}get osmUrl(){const t=this.place.osmId;return t?`https://www.openstreetmap.org/${this.place.osmType||"node"}/${t}`:null}get gmapsUrl(){return this.place.gmapsId||this.place.osmId?`https://www.google.com/maps/search/?api=1&query=${this.name}&query=${this.place.lat},${this.place.lon}`:null}get showDescription(){return"photon"!==this.place.source&&!!this.place.description}static{Xi(em({id:null,block:'[[[10,0],[14,0,"place-details"],[12],[1,"\\n"],[41,[30,0,["isEditing"]],[[[1," "],[8,[32,0],null,[["@place","@onSave","@onCancel"],[[30,0,["place"]],[30,0,["saveChanges"]],[30,0,["cancelEditing"]]]],null],[1,"\\n"]],[]],[[[1," "],[10,"h3"],[12],[1,[30,0,["name"]]],[13],[1,"\\n "],[10,2],[14,0,"place-type"],[12],[1,"\\n "],[1,[30,0,["type"]]],[1,"\\n "],[13],[1,"\\n"],[41,[30,0,["showDescription"]],[[[1," "],[10,2],[14,0,"place-description"],[12],[1,"\\n "],[1,[30,0,["place","description"]]],[1,"\\n "],[13],[1,"\\n"]],[]],null]],[]]],[1,"\\n "],[10,0],[14,0,"actions"],[12],[1,"\\n "],[10,0],[14,0,"save-button-wrapper"],[12],[1,"\\n "],[11,"button"],[16,0,[52,[30,0,["isSaved"]],"btn btn-secondary","btn btn-outline"]],[24,4,"button"],[4,[32,1],["click",[30,0,["toggleLists"]]],null],[12],[1,"\\n "],[8,[32,2],null,[["@name","@color"],["bookmark",[52,[30,0,["isSaved"]],"currentColor","var(--link-color)"]]],null],[1,"\\n "],[1,[52,[30,0,["isSaved"]],"Saved","Save"]],[1,"\\n "],[13],[1,"\\n\\n"],[41,[30,0,["showLists"]],[[[1," "],[8,[32,3],null,[["@place","@onClose","@isSaved"],[[30,0,["saveablePlace"]],[30,0,["closeLists"]],[30,0,["isSaved"]]]],null],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n\\n"],[41,[30,0,["isSaved"]],[[[1," "],[11,"button"],[24,0,"btn btn-outline"],[24,"title","Edit"],[16,"disabled",[30,0,["isEditing"]]],[24,4,"button"],[4,[32,1],["click",[30,0,["startEditing"]]],null],[12],[1,"\\n "],[8,[32,2],null,[["@name","@color"],["edit","var(--link-color)"]],null],[1,"\\n Edit\\n "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n\\n "],[10,0],[14,0,"meta-info"],[12],[1,"\\n\\n"],[41,[30,0,["cuisine"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["fork-and-knife","Cuisine"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[1,[30,0,["cuisine"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["openingHours"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["clock","Opening hours"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[1,[30,0,["openingHours"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["phone"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["phone","Phone"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[1,[30,0,["phone"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["website"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["globe","Website"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[1,[30,0,["website"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["email"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["mail","Email"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[1,[30,0,["email"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["facebook"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["facebook","Facebook"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[30,0,["facebook","url"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n "],[1,[30,0,["facebook","username"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["instagram"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["instagram","Instagram"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[30,0,["instagram","url"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n "],[1,[30,0,["instagram","username"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["wikipedia"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["wikipedia","Wikipedia"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[29,["https://wikipedia.org/wiki/",[30,0,["wikipedia"]]]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n Wikipedia\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"meta-info"],[12],[1,"\\n\\n"],[41,[30,0,["address"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["home","Address"]],null],[1,"\\n "],[10,1],[12],[1,[30,0,["address"]]],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name","@title"],["map-pin","Geo link"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[30,0,["geoLink"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n "],[1,[30,0,["visibleGeoLink"]]],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n"],[41,[30,0,["osmUrl"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name"],["map"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[30,0,["osmUrl"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n OpenStreetMap\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n"],[41,[30,0,["gmapsUrl"]],[[[1," "],[10,2],[14,0,"content-with-icon"],[12],[1,"\\n "],[8,[32,2],null,[["@name"],["map"]],null],[1,"\\n "],[10,1],[12],[1,"\\n "],[10,3],[15,6,[30,0,["gmapsUrl"]]],[14,"target","_blank"],[14,"rel","noopener noreferrer"],[12],[1,"\\n Google Maps\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n "],[13],[1,"\\n"],[13]],[],["if"]]',moduleName:"/home/basti/src/marco/app/components/place-details.gjs",scope:()=>[jS,S_,FS,qS],isStrictMode:!0}),this)}}const $S=Ab(function([t]){return Ax(t)});class GS extends MS{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");createNewPlace(){const t=this.router.currentRoute.queryParams,e=t.lat,n=t.lon;e&&n?this.router.transitionTo("place.new",{queryParams:{lat:e,lon:n}}):this.router.transitionTo("place.new",{queryParams:{lat:0,lon:0}})}static{Rx(this.prototype,"createNewPlace",[Ih])}selectPlace(t){this.args.onSelect&&this.args.onSelect(t)}static{Rx(this.prototype,"selectPlace",[Ih])}clearSelection(){this.args.onSelect&&this.args.onSelect(null)}static{Rx(this.prototype,"clearSelection",[Ih])}async toggleSave(t){if(t)if(t.createdAt)try{if(await this.storage.removePlace(t),console.debug("Place deleted:",t.title),this.args.onBookmarkChange&&this.args.onBookmarkChange(),this.args.onUpdate){const e={...t,id:void 0,geohash:void 0,createdAt:void 0};this.args.onUpdate(e)}this.args.onSelect&&this.args.onSelect(null),this.args.onClose&&this.args.onClose()}catch(e){console.error("Failed to delete:",e),alert("Failed to delete: "+e.message)}else{const e={title:Fx(t.osmTags,"Untitled Place"),lat:t.lat,lon:t.lon,tags:[],url:t.osmTags.website,osmId:String(t.osmId||t.id),osmType:t.osmType,osmTags:t.osmTags};try{const t=await this.storage.storePlace(e);console.debug("Place saved:",e.title),this.args.onBookmarkChange&&this.args.onBookmarkChange(),this.args.onUpdate&&this.args.onUpdate(t),this.args.onSelect&&this.args.onSelect(t)}catch(IN){console.error("Failed to save place:",IN),alert("Failed to save place: "+IN.message)}}}static{Rx(this.prototype,"toggleSave",[Ih])}async updateBookmark(t){try{const e=await this.storage.updatePlace(t);console.debug("Place updated:",e.title),this.args.onBookmarkChange&&this.args.onBookmarkChange(),this.args.onUpdate&&this.args.onUpdate(e)}catch(e){console.error("Failed to update place:",e),alert("Failed to update place: "+e.message)}}static{Rx(this.prototype,"updateBookmark",[Ih])}get isNearbySearch(){const t=this.router.currentRoute.queryParams;return!t.q&&!t.category&&t.lat&&t.lon}static{Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar"],[12],[1,"\\n "],[10,0],[14,0,"sidebar-header"],[12],[1,"\\n"],[41,[30,1],[[[1," "],[11,"button"],[24,0,"back-btn"],[24,4,"button"],[4,[32,0],["click",[30,0,["clearSelection"]]],null],[12],[8,[32,1],null,[["@name","@size","@color"],["arrow-left",20,"#333"]],null],[13],[1,"\\n"]],[]],[[[41,[30,0,["isNearbySearch"]],[[[1," "],[10,"h2"],[12],[8,[32,1],null,[["@name","@size","@color"],["target",20,"#ea4335"]],null],[1,"\\n Nearby"],[13],[1,"\\n"]],[]],[[[1," "],[10,"h2"],[12],[8,[32,1],null,[["@name","@size","@color"],["search",20,"#333"]],null],[1," Results"],[13],[1,"\\n"]],[]]]],[]]],[1," "],[11,"button"],[24,0,"close-btn"],[24,4,"button"],[4,[32,0],["click",[30,2]],null],[12],[8,[32,1],null,[["@name","@size","@color"],["x",20,"#333"]],null],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"sidebar-content"],[12],[1,"\\n"],[41,[30,1],[[[1," "],[8,[32,2],null,[["@place","@onToggleSave","@onSave"],[[30,1],[30,0,["toggleSave"]],[30,0,["updateBookmark"]]]],null],[1,"\\n"]],[]],[[[41,[30,3],[[[1," "],[10,"ul"],[14,0,"places-list"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,3]],null]],null],null,[[[1," "],[10,"li"],[12],[1,"\\n "],[11,"button"],[24,0,"place-item"],[24,4,"button"],[4,[32,0],["click",[28,[32,3],[[30,0,["selectPlace"]],[30,4]],null]],null],[12],[1,"\\n "],[10,0],[14,0,"place-name"],[12],[1,[28,[32,4],[[30,4,["title"]],[30,4,["osmTags","name"]],[30,4,["osmTags","name:en"]],"Unnamed Place"],null]],[13],[1,"\\n "],[10,0],[14,0,"place-type"],[12],[1,"\\n"],[41,[28,[32,5],[[30,4,["source"]],"osm"],null],[[[1," "],[1,[28,[32,6],[[30,4,["type"]]],null]],[1,"\\n"]],[]],[[[41,[28,[32,5],[[30,4,["source"]],"photon"],null],[[[1," "],[1,[30,4,["description"]]],[1,"\\n"]],[]],[[[41,[30,4,["osmTags"]],[[[1," "],[1,[28,[32,6],[[28,[32,7],[[30,4,["osmTags"]]],null]],null]],[1,"\\n"]],[]],[[[41,[30,4,["description"]],[[[1," "],[1,[30,4,["description"]]],[1,"\\n "]],[]],null]],[]]],[1," "]],[]]]],[]]],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[4]],null],[1," "],[13],[1,"\\n"]],[]],[[[41,[30,0,["isNearbySearch"]],[[[1," "],[10,2],[14,0,"empty-state"],[12],[1,"No places found nearby."],[13],[1,"\\n"]],[]],[[[1," "],[10,2],[14,0,"empty-state"],[12],[1,"No results found."],[13],[1,"\\n"]],[]]]],[]]],[1,"\\n "],[11,"button"],[24,0,"btn btn-outline create-place"],[24,4,"button"],[4,[32,0],["click",[30,0,["createNewPlace"]]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["plus",18,"var(--link-color)"]],null],[1,"\\n Create new place\\n "],[13],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n"],[13]],["@selectedPlace","@onClose","@places","place"],["if","each","-track-array"]]',moduleName:"/home/basti/src/marco/app/components/places-sidebar.gjs",scope:()=>[S_,FS,VS,IS,AS,zS,$S,Dx],isStrictMode:!0}),this)}}class WS extends MS{static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");selectPlace(t){t&&(this.mapUi.returnToSearch=!0,this.router.transitionTo("place",t))}static{Rx(this.prototype,"selectPlace",[Ih])}close(){this.router.transitionTo("index")}static{Rx(this.prototype,"close",[Ih])}static{Xi(em({id:null,block:'[[[8,[32,0],null,[["@places","@onSelect","@onClose"],[[30,1],[30,0,["selectPlace"]],[30,0,["close"]]]],null]],["@model"],[]]',moduleName:"/home/basti/src/marco/app/templates/search.gjs",scope:()=>[GS],isStrictMode:!0}),this)}}const HS=Object.freeze(Object.defineProperty({__proto__:null,default:WS},Symbol.toStringTag,{value:"Module"})),ZS=Object.freeze(Object.defineProperty({__proto__:null,default:class extends cd{queryParams=["lat","lon","q","selected","category"];lat=null;lon=null;q=null;selected=null;category=null}},Symbol.toStringTag,{value:"Module"}));class KS extends kp{static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");static{Mx(this.prototype,"photon",[qf])}#ft=void Px(this,"photon");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"toast",[qf])}#gt=void Px(this,"toast");queryParams={lat:{refreshModel:!0},lon:{refreshModel:!0},q:{refreshModel:!0},selected:{refreshModel:!0},category:{refreshModel:!0}};async model(t){const e=t.lat?parseFloat(t.lat):null,n=t.lon?parseFloat(t.lon):null;let i=[],r=null,s=null;try{if(t.category&&e&&n){r="category",s=t.category,this.mapUi.startLoading(r,s);let o=this.mapUi.currentBounds;if(!o){const t=.01;o={minLat:e-t,maxLat:e+t,minLon:n-t,maxLon:n+t}}i=await this.osm.getCategoryPois(o,t.category,e,n),i=i.map(t=>({...t,_distance:KC(e,n,t.lat,t.lon)})).sort((t,e)=>t._distance-e._distance)}else if(t.q){r="text",s=t.q,this.mapUi.startLoading(r,s),i=await this.photon.search(t.q,e,n);const o=t.q.toLowerCase();this.storage.savedPlaces.filter(t=>t.title?.toLowerCase().includes(o)||t.description?.toLowerCase().includes(o)).forEach(t=>{i.find(e=>t.osmId&&e.osmId===t.osmId||e.id&&e.id===t.id)||i.push(t)})}else if(e&&n){const t=50;i=await this.osm.getNearbyPois(e,n,t),this.storage.savedPlaces.filter(i=>KC(e,n,i.lat,i.lon)<=t).forEach(t=>{i.find(e=>t.osmId&&e.osmId===t.osmId||e.id&&e.id===t.id)||i.push(t)}),i=i.map(t=>({...t,_distance:KC(e,n,t.lat,t.lon)})).sort((t,e)=>t._distance-e._distance)}}finally{r&&s&&this.mapUi.stopLoading(r,s)}return i=i.map(t=>this.storage.findPlaceById(t.osmId)||t),i}afterModel(t,e){const{q:n,selected:i}=e.to.queryParams,r=i||n;if(r&&t.length>0){let e=null;if(e=t.find(t=>t.osmTags&&(t.osmTags.name===r||t.osmTags["name:en"]===r)),!e){const n=t[0];n._distance<=10&&(e=n)}if(e)return void this.router.replaceWith("place",e)}this.mapUi.stopSearch()}setupController(t,e){super.setupController(t,e),this.mapUi.stopSearch(),this.mapUi.setSearchResults(e);const{q:n,category:i,lat:r,lon:s}=this.paramsFor("search");this.mapUi.currentSearch={q:n,category:i,lat:r,lon:s}}error(t,e){return this.mapUi.stopSearch(),this.toast.show("Search request failed. Please try again."),e&&e.abort(),!1}static{Rx(this.prototype,"error",[Ih])}}const YS=Object.freeze(Object.defineProperty({__proto__:null,default:KS},Symbol.toStringTag,{value:"Module"}));var XS,JS,QS;let tk=(XS=qf("page-title"),QS=uS((JS=class extends Mb{constructor(t){super(t),hS(this,"tokens",QS,this),cS(this,"tokenId",et(this)),this.tokens.push({id:this.tokenId})}compute(t,e){const n={...e,id:this.tokenId,title:t.join("")};return this.tokens.push(n),this.tokens.scheduleTitleUpdate(),""}willDestroy(){super.willDestroy(),this.tokens.remove(this.tokenId),this.tokens.scheduleTitleUpdate()}}).prototype,"tokens",[XS],{configurable:!0,enumerable:!0,writable:!0,initializer:null}),JS);const ek="add",nk="remove",ik="propertychange",rk="change",sk="contextmenu",ok="click",ak="keydown",lk="keypress",ck="touchmove",hk="wheel";class uk{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}}function dk(t,e){return t>e?1:t<e?-1:0}function pk(t,e){return t<e?1:t>e?-1:0}function fk(t,e,n){if(t[0]<=e)return 0;const i=t.length;if(e<=t[i-1])return i-1;if("function"==typeof n){for(let r=1;r<i;++r){const i=t[r];if(i===e)return r;if(i<e)return n(e,t[r-1],i)>0?r-1:r}return i-1}if(n>0){for(let n=1;n<i;++n)if(t[n]<e)return n-1;return i-1}if(n<0){for(let n=1;n<i;++n)if(t[n]<=e)return n;return i-1}for(let r=1;r<i;++r){if(t[r]==e)return r;if(t[r]<e)return t[r-1]-e<e-t[r]?r-1:r}return i-1}function gk(t,e,n){for(;e<n;){const i=t[e];t[e]=t[n],t[n]=i,++e,--n}}function mk(t,e){const n=Array.isArray(e)?e:[e],i=n.length;for(let r=0;r<i;r++)t[t.length]=n[r]}function yk(t,e){const n=t.length;if(n!==e.length)return!1;for(let i=0;i<n;i++)if(t[i]!==e[i])return!1;return!0}function vk(){return!0}function _k(){return!1}function bk(){}function wk(t){let e,n,i;return function(){const r=Array.prototype.slice.call(arguments);return n&&this===i&&yk(r,n)||(i=this,n=r,e=t.apply(this,arguments)),e}}function xk(t){return function(){let e;try{e=t()}catch(n){return Promise.reject(n)}return e instanceof Promise?e:Promise.resolve(e)}()}function Ck(t){for(const e in t)delete t[e]}function Sk(t){let e;for(e in t)return!1;return!e}class kk{constructor(t){this.propagationStopped,this.defaultPrevented,this.type=t,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}}class Ek extends uk{constructor(t){super(),this.eventTarget_=t,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(t,e){if(!t||!e)return;const n=this.listeners_||(this.listeners_={}),i=n[t]||(n[t]=[]);i.includes(e)||i.push(e)}dispatchEvent(t){const e="string"==typeof t,n=e?t:t.type,i=this.listeners_&&this.listeners_[n];if(!i)return;const r=e?new kk(t):t;r.target||(r.target=this.eventTarget_||this);const s=this.dispatching_||(this.dispatching_={}),o=this.pendingRemovals_||(this.pendingRemovals_={});let a;n in s||(s[n]=0,o[n]=0),++s[n];for(let l=0,c=i.length;l<c;++l)if(a="handleEvent"in i[l]?i[l].handleEvent(r):i[l].call(this,r),!1===a||r.propagationStopped){a=!1;break}if(0===--s[n]){let t=o[n];for(delete o[n];t--;)this.removeEventListener(n,bk);delete s[n]}return a}disposeInternal(){this.listeners_&&Ck(this.listeners_)}getListeners(t){return this.listeners_&&this.listeners_[t]||void 0}hasListener(t){return!!this.listeners_&&(t?t in this.listeners_:Object.keys(this.listeners_).length>0)}removeEventListener(t,e){if(!this.listeners_)return;const n=this.listeners_[t];if(!n)return;const i=n.indexOf(e);-1!==i&&(this.pendingRemovals_&&t in this.pendingRemovals_?(n[i]=bk,++this.pendingRemovals_[t]):(n.splice(i,1),0===n.length&&delete this.listeners_[t]))}}function Tk(t,e,n,i,r){if(r){const r=n;n=function(s){return t.removeEventListener(e,n),r.call(i??this,s)}}else i&&i!==t&&(n=n.bind(i));const s={target:t,type:e,listener:n};return t.addEventListener(e,n),s}function Lk(t,e,n,i){return Tk(t,e,n,i,!0)}function Mk(t){t&&t.target&&(t.target.removeEventListener(t.type,t.listener),Ck(t))}class Rk extends Ek{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(rk)}getRevision(){return this.revision_}onInternal(t,e){if(Array.isArray(t)){const n=t.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=Tk(this,t[r],e);return i}return Tk(this,t,e)}onceInternal(t,e){let n;if(Array.isArray(t)){const i=t.length;n=new Array(i);for(let r=0;r<i;++r)n[r]=Lk(this,t[r],e)}else n=Lk(this,t,e);return e.ol_key=n,n}unInternal(t,e){const n=e.ol_key;if(n)!function(t){if(Array.isArray(t))for(let e=0,n=t.length;e<n;++e)Mk(t[e]);else Mk(t)}(n);else if(Array.isArray(t))for(let i=0,r=t.length;i<r;++i)this.removeEventListener(t[i],e);else this.removeEventListener(t,e)}}function Pk(){throw new Error("Unimplemented abstract method.")}Rk.prototype.on,Rk.prototype.once,Rk.prototype.un;let Ik=0;function Ok(t){return t.ol_uid||(t.ol_uid=String(++Ik))}class Ak extends kk{constructor(t,e,n){super(t),this.key=e,this.oldValue=n}}class zk extends Rk{constructor(t){super(),this.on,this.once,this.un,Ok(this),this.values_=null,void 0!==t&&this.setProperties(t)}get(t){let e;return this.values_&&this.values_.hasOwnProperty(t)&&(e=this.values_[t]),e}getKeys(){return this.values_&&Object.keys(this.values_)||[]}getProperties(){return this.values_&&Object.assign({},this.values_)||{}}getPropertiesInternal(){return this.values_}hasProperties(){return!!this.values_}notify(t,e){let n;n=`change:${t}`,this.hasListener(n)&&this.dispatchEvent(new Ak(n,t,e)),n=ik,this.hasListener(n)&&this.dispatchEvent(new Ak(n,t,e))}addChangeListener(t,e){this.addEventListener(`change:${t}`,e)}removeChangeListener(t,e){this.removeEventListener(`change:${t}`,e)}set(t,e,n){const i=this.values_||(this.values_={});if(n)i[t]=e;else{const n=i[t];i[t]=e,n!==e&&this.notify(t,n)}}setProperties(t,e){for(const n in t)this.set(n,t[n],e)}applyProperties(t){t.values_&&Object.assign(this.values_||(this.values_={}),t.values_)}unset(t,e){if(this.values_&&t in this.values_){const n=this.values_[t];delete this.values_[t],Sk(this.values_)&&(this.values_=null),e||this.notify(t,n)}}}const Fk="length";class jk extends kk{constructor(t,e,n){super(t),this.element=e,this.index=n}}class Dk extends zk{constructor(t,e){if(super(),this.on,this.once,this.un,e=e||{},this.unique_=!!e.unique,this.array_=t??[],this.unique_)for(let n=1,i=this.array_.length;n<i;++n)this.assertUnique_(this.array_[n],n);this.updateLength_()}clear(){for(;this.getLength()>0;)this.pop()}extend(t){for(let e=0,n=t.length;e<n;++e)this.push(t[e]);return this}forEach(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n)t(e[n],n,e)}getArray(){return this.array_}item(t){return this.array_[t]}getLength(){return this.get(Fk)}insertAt(t,e){if(t<0||t>this.getLength())throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e),this.array_.splice(t,0,e),this.updateLength_(),this.dispatchEvent(new jk(ek,e,t))}pop(){return this.removeAt(this.getLength()-1)}push(t){const e=this.getLength();return this.insertAt(e,t),this.getLength()}remove(t){const e=this.array_;for(let n=0,i=e.length;n<i;++n)if(e[n]===t)return this.removeAt(n)}removeAt(t){if(t<0||t>=this.getLength())return;const e=this.array_[t];return this.array_.splice(t,1),this.updateLength_(),this.dispatchEvent(new jk(nk,e,t)),e}setAt(t,e){if(t>=this.getLength())return void this.insertAt(t,e);if(t<0)throw new Error("Index out of bounds: "+t);this.unique_&&this.assertUnique_(e,t);const n=this.array_[t];this.array_[t]=e,this.dispatchEvent(new jk(nk,n,t)),this.dispatchEvent(new jk(ek,e,t))}updateLength_(){this.set(Fk,this.array_.length)}assertUnique_(t,e){const n=this.array_;for(let i=0,r=n.length;i<r;++i)if(n[i]===t&&i!==e)throw new Error("Duplicate item added to a unique collection")}}class Nk extends kk{constructor(t,e,n){super(t),this.map=e,this.frameState=void 0!==n?n:null}}class Bk extends Nk{constructor(t,e,n,i,r,s){super(t,e,r),this.originalEvent=n,this.pixel_=null,this.coordinate_=null,this.dragging=void 0!==i&&i,this.activePointers=s}get pixel(){return this.pixel_||(this.pixel_=this.map.getEventPixel(this.originalEvent)),this.pixel_}set pixel(t){this.pixel_=t}get coordinate(){return this.coordinate_||(this.coordinate_=this.map.getCoordinateFromPixel(this.pixel)),this.coordinate_}set coordinate(t){this.coordinate_=t}preventDefault(){super.preventDefault(),"preventDefault"in this.originalEvent&&this.originalEvent.preventDefault()}stopPropagation(){super.stopPropagation(),"stopPropagation"in this.originalEvent&&this.originalEvent.stopPropagation()}}const Uk={SINGLECLICK:"singleclick",CLICK:ok,DBLCLICK:"dblclick",POINTERDRAG:"pointerdrag",POINTERMOVE:"pointermove",POINTERDOWN:"pointerdown",POINTERUP:"pointerup",POINTEROVER:"pointerover",POINTEROUT:"pointerout",POINTERENTER:"pointerenter",POINTERLEAVE:"pointerleave",POINTERCANCEL:"pointercancel"},qk="undefined"!=typeof navigator&&void 0!==navigator.userAgent?navigator.userAgent.toLowerCase():"";qk.includes("safari")&&!qk.includes("chrom")&&(qk.includes("version/15.4")||/cpu (os|iphone os) 15_4 like mac os x/.test(qk));const Vk=qk.includes("webkit")&&!qk.includes("edge"),$k=qk.includes("macintosh"),Gk="undefined"!=typeof devicePixelRatio?devicePixelRatio:1,Wk="undefined"!=typeof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas&&self instanceof WorkerGlobalScope,Hk="undefined"!=typeof Image&&Image.prototype.decode,Zk="function"==typeof createImageBitmap,Kk=function(){let t=!1;try{const e=Object.defineProperty({},"passive",{get:function(){t=!0}});window.addEventListener("_",null,e),window.removeEventListener("_",null,e)}catch{}return t}(),Yk="pointerdown";class Xk extends Ek{constructor(t,e){super(t),this.map_=t,this.clickTimeoutId_,this.emulateClicks_=!1,this.dragging_=!1,this.dragListenerKeys_=[],this.moveTolerance_=void 0===e?1:e,this.down_=null;const n=this.map_.getViewport();this.activePointers_=[],this.trackedTouches_={},this.element_=n,this.pointerdownListenerKey_=Tk(n,Yk,this.handlePointerDown_,this),this.originalPointerMoveEvent_,this.relayedListenerKey_=Tk(n,"pointermove",this.relayMoveEvent_,this),this.boundHandleTouchMove_=this.handleTouchMove_.bind(this),this.element_.addEventListener(ck,this.boundHandleTouchMove_,!!Kk&&{passive:!1})}emulateClick_(t){let e=new Bk(Uk.CLICK,this.map_,t);this.dispatchEvent(e),void 0!==this.clickTimeoutId_?(clearTimeout(this.clickTimeoutId_),this.clickTimeoutId_=void 0,e=new Bk(Uk.DBLCLICK,this.map_,t),this.dispatchEvent(e)):this.clickTimeoutId_=setTimeout(()=>{this.clickTimeoutId_=void 0;const e=new Bk(Uk.SINGLECLICK,this.map_,t);this.dispatchEvent(e)},250)}updateActivePointers_(t){const e=t,n=e.pointerId;if(e.type==Uk.POINTERUP||e.type==Uk.POINTERCANCEL){delete this.trackedTouches_[n];for(const t in this.trackedTouches_)if(this.trackedTouches_[t].target!==e.target){delete this.trackedTouches_[t];break}}else e.type!=Uk.POINTERDOWN&&e.type!=Uk.POINTERMOVE||(this.trackedTouches_[n]=e);this.activePointers_=Object.values(this.trackedTouches_)}handlePointerUp_(t){this.updateActivePointers_(t);const e=new Bk(Uk.POINTERUP,this.map_,t,void 0,void 0,this.activePointers_);this.dispatchEvent(e),this.emulateClicks_&&!e.defaultPrevented&&!this.dragging_&&this.isMouseActionButton_(t)&&this.emulateClick_(this.down_),0===this.activePointers_.length&&(this.dragListenerKeys_.forEach(Mk),this.dragListenerKeys_.length=0,this.dragging_=!1,this.down_=null)}isMouseActionButton_(t){return 0===t.button}handlePointerDown_(t){this.emulateClicks_=0===this.activePointers_.length,this.updateActivePointers_(t);const e=new Bk(Uk.POINTERDOWN,this.map_,t,void 0,void 0,this.activePointers_);if(this.dispatchEvent(e),this.down_=new PointerEvent(t.type,t),Object.defineProperty(this.down_,"target",{writable:!1,value:t.target}),0===this.dragListenerKeys_.length){const t=this.map_.getOwnerDocument();this.dragListenerKeys_.push(Tk(t,Uk.POINTERMOVE,this.handlePointerMove_,this),Tk(t,Uk.POINTERUP,this.handlePointerUp_,this),Tk(this.element_,Uk.POINTERCANCEL,this.handlePointerUp_,this)),this.element_.getRootNode&&this.element_.getRootNode()!==t&&this.dragListenerKeys_.push(Tk(this.element_.getRootNode(),Uk.POINTERUP,this.handlePointerUp_,this))}}handlePointerMove_(t){if(this.isMoving_(t)){this.updateActivePointers_(t),this.dragging_=!0;const e=new Bk(Uk.POINTERDRAG,this.map_,t,this.dragging_,void 0,this.activePointers_);this.dispatchEvent(e)}}relayMoveEvent_(t){this.originalPointerMoveEvent_=t;const e=!(!this.down_||!this.isMoving_(t));this.dispatchEvent(new Bk(Uk.POINTERMOVE,this.map_,t,e))}handleTouchMove_(t){const e=this.originalPointerMoveEvent_;e&&!e.defaultPrevented||"boolean"==typeof t.cancelable&&!0!==t.cancelable||t.preventDefault()}isMoving_(t){return this.dragging_||Math.abs(t.clientX-this.down_.clientX)>this.moveTolerance_||Math.abs(t.clientY-this.down_.clientY)>this.moveTolerance_}disposeInternal(){this.relayedListenerKey_&&(Mk(this.relayedListenerKey_),this.relayedListenerKey_=null),this.element_.removeEventListener(ck,this.boundHandleTouchMove_),this.pointerdownListenerKey_&&(Mk(this.pointerdownListenerKey_),this.pointerdownListenerKey_=null),this.dragListenerKeys_.forEach(Mk),this.dragListenerKeys_.length=0,this.element_=null,super.disposeInternal()}}const Jk="postrender",Qk="loadstart",tE="loadend",eE="layergroup",nE="size",iE="target",rE="view";function sE(t,e){if(!t)throw new Error(e)}const oE=1/0;class aE{constructor(t,e){this.priorityFunction_=t,this.keyFunction_=e,this.elements_=[],this.priorities_=[],this.queuedElements_={}}clear(){this.elements_.length=0,this.priorities_.length=0,Ck(this.queuedElements_)}dequeue(){const t=this.elements_,e=this.priorities_,n=t[0];1==t.length?(t.length=0,e.length=0):(t[0]=t.pop(),e[0]=e.pop(),this.siftUp_(0));const i=this.keyFunction_(n);return delete this.queuedElements_[i],n}enqueue(t){sE(!(this.keyFunction_(t)in this.queuedElements_),"Tried to enqueue an `element` that was already added to the queue");const e=this.priorityFunction_(t);return e!=oE&&(this.elements_.push(t),this.priorities_.push(e),this.queuedElements_[this.keyFunction_(t)]=!0,this.siftDown_(0,this.elements_.length-1),!0)}getCount(){return this.elements_.length}getLeftChildIndex_(t){return 2*t+1}getRightChildIndex_(t){return 2*t+2}getParentIndex_(t){return t-1>>1}heapify_(){let t;for(t=(this.elements_.length>>1)-1;t>=0;t--)this.siftUp_(t)}isEmpty(){return 0===this.elements_.length}isKeyQueued(t){return t in this.queuedElements_}isQueued(t){return this.isKeyQueued(this.keyFunction_(t))}siftUp_(t){const e=this.elements_,n=this.priorities_,i=e.length,r=e[t],s=n[t],o=t;for(;t<i>>1;){const r=this.getLeftChildIndex_(t),s=this.getRightChildIndex_(t),o=s<i&&n[s]<n[r]?s:r;e[t]=e[o],n[t]=n[o],t=o}e[t]=r,n[t]=s,this.siftDown_(o,t)}siftDown_(t,e){const n=this.elements_,i=this.priorities_,r=n[e],s=i[e];for(;e>t;){const t=this.getParentIndex_(e);if(!(i[t]>s))break;n[e]=n[t],i[e]=i[t],e=t}n[e]=r,i[e]=s}reprioritize(){const t=this.priorityFunction_,e=this.elements_,n=this.priorities_;let i=0;const r=e.length;let s,o,a;for(o=0;o<r;++o)s=e[o],a=t(s),a==oE?delete this.queuedElements_[this.keyFunction_(s)]:(n[i]=a,e[i++]=s);e.length=i,n.length=i,this.heapify_()}}class lE extends aE{constructor(t,e){super(e=>t.apply(null,e),t=>t[0].getKey()),this.boundHandleTileChange_=this.handleTileChange.bind(this),this.tileChangeCallback_=e,this.tilesLoading_=0,this.tilesLoadingKeys_={}}enqueue(t){const e=super.enqueue(t);return e&&t[0].addEventListener(rk,this.boundHandleTileChange_),e}getTilesLoading(){return this.tilesLoading_}handleTileChange(t){const e=t.target,n=e.getState();if(2===n||3===n||4===n){3!==n&&e.removeEventListener(rk,this.boundHandleTileChange_);const t=e.getKey();t in this.tilesLoadingKeys_&&(delete this.tilesLoadingKeys_[t],--this.tilesLoading_),this.tileChangeCallback_()}}loadMoreTiles(t,e){let n=0;for(;this.tilesLoading_<t&&n<e&&this.getCount()>0;){const t=this.dequeue()[0],e=t.getKey();0!==t.getState()||e in this.tilesLoadingKeys_||(this.tilesLoadingKeys_[e]=!0,++this.tilesLoading_,++n,t.load())}}}const cE={CENTER:"center",RESOLUTION:"resolution",ROTATION:"rotation"};function hE(t,e,n){return Math.min(Math.max(t,e),n)}function uE(t,e,n,i,r,s){const o=r-n,a=s-i;if(0!==o||0!==a){const l=((t-n)*o+(e-i)*a)/(o*o+a*a);l>1?(n=r,i=s):l>0&&(n+=o*l,i+=a*l)}return dE(t,e,n,i)}function dE(t,e,n,i){const r=n-t,s=i-e;return r*r+s*s}function pE(t){return 180*t/Math.PI}function fE(t){return t*Math.PI/180}function gE(t,e){const n=t%e;return n*e<0?n+e:n}function mE(t,e,n){return t+n*(e-t)}function yE(t,e){const n=Math.pow(10,e);return Math.round(t*n)/n}function vE(t,e){return Math.floor(yE(t,e))}function _E(t,e){return Math.ceil(yE(t,e))}function bE(t,e,n){if(t>=e&&t<n)return t;const i=n-e;return((t-e)%i+i)%i+e}function wE(t,e,n){return function(i,r,s,o,a){if(!i)return;if(!r&&!e)return i;const l=e?0:s[0]*r,c=e?0:s[1]*r,h=a?a[0]:0,u=a?a[1]:0;let d=t[0]+l/2+h,p=t[2]-l/2+h,f=t[1]+c/2+u,g=t[3]-c/2+u;d>p&&(d=(p+d)/2,p=d),f>g&&(f=(g+f)/2,g=f);let m=hE(i[0],d,p),y=hE(i[1],f,g);if(o&&n&&r){const t=30*r;m+=-t*Math.log(1+Math.max(0,d-i[0])/t)+t*Math.log(1+Math.max(0,i[0]-p)/t),y+=-t*Math.log(1+Math.max(0,f-i[1])/t)+t*Math.log(1+Math.max(0,i[1]-g)/t)}return[m,y]}}function xE(t){return t}function CE(t){const e=[1/0,1/0,-1/0,-1/0];for(let n=0,i=t.length;n<i;++n)jE(e,t[n]);return e}function SE(t,e,n){return n?(n[0]=t[0]-e,n[1]=t[1]-e,n[2]=t[2]+e,n[3]=t[3]+e,n):[t[0]-e,t[1]-e,t[2]+e,t[3]+e]}function kE(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t.slice()}function EE(t,e,n){let i,r;return i=e<t[0]?t[0]-e:t[2]<e?e-t[2]:0,r=n<t[1]?t[1]-n:t[3]<n?n-t[3]:0,i*i+r*r}function TE(t,e){return ME(t,e[0],e[1])}function LE(t,e){return t[0]<=e[0]&&e[2]<=t[2]&&t[1]<=e[1]&&e[3]<=t[3]}function ME(t,e,n){return t[0]<=e&&e<=t[2]&&t[1]<=n&&n<=t[3]}function RE(t,e){const n=t[0],i=t[1],r=t[2],s=t[3],o=e[0],a=e[1];let l=0;return o<n?l|=16:o>r&&(l|=4),a<i?l|=8:a>s&&(l|=2),0===l&&(l=1),l}function PE(t,e,n,i,r){return r?(r[0]=t,r[1]=e,r[2]=n,r[3]=i,r):[t,e,n,i]}function IE(t){return PE(1/0,1/0,-1/0,-1/0,t)}function OE(t,e){const n=t[0],i=t[1];return PE(n,i,n,i,e)}function AE(t,e,n,i,r){return DE(IE(r),t,e,n,i)}function zE(t,e){return t[0]==e[0]&&t[2]==e[2]&&t[1]==e[1]&&t[3]==e[3]}function FE(t,e){return e[0]<t[0]&&(t[0]=e[0]),e[2]>t[2]&&(t[2]=e[2]),e[1]<t[1]&&(t[1]=e[1]),e[3]>t[3]&&(t[3]=e[3]),t}function jE(t,e){e[0]<t[0]&&(t[0]=e[0]),e[0]>t[2]&&(t[2]=e[0]),e[1]<t[1]&&(t[1]=e[1]),e[1]>t[3]&&(t[3]=e[1])}function DE(t,e,n,i,r){for(;n<i;n+=r)NE(t,e[n],e[n+1]);return t}function NE(t,e,n){t[0]=Math.min(t[0],e),t[1]=Math.min(t[1],n),t[2]=Math.max(t[2],e),t[3]=Math.max(t[3],n)}function BE(t,e){let n;return n=e(qE(t)),n||(n=e(VE(t)),n||(n=e(XE(t)),n||(n=e(YE(t)),n||!1)))}function UE(t){let e=0;return tT(t)||(e=JE(t)*ZE(t)),e}function qE(t){return[t[0],t[1]]}function VE(t){return[t[2],t[1]]}function $E(t){return[(t[0]+t[2])/2,(t[1]+t[3])/2]}function GE(t,e){let n;if("bottom-left"===e)n=qE(t);else if("bottom-right"===e)n=VE(t);else if("top-left"===e)n=YE(t);else{if("top-right"!==e)throw new Error("Invalid corner");n=XE(t)}return n}function WE(t,e,n,i,r){const[s,o,a,l,c,h,u,d]=HE(t,e,n,i);return PE(Math.min(s,a,c,u),Math.min(o,l,h,d),Math.max(s,a,c,u),Math.max(o,l,h,d),r)}function HE(t,e,n,i){const r=e*i[0]/2,s=e*i[1]/2,o=Math.cos(n),a=Math.sin(n),l=r*o,c=r*a,h=s*o,u=s*a,d=t[0],p=t[1];return[d-l+u,p-c-h,d-l-u,p-c+h,d+l-u,p+c+h,d+l+u,p+c-h,d-l+u,p-c-h]}function ZE(t){return t[3]-t[1]}function KE(t,e,n){const i=n||[1/0,1/0,-1/0,-1/0];return QE(t,e)?(t[0]>e[0]?i[0]=t[0]:i[0]=e[0],t[1]>e[1]?i[1]=t[1]:i[1]=e[1],t[2]<e[2]?i[2]=t[2]:i[2]=e[2],t[3]<e[3]?i[3]=t[3]:i[3]=e[3]):IE(i),i}function YE(t){return[t[0],t[3]]}function XE(t){return[t[2],t[3]]}function JE(t){return t[2]-t[0]}function QE(t,e){return t[0]<=e[2]&&t[2]>=e[0]&&t[1]<=e[3]&&t[3]>=e[1]}function tT(t){return t[2]<t[0]||t[3]<t[1]}function eT(t,e,n,i){if(tT(t))return IE(n);let r=[];if(i>1){const e=t[2]-t[0],n=t[3]-t[1];for(let s=0;s<i;++s)r.push(t[0]+e*s/i,t[1],t[2],t[1]+n*s/i,t[2]-e*s/i,t[3],t[0],t[3]-n*s/i)}else r=[t[0],t[1],t[2],t[1],t[2],t[3],t[0],t[3]];e(r,r,2);const s=[],o=[];for(let a=0,l=r.length;a<l;a+=2)s.push(r[a]),o.push(r[a+1]);return function(t,e,n){return PE(Math.min.apply(null,t),Math.min.apply(null,e),Math.max.apply(null,t),Math.max.apply(null,e),n)}(s,o,n)}function nT(t,e){const n=e.getExtent(),i=$E(t);if(e.canWrapX()&&(i[0]<n[0]||i[0]>=n[2])){const e=JE(n),r=Math.floor((i[0]-n[0])/e)*e;t[0]-=r,t[2]-=r}return t}function iT(t,e,n){if(e.canWrapX()){const i=e.getExtent();if(!isFinite(t[0])||!isFinite(t[2]))return[[i[0],t[1],i[2],t[3]]];nT(t,e);const r=JE(i);if(JE(t)>r&&!n)return[[i[0],t[1],i[2],t[3]]];if(t[0]<i[0])return[[t[0]+r,t[1],i[2],t[3]],[i[0],t[1],t[2],t[3]]];if(t[2]>i[2])return[[t[0],t[1],i[2],t[3]],[i[0],t[1],t[2]-r,t[3]]]}return[t]}function rT(t,e){let n=!0;for(let i=t.length-1;i>=0;--i)if(t[i]!=e[i]){n=!1;break}return n}function sT(t,e){const n=Math.cos(e),i=Math.sin(e),r=t[0]*n-t[1]*i,s=t[1]*n+t[0]*i;return t[0]=r,t[1]=s,t}function oT(t,e){if(e.canWrapX()){const n=JE(e.getExtent()),i=function(t,e,n){const i=e.getExtent();let r=0;return e.canWrapX()&&(t[0]<i[0]||t[0]>i[2])&&(n=n||JE(i),r=Math.floor((t[0]-i[0])/n)),r}(t,e,n);i&&(t[0]-=i*n)}return t}function aT(t){return Math.pow(t,3)}function lT(t){return 1-aT(1-t)}function cT(t){return 3*t*t-2*t*t*t}function hT(t){return t}const uT=6371008.8;function dT(t,e,n){n=n||uT;const i=fE(t[1]),r=fE(e[1]),s=(r-i)/2,o=fE(e[0]-t[0])/2,a=Math.sin(s)*Math.sin(s)+Math.sin(o)*Math.sin(o)*Math.cos(i)*Math.cos(r);return 2*n*Math.atan2(Math.sqrt(a),Math.sqrt(1-a))}function pT(t,e,n,i){i=i||uT;const r=fE(t[1]),s=fE(t[0]),o=e/i,a=Math.asin(Math.sin(r)*Math.cos(o)+Math.cos(r)*Math.sin(o)*Math.cos(n));return[pE(s+Math.atan2(Math.sin(n)*Math.sin(o)*Math.cos(r),Math.cos(o)-Math.sin(r)*Math.sin(a))),pE(a)]}function fT(...t){console.warn(...t)}const gT={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937};class mT{constructor(t){this.code_=t.code,this.units_=t.units,this.extent_=void 0!==t.extent?t.extent:null,this.worldExtent_=void 0!==t.worldExtent?t.worldExtent:null,this.axisOrientation_=void 0!==t.axisOrientation?t.axisOrientation:"enu",this.global_=void 0!==t.global&&t.global,this.canWrapX_=!(!this.global_||!this.extent_),this.getPointResolutionFunc_=t.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=t.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||gT[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(t){this.global_=t,this.canWrapX_=!(!t||!this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(t){this.defaultTileGrid_=t}setExtent(t){this.extent_=t,this.canWrapX_=!(!this.global_||!t)}setWorldExtent(t){this.worldExtent_=t}setGetPointResolution(t){this.getPointResolutionFunc_=t}getPointResolutionFunc(){return this.getPointResolutionFunc_}}const yT=6378137,vT=Math.PI*yT,_T=[-vT,-vT,vT,vT],bT=[-180,-85,180,85],wT=yT*Math.log(Math.tan(Math.PI/2));class xT extends mT{constructor(t){super({code:t,units:"m",extent:_T,global:!0,worldExtent:bT,getPointResolution:function(t,e){return t/Math.cosh(e[1]/yT)}})}}const CT=[new xT("EPSG:3857"),new xT("EPSG:102100"),new xT("EPSG:102113"),new xT("EPSG:900913"),new xT("http://www.opengis.net/def/crs/EPSG/0/3857"),new xT("http://www.opengis.net/gml/srs/epsg.xml#3857")],ST=[-180,-90,180,90],kT=6378137*Math.PI/180;class ET extends mT{constructor(t,e){super({code:t,units:"degrees",extent:ST,axisOrientation:e,global:!0,metersPerUnit:kT,worldExtent:ST})}}const TT=[new ET("CRS:84"),new ET("EPSG:4326","neu"),new ET("urn:ogc:def:crs:OGC:1.3:CRS84"),new ET("urn:ogc:def:crs:OGC:2:84"),new ET("http://www.opengis.net/def/crs/OGC/1.3/CRS84"),new ET("http://www.opengis.net/gml/srs/epsg.xml#4326","neu"),new ET("http://www.opengis.net/def/crs/EPSG/0/4326","neu")];let LT={},MT={};function RT(t,e,n){const i=t.getCode(),r=e.getCode();i in MT||(MT[i]={}),MT[i][r]=n}function PT(t,e){return t in MT&&e in MT[t]?MT[t][e]:null}const IT=.9996,OT=.00669438,AT=OT*OT,zT=AT*OT,FT=OT/(1-OT),jT=Math.sqrt(1-OT),DT=(1-jT)/(1+jT),NT=DT*DT,BT=NT*DT,UT=BT*DT,qT=UT*DT,VT=.9983242984503243,$T=15*AT/256+45*zT/1024,GT=35*zT/3072,WT=1.5*DT-27/32*BT+269/512*qT,HT=21/16*NT-55/32*UT,ZT=151/96*BT-417/128*qT,KT=1097/512*UT,YT=6378137;function XT(t,e,n){const i=t-5e5,r=(n.north?e:e-1e7)/IT/(YT*VT),s=r+WT*Math.sin(2*r)+HT*Math.sin(4*r)+ZT*Math.sin(6*r)+KT*Math.sin(8*r),o=Math.sin(s),a=o*o,l=Math.cos(s),c=o/l,h=c*c,u=h*h,d=1-OT*a,p=Math.sqrt(1-OT*a),f=FT*l**2,g=f*f,m=i/(YT/p*IT),y=m*m,v=y*m,_=v*m,b=_*m,w=s-c/((1-OT)/d)*(y/2-_/24*(5+3*h+10*f-4*g-9*FT))+b*m/720*(61+90*h+298*f+45*u-252*FT-3*g);let x=(m-v/6*(1+2*h+f)+b/120*(5-2*f+28*h-3*g+8*FT+24*u))/l;return x=bE(x+fE(QT(n.number)),-Math.PI,Math.PI),[pE(x),pE(w)]}function JT(t,e,n){t=bE(t,-180,180),e<-80?e=-80:e>84&&(e=84);const i=fE(e),r=Math.sin(i),s=Math.cos(i),o=r/s,a=o*o,l=a*a,c=fE(t),h=fE(QT(n.number)),u=YT/Math.sqrt(1-OT*r**2),d=FT*s**2,p=s*bE(c-h,-Math.PI,Math.PI),f=p*p,g=f*p,m=g*p,y=m*p,v=y*p,_=YT*(VT*i-.002514607064228144*Math.sin(2*i)+$T*Math.sin(4*i)-GT*Math.sin(6*i)),b=IT*u*(p+g/6*(1-a+d)+y/120*(5-18*a+l+72*d-58*FT))+5e5;let w=IT*(_+u*o*(f/2+m/24*(5-a+9*d+4*d**2)+v/720*(61-58*a+l+600*d-330*FT)));return n.north||(w+=1e7),[b,w]}function QT(t){return 6*(t-1)-180+3}const tL=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function eL(t){let e=0;for(const r of tL){const n=t.match(r);if(n){e=parseInt(n[1]);break}}if(!e)return null;let n=0,i=!1;return e>32700&&e<32761?n=e-32700:e>32600&&e<32661&&(i=!0,n=e-32600),n?{number:n,north:i}:null}function nL(t,e){return function(n,i,r,s){const o=n.length;r=r>1?r:2,s=s??r,i||(i=r>2?n.slice():new Array(o));for(let a=0;a<o;a+=s){const r=n[a],s=n[a+1],o=t(r,s,e);i[a]=o[0],i[a+1]=o[1]}return i}}const iL=[function(t){const e=eL(t.getCode());return e?{forward:nL(JT,e),inverse:nL(XT,e)}:null}],rL=[function(t){return eL(t)?new mT({code:t,units:"m"}):null}];let sL=!0;function oL(){sL=!1}function aL(t,e){if(void 0!==e)for(let n=0,i=t.length;n<i;++n)e[n]=t[n];else e=t.slice();return e}function lL(t,e){if(void 0!==e&&t!==e){for(let n=0,i=t.length;n<i;++n)e[n]=t[n];t=e}return t}function cL(t){!function(t,e){LT[t]=e}(t.getCode(),t),RT(t,t,aL)}function hL(t){if("string"!=typeof t)return t;const e=LT[n=t]||LT[n.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,"EPSG:$3")]||null;var n;if(e)return e;for(const i of rL){const e=i(t);if(e)return e}return null}function uL(t,e,n,i){let r;const s=(t=hL(t)).getPointResolutionFunc();if(s){if(r=s(e,n),i&&i!==t.getUnits()){const e=t.getMetersPerUnit();e&&(r=r*e/gT[i])}}else{const s=t.getUnits();if("degrees"==s&&!i||"degrees"==i)r=e;else{const o=yL(t,hL("EPSG:4326"));if(o||"degrees"===s){let t=[n[0]-e/2,n[1],n[0]+e/2,n[1],n[0],n[1]-e/2,n[0],n[1]+e/2];t=o(t,t,2),r=(dT(t.slice(0,2),t.slice(2,4))+dT(t.slice(4,6),t.slice(6,8)))/2}else r=e*t.getMetersPerUnit();const a=i?gT[i]:t.getMetersPerUnit();void 0!==a&&(r/=a)}}return r}function dL(t){!function(t){t.forEach(cL)}(t),t.forEach(function(e){t.forEach(function(t){e!==t&&RT(e,t,aL)})})}function pL(t,e){return t?"string"==typeof t?hL(t):t:hL(e)}function fL(t,e){return oL(),bL(t,"EPSG:4326",void 0!==e?e:"EPSG:3857")}function gL(t){const e=bL(t,"EPSG:3857","EPSG:4326"),n=e[0];return(n<-180||n>180)&&(e[0]=gE(n+180,360)-180),e}function mL(t,e){if(t===e)return!0;const n=t.getUnits()===e.getUnits();return(t.getCode()===e.getCode()||yL(t,e)===aL)&&n}function yL(t,e){const n=t.getCode(),i=e.getCode();let r=PT(n,i);if(r)return r;let s=null,o=null;for(const l of iL)s||(s=l(t)),o||(o=l(e));if(!s&&!o)return null;const a="EPSG:4326";if(o)if(s)r=vL(s.inverse,o.forward);else{const t=PT(n,a);t&&(r=vL(t,o.forward))}else{const t=PT(a,i);t&&(r=vL(s.inverse,t))}return r&&(cL(t),cL(e),RT(t,e,r)),r}function vL(t,e){return function(n,i,r,s){return i=t(n,i,r,s),e(i,i,r,s)}}function _L(t,e){return yL(hL(t),hL(e))}function bL(t,e,n){const i=_L(e,n);if(!i){const t=hL(e).getCode(),i=hL(n).getCode();throw new Error(`No transform available between ${t} and ${i}`)}return i(t,void 0,t.length)}function wL(t,e,n,i){return eT(t,_L(e,n),void 0,i)}function xL(t){return t}function CL(t){return sL&&!rT(t,[0,0])&&t[0]>=-180&&t[0]<=180&&t[1]>=-90&&t[1]<=90&&(sL=!1,fT("Call useGeographic() from ol/proj once to work with [longitude, latitude] coordinates.")),t}function SL(t){return t}var kL,EL,TL;dL(CT),dL(TT),kL=CT,EL=function(t,e,n,i){const r=t.length;n=n>1?n:2,i=i??n,void 0===e&&(e=n>2?t.slice():new Array(r));for(let s=0;s<r;s+=i){e[s]=vT*t[s]/180;let n=yT*Math.log(Math.tan(Math.PI*(+t[s+1]+90)/360));n>wT?n=wT:n<-wT&&(n=-wT),e[s+1]=n}return e},TL=function(t,e,n,i){const r=t.length;n=n>1?n:2,i=i??n,void 0===e&&(e=n>2?t.slice():new Array(r));for(let s=0;s<r;s+=i)e[s]=180*t[s]/vT,e[s+1]=360*Math.atan(Math.exp(t[s+1]/yT))/Math.PI-90;return e},TT.forEach(function(t){kL.forEach(function(e){RT(t,e,EL),RT(e,t,TL)})});const LL=new Array(6);function ML(t){return PL(t,1,0,0,1,0,0)}function RL(t,e){const n=t[0],i=t[1],r=t[2],s=t[3],o=t[4],a=t[5],l=e[0],c=e[1],h=e[2],u=e[3],d=e[4],p=e[5];return t[0]=n*l+r*c,t[1]=i*l+s*c,t[2]=n*h+r*u,t[3]=i*h+s*u,t[4]=n*d+r*p+o,t[5]=i*d+s*p+a,t}function PL(t,e,n,i,r,s,o){return t[0]=e,t[1]=n,t[2]=i,t[3]=r,t[4]=s,t[5]=o,t}function IL(t,e){const n=e[0],i=e[1];return e[0]=t[0]*n+t[2]*i+t[4],e[1]=t[1]*n+t[3]*i+t[5],e}function OL(t,e,n){return RL(t,PL(LL,e,0,0,n,0,0))}function AL(t,e,n,i,r,s,o,a){const l=Math.sin(s),c=Math.cos(s);return t[0]=i*c,t[1]=r*l,t[2]=-i*l,t[3]=r*c,t[4]=o*i*c-a*i*l+e,t[5]=o*r*l+a*r*c+n,t}function zL(t,e){const n=(i=e)[0]*i[3]-i[1]*i[2];var i;sE(0!==n,"Transformation matrix cannot be inverted");const r=e[0],s=e[1],o=e[2],a=e[3],l=e[4],c=e[5];return t[0]=a/n,t[1]=-s/n,t[2]=-o/n,t[3]=r/n,t[4]=(o*c-a*l)/n,t[5]=-(r*c-s*l)/n,t}const FL=[1e5,1e5,1e5,1e5,2,2];function jL(t){return t.substring(7,t.length-1).split(",").map(parseFloat)}function DL(t,e,n,i,r,s,o){s=s||[],o=o||2;let a=0;for(let l=e;l<n;l+=i){const e=t[l],n=t[l+1];s[a++]=r[0]*e+r[2]*n+r[4],s[a++]=r[1]*e+r[3]*n+r[5];for(let i=2;i<o;i++)s[a++]=t[l+i]}return s&&s.length!=a&&(s.length=a),s}function NL(t,e,n,i,r,s,o){o=o||[];const a=Math.cos(r),l=Math.sin(r),c=s[0],h=s[1];let u=0;for(let d=e;d<n;d+=i){const e=t[d]-c,n=t[d+1]-h;o[u++]=c+e*a-n*l,o[u++]=h+e*l+n*a;for(let r=d+2;r<d+i;++r)o[u++]=t[r]}return o&&o.length!=u&&(o.length=u),o}const BL=[1,0,0,1,0,0],UL=[NaN,NaN];class qL extends zk{constructor(){super(),this.extent_=[1/0,1/0,-1/0,-1/0],this.extentRevision_=-1,this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=0,this.simplifyTransformedInternal=wk((t,e,n)=>{if(!n)return this.getSimplifiedGeometry(e);const i=this.clone();return i.applyTransform(n),i.getSimplifiedGeometry(e)})}simplifyTransformed(t,e){return this.simplifyTransformedInternal(this.getRevision(),t,e)}clone(){return Pk()}closestPointXY(t,e,n,i){return Pk()}containsXY(t,e){return 0===this.closestPointXY(t,e,UL,Number.MIN_VALUE)}getClosestPoint(t,e){return e=e||[NaN,NaN],this.closestPointXY(t[0],t[1],e,1/0),e}intersectsCoordinate(t){return this.containsXY(t[0],t[1])}computeExtent(t){return Pk()}getExtent(t){if(this.extentRevision_!=this.getRevision()){const t=this.computeExtent(this.extent_);(isNaN(t[0])||isNaN(t[1]))&&IE(t),this.extentRevision_=this.getRevision()}return function(t,e){return e?(e[0]=t[0],e[1]=t[1],e[2]=t[2],e[3]=t[3],e):t}(this.extent_,t)}rotate(t,e){Pk()}scale(t,e,n){Pk()}simplify(t){return this.getSimplifiedGeometry(t*t)}getSimplifiedGeometry(t){return Pk()}getType(){return Pk()}applyTransform(t){Pk()}intersectsExtent(t){return Pk()}translate(t,e){Pk()}transform(t,e){const n=hL(t),i="tile-pixels"==n.getUnits()?function(t,i,r){const s=n.getExtent(),o=n.getWorldExtent(),a=ZE(o)/ZE(s);AL(BL,o[0],o[3],a,-a,0,0,0);const l=DL(t,0,t.length,r,BL,i),c=_L(n,e);return c?c(l,l,r):l}:_L(n,e);return this.applyTransform(i),this}}class VL extends qL{constructor(){super(),this.layout="XY",this.stride=2,this.flatCoordinates}computeExtent(t){return AE(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinates(){return Pk()}getFirstCoordinate(){return this.flatCoordinates.slice(0,this.stride)}getFlatCoordinates(){return this.flatCoordinates}getLastCoordinate(){return this.flatCoordinates.slice(this.flatCoordinates.length-this.stride)}getLayout(){return this.layout}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<=this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=this.getSimplifiedGeometryInternal(t);return e.getFlatCoordinates().length<this.flatCoordinates.length?e:(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getSimplifiedGeometryInternal(t){return this}getStride(){return this.stride}setFlatCoordinates(t,e){this.stride=GL(t),this.layout=t,this.flatCoordinates=e}setCoordinates(t,e){Pk()}setLayout(t,e,n){let i;if(t)i=GL(t);else{for(let t=0;t<n;++t){if(0===e.length)return this.layout="XY",void(this.stride=2);e=e[0]}i=e.length,t=$L(i)}this.layout=t,this.stride=i}applyTransform(t){this.flatCoordinates&&(t(this.flatCoordinates,this.flatCoordinates,this.layout.startsWith("XYZ")?3:2,this.stride),this.changed())}rotate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();NL(n,0,n.length,i,t,e,n),this.changed()}}scale(t,e,n){void 0===e&&(e=t),n||(n=$E(this.getExtent()));const i=this.getFlatCoordinates();if(i){const r=this.getStride();!function(t,e,n,i,r,s,o,a){a=a||[];const l=o[0],c=o[1];let h=0;for(let u=0;u<n;u+=i){const e=t[u]-l,n=t[u+1]-c;a[h++]=l+r*e,a[h++]=c+s*n;for(let r=u+2;r<u+i;++r)a[h++]=t[r]}a&&a.length!=h&&(a.length=h)}(i,0,i.length,r,t,e,n,i),this.changed()}}translate(t,e){const n=this.getFlatCoordinates();if(n){const i=this.getStride();!function(t,e,n,i,r,s,o){o=o||[];let a=0;for(let l=0;l<n;l+=i){o[a++]=t[l]+r,o[a++]=t[l+1]+s;for(let e=l+2;e<l+i;++e)o[a++]=t[e]}o&&o.length!=a&&(o.length=a)}(n,0,n.length,i,t,e,n),this.changed()}}}function $L(t){let e;return 2==t?e="XY":3==t?e="XYZ":4==t&&(e="XYZM"),e}function GL(t){let e;return"XY"==t?e=2:"XYZ"==t||"XYM"==t?e=3:"XYZM"==t&&(e=4),e}function WL(t,e,n,i){let r=0;const s=t[n-i],o=t[n-i+1];let a=0,l=0;for(;e<n;e+=i){const n=t[e]-s,i=t[e+1]-o;r+=l*n-a*i,a=n,l=i}return r/2}function HL(t,e,n,i){let r=0;for(let s=0,o=n.length;s<o;++s){const o=n[s];r+=WL(t,e,o,i),e=o}return r}function ZL(t,e,n,i,r,s,o){const a=t[e],l=t[e+1],c=t[n]-a,h=t[n+1]-l;let u;if(0===c&&0===h)u=e;else{const d=((r-a)*c+(s-l)*h)/(c*c+h*h);if(d>1)u=n;else{if(d>0){for(let r=0;r<i;++r)o[r]=mE(t[e+r],t[n+r],d);return void(o.length=i)}u=e}}for(let d=0;d<i;++d)o[d]=t[u+d];o.length=i}function KL(t,e,n,i,r){let s=t[e],o=t[e+1];for(e+=i;e<n;e+=i){const n=t[e],i=t[e+1],a=dE(s,o,n,i);a>r&&(r=a),s=n,o=i}return r}function YL(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){const o=n[s];r=KL(t,e,o,i,r),e=o}return r}function XL(t,e,n,i,r,s,o,a,l,c,h){if(e==n)return c;let u,d;if(0===r){if(d=dE(o,a,t[e],t[e+1]),d<c){for(u=0;u<i;++u)l[u]=t[e+u];return l.length=i,d}return c}h=h||[NaN,NaN];let p=e+i;for(;p<n;)if(ZL(t,p-i,p,i,o,a,h),d=dE(o,a,h[0],h[1]),d<c){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i,p+=i}else p+=i*Math.max((Math.sqrt(d)-Math.sqrt(c))/r|0,1);if(s&&(ZL(t,n-i,e,i,o,a,h),d=dE(o,a,h[0],h[1]),d<c)){for(c=d,u=0;u<i;++u)l[u]=h[u];l.length=i}return c}function JL(t,e,n,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=n.length;u<d;++u){const d=n[u];c=XL(t,e,d,i,r,s,o,a,l,c,h),e=d}return c}function QL(t,e,n,i){for(let r=0,s=n.length;r<s;++r){const s=n[r];for(let n=0;n<i;++n)t[e++]=s[n]}return e}function tM(t,e,n,i,r){r=r||[];let s=0;for(let o=0,a=n.length;o<a;++o){const a=QL(t,e,n[o],i);r[s++]=a,e=a}return r.length=s,r}function eM(t,e,n,i,r){r=r||[];let s=0;for(let o=0,a=n.length;o<a;++o){const a=tM(t,e,n[o],i,r[s]);0===a.length&&(a[0]=e),r[s++]=a,e=a[a.length-1]}return r.length=s,r}function nM(t,e,n,i,r){r=void 0!==r?r:[];let s=0;for(let o=e;o<n;o+=i)r[s++]=t.slice(o,o+i);return r.length=s,r}function iM(t,e,n,i,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=n.length;o<a;++o){const a=n[o];r[s++]=nM(t,e,a,i,r[s]),e=a}return r.length=s,r}function rM(t,e,n,i,r){r=void 0!==r?r:[];let s=0;for(let o=0,a=n.length;o<a;++o){const a=n[o];r[s++]=1===a.length&&a[0]===e?[]:iM(t,e,a,i,r[s]),e=a[a.length-1]}return r.length=s,r}function sM(t,e,n,i,r,s,o){const a=(n-e)/i;if(a<3){for(;e<n;e+=i)s[o++]=t[e],s[o++]=t[e+1];return o}const l=new Array(a);l[0]=1,l[a-1]=1;const c=[e,n-i];let h=0;for(;c.length>0;){const n=c.pop(),s=c.pop();let o=0;const a=t[s],u=t[s+1],d=t[n],p=t[n+1];for(let e=s+i;e<n;e+=i){const n=uE(t[e],t[e+1],a,u,d,p);n>o&&(h=e,o=n)}o>r&&(l[(h-e)/i]=1,s+i<h&&c.push(s,h),h+i<n&&c.push(h,n))}for(let u=0;u<a;++u)l[u]&&(s[o++]=t[e+u*i],s[o++]=t[e+u*i+1]);return o}function oM(t,e,n,i,r,s,o,a){for(let l=0,c=n.length;l<c;++l){const c=n[l];o=sM(t,e,c,i,r,s,o),a.push(o),e=c}return o}function aM(t,e){return e*Math.round(t/e)}function lM(t,e,n,i,r,s,o){if(e==n)return o;let a,l,c=aM(t[e],r),h=aM(t[e+1],r);e+=i,s[o++]=c,s[o++]=h;do{if(a=aM(t[e],r),l=aM(t[e+1],r),(e+=i)==n)return s[o++]=a,s[o++]=l,o}while(a==c&&l==h);for(;e<n;){const n=aM(t[e],r),u=aM(t[e+1],r);if(e+=i,n==a&&u==l)continue;const d=a-c,p=l-h,f=n-c,g=u-h;d*g==p*f&&(d<0&&f<d||d==f||d>0&&f>d)&&(p<0&&g<p||p==g||p>0&&g>p)?(a=n,l=u):(s[o++]=a,s[o++]=l,c=a,h=l,a=n,l=u)}return s[o++]=a,s[o++]=l,o}function cM(t,e,n,i,r,s,o,a){for(let l=0,c=n.length;l<c;++l){const c=n[l];o=lM(t,e,c,i,r,s,o),a.push(o),e=c}return o}class hM extends VL{constructor(t,e){super(),this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}clone(){return new hM(this.flatCoordinates.slice(),this.layout)}closestPointXY(t,e,n,i){return i<EE(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(KL(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),XL(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!0,t,e,n,i))}getArea(){return WL(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinates(){return nM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getSimplifiedGeometryInternal(t){const e=[];return e.length=sM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new hM(e,"XY")}getType(){return"LinearRing"}intersectsExtent(t){return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=QL(this.flatCoordinates,0,t,this.stride),this.changed()}}class uM extends VL{constructor(t,e){super(),this.setCoordinates(t,e)}clone(){const t=new uM(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){const r=this.flatCoordinates,s=dE(t,e,r[0],r[1]);if(s<i){const t=this.stride;for(let e=0;e<t;++e)n[e]=r[e];return n.length=t,s}return i}getCoordinates(){return this.flatCoordinates.slice()}computeExtent(t){return OE(this.flatCoordinates,t)}getType(){return"Point"}intersectsExtent(t){return ME(t,this.flatCoordinates[0],this.flatCoordinates[1])}setCoordinates(t,e){this.setLayout(e,t,0),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=function(t,e,n){for(let i=0,r=n.length;i<r;++i)t[e++]=n[i];return e}(this.flatCoordinates,0,t,this.stride),this.changed()}}function dM(t,e,n,i,r){return!BE(r,function(r){return!pM(t,e,n,i,r[0],r[1])})}function pM(t,e,n,i,r,s){let o=0,a=t[n-i],l=t[n-i+1];for(;e<n;e+=i){const n=t[e],i=t[e+1];l<=s?i>s&&(n-a)*(s-l)-(r-a)*(i-l)>0&&o++:i<=s&&(n-a)*(s-l)-(r-a)*(i-l)<0&&o--,a=n,l=i}return 0!==o}function fM(t,e,n,i,r,s){if(0===n.length)return!1;if(!pM(t,e,n[0],i,r,s))return!1;for(let o=1,a=n.length;o<a;++o)if(pM(t,n[o-1],n[o],i,r,s))return!1;return!0}function gM(t,e,n,i,r,s,o){let a,l,c,h,u,d,p;const f=r[s+1],g=[];for(let v=0,_=n.length;v<_;++v){const r=n[v];for(h=t[r-i],d=t[r-i+1],a=e;a<r;a+=i)u=t[a],p=t[a+1],(f<=d&&p<=f||d<=f&&f<=p)&&(c=(f-d)/(p-d)*(u-h)+h,g.push(c)),h=u,d=p}let m=NaN,y=-1/0;for(g.sort(dk),h=g[0],a=1,l=g.length;a<l;++a){u=g[a];const r=Math.abs(u-h);r>y&&(c=(h+u)/2,fM(t,e,n,i,c,f)&&(m=c,y=r)),h=u}return isNaN(m)&&(m=r[s]),o?(o.push(m,f,y),o):[m,f,y]}function mM(t,e,n,i,r){let s=[];for(let o=0,a=n.length;o<a;++o){const a=n[o];s=gM(t,e,a,i,r,2*o,s),e=a[a.length-1]}return s}function yM(t,e,n,i,r){let s;for(e+=i;e<n;e+=i)if(s=r(t.slice(e-i,e),t.slice(e,e+i)),s)return s;return!1}function vM(t,e,n,i,r,s){return s=s??DE([1/0,1/0,-1/0,-1/0],t,e,n,i),!!QE(r,s)&&(s[0]>=r[0]&&s[2]<=r[2]||s[1]>=r[1]&&s[3]<=r[3]||yM(t,e,n,i,function(t,e){return function(t,e,n){let i=!1;const r=RE(t,e),s=RE(t,n);if(1===r||1===s)i=!0;else{const o=t[0],a=t[1],l=t[2],c=t[3],h=e[0],u=e[1],d=n[0],p=n[1],f=(p-u)/(d-h);let g,m;2&s&&!(2&r)&&(g=d-(p-c)/f,i=g>=o&&g<=l),i||!(4&s)||4&r||(m=p-(d-l)*f,i=m>=a&&m<=c),i||!(8&s)||8&r||(g=d-(p-a)/f,i=g>=o&&g<=l),i||!(16&s)||16&r||(m=p-(d-o)*f,i=m>=a&&m<=c)}return i}(r,t,e)}))}function _M(t,e,n,i,r){return!!(vM(t,e,n,i,r)||pM(t,e,n,i,r[0],r[1])||pM(t,e,n,i,r[0],r[3])||pM(t,e,n,i,r[2],r[1])||pM(t,e,n,i,r[2],r[3]))}function bM(t,e,n,i,r){if(!_M(t,e,n[0],i,r))return!1;if(1===n.length)return!0;for(let s=1,o=n.length;s<o;++s)if(dM(t,n[s-1],n[s],i,r)&&!vM(t,n[s-1],n[s],i,r))return!1;return!0}function wM(t,e,n,i){for(;e<n-i;){for(let r=0;r<i;++r){const s=t[e+r];t[e+r]=t[n-i+r],t[n-i+r]=s}e+=i,n-=i}}function xM(t,e,n,i){let r=0,s=t[n-i],o=t[n-i+1];for(;e<n;e+=i){const n=t[e],i=t[e+1];r+=(n-s)*(i+o),s=n,o=i}return 0===r?void 0:r>0}function CM(t,e,n,i,r){r=void 0!==r&&r;for(let s=0,o=n.length;s<o;++s){const o=n[s],a=xM(t,e,o,i);if(0===s){if(r&&a||!r&&!a)return!1}else if(r&&!a||!r&&a)return!1;e=o}return!0}function SM(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){const o=n[s];if(!CM(t,e,o,i,r))return!1;o.length&&(e=o[o.length-1])}return!0}function kM(t,e,n,i,r){r=void 0!==r&&r;for(let s=0,o=n.length;s<o;++s){const o=n[s],a=xM(t,e,o,i);(0===s?r&&a||!r&&!a:r&&!a||!r&&a)&&wM(t,e,o,i),e=o}return e}function EM(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s)e=kM(t,e,n[s],i,r);return e}function TM(t,e){const n=[];let i,r=0,s=0;for(let o=0,a=e.length;o<a;++o){const a=e[o],l=xM(t,r,a,2);if(void 0===i&&(i=l),l===i)n.push(e.slice(s,o+1));else{if(0===n.length)continue;n[n.length-1].push(e[s])}s=o+1,r=a}return n}class LM extends VL{constructor(t,e,n){super(),this.ends_=[],this.flatInteriorPointRevision_=-1,this.flatInteriorPoint_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,void 0!==e&&n?(this.setFlatCoordinates(e,t),this.ends_=n):this.setCoordinates(t,e)}appendLinearRing(t){this.flatCoordinates?mk(this.flatCoordinates,t.getFlatCoordinates()):this.flatCoordinates=t.getFlatCoordinates().slice(),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new LM(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<EE(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(YL(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),JL(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!0,t,e,n,i))}containsXY(t,e){return fM(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,e)}getArea(){return HL(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),kM(e,0,this.ends_,this.stride,t)):e=this.flatCoordinates,iM(e,0,this.ends_,this.stride)}getEnds(){return this.ends_}getFlatInteriorPoint(){if(this.flatInteriorPointRevision_!=this.getRevision()){const t=$E(this.getExtent());this.flatInteriorPoint_=gM(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t,0),this.flatInteriorPointRevision_=this.getRevision()}return this.flatInteriorPoint_}getInteriorPoint(){return new uM(this.getFlatInteriorPoint(),"XYM")}getLinearRingCount(){return this.ends_.length}getLinearRing(t){return t<0||this.ends_.length<=t?null:new hM(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLinearRings(){const t=this.layout,e=this.flatCoordinates,n=this.ends_,i=[];let r=0;for(let s=0,o=n.length;s<o;++s){const o=n[s],a=new hM(e.slice(r,o),t);i.push(a),r=o}return i}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;CM(t,0,this.ends_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=kM(this.orientedFlatCoordinates_,0,this.ends_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=cM(this.flatCoordinates,0,this.ends_,this.stride,Math.sqrt(t),e,0,n),new LM(e,"XY",n)}getType(){return"Polygon"}intersectsExtent(t){return bM(this.getOrientedFlatCoordinates(),0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=tM(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()}}function MM(t){if(tT(t))throw new Error("Cannot create polygon from empty extent");const e=t[0],n=t[1],i=t[2],r=t[3],s=[e,n,e,r,i,r,i,n,e,n];return new LM(s,"XY",[s.length])}function RM(t,e,n,i){const r=JE(e)/n[0],s=ZE(e)/n[1];return i?Math.min(t,Math.max(r,s)):Math.min(t,Math.min(r,s))}function PM(t,e,n){let i=Math.min(t,e);return i*=Math.log(1+50*Math.max(0,t/e-1))/50+1,n&&(i=Math.max(i,n),i/=Math.log(1+50*Math.max(0,n/t-1))/50+1),hE(i,n/2,2*e)}function IM(t,e,n,i,r){return n=void 0===n||n,function(s,o,a,l){if(void 0!==s){const o=i?RM(t,i,a,r):t;return n&&l?PM(s,o,e):hE(s,e,o)}}}function OM(t){if(void 0!==t)return 0}function AM(t){if(void 0!==t)return t}class zM extends zk{constructor(t){super(),this.on,this.once,this.un,t=Object.assign({},t),this.hints_=[0,0],this.animations_=[],this.updateAnimationKey_,this.projection_=pL(t.projection,"EPSG:3857"),this.viewportSize_=[100,100],this.targetCenter_=null,this.targetResolution_,this.targetRotation_,this.nextCenter_=null,this.nextResolution_,this.nextRotation_,this.cancelAnchor_=void 0,t.projection&&oL(),t.center&&(t.center=CL(t.center,this.projection_)),t.extent&&(t.extent=SL(t.extent,this.projection_)),this.applyOptions_(t)}applyOptions_(t){const e=Object.assign({},t);for(const o in cE)delete e[o];this.setProperties(e,!0);const n=function(t){let e,n,i,r=void 0!==t.minZoom?t.minZoom:0,s=void 0!==t.maxZoom?t.maxZoom:28;const o=void 0!==t.zoomFactor?t.zoomFactor:2,a=void 0!==t.multiWorld&&t.multiWorld,l=void 0===t.smoothResolutionConstraint||t.smoothResolutionConstraint,c=void 0!==t.showFullExtent&&t.showFullExtent,h=pL(t.projection,"EPSG:3857"),u=h.getExtent();let d=t.constrainOnlyCenter,p=t.extent;if(a||p||!h.isGlobal()||(d=!1,p=u),void 0!==t.resolutions){const o=t.resolutions;n=o[r],i=void 0!==o[s]?o[s]:o[o.length-1],e=t.constrainResolution?function(t,e,n,i){return e=void 0===e||e,function(r,s,o,a){if(void 0!==r){const l=t[0],c=t[t.length-1],h=n?RM(l,n,o,i):l;if(a)return e?PM(r,h,c):hE(r,c,h);const u=Math.min(h,r),d=Math.floor(fk(t,u,s));return t[d]>h&&d<t.length-1?t[d+1]:t[d]}}}(o,l,!d&&p,c):IM(n,i,l,!d&&p,c)}else{const a=(u?Math.max(JE(u),ZE(u)):360*gT.degrees/h.getMetersPerUnit())/256/Math.pow(2,0),f=a/Math.pow(2,28);n=t.maxResolution,void 0!==n?r=0:n=a/Math.pow(o,r),i=t.minResolution,void 0===i&&(i=void 0!==t.maxZoom?void 0!==t.maxResolution?n/Math.pow(o,s):a/Math.pow(o,s):f),s=r+Math.floor(Math.log(n/i)/Math.log(o)),i=n/Math.pow(o,s-r),e=t.constrainResolution?function(t,e,n,i,r,s){return i=void 0===i||i,n=void 0!==n?n:0,function(o,a,l,c){if(void 0!==o){const h=r?RM(e,r,l,s):e;if(c)return i?PM(o,h,n):hE(o,n,h);const u=1e-9,d=Math.ceil(Math.log(e/h)/Math.log(t)-u),p=-a*(.5-u)+.5,f=Math.min(h,o),g=Math.floor(Math.log(e/f)/Math.log(t)+p),m=Math.max(d,g);return hE(e/Math.pow(t,m),n,h)}}}(o,n,i,l,!d&&p,c):IM(n,i,l,!d&&p,c)}return{constraint:e,maxResolution:n,minResolution:i,minZoom:r,zoomFactor:o}}(t);this.maxResolution_=n.maxResolution,this.minResolution_=n.minResolution,this.zoomFactor_=n.zoomFactor,this.resolutions_=t.resolutions,this.padding_=t.padding,this.minZoom_=n.minZoom;const i=function(t){if(void 0!==t.extent){const e=void 0===t.smoothExtentConstraint||t.smoothExtentConstraint;return wE(t.extent,t.constrainOnlyCenter,e)}const e=pL(t.projection,"EPSG:3857");if(!0!==t.multiWorld&&e.isGlobal()){const t=e.getExtent().slice();return t[0]=-1/0,t[2]=1/0,wE(t,!1,!1)}return xE}(t),r=n.constraint,s=function(t){if(void 0===t.enableRotation||t.enableRotation){const e=t.constrainRotation;return void 0===e||!0===e?function(){const t=fE(5);return function(e,n){return n||void 0===e?e:Math.abs(e)<=t?0:e}}():!1===e?AM:"number"==typeof e?function(t){const e=2*Math.PI/t;return function(t,n){return n?t:void 0!==t?t=Math.floor(t/e+.5)*e:void 0}}(e):AM}return OM}(t);this.constraints_={center:i,resolution:r,rotation:s},this.setRotation(void 0!==t.rotation?t.rotation:0),this.setCenterInternal(void 0!==t.center?t.center:null),void 0!==t.resolution?this.setResolution(t.resolution):void 0!==t.zoom&&this.setZoom(t.zoom)}get padding(){return this.padding_}set padding(t){let e=this.padding_;this.padding_=t;const n=this.getCenterInternal();if(n){const i=t||[0,0,0,0];e=e||[0,0,0,0];const r=this.getResolution(),s=r/2*(i[3]-e[3]+e[1]-i[1]),o=r/2*(i[0]-e[0]+e[2]-i[2]);this.setCenterInternal([n[0]+s,n[1]-o])}}getUpdatedOptions_(t){const e=this.getProperties();return void 0!==e.resolution?e.resolution=this.getResolution():e.zoom=this.getZoom(),e.center=this.getCenterInternal(),e.rotation=this.getRotation(),Object.assign({},e,t)}animate(t){this.isDef()&&!this.getAnimating()&&this.resolveConstraints(0);const e=new Array(arguments.length);for(let n=0;n<e.length;++n){let t=arguments[n];t.center&&(t=Object.assign({},t),t.center=CL(t.center,this.getProjection())),t.anchor&&(t=Object.assign({},t),t.anchor=CL(t.anchor,this.getProjection())),e[n]=t}this.animateInternal.apply(this,e)}animateInternal(t){let e,n=arguments.length;n>1&&"function"==typeof arguments[n-1]&&(e=arguments[n-1],--n);let i=0;for(;i<n&&!this.isDef();++i){const t=arguments[i];t.center&&this.setCenterInternal(t.center),void 0!==t.zoom?this.setZoom(t.zoom):t.resolution&&this.setResolution(t.resolution),void 0!==t.rotation&&this.setRotation(t.rotation)}if(i===n)return void(e&&FM(e,!0));let r=Date.now(),s=this.targetCenter_.slice(),o=this.targetResolution_,a=this.targetRotation_;const l=[];for(;i<n;++i){const t=arguments[i],n={start:r,complete:!1,anchor:t.anchor,duration:void 0!==t.duration?t.duration:1e3,easing:t.easing||cT,callback:e};if(t.center&&(n.sourceCenter=s,n.targetCenter=t.center.slice(),s=n.targetCenter),void 0!==t.zoom?(n.sourceResolution=o,n.targetResolution=this.getResolutionForZoom(t.zoom),o=n.targetResolution):t.resolution&&(n.sourceResolution=o,n.targetResolution=t.resolution,o=n.targetResolution),void 0!==t.rotation){n.sourceRotation=a;const e=gE(t.rotation-a+Math.PI,2*Math.PI)-Math.PI;n.targetRotation=a+e,a=n.targetRotation}jM(n)?n.complete=!0:r+=n.duration,l.push(n)}this.animations_.push(l),this.setHint(0,1),this.updateAnimations_()}getAnimating(){return this.hints_[0]>0}getInteracting(){return this.hints_[1]>0}cancelAnimations(){let t;this.setHint(0,-this.hints_[0]);for(let e=0,n=this.animations_.length;e<n;++e){const n=this.animations_[e];if(n[0].callback&&FM(n[0].callback,!1),!t)for(let e=0,i=n.length;e<i;++e){const i=n[e];if(!i.complete){t=i.anchor;break}}}this.animations_.length=0,this.cancelAnchor_=t,this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN}updateAnimations_(){if(void 0!==this.updateAnimationKey_&&(cancelAnimationFrame(this.updateAnimationKey_),this.updateAnimationKey_=void 0),!this.getAnimating())return;const t=Date.now();let e=!1;for(let n=this.animations_.length-1;n>=0;--n){const i=this.animations_[n];let r=!0;for(let n=0,s=i.length;n<s;++n){const s=i[n];if(s.complete)continue;const o=t-s.start;let a=s.duration>0?o/s.duration:1;a>=1?(s.complete=!0,a=1):r=!1;const l=s.easing(a);if(s.sourceCenter){const t=s.sourceCenter[0],e=s.sourceCenter[1],n=s.targetCenter[0],i=s.targetCenter[1];this.nextCenter_=s.targetCenter;const r=t+l*(n-t),o=e+l*(i-e);this.targetCenter_=[r,o]}if(s.sourceResolution&&s.targetResolution){const t=1===l?s.targetResolution:s.sourceResolution+l*(s.targetResolution-s.sourceResolution);if(s.anchor){const e=this.getViewportSize_(this.getRotation()),n=this.constraints_.resolution(t,0,e,!0);this.targetCenter_=this.calculateCenterZoom(n,s.anchor)}this.nextResolution_=s.targetResolution,this.targetResolution_=t,this.applyTargetState_(!0)}if(void 0!==s.sourceRotation&&void 0!==s.targetRotation){const t=1===l?gE(s.targetRotation+Math.PI,2*Math.PI)-Math.PI:s.sourceRotation+l*(s.targetRotation-s.sourceRotation);if(s.anchor){const e=this.constraints_.rotation(t,!0);this.targetCenter_=this.calculateCenterRotate(e,s.anchor)}this.nextRotation_=s.targetRotation,this.targetRotation_=t}if(this.applyTargetState_(!0),e=!0,!s.complete)break}if(r){this.animations_[n]=null,this.setHint(0,-1),this.nextCenter_=null,this.nextResolution_=NaN,this.nextRotation_=NaN;const t=i[0].callback;t&&FM(t,!0)}}this.animations_=this.animations_.filter(Boolean),e&&void 0===this.updateAnimationKey_&&(this.updateAnimationKey_=requestAnimationFrame(this.updateAnimations_.bind(this)))}calculateCenterRotate(t,e){let n;const i=this.getCenterInternal();var r,s;return void 0!==i&&(n=[i[0]-e[0],i[1]-e[1]],sT(n,t-this.getRotation()),s=e,(r=n)[0]+=+s[0],r[1]+=+s[1]),n}calculateCenterZoom(t,e){let n;const i=this.getCenterInternal(),r=this.getResolution();return void 0!==i&&void 0!==r&&(n=[e[0]-t*(e[0]-i[0])/r,e[1]-t*(e[1]-i[1])/r]),n}getViewportSize_(t){const e=this.viewportSize_;if(t){const n=e[0],i=e[1];return[Math.abs(n*Math.cos(t))+Math.abs(i*Math.sin(t)),Math.abs(n*Math.sin(t))+Math.abs(i*Math.cos(t))]}return e}setViewportSize(t){this.viewportSize_=Array.isArray(t)?t.slice():[100,100],this.getAnimating()||this.resolveConstraints(0)}getCenter(){const t=this.getCenterInternal();return t?xL(t,this.getProjection()):t}getCenterInternal(){return this.get(cE.CENTER)}getConstraints(){return this.constraints_}getConstrainResolution(){return this.get("constrainResolution")}getHints(t){return void 0!==t?(t[0]=this.hints_[0],t[1]=this.hints_[1],t):this.hints_.slice()}calculateExtent(t){return e=this.calculateExtentInternal(t),this.getProjection(),e;var e}calculateExtentInternal(t){t=t||this.getViewportSizeMinusPadding_();const e=this.getCenterInternal();sE(e,"The view center is not defined");const n=this.getResolution();sE(void 0!==n,"The view resolution is not defined");const i=this.getRotation();return sE(void 0!==i,"The view rotation is not defined"),WE(e,n,i,t)}getMaxResolution(){return this.maxResolution_}getMinResolution(){return this.minResolution_}getMaxZoom(){return this.getZoomForResolution(this.minResolution_)}setMaxZoom(t){this.applyOptions_(this.getUpdatedOptions_({maxZoom:t}))}getMinZoom(){return this.getZoomForResolution(this.maxResolution_)}setMinZoom(t){this.applyOptions_(this.getUpdatedOptions_({minZoom:t}))}setConstrainResolution(t){this.applyOptions_(this.getUpdatedOptions_({constrainResolution:t}))}getProjection(){return this.projection_}getResolution(){return this.get(cE.RESOLUTION)}getResolutions(){return this.resolutions_}getResolutionForExtent(t,e){return this.getResolutionForExtentInternal(SL(t,this.getProjection()),e)}getResolutionForExtentInternal(t,e){e=e||this.getViewportSizeMinusPadding_();const n=JE(t)/e[0],i=ZE(t)/e[1];return Math.max(n,i)}getResolutionForValueFunction(t){t=t||2;const e=this.getConstrainedResolution(this.maxResolution_),n=this.minResolution_,i=Math.log(e/n)/Math.log(t);return function(n){return e/Math.pow(t,n*i)}}getRotation(){return this.get(cE.ROTATION)}getValueForResolutionFunction(t){const e=Math.log(t||2),n=this.getConstrainedResolution(this.maxResolution_),i=this.minResolution_,r=Math.log(n/i)/e;return function(t){return Math.log(n/t)/e/r}}getViewportSizeMinusPadding_(t){let e=this.getViewportSize_(t);const n=this.padding_;return n&&(e=[e[0]-n[1]-n[3],e[1]-n[0]-n[2]]),e}getState(){const t=this.getProjection(),e=this.getResolution(),n=this.getRotation();let i=this.getCenterInternal();const r=this.padding_;if(r){const t=this.getViewportSizeMinusPadding_();i=DM(i,this.getViewportSize_(),[t[0]/2+r[3],t[1]/2+r[0]],e,n)}return{center:i.slice(0),projection:void 0!==t?t:null,resolution:e,nextCenter:this.nextCenter_,nextResolution:this.nextResolution_,nextRotation:this.nextRotation_,rotation:n,zoom:this.getZoom()}}getViewStateAndExtent(){return{viewState:this.getState(),extent:this.calculateExtent()}}getZoom(){let t;const e=this.getResolution();return void 0!==e&&(t=this.getZoomForResolution(e)),t}getZoomForResolution(t){let e,n,i=this.minZoom_||0;if(this.resolutions_){const r=fk(this.resolutions_,t,1);i=r,e=this.resolutions_[r],n=r==this.resolutions_.length-1?2:e/this.resolutions_[r+1]}else e=this.maxResolution_,n=this.zoomFactor_;return i+Math.log(e/t)/Math.log(n)}getResolutionForZoom(t){if(this.resolutions_?.length){if(1===this.resolutions_.length)return this.resolutions_[0];const e=hE(Math.floor(t),0,this.resolutions_.length-2),n=this.resolutions_[e]/this.resolutions_[e+1];return this.resolutions_[e]/Math.pow(n,hE(t-e,0,1))}return this.maxResolution_/Math.pow(this.zoomFactor_,t-this.minZoom_)}fit(t,e){let n;if(sE(Array.isArray(t)||"function"==typeof t.getSimplifiedGeometry,"Invalid extent or geometry provided as `geometry`"),Array.isArray(t))sE(!tT(t),"Cannot fit empty extent provided as `geometry`"),n=MM(SL(t,this.getProjection()));else if("Circle"===t.getType()){const e=SL(t.getExtent(),this.getProjection());n=MM(e),n.rotate(this.getRotation(),$E(e))}else n=t;this.fitInternal(n,e)}rotatedExtentForGeometry(t){const e=this.getRotation(),n=Math.cos(e),i=Math.sin(-e),r=t.getFlatCoordinates(),s=t.getStride();let o=1/0,a=1/0,l=-1/0,c=-1/0;for(let h=0,u=r.length;h<u;h+=s){const t=r[h]*n-r[h+1]*i,e=r[h]*i+r[h+1]*n;o=Math.min(o,t),a=Math.min(a,e),l=Math.max(l,t),c=Math.max(c,e)}return[o,a,l,c]}fitInternal(t,e){let n=(e=e||{}).size;n||(n=this.getViewportSizeMinusPadding_());const i=void 0!==e.padding?e.padding:[0,0,0,0],r=void 0!==e.nearest&&e.nearest;let s;s=void 0!==e.minResolution?e.minResolution:void 0!==e.maxZoom?this.getResolutionForZoom(e.maxZoom):0;const o=this.rotatedExtentForGeometry(t);let a=this.getResolutionForExtentInternal(o,[n[0]-i[1]-i[3],n[1]-i[0]-i[2]]);a=isNaN(a)?s:Math.max(a,s),a=this.getConstrainedResolution(a,r?0:1);const l=this.getRotation(),c=Math.sin(l),h=Math.cos(l),u=$E(o);u[0]+=(i[1]-i[3])/2*a,u[1]+=(i[0]-i[2])/2*a;const d=u[0]*h-u[1]*c,p=u[1]*h+u[0]*c,f=this.getConstrainedCenter([d,p],a),g=e.callback?e.callback:bk;void 0!==e.duration?this.animateInternal({resolution:a,center:f,duration:e.duration,easing:e.easing},g):(this.targetResolution_=a,this.targetCenter_=f,this.applyTargetState_(!1,!0),FM(g,!0))}centerOn(t,e,n){this.centerOnInternal(CL(t,this.getProjection()),e,n)}centerOnInternal(t,e,n){this.setCenterInternal(DM(t,e,n,this.getResolution(),this.getRotation()))}calculateCenterShift(t,e,n,i){let r;const s=this.padding_;if(s&&t){const o=this.getViewportSizeMinusPadding_(-n),a=DM(t,i,[o[0]/2+s[3],o[1]/2+s[0]],e,n);r=[t[0]-a[0],t[1]-a[1]]}return r}isDef(){return!!this.getCenterInternal()&&void 0!==this.getResolution()}adjustCenter(t){const e=xL(this.targetCenter_,this.getProjection());this.setCenter([e[0]+t[0],e[1]+t[1]])}adjustCenterInternal(t){const e=this.targetCenter_;this.setCenterInternal([e[0]+t[0],e[1]+t[1]])}adjustResolution(t,e){e=e&&CL(e,this.getProjection()),this.adjustResolutionInternal(t,e)}adjustResolutionInternal(t,e){const n=this.getAnimating()||this.getInteracting(),i=this.getViewportSize_(this.getRotation()),r=this.constraints_.resolution(this.targetResolution_*t,0,i,n);e&&(this.targetCenter_=this.calculateCenterZoom(r,e)),this.targetResolution_*=t,this.applyTargetState_()}adjustZoom(t,e){this.adjustResolution(Math.pow(this.zoomFactor_,-t),e)}adjustRotation(t,e){e&&(e=CL(e,this.getProjection())),this.adjustRotationInternal(t,e)}adjustRotationInternal(t,e){const n=this.getAnimating()||this.getInteracting(),i=this.constraints_.rotation(this.targetRotation_+t,n);e&&(this.targetCenter_=this.calculateCenterRotate(i,e)),this.targetRotation_+=t,this.applyTargetState_()}setCenter(t){this.setCenterInternal(t?CL(t,this.getProjection()):t)}setCenterInternal(t){this.targetCenter_=t,this.applyTargetState_()}setHint(t,e){return this.hints_[t]+=e,this.changed(),this.hints_[t]}setResolution(t){this.targetResolution_=t,this.applyTargetState_()}setRotation(t){this.targetRotation_=t,this.applyTargetState_()}setZoom(t){this.setResolution(this.getResolutionForZoom(t))}applyTargetState_(t,e){const n=this.getAnimating()||this.getInteracting()||e,i=this.constraints_.rotation(this.targetRotation_,n),r=this.getViewportSize_(i),s=this.constraints_.resolution(this.targetResolution_,0,r,n),o=this.constraints_.center(this.targetCenter_,s,r,n,this.calculateCenterShift(this.targetCenter_,s,i,r));this.get(cE.ROTATION)!==i&&this.set(cE.ROTATION,i),this.get(cE.RESOLUTION)!==s&&(this.set(cE.RESOLUTION,s),this.set("zoom",this.getZoom(),!0)),o&&this.get(cE.CENTER)&&rT(this.get(cE.CENTER),o)||this.set(cE.CENTER,o),this.getAnimating()&&!t&&this.cancelAnimations(),this.cancelAnchor_=void 0}resolveConstraints(t,e,n){t=void 0!==t?t:200;const i=e||0,r=this.constraints_.rotation(this.targetRotation_),s=this.getViewportSize_(r),o=this.constraints_.resolution(this.targetResolution_,i,s),a=this.constraints_.center(this.targetCenter_,o,s,!1,this.calculateCenterShift(this.targetCenter_,o,r,s));if(0===t&&!this.cancelAnchor_)return this.targetResolution_=o,this.targetRotation_=r,this.targetCenter_=a,void this.applyTargetState_();n=n||(0===t?this.cancelAnchor_:void 0),this.cancelAnchor_=void 0,this.getResolution()===o&&this.getRotation()===r&&this.getCenterInternal()&&rT(this.getCenterInternal(),a)||(this.getAnimating()&&this.cancelAnimations(),this.animateInternal({rotation:r,center:a,resolution:o,duration:t,easing:lT,anchor:n}))}beginInteraction(){this.resolveConstraints(0),this.setHint(1,1)}endInteraction(t,e,n){n=n&&CL(n,this.getProjection()),this.endInteractionInternal(t,e,n)}endInteractionInternal(t,e,n){this.getInteracting()&&(this.setHint(1,-1),this.resolveConstraints(t,e,n))}getConstrainedCenter(t,e){const n=this.getViewportSize_(this.getRotation());return this.constraints_.center(t,e||this.getResolution(),n)}getConstrainedZoom(t,e){const n=this.getResolutionForZoom(t);return this.getZoomForResolution(this.getConstrainedResolution(n,e))}getConstrainedResolution(t,e){e=e||0;const n=this.getViewportSize_(this.getRotation());return this.constraints_.resolution(t,e,n)}}function FM(t,e){setTimeout(function(){t(e)},0)}function jM(t){return!(t.sourceCenter&&t.targetCenter&&!rT(t.sourceCenter,t.targetCenter))&&t.sourceResolution===t.targetResolution&&t.sourceRotation===t.targetRotation}function DM(t,e,n,i,r){const s=Math.cos(-r);let o=Math.sin(-r),a=t[0]*s-t[1]*o,l=t[1]*s+t[0]*o;return a+=(e[0]/2-n[0])*i,l+=(n[1]-e[1]/2)*i,o=-o,[a*s-l*o,l*s+a*o]}const NM="ol-hidden",BM="ol-unselectable",UM="ol-control",qM="ol-collapsed",VM=new RegExp(["^\\s*(?=(?:(?:[-a-z]+\\s*){0,2}(italic|oblique))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(small-caps))?)","(?=(?:(?:[-a-z]+\\s*){0,2}(bold(?:er)?|lighter|[1-9]00 ))?)","(?:(?:normal|\\1|\\2|\\3)\\s*){0,3}((?:xx?-)?","(?:small|large)|medium|smaller|larger|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx]))","(?:\\s*\\/\\s*(normal|[\\.\\d]+(?:\\%|in|[cem]m|ex|p[ctx])?))","?\\s*([-,\\\"\\'\\sa-z0-9]+?)\\s*$"].join(""),"i"),$M=["style","variant","weight","size","lineHeight","family"],GM={normal:400,bold:700},WM=function(t){const e=t.match(VM);if(!e)return null;const n={lineHeight:"normal",size:"1.2em",style:"normal",weight:"400",variant:"normal"};for(let i=0,r=$M.length;i<r;++i){const t=e[i+1];void 0!==t&&(n[$M[i]]="string"==typeof t?t.trim():t)}return isNaN(Number(n.weight))&&n.weight in GM&&(n.weight=GM[n.weight]),n.families=n.family.split(/,\s?/).map(t=>t.trim().replace(/^['"]|['"]$/g,"")),n};function HM(t,e,n,i){let r;return r=n&&n.length?n.shift():Wk?new class extends OffscreenCanvas{style={}}(t??300,e??150):document.createElement("canvas"),t&&(r.width=t),e&&(r.height=e),r.getContext("2d",i)}let ZM;function KM(){return ZM||(ZM=HM(1,1)),ZM}function YM(t){const e=t.canvas;e.width=1,e.height=1,t.clearRect(0,0,1,1)}function XM(t){let e=t.offsetWidth;const n=getComputedStyle(t);return e+=parseInt(n.marginLeft,10)+parseInt(n.marginRight,10),e}function JM(t){let e=t.offsetHeight;const n=getComputedStyle(t);return e+=parseInt(n.marginTop,10)+parseInt(n.marginBottom,10),e}function QM(t,e){const n=e.parentNode;n&&n.replaceChild(t,e)}function tR(t){for(;t.lastChild;)t.lastChild.remove()}function eR(){const t=new Proxy({childNodes:[],appendChild:function(t){return this.childNodes.push(t),t},remove:function(){},removeChild:function(t){const e=this.childNodes.indexOf(t);if(-1===e)throw new Error("Node to remove was not found");return this.childNodes.splice(e,1),t},insertBefore:function(t,e){const n=this.childNodes.indexOf(e);if(-1===n)throw new Error("Reference node not found");return this.childNodes.splice(n,0,t),t},style:{}},{get:(t,e,n)=>"firstElementChild"===e?t.childNodes.length>0?t.childNodes[0]:null:Reflect.get(t,e,n)});return t}function nR(t){return"undefined"!=typeof HTMLCanvasElement&&t instanceof HTMLCanvasElement||"undefined"!=typeof OffscreenCanvas&&t instanceof OffscreenCanvas}class iR extends zk{constructor(t){super();const e=t.element;!e||t.target||e.style.pointerEvents||(e.style.pointerEvents="auto"),this.element=e||null,this.target_=null,this.map_=null,this.listenerKeys=[],t.render&&(this.render=t.render),t.target&&this.setTarget(t.target)}disposeInternal(){this.element?.remove(),super.disposeInternal()}getMap(){return this.map_}setMap(t){this.map_&&this.element?.remove();for(let e=0,n=this.listenerKeys.length;e<n;++e)Mk(this.listenerKeys[e]);if(this.listenerKeys.length=0,this.map_=t,t){const e=this.target_??t.getOverlayContainerStopEvent();this.element&&e.appendChild(this.element),this.render!==bk&&this.listenerKeys.push(Tk(t,Jk,this.render,this)),t.render()}}render(t){}setTarget(t){this.target_="string"==typeof t?document.getElementById(t):t}}class rR extends iR{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target}),this.ulElement_=document.createElement("ul"),this.collapsed_=void 0===t.collapsed||t.collapsed,this.userCollapsed_=this.collapsed_,this.overrideCollapsible_=void 0!==t.collapsible,this.collapsible_=void 0===t.collapsible||t.collapsible,this.collapsible_||(this.collapsed_=!1),this.attributions_=t.attributions;const e=void 0!==t.className?t.className:"ol-attribution",n=void 0!==t.tipLabel?t.tipLabel:"Attributions",i=void 0!==t.expandClassName?t.expandClassName:e+"-expand",r=void 0!==t.collapseLabel?t.collapseLabel:"",s=void 0!==t.collapseClassName?t.collapseClassName:e+"-collapse";"string"==typeof r?(this.collapseLabel_=document.createElement("span"),this.collapseLabel_.textContent=r,this.collapseLabel_.className=s):this.collapseLabel_=r;const o=void 0!==t.label?t.label:"i";"string"==typeof o?(this.label_=document.createElement("span"),this.label_.textContent=o,this.label_.className=i):this.label_=o;const a=this.collapsible_&&!this.collapsed_?this.collapseLabel_:this.label_;this.toggleButton_=document.createElement("button"),this.toggleButton_.setAttribute("type","button"),this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_)),this.toggleButton_.title=n,this.toggleButton_.appendChild(a),this.toggleButton_.addEventListener(ok,this.handleClick_.bind(this),!1);const l=e+" "+BM+" "+UM+(this.collapsed_&&this.collapsible_?" "+qM:"")+(this.collapsible_?"":" ol-uncollapsible"),c=this.element;c.className=l,c.appendChild(this.toggleButton_),c.appendChild(this.ulElement_),this.renderedAttributions_=[],this.renderedVisible_=!0}collectSourceAttributions_(t){const e=this.getMap().getAllLayers(),n=new Set(e.flatMap(e=>e.getAttributions(t)));if(void 0!==this.attributions_&&(Array.isArray(this.attributions_)?this.attributions_.forEach(t=>n.add(t)):n.add(this.attributions_)),!this.overrideCollapsible_){const t=!e.some(t=>!1===t.getSource()?.getAttributionsCollapsible());this.setCollapsible(t)}return Array.from(n)}async updateElement_(t){if(!t)return void(this.renderedVisible_&&(this.element.style.display="none",this.renderedVisible_=!1));const e=await Promise.all(this.collectSourceAttributions_(t).map(t=>xk(()=>t))),n=e.length>0;if(this.renderedVisible_!=n&&(this.element.style.display=n?"":"none",this.renderedVisible_=n),!yk(e,this.renderedAttributions_)){tR(this.ulElement_);for(let t=0,n=e.length;t<n;++t){const n=document.createElement("li");n.innerHTML=e[t],this.ulElement_.appendChild(n)}this.renderedAttributions_=e}}handleClick_(t){t.preventDefault(),this.handleToggle_(),this.userCollapsed_=this.collapsed_}handleToggle_(){this.element.classList.toggle(qM),this.collapsed_?QM(this.collapseLabel_,this.label_):QM(this.label_,this.collapseLabel_),this.collapsed_=!this.collapsed_,this.toggleButton_.setAttribute("aria-expanded",String(!this.collapsed_))}getCollapsible(){return this.collapsible_}setCollapsible(t){this.collapsible_!==t&&(this.collapsible_=t,this.element.classList.toggle("ol-uncollapsible"),this.userCollapsed_&&this.handleToggle_())}setCollapsed(t){this.userCollapsed_=t,this.collapsible_&&this.collapsed_!==t&&this.handleToggle_()}getCollapsed(){return this.collapsed_}render(t){this.updateElement_(t.frameState)}}class sR extends iR{constructor(t){t=t||{},super({element:document.createElement("div"),render:t.render,target:t.target});const e=void 0!==t.className?t.className:"ol-rotate",n=void 0!==t.label?t.label:"⇧",i=void 0!==t.compassClassName?t.compassClassName:"ol-compass";this.label_=null,"string"==typeof n?(this.label_=document.createElement("span"),this.label_.className=i,this.label_.textContent=n):(this.label_=n,this.label_.classList.add(i));const r=t.tipLabel?t.tipLabel:"Reset rotation",s=document.createElement("button");s.className=e+"-reset",s.setAttribute("type","button"),s.title=r,s.appendChild(this.label_),s.addEventListener(ok,this.handleClick_.bind(this),!1);const o=e+" "+BM+" "+UM,a=this.element;a.className=o,a.appendChild(s),this.callResetNorth_=t.resetNorth?t.resetNorth:void 0,this.duration_=void 0!==t.duration?t.duration:250,this.autoHide_=void 0===t.autoHide||t.autoHide,this.rotation_=void 0,this.autoHide_&&this.element.classList.add(NM)}handleClick_(t){t.preventDefault(),void 0!==this.callResetNorth_?this.callResetNorth_():this.resetNorth_()}resetNorth_(){const t=this.getMap().getView();if(!t)return;const e=t.getRotation();void 0!==e&&(this.duration_>0&&e%(2*Math.PI)!=0?t.animate({rotation:0,duration:this.duration_,easing:lT}):t.setRotation(0))}render(t){const e=t.frameState;if(!e)return;const n=e.viewState.rotation;if(n!=this.rotation_){const t="rotate("+n+"rad)";if(this.autoHide_){const t=this.element.classList.contains(NM);t||0!==n?t&&0!==n&&this.element.classList.remove(NM):this.element.classList.add(NM)}this.label_.style.transform=t}this.rotation_=n}}class oR extends iR{constructor(t){t=t||{},super({element:document.createElement("div"),target:t.target});const e=void 0!==t.className?t.className:"ol-zoom",n=void 0!==t.delta?t.delta:1,i=void 0!==t.zoomInClassName?t.zoomInClassName:e+"-in",r=void 0!==t.zoomOutClassName?t.zoomOutClassName:e+"-out",s=void 0!==t.zoomInLabel?t.zoomInLabel:"+",o=void 0!==t.zoomOutLabel?t.zoomOutLabel:"",a=void 0!==t.zoomInTipLabel?t.zoomInTipLabel:"Zoom in",l=void 0!==t.zoomOutTipLabel?t.zoomOutTipLabel:"Zoom out",c=document.createElement("button");c.className=i,c.setAttribute("type","button"),c.title=a,c.appendChild("string"==typeof s?document.createTextNode(s):s),c.addEventListener(ok,this.handleClick_.bind(this,n),!1);const h=document.createElement("button");h.className=r,h.setAttribute("type","button"),h.title=l,h.appendChild("string"==typeof o?document.createTextNode(o):o),h.addEventListener(ok,this.handleClick_.bind(this,-n),!1);const u=e+" "+BM+" "+UM,d=this.element;d.className=u,d.appendChild(c),d.appendChild(h),this.duration_=void 0!==t.duration?t.duration:250}handleClick_(t,e){e.preventDefault(),this.zoomByDelta_(t)}zoomByDelta_(t){const e=this.getMap().getView();if(!e)return;const n=e.getZoom();if(void 0!==n){const i=e.getConstrainedZoom(n+t);this.duration_>0?(e.getAnimating()&&e.cancelAnimations(),e.animate({zoom:i,duration:this.duration_,easing:lT})):e.setZoom(i)}}}function aR(t){t=t||{};const e=new Dk;return(void 0===t.zoom||t.zoom)&&e.push(new oR(t.zoomOptions)),(void 0===t.rotate||t.rotate)&&e.push(new sR(t.rotateOptions)),(void 0===t.attribution||t.attribution)&&e.push(new rR(t.attributionOptions)),e}class lR{constructor(t,e,n){this.decay_=t,this.minVelocity_=e,this.delay_=n,this.points_=[],this.angle_=0,this.initialVelocity_=0}begin(){this.points_.length=0,this.angle_=0,this.initialVelocity_=0}update(t,e){this.points_.push(t,e,Date.now())}end(){if(this.points_.length<6)return!1;const t=Date.now()-this.delay_,e=this.points_.length-3;if(this.points_[e+2]<t)return!1;let n=e-3;for(;n>0&&this.points_[n+2]>t;)n-=3;const i=this.points_[e+2]-this.points_[n+2];if(i<1e3/60)return!1;const r=this.points_[e]-this.points_[n],s=this.points_[e+1]-this.points_[n+1];return this.angle_=Math.atan2(s,r),this.initialVelocity_=Math.sqrt(r*r+s*s)/i,this.initialVelocity_>this.minVelocity_}getDistance(){return(this.minVelocity_-this.initialVelocity_)/this.decay_}getAngle(){return this.angle_}}const cR="active";class hR extends zk{constructor(t){super(),this.on,this.once,this.un,t&&t.handleEvent&&(this.handleEvent=t.handleEvent),this.map_=null,this.setActive(!0)}getActive(){return this.get(cR)}getMap(){return this.map_}handleEvent(t){return!0}setActive(t){this.set(cR,t)}setMap(t){this.map_=t}}function uR(t,e,n,i){const r=t.getZoom();if(void 0===r)return;const s=t.getConstrainedZoom(r+e),o=t.getResolutionForZoom(s);t.getAnimating()&&t.cancelAnimations(),t.animate({resolution:o,anchor:n,duration:void 0!==i?i:250,easing:lT})}class dR extends hR{constructor(t){super(),t=t||{},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:250}handleEvent(t){let e=!1;if(t.type==Uk.DBLCLICK){const n=t.originalEvent,i=t.map,r=t.coordinate,s=n.shiftKey?-this.delta_:this.delta_;uR(i.getView(),s,r,this.duration_),n.preventDefault(),e=!0}return!e}}function pR(t){const e=arguments;return function(t){let n=!0;for(let i=0,r=e.length;i<r&&(n=n&&e[i](t),n);++i);return n}}const fR=function(t){const e=t.originalEvent;return e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},gR=function(t){const e=t.map.getTargetElement(),n=e.getRootNode();return!(n instanceof ShadowRoot?n.host:e).hasAttribute("tabindex")||function(t){const e=t.map.getTargetElement(),n=e.getRootNode(),i=t.map.getOwnerDocument().activeElement;return n instanceof ShadowRoot?n.host.contains(i):e.contains(i)}(t)},mR=vk,yR=function(t){const e=t.originalEvent;return"pointerId"in e&&0==e.button&&!(Vk&&$k&&e.ctrlKey)},vR=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&!e.shiftKey},_R=function(t){const e=t.originalEvent;return!e.altKey&&!(e.metaKey||e.ctrlKey)&&e.shiftKey},bR=function(t){const e=t.originalEvent,n=e.target.tagName;return"INPUT"!==n&&"SELECT"!==n&&"TEXTAREA"!==n&&!e.target.isContentEditable},wR=function(t){const e=t.originalEvent;return"pointerId"in e&&"mouse"==e.pointerType},xR=function(t){const e=t.originalEvent;return"pointerId"in e&&e.isPrimary&&0===e.button};class CR extends hR{constructor(t){super(t=t||{}),t.handleDownEvent&&(this.handleDownEvent=t.handleDownEvent),t.handleDragEvent&&(this.handleDragEvent=t.handleDragEvent),t.handleMoveEvent&&(this.handleMoveEvent=t.handleMoveEvent),t.handleUpEvent&&(this.handleUpEvent=t.handleUpEvent),t.stopDown&&(this.stopDown=t.stopDown),this.handlingDownUpSequence=!1,this.targetPointers=[]}getPointerCount(){return this.targetPointers.length}handleDownEvent(t){return!1}handleDragEvent(t){}handleEvent(t){if(!t.originalEvent)return!0;let e=!1;if(this.updateTrackedPointers_(t),this.handlingDownUpSequence){if(t.type==Uk.POINTERDRAG)this.handleDragEvent(t),t.originalEvent.preventDefault();else if(t.type==Uk.POINTERUP){const e=this.handleUpEvent(t);this.handlingDownUpSequence=e&&this.targetPointers.length>0}}else if(t.type==Uk.POINTERDOWN){const n=this.handleDownEvent(t);this.handlingDownUpSequence=n,e=this.stopDown(n)}else t.type==Uk.POINTERMOVE&&this.handleMoveEvent(t);return!e}handleMoveEvent(t){}handleUpEvent(t){return!1}stopDown(t){return t}updateTrackedPointers_(t){t.activePointers&&(this.targetPointers=t.activePointers)}}function SR(t){const e=t.length;let n=0,i=0;for(let r=0;r<e;r++)n+=t[r].clientX,i+=t[r].clientY;return{clientX:n/e,clientY:i/e}}class kR extends CR{constructor(t){super({stopDown:_k}),t=t||{},this.kinetic_=t.kinetic,this.lastCentroid=null,this.lastPointersCount_,this.panning_=!1;const e=t.condition?t.condition:pR(vR,xR);this.condition_=t.onFocusOnly?pR(gR,e):e,this.noKinetic_=!1}handleDragEvent(t){const e=t.map;this.panning_||(this.panning_=!0,e.getView().beginInteraction());const n=this.targetPointers,i=e.getEventPixel(SR(n));if(n.length==this.lastPointersCount_){if(this.kinetic_&&this.kinetic_.update(i[0],i[1]),this.lastCentroid){const e=[this.lastCentroid[0]-i[0],i[1]-this.lastCentroid[1]],n=t.map.getView();r=e,s=n.getResolution(),r[0]*=s,r[1]*=s,sT(e,n.getRotation()),n.adjustCenterInternal(e)}}else this.kinetic_&&this.kinetic_.begin();var r,s;this.lastCentroid=i,this.lastPointersCount_=n.length,t.originalEvent.preventDefault()}handleUpEvent(t){const e=t.map,n=e.getView();if(0===this.targetPointers.length){if(!this.noKinetic_&&this.kinetic_&&this.kinetic_.end()){const t=this.kinetic_.getDistance(),i=this.kinetic_.getAngle(),r=n.getCenterInternal(),s=e.getPixelFromCoordinateInternal(r),o=e.getCoordinateFromPixelInternal([s[0]-t*Math.cos(i),s[1]-t*Math.sin(i)]);n.animateInternal({center:n.getConstrainedCenter(o),duration:500,easing:lT})}return this.panning_&&(this.panning_=!1,n.endInteraction()),!1}return this.kinetic_&&this.kinetic_.begin(),this.lastCentroid=null,!0}handleDownEvent(t){if(this.targetPointers.length>0&&this.condition_(t)){const e=t.map.getView();return this.lastCentroid=null,e.getAnimating()&&e.cancelAnimations(),this.kinetic_&&this.kinetic_.begin(),this.noKinetic_=this.targetPointers.length>1,!0}return!1}}class ER extends CR{constructor(t){t=t||{},super({stopDown:_k}),this.condition_=t.condition?t.condition:fR,this.lastAngle_=void 0,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){if(!wR(t))return;const e=t.map,n=e.getView();if(n.getConstraints().rotation===OM)return;const i=e.getSize(),r=t.pixel,s=Math.atan2(i[1]/2-r[1],r[0]-i[0]/2);if(void 0!==this.lastAngle_){const t=s-this.lastAngle_;n.adjustRotationInternal(-t)}this.lastAngle_=s}handleUpEvent(t){return!wR(t)||(t.map.getView().endInteraction(this.duration_),!1)}handleDownEvent(t){return!(!wR(t)||!yR(t)||!this.condition_(t)||(t.map.getView().beginInteraction(),this.lastAngle_=void 0,0))}}class TR extends uk{constructor(t){super(),this.geometry_=null,this.element_=document.createElement("div"),this.element_.style.position="absolute",this.element_.style.pointerEvents="auto",this.element_.className="ol-box "+t,this.map_=null,this.startPixel_=null,this.endPixel_=null}disposeInternal(){this.setMap(null)}render_(){const t=this.startPixel_,e=this.endPixel_,n="px",i=this.element_.style;i.left=Math.min(t[0],e[0])+n,i.top=Math.min(t[1],e[1])+n,i.width=Math.abs(e[0]-t[0])+n,i.height=Math.abs(e[1]-t[1])+n}setMap(t){if(this.map_){this.map_.getOverlayContainer().removeChild(this.element_);const t=this.element_.style;t.left="inherit",t.top="inherit",t.width="inherit",t.height="inherit"}this.map_=t,this.map_&&this.map_.getOverlayContainer().appendChild(this.element_)}setPixels(t,e){this.startPixel_=t,this.endPixel_=e,this.createOrUpdateGeometry(),this.render_()}createOrUpdateGeometry(){if(!this.map_)return;const t=this.startPixel_,e=this.endPixel_,n=[t,[t[0],e[1]],e,[e[0],t[1]]].map(this.map_.getCoordinateFromPixelInternal,this.map_);n[4]=n[0].slice(),this.geometry_?this.geometry_.setCoordinates([n]):this.geometry_=new LM([n])}getGeometry(){return this.geometry_}}const LR="boxcancel";class MR extends kk{constructor(t,e,n){super(t),this.coordinate=e,this.mapBrowserEvent=n}}class RR extends CR{constructor(t){super(),this.on,this.once,this.un,t=t??{},this.box_=new TR(t.className||"ol-dragbox"),this.minArea_=t.minArea??64,t.onBoxEnd&&(this.onBoxEnd=t.onBoxEnd),this.startPixel_=null,this.condition_=t.condition??yR,this.boxEndCondition_=t.boxEndCondition??this.defaultBoxEndCondition}defaultBoxEndCondition(t,e,n){const i=n[0]-e[0],r=n[1]-e[1];return i*i+r*r>=this.minArea_}getGeometry(){return this.box_.getGeometry()}handleDragEvent(t){this.startPixel_&&(this.box_.setPixels(this.startPixel_,t.pixel),this.dispatchEvent(new MR("boxdrag",t.coordinate,t)))}handleUpEvent(t){if(!this.startPixel_)return!1;const e=this.boxEndCondition_(t,this.startPixel_,t.pixel);return e&&this.onBoxEnd(t),this.dispatchEvent(new MR(e?"boxend":LR,t.coordinate,t)),this.box_.setMap(null),this.startPixel_=null,!1}handleDownEvent(t){return!!this.condition_(t)&&(this.startPixel_=t.pixel,this.box_.setMap(t.map),this.box_.setPixels(this.startPixel_,this.startPixel_),this.dispatchEvent(new MR("boxstart",t.coordinate,t)),!0)}onBoxEnd(t){}setActive(t){t||(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new MR(LR,this.startPixel_,null)),this.startPixel_=null)),super.setActive(t)}setMap(t){this.getMap()&&(this.box_.setMap(null),this.startPixel_&&(this.dispatchEvent(new MR(LR,this.startPixel_,null)),this.startPixel_=null)),super.setMap(t)}}class PR extends RR{constructor(t){super({condition:(t=t||{}).condition?t.condition:_R,className:t.className||"ol-dragzoom",minArea:t.minArea}),this.duration_=void 0!==t.duration?t.duration:200,this.out_=void 0!==t.out&&t.out}onBoxEnd(t){const e=this.getMap().getView();let n=this.getGeometry();if(this.out_){const t=e.rotatedExtentForGeometry(n),i=e.getResolutionForExtentInternal(t),r=e.getResolution()/i;n=n.clone(),n.scale(r*r)}e.fitInternal(n,{duration:this.duration_,easing:lT})}}const IR="ArrowLeft",OR="ArrowRight",AR="ArrowDown";class zR extends hR{constructor(t){super(),t=t||{},this.defaultCondition_=function(t){return vR(t)&&bR(t)},this.condition_=void 0!==t.condition?t.condition:this.defaultCondition_,this.duration_=void 0!==t.duration?t.duration:100,this.pixelDelta_=void 0!==t.pixelDelta?t.pixelDelta:128}handleEvent(t){let e=!1;if(t.type==ak){const n=t.originalEvent,i=n.key;if(this.condition_(t)&&(i==AR||i==IR||i==OR||"ArrowUp"==i)){const r=t.map.getView(),s=r.getResolution()*this.pixelDelta_;let o=0,a=0;i==AR?a=-s:i==IR?o=-s:i==OR?o=s:a=s;const l=[o,a];sT(l,r.getRotation()),function(t,e,n){const i=t.getCenterInternal();if(i){const r=[i[0]+e[0],i[1]+e[1]];t.animateInternal({duration:void 0!==n?n:250,easing:hT,center:t.getConstrainedCenter(r)})}}(r,l,this.duration_),n.preventDefault(),e=!0}}return!e}}class FR extends hR{constructor(t){super(),t=t||{},this.condition_=t.condition?t.condition:function(t){return!function(t){const e=t.originalEvent;return $k?e.metaKey:e.ctrlKey}(t)&&bR(t)},this.delta_=t.delta?t.delta:1,this.duration_=void 0!==t.duration?t.duration:100}handleEvent(t){let e=!1;if(t.type==ak||t.type==lk){const n=t.originalEvent,i=n.key;if(this.condition_(t)&&("+"===i||"-"===i)){const r=t.map,s="+"===i?this.delta_:-this.delta_;uR(r.getView(),s,void 0,this.duration_),n.preventDefault(),e=!0}}return!e}}class jR extends hR{constructor(t){super(t=t||{}),this.totalDelta_=0,this.lastDelta_=0,this.maxDelta_=void 0!==t.maxDelta?t.maxDelta:1,this.duration_=void 0!==t.duration?t.duration:250,this.timeout_=void 0!==t.timeout?t.timeout:80,this.useAnchor_=void 0===t.useAnchor||t.useAnchor,this.constrainResolution_=void 0!==t.constrainResolution&&t.constrainResolution;const e=t.condition?t.condition:mR;this.condition_=t.onFocusOnly?pR(gR,e):e,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_,this.mode_=void 0,this.trackpadEventGap_=400,this.trackpadTimeoutId_,this.deltaPerZoom_=300}endInteraction_(){this.trackpadTimeoutId_=void 0;const t=this.getMap();t&&t.getView().endInteraction(void 0,this.lastDelta_?this.lastDelta_>0?1:-1:0,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null)}handleEvent(t){if(!this.condition_(t))return!0;if(t.type!==hk)return!0;const e=t.map,n=t.originalEvent;n.preventDefault(),this.useAnchor_&&(this.lastAnchor_=t.pixel);let i=n.deltaY;switch(n.deltaMode){case WheelEvent.DOM_DELTA_LINE:i*=40;break;case WheelEvent.DOM_DELTA_PAGE:i*=300}if(0===i)return!1;this.lastDelta_=i;const r=Date.now();void 0===this.startTime_&&(this.startTime_=r),(!this.mode_||r-this.startTime_>this.trackpadEventGap_)&&(this.mode_=Math.abs(i)<4?"trackpad":"wheel");const s=e.getView();if("trackpad"===this.mode_&&!s.getConstrainResolution()&&!this.constrainResolution_)return this.trackpadTimeoutId_?clearTimeout(this.trackpadTimeoutId_):(s.getAnimating()&&s.cancelAnimations(),s.beginInteraction()),this.trackpadTimeoutId_=setTimeout(this.endInteraction_.bind(this),this.timeout_),s.adjustZoom(-i/this.deltaPerZoom_,this.lastAnchor_?e.getCoordinateFromPixel(this.lastAnchor_):null),this.startTime_=r,!1;this.totalDelta_+=i;const o=Math.max(this.timeout_-(r-this.startTime_),0);return clearTimeout(this.timeoutId_),this.timeoutId_=setTimeout(this.handleWheelZoom_.bind(this,e),o),!1}handleWheelZoom_(t){const e=t.getView();e.getAnimating()&&e.cancelAnimations();let n=-hE(this.totalDelta_,-this.maxDelta_*this.deltaPerZoom_,this.maxDelta_*this.deltaPerZoom_)/this.deltaPerZoom_;(e.getConstrainResolution()||this.constrainResolution_)&&(n=n?n>0?1:-1:0),uR(e,n,this.lastAnchor_?t.getCoordinateFromPixel(this.lastAnchor_):null,this.duration_),this.mode_=void 0,this.totalDelta_=0,this.lastAnchor_=null,this.startTime_=void 0,this.timeoutId_=void 0}setMouseAnchor(t){this.useAnchor_=t,t||(this.lastAnchor_=null)}}class DR extends CR{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=_k),super(e),this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.threshold_=void 0!==t.threshold?t.threshold:.3,this.duration_=void 0!==t.duration?t.duration:250}handleDragEvent(t){let e=0;const n=this.targetPointers[0],i=this.targetPointers[1],r=Math.atan2(i.clientY-n.clientY,i.clientX-n.clientX);if(void 0!==this.lastAngle_){const t=r-this.lastAngle_;this.rotationDelta_+=t,!this.rotating_&&Math.abs(this.rotationDelta_)>this.threshold_&&(this.rotating_=!0),e=t}this.lastAngle_=r;const s=t.map,o=s.getView();o.getConstraints().rotation!==OM&&(this.anchor_=s.getCoordinateFromPixelInternal(s.getEventPixel(SR(this.targetPointers))),this.rotating_&&(s.render(),o.adjustRotationInternal(e,this.anchor_)))}handleUpEvent(t){return!(this.targetPointers.length<2&&(t.map.getView().endInteraction(this.duration_),1))}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastAngle_=void 0,this.rotating_=!1,this.rotationDelta_=0,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}class NR extends CR{constructor(t){const e=t=t||{};e.stopDown||(e.stopDown=_k),super(e),this.anchor_=null,this.duration_=void 0!==t.duration?t.duration:400,this.lastDistance_=void 0,this.lastScaleDelta_=1}handleDragEvent(t){let e=1;const n=this.targetPointers[0],i=this.targetPointers[1],r=n.clientX-i.clientX,s=n.clientY-i.clientY,o=Math.sqrt(r*r+s*s);void 0!==this.lastDistance_&&(e=this.lastDistance_/o),this.lastDistance_=o;const a=t.map,l=a.getView();1!=e&&(this.lastScaleDelta_=e),this.anchor_=a.getCoordinateFromPixelInternal(a.getEventPixel(SR(this.targetPointers))),a.render(),l.adjustResolutionInternal(e,this.anchor_)}handleUpEvent(t){if(this.targetPointers.length<2){const e=t.map.getView(),n=this.lastScaleDelta_>1?1:-1;return e.endInteraction(this.duration_,n),!1}return!0}handleDownEvent(t){if(this.targetPointers.length>=2){const e=t.map;return this.anchor_=null,this.lastDistance_=void 0,this.lastScaleDelta_=1,this.handlingDownUpSequence||e.getView().beginInteraction(),!0}return!1}}function BR(t){t=t||{};const e=new Dk,n=new lR(-.005,.05,100);return(void 0===t.altShiftDragRotate||t.altShiftDragRotate)&&e.push(new ER),(void 0===t.doubleClickZoom||t.doubleClickZoom)&&e.push(new dR({delta:t.zoomDelta,duration:t.zoomDuration})),(void 0===t.dragPan||t.dragPan)&&e.push(new kR({onFocusOnly:t.onFocusOnly,kinetic:n})),(void 0===t.pinchRotate||t.pinchRotate)&&e.push(new DR),(void 0===t.pinchZoom||t.pinchZoom)&&e.push(new NR({duration:t.zoomDuration})),(void 0===t.keyboard||t.keyboard)&&(e.push(new zR),e.push(new FR({delta:t.zoomDelta,duration:t.zoomDuration}))),(void 0===t.mouseWheelZoom||t.mouseWheelZoom)&&e.push(new jR({onFocusOnly:t.onFocusOnly,duration:t.zoomDuration})),(void 0===t.shiftDragZoom||t.shiftDragZoom)&&e.push(new PR({duration:t.zoomDuration})),e}const UR="opacity",qR="visible",VR="extent",$R="zIndex",GR="maxResolution",WR="minResolution",HR="maxZoom",ZR="minZoom",KR="source";class YR extends zk{constructor(t){super(),this.on,this.once,this.un,this.background_=t.background;const e=Object.assign({},t);"object"==typeof t.properties&&(delete e.properties,Object.assign(e,t.properties)),e[UR]=void 0!==t.opacity?t.opacity:1,sE("number"==typeof e[UR],"Layer opacity must be a number"),e[qR]=void 0===t.visible||t.visible,e[$R]=t.zIndex,e[GR]=void 0!==t.maxResolution?t.maxResolution:1/0,e[WR]=void 0!==t.minResolution?t.minResolution:0,e[ZR]=void 0!==t.minZoom?t.minZoom:-1/0,e[HR]=void 0!==t.maxZoom?t.maxZoom:1/0,this.className_=void 0!==e.className?e.className:"ol-layer",delete e.className,this.setProperties(e),this.state_=null}getBackground(){return this.background_}getClassName(){return this.className_}getLayerState(t){const e=this.state_||{layer:this,managed:void 0===t||t},n=this.getZIndex();return e.opacity=hE(Math.round(100*this.getOpacity())/100,0,1),e.visible=this.getVisible(),e.extent=this.getExtent(),e.zIndex=void 0!==n||e.managed?n:1/0,e.maxResolution=this.getMaxResolution(),e.minResolution=Math.max(this.getMinResolution(),0),e.minZoom=this.getMinZoom(),e.maxZoom=this.getMaxZoom(),this.state_=e,e}getLayersArray(t){return Pk()}getLayerStatesArray(t){return Pk()}getExtent(){return this.get(VR)}getMaxResolution(){return this.get(GR)}getMinResolution(){return this.get(WR)}getMinZoom(){return this.get(ZR)}getMaxZoom(){return this.get(HR)}getOpacity(){return this.get(UR)}getSourceState(){return Pk()}getVisible(){return this.get(qR)}getZIndex(){return this.get($R)}setBackground(t){this.background_=t,this.changed()}setExtent(t){this.set(VR,t)}setMaxResolution(t){this.set(GR,t)}setMinResolution(t){this.set(WR,t)}setMaxZoom(t){this.set(HR,t)}setMinZoom(t){this.set(ZR,t)}setOpacity(t){sE("number"==typeof t,"Layer opacity must be a number"),this.set(UR,t)}setVisible(t){this.set(qR,t)}setZIndex(t){this.set($R,t)}disposeInternal(){this.state_&&(this.state_.layer=null,this.state_=null),super.disposeInternal()}}const XR="addlayer",JR="removelayer";class QR extends kk{constructor(t,e){super(t),this.layer=e}}const tP="layers";class eP extends YR{constructor(t){t=t||{};const e=Object.assign({},t);delete e.layers;let n=t.layers;super(e),this.on,this.once,this.un,this.layersListenerKeys_=[],this.listenerKeys_={},this.addChangeListener(tP,this.handleLayersChanged_),n?Array.isArray(n)?n=new Dk(n.slice(),{unique:!0}):sE("function"==typeof n.getArray,"Expected `layers` to be an array or a `Collection`"):n=new Dk(void 0,{unique:!0}),this.setLayers(n)}handleLayerChange_(){this.changed()}handleLayersChanged_(){this.layersListenerKeys_.forEach(Mk),this.layersListenerKeys_.length=0;const t=this.getLayers();this.layersListenerKeys_.push(Tk(t,ek,this.handleLayersAdd_,this),Tk(t,nk,this.handleLayersRemove_,this));for(const n in this.listenerKeys_)this.listenerKeys_[n].forEach(Mk);Ck(this.listenerKeys_);const e=t.getArray();for(let n=0,i=e.length;n<i;n++){const t=e[n];this.registerLayerListeners_(t),this.dispatchEvent(new QR(XR,t))}this.changed()}registerLayerListeners_(t){const e=[Tk(t,ik,this.handleLayerChange_,this),Tk(t,rk,this.handleLayerChange_,this)];t instanceof eP&&e.push(Tk(t,XR,this.handleLayerGroupAdd_,this),Tk(t,JR,this.handleLayerGroupRemove_,this)),this.listenerKeys_[Ok(t)]=e}handleLayerGroupAdd_(t){this.dispatchEvent(new QR(XR,t.layer))}handleLayerGroupRemove_(t){this.dispatchEvent(new QR(JR,t.layer))}handleLayersAdd_(t){const e=t.element;this.registerLayerListeners_(e),this.dispatchEvent(new QR(XR,e)),this.changed()}handleLayersRemove_(t){const e=t.element,n=Ok(e);this.listenerKeys_[n].forEach(Mk),delete this.listenerKeys_[n],this.dispatchEvent(new QR(JR,e)),this.changed()}getLayers(){return this.get(tP)}setLayers(t){const e=this.getLayers();if(e){const t=e.getArray();for(let e=0,n=t.length;e<n;++e)this.dispatchEvent(new QR(JR,t[e]))}this.set(tP,t)}getLayersArray(t){return t=void 0!==t?t:[],this.getLayers().forEach(function(e){e.getLayersArray(t)}),t}getLayerStatesArray(t){const e=void 0!==t?t:[],n=e.length;this.getLayers().forEach(function(t){t.getLayerStatesArray(e)});const i=this.getLayerState();let r=i.zIndex;t||void 0!==i.zIndex||(r=0);for(let s=n,o=e.length;s<o;s++){const t=e[s];t.opacity*=i.opacity,t.visible=t.visible&&i.visible,t.maxResolution=Math.min(t.maxResolution,i.maxResolution),t.minResolution=Math.max(t.minResolution,i.minResolution),t.minZoom=Math.max(t.minZoom,i.minZoom),t.maxZoom=Math.min(t.maxZoom,i.maxZoom),void 0!==i.extent&&(void 0!==t.extent?t.extent=KE(t.extent,i.extent):t.extent=i.extent),void 0===t.zIndex&&(t.zIndex=r)}return e}getSourceState(){return"ready"}}const nP="prerender",iP="postrender",rP="precompose",sP="rendercomplete";class oP extends YR{constructor(t){const e=Object.assign({},t);delete e.source,super(e),this.on,this.once,this.un,this.mapPrecomposeKey_=null,this.mapRenderKey_=null,this.sourceChangeKey_=null,this.renderer_=null,this.sourceReady_=!1,this.rendered=!1,t.render&&(this.render=t.render),t.map&&this.setMap(t.map),this.addChangeListener(KR,this.handleSourcePropertyChange_);const n=t.source?t.source:null;this.setSource(n)}getLayersArray(t){return(t=t||[]).push(this),t}getLayerStatesArray(t){return(t=t||[]).push(this.getLayerState()),t}getSource(){return this.get(KR)||null}getRenderSource(){return this.getSource()}getSourceState(){const t=this.getSource();return t?t.getState():"undefined"}handleSourceChange_(){this.changed(),this.sourceReady_||"ready"!==this.getSource().getState()||(this.sourceReady_=!0,this.dispatchEvent("sourceready"))}handleSourcePropertyChange_(){this.sourceChangeKey_&&(Mk(this.sourceChangeKey_),this.sourceChangeKey_=null),this.sourceReady_=!1;const t=this.getSource();t&&(this.sourceChangeKey_=Tk(t,rk,this.handleSourceChange_,this),"ready"===t.getState()&&(this.sourceReady_=!0,setTimeout(()=>{this.dispatchEvent("sourceready")},0))),this.changed()}getFeatures(t){return this.renderer_?this.renderer_.getFeatures(t):Promise.resolve([])}getData(t){return this.renderer_&&this.rendered?this.renderer_.getData(t):null}isVisible(t){let e;const n=this.getMapInternal();let i;if(!t&&n&&(t=n.getView()),e=t instanceof zM?{viewState:t.getState(),extent:t.calculateExtent()}:t,!e.layerStatesArray&&n&&(e.layerStatesArray=n.getLayerGroup().getLayerStatesArray()),e.layerStatesArray){if(i=e.layerStatesArray.find(t=>t.layer===this),!i)return!1}else i=this.getLayerState();const r=this.getExtent();return aP(i,e.viewState)&&(!r||QE(r,e.extent))}getAttributions(t){if(!this.isVisible(t))return[];const e=this.getSource()?.getAttributions();if(!e)return[];let n=e(t instanceof zM?t.getViewStateAndExtent():t);return Array.isArray(n)||(n=[n]),n}render(t,e){const n=this.getRenderer();return n.prepareFrame(t)?(this.rendered=!0,n.renderFrame(t,e)):null}unrender(){this.rendered=!1}getDeclutter(){}renderDeclutter(t,e){}renderDeferred(t){const e=this.getRenderer();e&&e.renderDeferred(t)}setMapInternal(t){t||this.unrender(),this.set("map",t)}getMapInternal(){return this.get("map")}setMap(t){this.mapPrecomposeKey_&&(Mk(this.mapPrecomposeKey_),this.mapPrecomposeKey_=null),t||this.changed(),this.mapRenderKey_&&(Mk(this.mapRenderKey_),this.mapRenderKey_=null),t&&(this.mapPrecomposeKey_=Tk(t,rP,this.handlePrecompose_,this),this.mapRenderKey_=Tk(this,rk,t.render,t),this.changed())}handlePrecompose_(t){const e=t.frameState.layerStatesArray,n=this.getLayerState(!1);sE(!e.some(t=>t.layer===n.layer),"A layer can only be added to the map once. Use either `layer.setMap()` or `map.addLayer()`, not both."),e.push(n)}setSource(t){this.set(KR,t)}getRenderer(){return this.renderer_||(this.renderer_=this.createRenderer()),this.renderer_}hasRenderer(){return!!this.renderer_}createRenderer(){return null}clearRenderer(){this.renderer_&&(this.renderer_.dispose(),delete this.renderer_)}disposeInternal(){this.clearRenderer(),this.setSource(null),super.disposeInternal()}}function aP(t,e){if(!t.visible)return!1;const n=e.resolution;if(n<t.minResolution||n>=t.maxResolution)return!1;const i=e.zoom;return i>t.minZoom&&i<=t.maxZoom}function lP(t,e,n=0,i=t.length-1,r=hP){for(;i>n;){if(i-n>600){const s=i-n+1,o=e-n+1,a=Math.log(s),l=.5*Math.exp(2*a/3),c=.5*Math.sqrt(a*l*(s-l)/s)*(o-s/2<0?-1:1);lP(t,e,Math.max(n,Math.floor(e-o*l/s+c)),Math.min(i,Math.floor(e+(s-o)*l/s+c)),r)}const s=t[e];let o=n,a=i;for(cP(t,n,e),r(t[i],s)>0&&cP(t,n,i);o<a;){for(cP(t,o,a),o++,a--;r(t[o],s)<0;)o++;for(;r(t[a],s)>0;)a--}0===r(t[n],s)?cP(t,n,a):(a++,cP(t,a,i)),a<=e&&(n=a+1),e<=a&&(i=a-1)}}function cP(t,e,n){const i=t[e];t[e]=t[n],t[n]=i}function hP(t,e){return t<e?-1:t>e?1:0}let uP=class{constructor(t=9){this._maxEntries=Math.max(4,t),this._minEntries=Math.max(2,Math.ceil(.4*this._maxEntries)),this.clear()}all(){return this._all(this.data,[])}search(t){let e=this.data;const n=[];if(!CP(t,e))return n;const i=this.toBBox,r=[];for(;e;){for(let s=0;s<e.children.length;s++){const o=e.children[s],a=e.leaf?i(o):o;CP(t,a)&&(e.leaf?n.push(o):xP(t,a)?this._all(o,n):r.push(o))}e=r.pop()}return n}collides(t){let e=this.data;if(!CP(t,e))return!1;const n=[];for(;e;){for(let i=0;i<e.children.length;i++){const r=e.children[i],s=e.leaf?this.toBBox(r):r;if(CP(t,s)){if(e.leaf||xP(t,s))return!0;n.push(r)}}e=n.pop()}return!1}load(t){if(!t||!t.length)return this;if(t.length<this._minEntries){for(let e=0;e<t.length;e++)this.insert(t[e]);return this}let e=this._build(t.slice(),0,t.length-1,0);if(this.data.children.length)if(this.data.height===e.height)this._splitRoot(this.data,e);else{if(this.data.height<e.height){const t=this.data;this.data=e,e=t}this._insert(e,this.data.height-e.height-1,!0)}else this.data=e;return this}insert(t){return t&&this._insert(t,this.data.height-1),this}clear(){return this.data=SP([]),this}remove(t,e){if(!t)return this;let n=this.data;const i=this.toBBox(t),r=[],s=[];let o,a,l;for(;n||r.length;){if(n||(n=r.pop(),a=r[r.length-1],o=s.pop(),l=!0),n.leaf){const i=dP(t,n.children,e);if(-1!==i)return n.children.splice(i,1),r.push(n),this._condense(r),this}l||n.leaf||!xP(n,i)?a?(o++,n=a.children[o],l=!1):n=null:(r.push(n),s.push(o),o=0,a=n,n=n.children[0])}return this}toBBox(t){return t}compareMinX(t,e){return t.minX-e.minX}compareMinY(t,e){return t.minY-e.minY}toJSON(){return this.data}fromJSON(t){return this.data=t,this}_all(t,e){const n=[];for(;t;)t.leaf?e.push(...t.children):n.push(...t.children),t=n.pop();return e}_build(t,e,n,i){const r=n-e+1;let s,o=this._maxEntries;if(r<=o)return s=SP(t.slice(e,n+1)),pP(s,this.toBBox),s;i||(i=Math.ceil(Math.log(r)/Math.log(o)),o=Math.ceil(r/Math.pow(o,i-1))),s=SP([]),s.leaf=!1,s.height=i;const a=Math.ceil(r/o),l=a*Math.ceil(Math.sqrt(o));kP(t,e,n,l,this.compareMinX);for(let c=e;c<=n;c+=l){const e=Math.min(c+l-1,n);kP(t,c,e,a,this.compareMinY);for(let n=c;n<=e;n+=a){const r=Math.min(n+a-1,e);s.children.push(this._build(t,n,r,i-1))}}return pP(s,this.toBBox),s}_chooseSubtree(t,e,n,i){for(;i.push(e),!e.leaf&&i.length-1!==n;){let n,i=1/0,r=1/0;for(let s=0;s<e.children.length;s++){const o=e.children[s],a=vP(o),l=bP(t,o)-a;l<r?(r=l,i=a<i?a:i,n=o):l===r&&a<i&&(i=a,n=o)}e=n||e.children[0]}return e}_insert(t,e,n){const i=n?t:this.toBBox(t),r=[],s=this._chooseSubtree(i,this.data,e,r);for(s.children.push(t),gP(s,i);e>=0&&r[e].children.length>this._maxEntries;)this._split(r,e),e--;this._adjustParentBBoxes(i,r,e)}_split(t,e){const n=t[e],i=n.children.length,r=this._minEntries;this._chooseSplitAxis(n,r,i);const s=this._chooseSplitIndex(n,r,i),o=SP(n.children.splice(s,n.children.length-s));o.height=n.height,o.leaf=n.leaf,pP(n,this.toBBox),pP(o,this.toBBox),e?t[e-1].children.push(o):this._splitRoot(n,o)}_splitRoot(t,e){this.data=SP([t,e]),this.data.height=t.height+1,this.data.leaf=!1,pP(this.data,this.toBBox)}_chooseSplitIndex(t,e,n){let i,r=1/0,s=1/0;for(let o=e;o<=n-e;o++){const e=fP(t,0,o,this.toBBox),a=fP(t,o,n,this.toBBox),l=wP(e,a),c=vP(e)+vP(a);l<r?(r=l,i=o,s=c<s?c:s):l===r&&c<s&&(s=c,i=o)}return i||n-e}_chooseSplitAxis(t,e,n){const i=t.leaf?this.compareMinX:mP,r=t.leaf?this.compareMinY:yP;this._allDistMargin(t,e,n,i)<this._allDistMargin(t,e,n,r)&&t.children.sort(i)}_allDistMargin(t,e,n,i){t.children.sort(i);const r=this.toBBox,s=fP(t,0,e,r),o=fP(t,n-e,n,r);let a=_P(s)+_P(o);for(let l=e;l<n-e;l++){const e=t.children[l];gP(s,t.leaf?r(e):e),a+=_P(s)}for(let l=n-e-1;l>=e;l--){const e=t.children[l];gP(o,t.leaf?r(e):e),a+=_P(o)}return a}_adjustParentBBoxes(t,e,n){for(let i=n;i>=0;i--)gP(e[i],t)}_condense(t){for(let e,n=t.length-1;n>=0;n--)0===t[n].children.length?n>0?(e=t[n-1].children,e.splice(e.indexOf(t[n]),1)):this.clear():pP(t[n],this.toBBox)}};function dP(t,e,n){if(!n)return e.indexOf(t);for(let i=0;i<e.length;i++)if(n(t,e[i]))return i;return-1}function pP(t,e){fP(t,0,t.children.length,e,t)}function fP(t,e,n,i,r){r||(r=SP(null)),r.minX=1/0,r.minY=1/0,r.maxX=-1/0,r.maxY=-1/0;for(let s=e;s<n;s++){const e=t.children[s];gP(r,t.leaf?i(e):e)}return r}function gP(t,e){return t.minX=Math.min(t.minX,e.minX),t.minY=Math.min(t.minY,e.minY),t.maxX=Math.max(t.maxX,e.maxX),t.maxY=Math.max(t.maxY,e.maxY),t}function mP(t,e){return t.minX-e.minX}function yP(t,e){return t.minY-e.minY}function vP(t){return(t.maxX-t.minX)*(t.maxY-t.minY)}function _P(t){return t.maxX-t.minX+(t.maxY-t.minY)}function bP(t,e){return(Math.max(e.maxX,t.maxX)-Math.min(e.minX,t.minX))*(Math.max(e.maxY,t.maxY)-Math.min(e.minY,t.minY))}function wP(t,e){const n=Math.max(t.minX,e.minX),i=Math.max(t.minY,e.minY),r=Math.min(t.maxX,e.maxX),s=Math.min(t.maxY,e.maxY);return Math.max(0,r-n)*Math.max(0,s-i)}function xP(t,e){return t.minX<=e.minX&&t.minY<=e.minY&&e.maxX<=t.maxX&&e.maxY<=t.maxY}function CP(t,e){return e.minX<=t.maxX&&e.minY<=t.maxY&&e.maxX>=t.minX&&e.maxY>=t.minY}function SP(t){return{children:t,height:1,leaf:!0,minX:1/0,minY:1/0,maxX:-1/0,maxY:-1/0}}function kP(t,e,n,i,r){const s=[e,n];for(;s.length;){if((n=s.pop())-(e=s.pop())<=i)continue;const o=e+Math.ceil((n-e)/i/2)*i;lP(t,o,e,n,r),s.push(e,o,o,n)}}const EP=[NaN,NaN,NaN,0];let TP;const LP=/^rgba?\(\s*(\d+%?)\s+(\d+%?)\s+(\d+%?)(?:\s*\/\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,MP=/^rgba?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,RP=/^rgba?\(\s*(\d+%)\s*,\s*(\d+%)\s*,\s*(\d+%)(?:\s*,\s*(\d+%|\d*\.\d+|[01]))?\s*\)$/i,PP=/^#([\da-f]{3,4}|[\da-f]{6}|[\da-f]{8})$/i;function IP(t,e){return t.endsWith("%")?Number(t.substring(0,t.length-1))/e:Number(t)}function OP(t){throw new Error('failed to parse "'+t+'" as color')}function AP(t){if(t.toLowerCase().startsWith("rgb")){const e=t.match(MP)||t.match(LP)||t.match(RP);if(e){const t=e[4],n=100/255;return[hE(IP(e[1],n)+.5|0,0,255),hE(IP(e[2],n)+.5|0,0,255),hE(IP(e[3],n)+.5|0,0,255),void 0!==t?hE(IP(t,100),0,1):1]}OP(t)}if(t.startsWith("#")){if(PP.test(t)){const e=t.substring(1),n=e.length<=4?1:2,i=[0,0,0,255];for(let t=0,r=e.length;t<r;t+=n){let r=parseInt(e.substring(t,t+n),16);1===n&&(r+=r<<4),i[t/n]=r}return i[3]=i[3]/255,i}OP(t)}const e=(TP||(TP=HM(1,1,void 0,{willReadFrequently:!0,desynchronized:!0})),TP);e.fillStyle="#abcdef";let n=e.fillStyle;e.fillStyle=t,e.fillStyle===n&&(e.fillStyle="#fedcba",n=e.fillStyle,e.fillStyle=t,e.fillStyle===n&&OP(t));const i=e.fillStyle;if(i.startsWith("#")||i.startsWith("rgba"))return AP(i);e.clearRect(0,0,1,1),e.fillRect(0,0,1,1);const r=Array.from(e.getImageData(0,0,1,1).data);return r[3]=yE(r[3]/255,3),r}const zP={};let FP=0;function jP(t){if(4===t.length)return t;const e=t.slice();return e[3]=1,e}function DP(t){return t>.0031308?269.025*Math.pow(t,1/2.4)-14.025:3294.6*t}function NP(t){return t>.2068965?Math.pow(t,3):108/841*(t-4/29)}function BP(t){return t>10.314724?Math.pow((t+14.025)/269.025,2.4):t/3294.6}function UP(t){return t>.0088564?Math.pow(t,1/3):t/(108/841)+4/29}function qP(t){const e=BP(t[0]),n=BP(t[1]),i=BP(t[2]),r=UP(.222488403*e+.716873169*n+.06060791*i),s=500*(UP(.452247074*e+.399439023*n+.148375274*i)-r),o=200*(r-UP(.016863605*e+.117638439*n+.865350722*i)),a=Math.atan2(o,s)*(180/Math.PI);return[116*r-16,Math.sqrt(s*s+o*o),a<0?a+360:a,t[3]]}function VP(t){if("none"===t)return EP;if(zP.hasOwnProperty(t))return zP[t];if(FP>=1024){let t=0;for(const e in zP)3&t++||(delete zP[e],--FP)}const e=AP(t);4!==e.length&&OP(t);for(const n of e)isNaN(n)&&OP(t);return zP[t]=e,++FP,e}function $P(t){return Array.isArray(t)?t:VP(t)}function GP(t){let e=t[0];e!=(0|e)&&(e=e+.5|0);let n=t[1];n!=(0|n)&&(n=n+.5|0);let i=t[2];return i!=(0|i)&&(i=i+.5|0),"rgba("+e+","+n+","+i+","+(void 0===t[3]?1:Math.round(1e3*t[3])/1e3)+")"}function WP(t){return t[0]>0&&t[1]>0}function HP(t,e){return Array.isArray(t)?t:(void 0===e?e=[t,t]:(e[0]=t,e[1]=t),e)}let ZP=0;const KP=1<<ZP++,YP=1<<ZP++,XP=1<<ZP++,JP=1<<ZP++,QP=1<<ZP++,tI=1<<ZP++,eI=Math.pow(2,6)-1,nI={[KP]:"boolean",[YP]:"number",[XP]:"string",[JP]:"color",[QP]:"number[]",[tI]:"size"},iI=Object.keys(nI).map(Number).sort(dk);function rI(t){const e=[];for(const n of iI)sI(t,n)&&e.push(nI[n]);return 0===e.length?"untyped":e.length<3?e.join(" or "):e.slice(0,-1).join(", ")+", or "+e[e.length-1]}function sI(t,e){return(t&e)===e}function oI(t,e){return t===e}class aI{constructor(t,e){if(!function(t){return t in nI}(t))throw new Error(`literal expressions must have a specific type, got ${rI(t)}`);this.type=t,this.value=e}}class lI{constructor(t,e,...n){this.type=t,this.operator=e,this.args=n}}function cI(){return{variables:new Set,properties:new Set,featureId:!1,geometryType:!1,mapState:!1}}function hI(t,e,n){switch(typeof t){case"boolean":if(oI(e,XP))return new aI(XP,t?"true":"false");if(!sI(e,KP))throw new Error(`got a boolean, but expected ${rI(e)}`);return new aI(KP,t);case"number":if(oI(e,tI))return new aI(tI,HP(t));if(oI(e,KP))return new aI(KP,!!t);if(oI(e,XP))return new aI(XP,t.toString());if(!sI(e,YP))throw new Error(`got a number, but expected ${rI(e)}`);return new aI(YP,t);case"string":if(oI(e,JP))return new aI(JP,VP(t));if(oI(e,KP))return new aI(KP,!!t);if(!sI(e,XP))throw new Error(`got a string, but expected ${rI(e)}`);return new aI(XP,t)}if(!Array.isArray(t))throw new Error("expression must be an array or a primitive value");if(0===t.length)throw new Error("empty expression");if("string"==typeof t[0])return function(t,e,n){const i=t[0],r=rO[i];if(!r)throw new Error(`unknown operator: ${i}`);return r(t,e,n)}(t,e,n);for(const i of t)if("number"!=typeof i)throw new Error("expected an array of numbers");if(oI(e,tI)){if(2!==t.length)throw new Error(`expected an array of two values for a size, got ${t.length}`);return new aI(tI,t)}if(oI(e,JP)){if(3===t.length)return new aI(JP,[...t,1]);if(4===t.length)return new aI(JP,t);throw new Error(`expected an array of 3 or 4 values for a color, got ${t.length}`)}if(!sI(e,QP))throw new Error(`got an array of numbers, but expected ${rI(e)}`);return new aI(QP,t)}const uI="get",dI="var",pI="concat",fI="geometry-type",gI="line-metric",mI="any",yI="all",vI="!",_I="resolution",bI="zoom",wI="time",xI="==",CI="!=",SI=">",kI=">=",EI="<",TI="<=",LI="*",MI="/",RI="+",PI="-",II="clamp",OI="%",AI="^",zI="abs",FI="floor",jI="ceil",DI="round",NI="sin",BI="cos",UI="atan",qI="sqrt",VI="match",$I="between",GI="interpolate",WI="coalesce",HI="case",ZI="in",KI="number",YI="string",XI="array",JI="color",QI="id",tO="band",eO="palette",nO="to-string",iO="has",rO={[uI]:dO(lO(1,1/0),sO),[dI]:dO(lO(1,1),function(t,e,n){const i=t[1];if("string"!=typeof i)throw new Error("expected a string argument for var operation");return n.variables.add(i),[new aI(XP,i)]}),[iO]:dO(lO(1,1/0),sO),[QI]:dO(function(t,e,n){n.featureId=!0},aO),[pI]:dO(lO(2,1/0),hO(XP)),[fI]:dO(function(t,e,n){n.geometryType=!0},aO),[gI]:dO(aO),[_I]:dO(oO,aO),[bI]:dO(oO,aO),[wI]:dO(oO,aO),[mI]:dO(lO(2,1/0),hO(KP)),[yI]:dO(lO(2,1/0),hO(KP)),[vI]:dO(lO(1,1),hO(KP)),[xI]:dO(lO(2,2),hO(eI)),[CI]:dO(lO(2,2),hO(eI)),[SI]:dO(lO(2,2),hO(YP)),[kI]:dO(lO(2,2),hO(YP)),[EI]:dO(lO(2,2),hO(YP)),[TI]:dO(lO(2,2),hO(YP)),[LI]:dO(lO(2,1/0),cO),[WI]:dO(lO(2,1/0),cO),[MI]:dO(lO(2,2),hO(YP)),[RI]:dO(lO(2,1/0),hO(YP)),[PI]:dO(lO(2,2),hO(YP)),[II]:dO(lO(3,3),hO(YP)),[OI]:dO(lO(2,2),hO(YP)),[AI]:dO(lO(2,2),hO(YP)),[zI]:dO(lO(1,1),hO(YP)),[FI]:dO(lO(1,1),hO(YP)),[jI]:dO(lO(1,1),hO(YP)),[DI]:dO(lO(1,1),hO(YP)),[NI]:dO(lO(1,1),hO(YP)),[BI]:dO(lO(1,1),hO(YP)),[UI]:dO(lO(1,2),hO(YP)),[qI]:dO(lO(1,1),hO(YP)),[VI]:dO(lO(4,1/0),uO,function(t,e,n){const i=t.length-1,r=XP|YP|KP,s=hI(t[1],r,n),o=hI(t[t.length-1],e,n),a=new Array(i-2);for(let c=0;c<i-2;c+=2){try{const e=hI(t[c+2],s.type,n);a[c]=e}catch(l){throw new Error(`failed to parse argument ${c+1} of match expression: ${l.message}`)}try{const e=hI(t[c+3],o.type,n);a[c+1]=e}catch(l){throw new Error(`failed to parse argument ${c+2} of match expression: ${l.message}`)}}return[s,...a,o]}),[$I]:dO(lO(3,3),hO(YP)),[GI]:dO(lO(6,1/0),uO,function(t,e,n){const i=t[1];let r;switch(i[0]){case"linear":r=1;break;case"exponential":const t=i[1];if("number"!=typeof t||t<=0)throw new Error(`expected a number base for exponential interpolation, got ${JSON.stringify(t)} instead`);r=t;break;default:throw new Error(`invalid interpolation type: ${JSON.stringify(i)}`)}const s=new aI(YP,r);let o;try{o=hI(t[2],YP,n)}catch(l){throw new Error(`failed to parse argument 1 in interpolate expression: ${l.message}`)}const a=new Array(t.length-3);for(let c=0;c<a.length;c+=2){try{const e=hI(t[c+3],YP,n);a[c]=e}catch(l){throw new Error(`failed to parse argument ${c+2} for interpolate expression: ${l.message}`)}try{const i=hI(t[c+4],e,n);a[c+1]=i}catch(l){throw new Error(`failed to parse argument ${c+3} for interpolate expression: ${l.message}`)}}return[s,o,...a]}),[HI]:dO(lO(3,1/0),function(t){const e=t[0],n=t.length-1;if(n%2==0)throw new Error(`expected an odd number of arguments for ${e}, got ${n} instead`)},function(t,e,n){const i=hI(t[t.length-1],e,n),r=new Array(t.length-1);for(let o=0;o<r.length-1;o+=2){try{const e=hI(t[o+1],KP,n);r[o]=e}catch(s){throw new Error(`failed to parse argument ${o} of case expression: ${s.message}`)}try{const e=hI(t[o+2],i.type,n);r[o+1]=e}catch(s){throw new Error(`failed to parse argument ${o+1} of case expression: ${s.message}`)}}return r[r.length-1]=i,r}),[ZI]:dO(lO(2,2),function(t,e,n){let i,r=t[2];if(!Array.isArray(r))throw new Error('the second argument for the "in" operator must be an array');if("string"==typeof r[0]){if("literal"!==r[0])throw new Error('for the "in" operator, a string array should be wrapped in a "literal" operator to disambiguate from expressions');if(!Array.isArray(r[1]))throw new Error('failed to parse "in" expression: the literal operator must be followed by an array');r=r[1],i=XP}else i=YP;const s=new Array(r.length);for(let a=0;a<s.length;a++)try{const t=hI(r[a],i,n);s[a]=t}catch(o){throw new Error(`failed to parse haystack item ${a} for "in" expression: ${o.message}`)}return[hI(t[1],i,n),...s]}),[KI]:dO(lO(1,1/0),hO(eI)),[YI]:dO(lO(1,1/0),hO(eI)),[XI]:dO(lO(1,1/0),hO(YP)),[JI]:dO(lO(1,4),hO(YP)),[tO]:dO(lO(1,3),hO(YP)),[eO]:dO(lO(2,2),function(t,e,n){let i;try{i=hI(t[1],YP,n)}catch(o){throw new Error(`failed to parse first argument in palette expression: ${o.message}`)}const r=t[2];if(!Array.isArray(r))throw new Error("the second argument of palette must be an array");const s=new Array(r.length);for(let a=0;a<s.length;a++){let t;try{t=hI(r[a],JP,n)}catch(o){throw new Error(`failed to parse color at index ${a} in palette expression: ${o.message}`)}if(!(t instanceof aI))throw new Error(`the palette color at index ${a} must be a literal value`);s[a]=t}return[i,...s]}),[nO]:dO(lO(1,1),hO(KP|YP|XP|JP))};function sO(t,e,n){const i=t.length-1,r=new Array(i);for(let s=0;s<i;++s){const e=t[s+1];switch(typeof e){case"number":r[s]=new aI(YP,e);break;case"string":r[s]=new aI(XP,e);break;default:throw new Error(`expected a string key or numeric array index for a get operation, got ${e}`)}0===s&&n.properties.add(String(e))}return r}function oO(t,e,n){n.mapState=!0}function aO(t){const e=t[0];if(1!==t.length)throw new Error(`expected no arguments for ${e} operation`);return[]}function lO(t,e){return function(n){const i=n[0],r=n.length-1;if(t===e){if(r!==t)throw new Error(`expected ${t} argument${1===t?"":"s"} for ${i}, got ${r}`)}else if(r<t||r>e)throw new Error(`expected ${e===1/0?`${t} or more`:`${t} to ${e}`} arguments for ${i}, got ${r}`)}}function cO(t,e,n){const i=t.length-1,r=new Array(i);for(let s=0;s<i;++s){const i=hI(t[s+1],e,n);r[s]=i}return r}function hO(t){return function(e,n,i){const r=e.length-1,s=new Array(r);for(let o=0;o<r;++o){const n=hI(e[o+1],t,i);s[o]=n}return s}}function uO(t){const e=t[0],n=t.length-1;if(n%2==1)throw new Error(`expected an even number of arguments for operation ${e}, got ${n} instead`)}function dO(...t){return function(e,n,i){const r=e[0];let s;for(let o=0;o<t.length;o++){const r=t[o](e,n,i);if(o==t.length-1){if(!r)throw new Error("expected last argument validator to return the parsed args");s=r}}return new lI(n,r,...s)}}function pO(t){if(!t)return"";const e=t.getType();switch(e){case"Point":case"LineString":case"Polygon":return e;case"MultiPoint":case"MultiLineString":case"MultiPolygon":return e.substring(5);case"Circle":return"Polygon";case"GeometryCollection":return pO(t.getGeometries()[0]);default:return""}}function fO(t,e,n){return gO(hI(t,e,n))}function gO(t){if(t instanceof aI){if(t.type===JP&&"string"==typeof t.value){const e=VP(t.value);return function(){return e}}return function(){return t.value}}const e=t.operator;switch(e){case KI:case YI:case WI:return function(t){const e=t.operator,n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=gO(t.args[r]);switch(e){case WI:return t=>{for(let e=0;e<n;++e){const n=i[e](t);if(null!=n)return n}throw new Error("Expected one of the values to be non-null")};case KI:case YI:return t=>{for(let r=0;r<n;++r){const n=i[r](t);if(typeof n===e)return n}throw new Error(`Expected one of the values to be a ${e}`)};default:throw new Error(`Unsupported assertion operator ${e}`)}}(t);case uI:case dI:case iO:return function(t){const e=t.args[0].value;switch(t.operator){case uI:return n=>{const i=t.args;let r=n.properties[e];for(let t=1,e=i.length;t<e;++t)r=r[i[t].value];return r};case dI:return t=>t.variables[e];case iO:return n=>{const i=t.args;if(!(e in n.properties))return!1;let r=n.properties[e];for(let t=1,e=i.length;t<e;++t){const e=i[t].value;if(!r||!Object.hasOwn(r,e))return!1;r=r[e]}return!0};default:throw new Error(`Unsupported accessor operator ${t.operator}`)}}(t);case"id":return t=>t.featureId;case fI:return t=>t.geometryType;case pI:{const e=t.args.map(t=>gO(t));return t=>"".concat(...e.map(e=>e(t).toString()))}case _I:return t=>t.resolution;case mI:case yI:case $I:case ZI:case"!":return function(t){const e=t.operator,n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=gO(t.args[r]);switch(e){case mI:return t=>{for(let e=0;e<n;++e)if(i[e](t))return!0;return!1};case yI:return t=>{for(let e=0;e<n;++e)if(!i[e](t))return!1;return!0};case $I:return t=>{const e=i[0](t),n=i[1](t),r=i[2](t);return e>=n&&e<=r};case ZI:return t=>{const e=i[0](t);for(let r=1;r<n;++r)if(e===i[r](t))return!0;return!1};case"!":return t=>!i[0](t);default:throw new Error(`Unsupported logical operator ${e}`)}}(t);case xI:case CI:case"<":case TI:case">":case kI:return function(t){const e=t.operator,n=gO(t.args[0]),i=gO(t.args[1]);switch(e){case xI:return t=>n(t)===i(t);case CI:return t=>n(t)!==i(t);case"<":return t=>n(t)<i(t);case TI:return t=>n(t)<=i(t);case">":return t=>n(t)>i(t);case kI:return t=>n(t)>=i(t);default:throw new Error(`Unsupported comparison operator ${e}`)}}(t);case"*":case"/":case"+":case"-":case II:case"%":case"^":case zI:case FI:case jI:case DI:case NI:case BI:case UI:case qI:return function(t){const e=t.operator,n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=gO(t.args[r]);switch(e){case"*":return t=>{let e=1;for(let r=0;r<n;++r)e*=i[r](t);return e};case"/":return t=>i[0](t)/i[1](t);case"+":return t=>{let e=0;for(let r=0;r<n;++r)e+=i[r](t);return e};case"-":return t=>i[0](t)-i[1](t);case II:return t=>{const e=i[0](t),n=i[1](t);if(e<n)return n;const r=i[2](t);return e>r?r:e};case"%":return t=>i[0](t)%i[1](t);case"^":return t=>Math.pow(i[0](t),i[1](t));case zI:return t=>Math.abs(i[0](t));case FI:return t=>Math.floor(i[0](t));case jI:return t=>Math.ceil(i[0](t));case DI:return t=>Math.round(i[0](t));case NI:return t=>Math.sin(i[0](t));case BI:return t=>Math.cos(i[0](t));case UI:return 2===n?t=>Math.atan2(i[0](t),i[1](t)):t=>Math.atan(i[0](t));case qI:return t=>Math.sqrt(i[0](t));default:throw new Error(`Unsupported numeric operator ${e}`)}}(t);case HI:return function(t){const e=t.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=gO(t.args[i]);return t=>{for(let i=0;i<e-1;i+=2)if(n[i](t))return n[i+1](t);return n[e-1](t)}}(t);case VI:return function(t){const e=t.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=gO(t.args[i]);return t=>{const i=n[0](t);for(let r=1;r<e-1;r+=2)if(i===n[r](t))return n[r+1](t);return n[e-1](t)}}(t);case GI:return function(t){const e=t.args.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=gO(t.args[i]);return t=>{const i=n[0](t),r=n[1](t);let s,o;for(let a=2;a<e;a+=2){const e=n[a](t);let l=n[a+1](t);const c=Array.isArray(l);if(c&&(l=jP(l)),e>=r)return 2===a?l:c?yO(i,r,s,o,e,l):mO(i,r,s,o,e,l);s=e,o=l}return o}}(t);case nO:return function(t){const e=t.operator,n=t.args.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=gO(t.args[r]);if(e===nO)return e=>{const n=i[0](e);return t.args[0].type===JP?GP(n):n.toString()};throw new Error(`Unsupported convert operator ${e}`)}(t);default:throw new Error(`Unsupported operator ${e}`)}}function mO(t,e,n,i,r,s){const o=r-n;if(0===o)return i;const a=e-n;return i+(1===t?a/o:(Math.pow(t,a)-1)/(Math.pow(t,o)-1))*(s-i)}function yO(t,e,n,i,r,s){if(0===r-n)return i;const o=qP(i),a=qP(s);let l=a[2]-o[2];return l>180?l-=360:l<-180&&(l+=360),function(t){const e=(t[0]+16)/116,n=t[1],i=t[2]*Math.PI/180,r=NP(e),s=NP(e+n/500*Math.cos(i)),o=NP(e-n/200*Math.sin(i)),a=DP(3.021973625*s-1.617392459*r-.404875592*o),l=DP(-.943766287*s+1.916279586*r+.027607165*o),c=DP(.069407491*s-.22898585*r+1.159737864*o);return[hE(a+.5|0,0,255),hE(l+.5|0,0,255),hE(c+.5|0,0,255),t[3]]}([mO(t,e,n,o[0],r,a[0]),mO(t,e,n,o[1],r,a[1]),o[2]+mO(t,e,n,0,r,l),mO(t,e,n,i[3],r,s[3])])}class vO extends Ek{constructor(t,e,n,i){super(),this.extent=t,this.pixelRatio_=n,this.resolution=e,this.state="function"==typeof i?0:i,this.image_=null,this.loader="function"==typeof i?i:null}changed(){this.dispatchEvent(rk)}getExtent(){return this.extent}getImage(){return this.image_}getPixelRatio(){return this.pixelRatio_}getResolution(){return this.resolution}getState(){return this.state}load(){if(0==this.state&&this.loader){this.state=1,this.changed();const t=this.getResolution(),e=Array.isArray(t)?t[0]:t;xk(()=>this.loader(this.getExtent(),e,this.getPixelRatio())).then(t=>{"image"in t&&(this.image_=t.image),"extent"in t&&(this.extent=t.extent),"resolution"in t&&(this.resolution=t.resolution),"pixelRatio"in t&&(this.pixelRatio_=t.pixelRatio),(t instanceof HTMLImageElement||Zk&&t instanceof ImageBitmap||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement)&&(this.image_=t),this.state=2}).catch(t=>{this.state=3,console.error(t)}).finally(()=>this.changed())}}setImage(t){this.image_=t}setResolution(t){this.resolution=t}}function _O(t,e,n){return e+":"+t+":"+(n?$P(n):"null")}const bO=new class{constructor(){this.cache_={},this.patternCache_={},this.cacheSize_=0,this.maxCacheSize_=1024}clear(){this.cache_={},this.patternCache_={},this.cacheSize_=0}canExpireCache(){return this.cacheSize_>this.maxCacheSize_}expire(){if(this.canExpireCache()){let t=0;for(const e in this.cache_){const n=this.cache_[e];3&t++||n.hasListener()||(delete this.cache_[e],delete this.patternCache_[e],--this.cacheSize_)}}}get(t,e,n){const i=_O(t,e,n);return i in this.cache_?this.cache_[i]:null}getPattern(t,e,n){const i=_O(t,e,n);return i in this.patternCache_?this.patternCache_[i]:null}set(t,e,n,i,r){const s=_O(t,e,n),o=s in this.cache_;this.cache_[s]=i,r&&(0===i.getImageState()&&i.load(),1===i.getImageState()?i.ready().then(()=>{this.patternCache_[s]=KM().createPattern(i.getImage(1),"repeat")}):this.patternCache_[s]=KM().createPattern(i.getImage(1),"repeat")),o||++this.cacheSize_}setSize(t){this.maxCacheSize_=t,this.expire()}};let wO=null;class xO extends Ek{constructor(t,e,n,i,r){super(),this.hitDetectionImage_=null,this.image_=t,this.crossOrigin_=n,this.canvas_={},this.color_=r,this.imageState_=void 0===i?0:i,this.size_=t&&t.width&&t.height?[t.width,t.height]:null,this.src_=e,this.tainted_,this.ready_=null}initializeImage_(){this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)}isTainted_(){if(void 0===this.tainted_&&2===this.imageState_){wO||(wO=HM(1,1,void 0,{willReadFrequently:!0})),wO.drawImage(this.image_,0,0);try{wO.getImageData(0,0,1,1),this.tainted_=!1}catch{wO=null,this.tainted_=!0}}return!0===this.tainted_}dispatchChangeEvent_(){this.dispatchEvent(rk)}handleImageError_(){this.imageState_=3,this.dispatchChangeEvent_()}handleImageLoad_(){this.imageState_=2,this.size_=[this.image_.width,this.image_.height],this.dispatchChangeEvent_()}getImage(t){return this.image_||this.initializeImage_(),this.replaceColor_(t),this.canvas_[t]?this.canvas_[t]:this.image_}getPixelRatio(t){return this.replaceColor_(t),this.canvas_[t]?t:1}getImageState(){return this.imageState_}getHitDetectionImage(){if(this.image_||this.initializeImage_(),!this.hitDetectionImage_)if(this.isTainted_()){const t=this.size_[0],e=this.size_[1],n=HM(t,e);n.fillRect(0,0,t,e),this.hitDetectionImage_=n.canvas}else this.hitDetectionImage_=this.image_;return this.hitDetectionImage_}getSize(){return this.size_}getSrc(){return this.src_}load(){if(0===this.imageState_){this.image_||this.initializeImage_(),this.imageState_=1;try{void 0!==this.src_&&(this.image_.src=this.src_)}catch{this.handleImageError_()}this.image_ instanceof HTMLImageElement&&(t=this.image_,e=this.src_,e&&(t.src=e),t.src&&Hk?new Promise((e,n)=>t.decode().then(()=>e(t)).catch(i=>t.complete&&t.width?e(t):n(i))):function(t){return new Promise((e,n)=>{function i(){s(),e(t)}function r(){s(),n(new Error("Image load error"))}function s(){t.removeEventListener("load",i),t.removeEventListener("error",r)}t.addEventListener("load",i),t.addEventListener("error",r)})}(t)).then(t=>{this.image_=t,this.handleImageLoad_()}).catch(this.handleImageError_.bind(this))}var t,e}replaceColor_(t){if(!this.color_||this.canvas_[t]||2!==this.imageState_)return;const e=this.image_,n=HM(Math.ceil(e.width*t),Math.ceil(e.height*t)),i=n.canvas;var r;n.scale(t,t),n.drawImage(e,0,0),n.globalCompositeOperation="multiply",n.fillStyle="string"==typeof(r=this.color_)?r:GP(r),n.fillRect(0,0,i.width/t,i.height/t),n.globalCompositeOperation="destination-in",n.drawImage(e,0,0),this.canvas_[t]=i}ready(){return this.ready_||(this.ready_=new Promise(t=>{if(2===this.imageState_||3===this.imageState_)t();else{const e=()=>{2!==this.imageState_&&3!==this.imageState_||(this.removeEventListener(rk,e),t())};this.addEventListener(rk,e)}})),this.ready_}}function CO(t,e,n,i,r,s){let o=void 0===e?void 0:bO.get(e,n,r);return o||(o=new xO(t,t&&"src"in t?t.src||void 0:e,n,i,r),bO.set(e,n,r,o,s)),s&&o&&!bO.getPattern(e,n,r)&&bO.set(e,n,r,o,s),o}function SO(t){return t?Array.isArray(t)?GP(t):"object"==typeof t&&"src"in t?function(t){if(!t.offset||!t.size)return bO.getPattern(t.src,"anonymous",t.color);const e=t.src+":"+t.offset,n=bO.getPattern(e,void 0,t.color);if(n)return n;const i=bO.get(t.src,"anonymous",null);if(2!==i.getImageState())return null;const r=HM(t.size[0],t.size[1]);return r.drawImage(i.getImage(1),t.offset[0],t.offset[1],t.size[0],t.size[1],0,0,t.size[0],t.size[1]),CO(r.canvas,e,void 0,2,t.color,!0),bO.getPattern(e,void 0,t.color)}(t):t:null}const kO="10px sans-serif",EO="#000",TO="round",LO=[],MO="round",RO="#000",PO="center",IO="middle",OO=[0,0,0,0],AO=new zk;let zO,FO=null;const jO={},DO=new Set(["serif","sans-serif","monospace","cursive","fantasy","system-ui","ui-serif","ui-sans-serif","ui-monospace","ui-rounded","emoji","math","fangsong"]);function NO(t,e,n){return`${t} ${e} 16px "${n}"`}const BO=function(){const t=100;let e,n;async function i(t){await n.ready;const e=await n.load(t);if(0===e.length)return!1;const i=WM(t),r=i.families[0].toLowerCase(),s=i.weight;return e.some(t=>{const e=t.family.replace(/^['"]|['"]$/g,"").toLowerCase(),n=GM[t.weight]||t.weight;return e===r&&t.style===i.style&&n==s})}async function r(){await n.ready;let s=!0;const o=AO.getProperties(),a=Object.keys(o).filter(e=>o[e]<t);for(let e=a.length-1;e>=0;--e){const n=a[e];let r=o[n];r<t&&(await i(n)?(Ck(jO),AO.set(n,t)):(r+=10,AO.set(n,r,!0),r<t&&(s=!1)))}e=void 0,s||(e=setTimeout(r,100))}return async function(t){n||(n=Wk?self.fonts:document.fonts);const i=WM(t);if(!i)return;const s=i.families;let o=!1;for(const e of s){if(DO.has(e))continue;const t=NO(i.style,i.weight,e);void 0===AO.get(t)&&(AO.set(t,0,!0),o=!0)}o&&(clearTimeout(e),e=setTimeout(r,100))}}(),UO=function(){let t;return function(e){let n=jO[e];if(null==n){if(Wk){const t=WM(e),i=qO(e,"Žg");n=(isNaN(Number(t.lineHeight))?1.2:Number(t.lineHeight))*(i.actualBoundingBoxAscent+i.actualBoundingBoxDescent)}else t||(t=document.createElement("div"),t.innerHTML="M",t.style.minHeight="0",t.style.maxHeight="none",t.style.height="auto",t.style.padding="0",t.style.border="none",t.style.position="absolute",t.style.display="block",t.style.left="-99999px"),t.style.font=e,document.body.appendChild(t),n=t.offsetHeight,document.body.removeChild(t);jO[e]=n}return n}}();function qO(t,e){return FO||(FO=HM(1,1)),t!=zO&&(FO.font=t,zO=FO.font),FO.measureText(e)}function VO(t,e){return qO(t,e).width}function $O(t,e,n){if(e in n)return n[e];const i=e.split("\n").reduce((e,n)=>Math.max(e,VO(t,n)),0);return n[e]=i,i}class GO{constructor(t){this.opacity_=t.opacity,this.rotateWithView_=t.rotateWithView,this.rotation_=t.rotation,this.scale_=t.scale,this.scaleArray_=HP(t.scale),this.displacement_=t.displacement,this.declutterMode_=t.declutterMode}clone(){const t=this.getScale();return new GO({opacity:this.getOpacity(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getOpacity(){return this.opacity_}getRotateWithView(){return this.rotateWithView_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getDisplacement(){return this.displacement_}getDeclutterMode(){return this.declutterMode_}getAnchor(){return Pk()}getImage(t){return Pk()}getHitDetectionImage(){return Pk()}getPixelRatio(t){return 1}getImageState(){return Pk()}getImageSize(){return Pk()}getOrigin(){return Pk()}getSize(){return Pk()}setDisplacement(t){this.displacement_=t}setOpacity(t){this.opacity_=t}setRotateWithView(t){this.rotateWithView_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=HP(t)}listenImageChange(t){Pk()}load(){Pk()}unlistenImageChange(t){Pk()}ready(){return Promise.resolve()}}class WO extends GO{constructor(t){super({opacity:1,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,rotation:void 0!==t.rotation?t.rotation:0,scale:void 0!==t.scale?t.scale:1,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode}),this.hitDetectionCanvas_=null,this.fill_=void 0!==t.fill?t.fill:null,this.origin_=[0,0],this.points_=t.points,this.radius=t.radius,this.radius2_=t.radius2,this.angle_=void 0!==t.angle?t.angle:0,this.stroke_=void 0!==t.stroke?t.stroke:null,this.size_,this.renderOptions_,this.imageState_=this.fill_&&this.fill_.loading()?1:2,1===this.imageState_&&this.ready().then(()=>this.imageState_=2),this.render()}clone(){const t=this.getScale(),e=new WO({fill:this.getFill()?this.getFill().clone():void 0,points:this.getPoints(),radius:this.getRadius(),radius2:this.getRadius2(),angle:this.getAngle(),stroke:this.getStroke()?this.getStroke().clone():void 0,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),scale:Array.isArray(t)?t.slice():t,displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}getAnchor(){const t=this.size_,e=this.getDisplacement(),n=this.getScaleArray();return[t[0]/2-e[0]/n[0],t[1]/2+e[1]/n[1]]}getAngle(){return this.angle_}getFill(){return this.fill_}setFill(t){this.fill_=t,this.render()}getHitDetectionImage(){return this.hitDetectionCanvas_||(this.hitDetectionCanvas_=this.createHitDetectionCanvas_(this.renderOptions_)),this.hitDetectionCanvas_}getImage(t){const e=this.fill_?.getKey(),n=`${t},${this.angle_},${this.radius},${this.radius2_},${this.points_},${e}`+Object.values(this.renderOptions_).join(",");let i=bO.get(n,null,null)?.getImage(1);if(!i){const e=this.renderOptions_,r=Math.ceil(e.size*t),s=HM(r,r);this.draw_(e,s,t),i=s.canvas,bO.set(n,null,null,new xO(i,void 0,null,2,null))}return i}getPixelRatio(t){return t}getImageSize(){return this.size_}getImageState(){return this.imageState_}getOrigin(){return this.origin_}getPoints(){return this.points_}getRadius(){return this.radius}getRadius2(){return this.radius2_}getSize(){return this.size_}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t,this.render()}listenImageChange(t){}load(){}unlistenImageChange(t){}calculateLineJoinSize_(t,e,n){if(0===e||this.points_===1/0||"bevel"!==t&&"miter"!==t)return e;let i=this.radius,r=void 0===this.radius2_?i:this.radius2_;if(i<r){const t=i;i=r,r=t}const s=void 0===this.radius2_?this.points_:2*this.points_,o=2*Math.PI/s,a=r*Math.sin(o),l=i-Math.sqrt(r*r-a*a),c=Math.sqrt(a*a+l*l),h=c/a;if("miter"===t&&h<=n)return h*e;const u=e/2/h,d=e/2*(l/c),p=Math.sqrt((i+u)*(i+u)+d*d)-i;if(void 0===this.radius2_||"bevel"===t)return 2*p;const f=i*Math.sin(o),g=r-Math.sqrt(i*i-f*f),m=Math.sqrt(f*f+g*g)/f;if(m<=n){const t=m*e/2-r-i;return 2*Math.max(p,t)}return 2*p}createRenderOptions(){let t,e=TO,n=MO,i=0,r=null,s=0,o=0;this.stroke_&&(t=SO(this.stroke_.getColor()??RO),o=this.stroke_.getWidth()??1,r=this.stroke_.getLineDash(),s=this.stroke_.getLineDashOffset()??0,n=this.stroke_.getLineJoin()??MO,e=this.stroke_.getLineCap()??TO,i=this.stroke_.getMiterLimit()??10);const a=this.calculateLineJoinSize_(n,o,i),l=Math.max(this.radius,this.radius2_||0);return{strokeStyle:t,strokeWidth:o,size:Math.ceil(2*l+a),lineCap:e,lineDash:r,lineDashOffset:s,lineJoin:n,miterLimit:i}}render(){this.renderOptions_=this.createRenderOptions();const t=this.renderOptions_.size;this.hitDetectionCanvas_=null,this.size_=[t,t]}draw_(t,e,n){if(e.scale(n,n),e.translate(t.size/2,t.size/2),this.createPath_(e),this.fill_){let t=this.fill_.getColor();null===t&&(t=EO),e.fillStyle=SO(t),e.fill()}t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineCap=t.lineCap,e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}createHitDetectionCanvas_(t){let e;if(this.fill_){let n=this.fill_.getColor(),i=0;"string"==typeof n&&(n=$P(n)),null===n?i=1:Array.isArray(n)&&(i=4===n.length?n[3]:1),0===i&&(e=HM(t.size,t.size),this.drawHitDetectionCanvas_(t,e))}return e?e.canvas:this.getImage(1)}createPath_(t){let e=this.points_;const n=this.radius;if(e===1/0)t.arc(0,0,n,0,2*Math.PI);else{const i=void 0===this.radius2_?n:this.radius2_;void 0!==this.radius2_&&(e*=2);const r=this.angle_-Math.PI/2,s=2*Math.PI/e;for(let o=0;o<e;o++){const e=r+o*s,a=o%2==0?n:i;t.lineTo(a*Math.cos(e),a*Math.sin(e))}t.closePath()}}drawHitDetectionCanvas_(t,e){e.translate(t.size/2,t.size/2),this.createPath_(e),e.fillStyle=EO,e.fill(),t.strokeStyle&&(e.strokeStyle=t.strokeStyle,e.lineWidth=t.strokeWidth,t.lineDash&&(e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset),e.lineJoin=t.lineJoin,e.miterLimit=t.miterLimit,e.stroke())}ready(){return this.fill_?this.fill_.ready():Promise.resolve()}}class HO extends WO{constructor(t){super({points:1/0,fill:(t=t||{radius:5}).fill,radius:t.radius,stroke:t.stroke,scale:void 0!==t.scale?t.scale:1,rotation:void 0!==t.rotation?t.rotation:0,rotateWithView:void 0!==t.rotateWithView&&t.rotateWithView,displacement:void 0!==t.displacement?t.displacement:[0,0],declutterMode:t.declutterMode})}clone(){const t=this.getScale(),e=new HO({fill:this.getFill()?this.getFill().clone():void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,radius:this.getRadius(),scale:Array.isArray(t)?t.slice():t,rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()});return e.setOpacity(this.getOpacity()),e}setRadius(t){this.radius=t,this.render()}}class ZO{constructor(t){t=t||{},this.patternImage_=null,this.color_=null,void 0!==t.color&&this.setColor(t.color)}clone(){const t=this.getColor();return new ZO({color:Array.isArray(t)?t.slice():t||void 0})}getColor(){return this.color_}setColor(t){if(null!==t&&"object"==typeof t&&"src"in t){const e=CO(null,t.src,"anonymous",void 0,t.offset?null:t.color?t.color:null,!(t.offset&&t.size));e.ready().then(()=>{this.patternImage_=null}),0===e.getImageState()&&e.load(),1===e.getImageState()&&(this.patternImage_=e)}this.color_=t}getKey(){const t=this.getColor();return t?t instanceof CanvasPattern||t instanceof CanvasGradient?Ok(t):"object"==typeof t&&"src"in t?t.src+":"+t.offset:$P(t).toString():""}loading(){return!!this.patternImage_}ready(){return this.patternImage_?this.patternImage_.ready():Promise.resolve()}}function KO(t,e,n,i){return void 0!==n&&void 0!==i?[n/t,i/e]:void 0!==n?n/t:void 0!==i?i/e:1}class YO extends GO{constructor(t){const e=void 0!==(t=t||{}).opacity?t.opacity:1,n=void 0!==t.rotation?t.rotation:0,i=void 0!==t.scale?t.scale:1,r=void 0!==t.rotateWithView&&t.rotateWithView;super({opacity:e,rotation:n,scale:i,displacement:void 0!==t.displacement?t.displacement:[0,0],rotateWithView:r,declutterMode:t.declutterMode}),this.anchor_=void 0!==t.anchor?t.anchor:[.5,.5],this.normalizedAnchor_=null,this.anchorOrigin_=void 0!==t.anchorOrigin?t.anchorOrigin:"top-left",this.anchorXUnits_=void 0!==t.anchorXUnits?t.anchorXUnits:"fraction",this.anchorYUnits_=void 0!==t.anchorYUnits?t.anchorYUnits:"fraction",this.crossOrigin_=void 0!==t.crossOrigin?t.crossOrigin:null;const s=void 0!==t.img?t.img:null;let o,a=t.src;if(sE(!(void 0!==a&&s),"`image` and `src` cannot be provided at the same time"),void 0!==a&&0!==a.length||!s||(a=s.src||Ok(s)),sE(void 0!==a&&a.length>0,"A defined and non-empty `src` or `image` must be provided"),sE(!((void 0!==t.width||void 0!==t.height)&&void 0!==t.scale),"`width` or `height` cannot be provided together with `scale`"),void 0!==t.src?o=0:void 0!==s&&(o="complete"in s?s.complete?s.src?2:0:1:2),this.color_=void 0!==t.color?$P(t.color):null,this.iconImage_=CO(s,a,this.crossOrigin_,o,this.color_),this.offset_=void 0!==t.offset?t.offset:[0,0],this.offsetOrigin_=void 0!==t.offsetOrigin?t.offsetOrigin:"top-left",this.origin_=null,this.size_=void 0!==t.size?t.size:null,this.initialOptions_,void 0!==t.width||void 0!==t.height){let e,n;if(t.size)[e,n]=t.size;else{const i=this.getImage(1);if(i.width&&i.height)e=i.width,n=i.height;else if(i instanceof HTMLImageElement){this.initialOptions_=t;const e=()=>{if(this.unlistenImageChange(e),!this.initialOptions_)return;const n=this.iconImage_.getSize();this.setScale(KO(n[0],n[1],t.width,t.height))};return void this.listenImageChange(e)}}void 0!==e&&this.setScale(KO(e,n,t.width,t.height))}}clone(){let t,e,n;return this.initialOptions_?(e=this.initialOptions_.width,n=this.initialOptions_.height):(t=this.getScale(),t=Array.isArray(t)?t.slice():t),new YO({anchor:this.anchor_.slice(),anchorOrigin:this.anchorOrigin_,anchorXUnits:this.anchorXUnits_,anchorYUnits:this.anchorYUnits_,color:this.color_&&this.color_.slice?this.color_.slice():this.color_||void 0,crossOrigin:this.crossOrigin_,offset:this.offset_.slice(),offsetOrigin:this.offsetOrigin_,opacity:this.getOpacity(),rotateWithView:this.getRotateWithView(),rotation:this.getRotation(),scale:t,width:e,height:n,size:null!==this.size_?this.size_.slice():void 0,src:this.getSrc(),displacement:this.getDisplacement().slice(),declutterMode:this.getDeclutterMode()})}getAnchor(){let t=this.normalizedAnchor_;if(!t){t=this.anchor_;const e=this.getSize();if("fraction"==this.anchorXUnits_||"fraction"==this.anchorYUnits_){if(!e)return null;t=this.anchor_.slice(),"fraction"==this.anchorXUnits_&&(t[0]*=e[0]),"fraction"==this.anchorYUnits_&&(t[1]*=e[1])}if("top-left"!=this.anchorOrigin_){if(!e)return null;t===this.anchor_&&(t=this.anchor_.slice()),"top-right"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[0]=-t[0]+e[0]),"bottom-left"!=this.anchorOrigin_&&"bottom-right"!=this.anchorOrigin_||(t[1]=-t[1]+e[1])}this.normalizedAnchor_=t}const e=this.getDisplacement(),n=this.getScaleArray();return[t[0]-e[0]/n[0],t[1]+e[1]/n[1]]}setAnchor(t){this.anchor_=t,this.normalizedAnchor_=null}getColor(){return this.color_}getImage(t){return this.iconImage_.getImage(t)}getPixelRatio(t){return this.iconImage_.getPixelRatio(t)}getImageSize(){return this.iconImage_.getSize()}getImageState(){return this.iconImage_.getImageState()}getHitDetectionImage(){return this.iconImage_.getHitDetectionImage()}getOrigin(){if(this.origin_)return this.origin_;let t=this.offset_;if("top-left"!=this.offsetOrigin_){const e=this.getSize(),n=this.iconImage_.getSize();if(!e||!n)return null;t=t.slice(),"top-right"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[0]=n[0]-e[0]-t[0]),"bottom-left"!=this.offsetOrigin_&&"bottom-right"!=this.offsetOrigin_||(t[1]=n[1]-e[1]-t[1])}return this.origin_=t,this.origin_}getSrc(){return this.iconImage_.getSrc()}setSrc(t){this.iconImage_=CO(null,t,this.crossOrigin_,0,this.color_)}getSize(){return this.size_?this.size_:this.iconImage_.getSize()}getWidth(){const t=this.getScaleArray();return this.size_?this.size_[0]*t[0]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[0]*t[0]:void 0}getHeight(){const t=this.getScaleArray();return this.size_?this.size_[1]*t[1]:2==this.iconImage_.getImageState()?this.iconImage_.getSize()[1]*t[1]:void 0}setScale(t){delete this.initialOptions_,super.setScale(t)}listenImageChange(t){this.iconImage_.addEventListener(rk,t)}load(){this.iconImage_.load()}unlistenImageChange(t){this.iconImage_.removeEventListener(rk,t)}ready(){return this.iconImage_.ready()}}class XO{constructor(t){t=t||{},this.color_=void 0!==t.color?t.color:null,this.lineCap_=t.lineCap,this.lineDash_=void 0!==t.lineDash?t.lineDash:null,this.lineDashOffset_=t.lineDashOffset,this.lineJoin_=t.lineJoin,this.miterLimit_=t.miterLimit,this.width_=t.width}clone(){const t=this.getColor();return new XO({color:Array.isArray(t)?t.slice():t||void 0,lineCap:this.getLineCap(),lineDash:this.getLineDash()?this.getLineDash().slice():void 0,lineDashOffset:this.getLineDashOffset(),lineJoin:this.getLineJoin(),miterLimit:this.getMiterLimit(),width:this.getWidth()})}getColor(){return this.color_}getLineCap(){return this.lineCap_}getLineDash(){return this.lineDash_}getLineDashOffset(){return this.lineDashOffset_}getLineJoin(){return this.lineJoin_}getMiterLimit(){return this.miterLimit_}getWidth(){return this.width_}setColor(t){this.color_=t}setLineCap(t){this.lineCap_=t}setLineDash(t){this.lineDash_=t}setLineDashOffset(t){this.lineDashOffset_=t}setLineJoin(t){this.lineJoin_=t}setMiterLimit(t){this.miterLimit_=t}setWidth(t){this.width_=t}}class JO{constructor(t){t=t||{},this.geometry_=null,this.geometryFunction_=eA,void 0!==t.geometry&&this.setGeometry(t.geometry),this.fill_=void 0!==t.fill?t.fill:null,this.image_=void 0!==t.image?t.image:null,this.renderer_=void 0!==t.renderer?t.renderer:null,this.hitDetectionRenderer_=void 0!==t.hitDetectionRenderer?t.hitDetectionRenderer:null,this.stroke_=void 0!==t.stroke?t.stroke:null,this.text_=void 0!==t.text?t.text:null,this.zIndex_=t.zIndex}clone(){let t=this.getGeometry();return t&&"object"==typeof t&&(t=t.clone()),new JO({geometry:t??void 0,fill:this.getFill()?this.getFill().clone():void 0,image:this.getImage()?this.getImage().clone():void 0,renderer:this.getRenderer()??void 0,stroke:this.getStroke()?this.getStroke().clone():void 0,text:this.getText()?this.getText().clone():void 0,zIndex:this.getZIndex()})}getRenderer(){return this.renderer_}setRenderer(t){this.renderer_=t}setHitDetectionRenderer(t){this.hitDetectionRenderer_=t}getHitDetectionRenderer(){return this.hitDetectionRenderer_}getGeometry(){return this.geometry_}getGeometryFunction(){return this.geometryFunction_}getFill(){return this.fill_}setFill(t){this.fill_=t}getImage(){return this.image_}setImage(t){this.image_=t}getStroke(){return this.stroke_}setStroke(t){this.stroke_=t}getText(){return this.text_}setText(t){this.text_=t}getZIndex(){return this.zIndex_}setGeometry(t){"function"==typeof t?this.geometryFunction_=t:"string"==typeof t?this.geometryFunction_=function(e){return e.get(t)}:t?void 0!==t&&(this.geometryFunction_=function(){return t}):this.geometryFunction_=eA,this.geometry_=t}setZIndex(t){this.zIndex_=t}}let QO=null;function tA(){if(!QO){const t=new ZO({color:"rgba(255,255,255,0.4)"}),e=new XO({color:"#3399CC",width:1.25});QO=[new JO({image:new HO({fill:t,stroke:e,radius:5}),fill:t,stroke:e})]}return QO}function eA(t){return t.getGeometry()}let nA=class t{constructor(t){t=t||{},this.font_=t.font,this.rotation_=t.rotation,this.rotateWithView_=t.rotateWithView,this.keepUpright_=t.keepUpright,this.scale_=t.scale,this.scaleArray_=HP(void 0!==t.scale?t.scale:1),this.text_=t.text,this.textAlign_=t.textAlign,this.justify_=t.justify,this.repeat_=t.repeat,this.textBaseline_=t.textBaseline,this.fill_=void 0!==t.fill?t.fill:new ZO({color:"#333"}),this.maxAngle_=void 0!==t.maxAngle?t.maxAngle:Math.PI/4,this.placement_=void 0!==t.placement?t.placement:"point",this.overflow_=!!t.overflow,this.stroke_=void 0!==t.stroke?t.stroke:null,this.offsetX_=void 0!==t.offsetX?t.offsetX:0,this.offsetY_=void 0!==t.offsetY?t.offsetY:0,this.backgroundFill_=t.backgroundFill?t.backgroundFill:null,this.backgroundStroke_=t.backgroundStroke?t.backgroundStroke:null,this.padding_=void 0===t.padding?null:t.padding,this.declutterMode_=t.declutterMode}clone(){const e=this.getScale();return new t({font:this.getFont(),placement:this.getPlacement(),repeat:this.getRepeat(),maxAngle:this.getMaxAngle(),overflow:this.getOverflow(),rotation:this.getRotation(),rotateWithView:this.getRotateWithView(),keepUpright:this.getKeepUpright(),scale:Array.isArray(e)?e.slice():e,text:this.getText(),textAlign:this.getTextAlign(),justify:this.getJustify(),textBaseline:this.getTextBaseline(),fill:this.getFill()instanceof ZO?this.getFill().clone():this.getFill(),stroke:this.getStroke()?this.getStroke().clone():void 0,offsetX:this.getOffsetX(),offsetY:this.getOffsetY(),backgroundFill:this.getBackgroundFill()?this.getBackgroundFill().clone():void 0,backgroundStroke:this.getBackgroundStroke()?this.getBackgroundStroke().clone():void 0,padding:this.getPadding()||void 0,declutterMode:this.getDeclutterMode()})}getOverflow(){return this.overflow_}getFont(){return this.font_}getMaxAngle(){return this.maxAngle_}getPlacement(){return this.placement_}getRepeat(){return this.repeat_}getOffsetX(){return this.offsetX_}getOffsetY(){return this.offsetY_}getFill(){return this.fill_}getRotateWithView(){return this.rotateWithView_}getKeepUpright(){return this.keepUpright_}getRotation(){return this.rotation_}getScale(){return this.scale_}getScaleArray(){return this.scaleArray_}getStroke(){return this.stroke_}getText(){return this.text_}getTextAlign(){return this.textAlign_}getJustify(){return this.justify_}getTextBaseline(){return this.textBaseline_}getBackgroundFill(){return this.backgroundFill_}getBackgroundStroke(){return this.backgroundStroke_}getPadding(){return this.padding_}getDeclutterMode(){return this.declutterMode_}setOverflow(t){this.overflow_=t}setFont(t){this.font_=t}setMaxAngle(t){this.maxAngle_=t}setOffsetX(t){this.offsetX_=t}setOffsetY(t){this.offsetY_=t}setPlacement(t){this.placement_=t}setRepeat(t){this.repeat_=t}setRotateWithView(t){this.rotateWithView_=t}setKeepUpright(t){this.keepUpright_=t}setFill(t){this.fill_=t}setRotation(t){this.rotation_=t}setScale(t){this.scale_=t,this.scaleArray_=HP(void 0!==t?t:1)}setStroke(t){this.stroke_=t}setText(t){this.text_=t}setTextAlign(t){this.textAlign_=t}setJustify(t){this.justify_=t}setTextBaseline(t){this.textBaseline_=t}setBackgroundFill(t){this.backgroundFill_=t}setBackgroundStroke(t){this.backgroundStroke_=t}setPadding(t){this.padding_=t}};function iA(){return!0}function rA(t){const e=cI(),n=function(t,e){const n=t.length,i=new Array(n);for(let r=0;r<n;++r){const n=t[r],s="filter"in n?fO(n.filter,KP,e):iA;let o;if(Array.isArray(n.style)){const t=n.style.length;o=new Array(t);for(let i=0;i<t;++i)o[i]=oA(n.style[i],e)}else o=[oA(n.style,e)];i[r]={filter:s,styles:o}}return function(e){const r=[];let s=!1;for(let o=0;o<n;++o)if((0,i[o].filter)(e)&&(!t[o].else||!s)){s=!0;for(const t of i[o].styles){const n=t(e);n&&r.push(n)}}return r}}(t,e),i={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""};return function(t,r){if(i.properties=t.getPropertiesInternal(),i.resolution=r,e.featureId){const e=t.getId();i.featureId=void 0!==e?e:null}return e.geometryType&&(i.geometryType=pO(t.getGeometry())),n(i)}}function sA(t){const e=cI(),n=t.length,i=new Array(n);for(let o=0;o<n;++o)i[o]=oA(t[o],e);const r={variables:{},properties:{},resolution:NaN,featureId:null,geometryType:""},s=new Array(n);return function(t,o){if(r.properties=t.getPropertiesInternal(),r.resolution=o,e.featureId){const e=t.getId();r.featureId=void 0!==e?e:null}let a=0;for(let e=0;e<n;++e){const t=i[e](r);t&&(s[a]=t,a+=1)}return s.length=a,s}}function oA(t,e){const n=aA(t,"",e),i=lA(t,"",e),r=function(t,e){const n="text-",i=hA(t,n+"value",e);if(!i)return null;const r=aA(t,n,e),s=aA(t,n+"background-",e),o=lA(t,n,e),a=lA(t,n+"background-",e),l=hA(t,n+"font",e),c=cA(t,n+"max-angle",e),h=cA(t,n+"offset-x",e),u=cA(t,n+"offset-y",e),d=uA(t,n+"overflow",e),p=hA(t,n+"placement",e),f=cA(t,n+"repeat",e),g=mA(t,n+"scale",e),m=uA(t,n+"rotate-with-view",e),y=cA(t,n+"rotation",e),v=hA(t,n+"align",e),_=hA(t,n+"justify",e),b=hA(t,n+"baseline",e),w=uA(t,n+"keep-upright",e),x=pA(t,n+"padding",e),C=bA(t,n+"declutter-mode"),S=new nA({declutterMode:C});return function(t){if(S.setText(i(t)),r&&S.setFill(r(t)),s&&S.setBackgroundFill(s(t)),o&&S.setStroke(o(t)),a&&S.setBackgroundStroke(a(t)),l&&S.setFont(l(t)),c&&S.setMaxAngle(c(t)),h&&S.setOffsetX(h(t)),u&&S.setOffsetY(u(t)),d&&S.setOverflow(d(t)),p){const e=p(t);if("point"!==e&&"line"!==e)throw new Error("Expected point or line for text-placement");S.setPlacement(e)}if(f&&S.setRepeat(f(t)),g&&S.setScale(g(t)),m&&S.setRotateWithView(m(t)),y&&S.setRotation(y(t)),v){const e=v(t);if("left"!==e&&"center"!==e&&"right"!==e&&"end"!==e&&"start"!==e)throw new Error("Expected left, right, center, start, or end for text-align");S.setTextAlign(e)}if(_){const e=_(t);if("left"!==e&&"right"!==e&&"center"!==e)throw new Error("Expected left, right, or center for text-justify");S.setJustify(e)}if(b){const e=b(t);if("bottom"!==e&&"top"!==e&&"middle"!==e&&"alphabetic"!==e&&"hanging"!==e)throw new Error("Expected bottom, top, middle, alphabetic, or hanging for text-baseline");S.setTextBaseline(e)}return x&&S.setPadding(x(t)),w&&S.setKeepUpright(w(t)),S}}(t,e),s=function(t,e){return"icon-src"in t?function(t,e){const n="icon-",i=n+"src",r=xA(t[i],i),s=fA(t,n+"anchor",e),o=mA(t,n+"scale",e),a=cA(t,n+"opacity",e),l=fA(t,n+"displacement",e),c=cA(t,n+"rotation",e),h=uA(t,n+"rotate-with-view",e),u=vA(t,n+"anchor-origin"),d=_A(t,n+"anchor-x-units"),p=_A(t,n+"anchor-y-units"),f=function(t,e){const n=t[e];if(void 0!==n)return SA(n,e)}(t,n+"color"),g=function(t,e){const n=t[e];if(void 0!==n){if("string"!=typeof n)throw new Error(`Expected a string for ${e}`);return n}}(t,n+"cross-origin"),m=function(t,e){const n=t[e];if(void 0!==n)return wA(n,e)}(t,n+"offset"),y=vA(t,n+"offset-origin"),v=yA(t,n+"width"),_=yA(t,n+"height"),b=function(t,e){const n=t[e];if(void 0!==n){if("number"==typeof n)return HP(n);if(!Array.isArray(n))throw new Error(`Expected a number or size array for ${e}`);if(2!==n.length||"number"!=typeof n[0]||"number"!=typeof n[1])throw new Error(`Expected a number or size array for ${e}`);return n}}(t,n+"size"),w=bA(t,n+"declutter-mode"),x=new YO({src:r,anchorOrigin:u,anchorXUnits:d,anchorYUnits:p,color:f,crossOrigin:g,offset:m,offsetOrigin:y,height:_,width:v,size:b,declutterMode:w});return function(t){return a&&x.setOpacity(a(t)),l&&x.setDisplacement(l(t)),c&&x.setRotation(c(t)),h&&x.setRotateWithView(h(t)),o&&x.setScale(o(t)),s&&x.setAnchor(s(t)),x}}(t,e):"shape-points"in t?function(t,e){const n="shape-",i=n+"points",r=n+"radius",s=CA(t[i],i),o=CA(t[r],r),a=aA(t,n,e),l=lA(t,n,e),c=mA(t,n+"scale",e),h=fA(t,n+"displacement",e),u=cA(t,n+"rotation",e),d=uA(t,n+"rotate-with-view",e),p=yA(t,n+"radius2"),f=yA(t,n+"angle"),g=bA(t,n+"declutter-mode"),m=new WO({points:s,radius:o,radius2:p,angle:f,declutterMode:g});return function(t){return a&&m.setFill(a(t)),l&&m.setStroke(l(t)),h&&m.setDisplacement(h(t)),u&&m.setRotation(u(t)),d&&m.setRotateWithView(d(t)),c&&m.setScale(c(t)),m}}(t,e):"circle-radius"in t?function(t,e){const n="circle-",i=aA(t,n,e),r=lA(t,n,e),s=cA(t,n+"radius",e),o=mA(t,n+"scale",e),a=fA(t,n+"displacement",e),l=cA(t,n+"rotation",e),c=uA(t,n+"rotate-with-view",e),h=bA(t,n+"declutter-mode"),u=new HO({radius:5,declutterMode:h});return function(t){return s&&u.setRadius(s(t)),i&&u.setFill(i(t)),r&&u.setStroke(r(t)),a&&u.setDisplacement(a(t)),l&&u.setRotation(l(t)),c&&u.setRotateWithView(c(t)),o&&u.setScale(o(t)),u}}(t,e):null}(t,e),o=cA(t,"z-index",e);if(!(n||i||r||s||Sk(t)))throw new Error("No fill, stroke, point, or text symbolizer properties in style: "+JSON.stringify(t));const a=new JO;return function(t){let e=!0;if(n){const i=n(t);i&&(e=!1),a.setFill(i)}if(i){const n=i(t);n&&(e=!1),a.setStroke(n)}if(r){const n=r(t);n&&(e=!1),a.setText(n)}if(s){const n=s(t);n&&(e=!1),a.setImage(n)}return o&&a.setZIndex(o(t)),e?null:a}}function aA(t,e,n){let i;if(e+"fill-pattern-src"in t)i=function(t,e,n){const i=hA(t,e+"pattern-src",n),r=gA(t,e+"pattern-offset",n),s=gA(t,e+"pattern-size",n),o=dA(t,e+"color",n);return function(t){return{src:i(t),offset:r&&r(t),size:s&&s(t),color:o&&o(t)}}}(t,e+"fill-",n);else{if("none"===t[e+"fill-color"])return()=>null;i=dA(t,e+"fill-color",n)}if(!i)return null;const r=new ZO;return function(t){const e=i(t);return e===EP?null:(r.setColor(e),r)}}function lA(t,e,n){const i=cA(t,e+"stroke-width",n),r=dA(t,e+"stroke-color",n);if(!i&&!r)return null;const s=hA(t,e+"stroke-line-cap",n),o=hA(t,e+"stroke-line-join",n),a=pA(t,e+"stroke-line-dash",n),l=cA(t,e+"stroke-line-dash-offset",n),c=cA(t,e+"stroke-miter-limit",n),h=new XO;return function(t){if(r){const e=r(t);if(e===EP)return null;h.setColor(e)}if(i&&h.setWidth(i(t)),s){const e=s(t);if("butt"!==e&&"round"!==e&&"square"!==e)throw new Error("Expected butt, round, or square line cap");h.setLineCap(e)}if(o){const e=o(t);if("bevel"!==e&&"round"!==e&&"miter"!==e)throw new Error("Expected bevel, round, or miter line join");h.setLineJoin(e)}return a&&h.setLineDash(a(t)),l&&h.setLineDashOffset(l(t)),c&&h.setMiterLimit(c(t)),h}}function cA(t,e,n){if(!(e in t))return;const i=fO(t[e],YP,n);return function(t){return CA(i(t),e)}}function hA(t,e,n){if(!(e in t))return null;const i=fO(t[e],XP,n);return function(t){return xA(i(t),e)}}function uA(t,e,n){if(!(e in t))return null;const i=fO(t[e],KP,n);return function(t){const n=i(t);if("boolean"!=typeof n)throw new Error(`Expected a boolean for ${e}`);return n}}function dA(t,e,n){if(!(e in t))return null;const i=fO(t[e],JP,n);return function(t){return SA(i(t),e)}}function pA(t,e,n){if(!(e in t))return null;const i=fO(t[e],QP,n);return function(t){return wA(i(t),e)}}function fA(t,e,n){if(!(e in t))return null;const i=fO(t[e],QP,n);return function(t){const n=wA(i(t),e);if(2!==n.length)throw new Error(`Expected two numbers for ${e}`);return n}}function gA(t,e,n){if(!(e in t))return null;const i=fO(t[e],QP,n);return function(t){return kA(i(t),e)}}function mA(t,e,n){if(!(e in t))return null;const i=fO(t[e],QP|YP,n);return function(t){return function(t,e){return"number"==typeof t?t:kA(t,e)}(i(t),e)}}function yA(t,e){const n=t[e];if(void 0!==n){if("number"!=typeof n)throw new Error(`Expected a number for ${e}`);return n}}function vA(t,e){const n=t[e];if(void 0!==n){if("bottom-left"!==n&&"bottom-right"!==n&&"top-left"!==n&&"top-right"!==n)throw new Error(`Expected bottom-left, bottom-right, top-left, or top-right for ${e}`);return n}}function _A(t,e){const n=t[e];if(void 0!==n){if("pixels"!==n&&"fraction"!==n)throw new Error(`Expected pixels or fraction for ${e}`);return n}}function bA(t,e){const n=t[e];if(void 0!==n){if("string"!=typeof n)throw new Error(`Expected a string for ${e}`);if("declutter"!==n&&"obstacle"!==n&&"none"!==n)throw new Error(`Expected declutter, obstacle, or none for ${e}`);return n}}function wA(t,e){if(!Array.isArray(t))throw new Error(`Expected an array for ${e}`);const n=t.length;for(let i=0;i<n;++i)if("number"!=typeof t[i])throw new Error(`Expected an array of numbers for ${e}`);return t}function xA(t,e){if("string"!=typeof t)throw new Error(`Expected a string for ${e}`);return t}function CA(t,e){if("number"!=typeof t)throw new Error(`Expected a number for ${e}`);return t}function SA(t,e){if("string"==typeof t)return t;const n=wA(t,e),i=n.length;if(i<3||i>4)throw new Error(`Expected a color with 3 or 4 values for ${e}`);return n}function kA(t,e){const n=wA(t,e);if(2!==n.length)throw new Error(`Expected an array of two numbers for ${e}`);return n}const EA="renderOrder";class TA extends oP{constructor(t){t=t||{};const e=Object.assign({},t);delete e.style,delete e.renderBuffer,delete e.updateWhileAnimating,delete e.updateWhileInteracting,super(e),this.declutter_=t.declutter?String(t.declutter):void 0,this.renderBuffer_=void 0!==t.renderBuffer?t.renderBuffer:100,this.style_=null,this.styleFunction_=void 0,this.setStyle(t.style),this.updateWhileAnimating_=void 0!==t.updateWhileAnimating&&t.updateWhileAnimating,this.updateWhileInteracting_=void 0!==t.updateWhileInteracting&&t.updateWhileInteracting}getDeclutter(){return this.declutter_}getFeatures(t){return super.getFeatures(t)}getRenderBuffer(){return this.renderBuffer_}getRenderOrder(){return this.get(EA)}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}getUpdateWhileAnimating(){return this.updateWhileAnimating_}getUpdateWhileInteracting(){return this.updateWhileInteracting_}renderDeclutter(t,e){const n=this.getDeclutter();n in t.declutter==0&&(t.declutter[n]=new uP(9)),this.getRenderer().renderDeclutter(t,e)}setRenderOrder(t){this.set(EA,t)}setStyle(t){this.style_=void 0===t?tA:t;const e=function(t){if(void 0===t)return tA;if(!t)return null;if("function"==typeof t)return t;if(t instanceof JO)return t;if(!Array.isArray(t))return sA([t]);if(0===t.length)return[];const e=t.length,n=t[0];if(n instanceof JO){const n=new Array(e);for(let i=0;i<e;++i){const e=t[i];if(!(e instanceof JO))throw new Error("Expected a list of style instances");n[i]=e}return n}if("style"in n){const n=new Array(e);for(let i=0;i<e;++i){const e=t[i];if(!("style"in e))throw new Error("Expected a list of rules with a style property");n[i]=e}return rA(n)}return sA(t)}(t);this.styleFunction_=null===t?void 0:function(t){let e;if("function"==typeof t)e=t;else{let n;Array.isArray(t)?n=t:(sE("function"==typeof t.getZIndex,"Expected an `Style` or an array of `Style`"),n=[t]),e=function(){return n}}return e}(e),this.changed()}setDeclutter(t){this.declutter_=t?String(t):void 0,this.changed()}}class LA extends kk{constructor(t,e,n,i){super(t),this.inversePixelTransform=e,this.frameState=n,this.context=i}}class MA extends uk{constructor(t){super(),this.map_=t}dispatchRenderEvent(t,e){Pk()}calculateMatrices2D(t){const e=t.viewState,n=t.coordinateToPixelTransform,i=t.pixelToCoordinateTransform;AL(n,t.size[0]/2,t.size[1]/2,1/e.resolution,-1/e.resolution,-e.rotation,-e.center[0],-e.center[1]),zL(i,n)}forEachFeatureAtCoordinate(t,e,n,i,r,s,o,a){let l;const c=e.viewState;function h(t,e,n,i){return r.call(s,e,t?n:null,i)}const u=c.projection,d=oT(t.slice(),u),p=[[0,0]];if(u.canWrapX()&&i){const t=JE(u.getExtent());p.push([-t,0],[t,0])}const f=e.layerStatesArray,g=f.length,m=[],y=[];for(let _=0;_<p.length;_++)for(let i=g-1;i>=0;--i){const r=f[i],s=r.layer;if(s.hasRenderer()&&aP(r,c)&&o.call(a,s)){const i=s.getRenderer(),o=s.getSource();if(i&&o){const s=o.getWrapX()?d:t,a=h.bind(null,r.managed);y[0]=s[0]+p[_][0],y[1]=s[1]+p[_][1],l=i.forEachFeatureAtCoordinate(y,e,n,a,m)}if(l)return l}}if(0===m.length)return;const v=1/m.length;return m.forEach((t,e)=>t.distanceSq+=e*v),m.sort((t,e)=>t.distanceSq-e.distanceSq),m.some(t=>l=t.callback(t.feature,t.layer,t.geometry)),l}hasFeatureAtCoordinate(t,e,n,i,r,s){return void 0!==this.forEachFeatureAtCoordinate(t,e,n,i,vk,this,r,s)}getMap(){return this.map_}renderFrame(t){Pk()}scheduleExpireIconCache(t){bO.canExpireCache()&&t.postRenderFunctions.push(RA)}}function RA(){bO.expire()}class PA extends MA{constructor(t){super(t),this.fontChangeListenerKey_=Tk(AO,ik,t.redrawText,t),this.element_=Wk?eR():document.createElement("div");const e=this.element_.style;e.position="absolute",e.width="100%",e.height="100%",e.zIndex="0",this.element_.className=BM+" ol-layers";const n=t.getViewport();n&&n.insertBefore(this.element_,n.firstChild||null),this.children_=[],this.renderedVisible_=!0}dispatchRenderEvent(t,e){const n=this.getMap();if(n.hasListener(t)){const i=new LA(t,void 0,e);n.dispatchEvent(i)}}disposeInternal(){Mk(this.fontChangeListenerKey_),this.element_.remove(),super.disposeInternal()}renderFrame(t){if(!t)return void(this.renderedVisible_&&(this.element_.style.display="none",this.renderedVisible_=!1));this.calculateMatrices2D(t),this.dispatchRenderEvent(rP,t);const e=t.layerStatesArray.sort((t,e)=>t.zIndex-e.zIndex);e.some(t=>t.layer instanceof TA&&t.layer.getDeclutter())&&(t.declutter={});const n=t.viewState;this.children_.length=0;const i=[];let r=null;for(let o=0,a=e.length;o<a;++o){const s=e[o];t.layerIndex=o;const a=s.layer,l=a.getSourceState();if(!aP(s,n)||"ready"!=l&&"undefined"!=l){a.unrender();continue}const c=a.render(t,r);c&&(c!==r&&(this.children_.push(c),r=c),i.push(s))}this.declutter(t,i),function(t,e){const n=t.childNodes;for(let i=0;;++i){const r=n[i],s=e[i];if(!r&&!s)break;r!==s&&(r?s?t.insertBefore(s,r):(t.removeChild(r),--i):t.appendChild(s))}}(this.element_,this.children_);const s=this.getMap().getTargetElement();if(nR(s)){const t=s.getContext("2d");for(const e of this.children_){const n=e.firstElementChild||e,i=e.style.backgroundColor;if(i&&(!nR(n)||n.width>0)&&(t.fillStyle=i,t.fillRect(0,0,s.width,s.height)),nR(n)&&n.width>0){const i=e.style.opacity||n.style.opacity;t.globalAlpha=""===i?1:Number(i);const r=n.style.transform;if(r)t.setTransform(...jL(r));else{const e=parseFloat(n.style.width)/n.width,i=parseFloat(n.style.height)/n.height;t.setTransform(e,0,0,i,0,0)}t.drawImage(n,0,0)}}t.globalAlpha=1,t.setTransform(1,0,0,1,0,0)}this.dispatchRenderEvent("postcompose",t),this.renderedVisible_||(this.element_.style.display="",this.renderedVisible_=!0),this.scheduleExpireIconCache(t)}declutter(t,e){if(t.declutter){for(let n=e.length-1;n>=0;--n){const i=e[n],r=i.layer;r.getDeclutter()&&r.renderDeclutter(t,i)}e.forEach(e=>e.layer.renderDeferred(t))}}}function IA(t){t instanceof oP?t.setMapInternal(null):t instanceof eP&&t.getLayers().forEach(IA)}function OA(t,e){if(t instanceof oP)t.setMapInternal(e);else if(t instanceof eP){const n=t.getLayers().getArray();for(let t=0,i=n.length;t<i;++t)OA(n[t],e)}}let AA=class extends zk{constructor(t){super(),t=t||{},this.on,this.once,this.un;const e=function(t){let e=null;void 0!==t.keyboardEventTarget&&(e="string"==typeof t.keyboardEventTarget?document.getElementById(t.keyboardEventTarget):t.keyboardEventTarget);const n={},i=t.layers&&"function"==typeof t.layers.getLayers?t.layers:new eP({layers:t.layers});let r,s,o;return n[eE]=i,n[iE]=t.target,n[rE]=t.view instanceof zM?t.view:new zM,void 0!==t.controls&&(Array.isArray(t.controls)?r=new Dk(t.controls.slice()):(sE("function"==typeof t.controls.getArray,"Expected `controls` to be an array or an `ol/Collection.js`"),r=t.controls)),void 0!==t.interactions&&(Array.isArray(t.interactions)?s=new Dk(t.interactions.slice()):(sE("function"==typeof t.interactions.getArray,"Expected `interactions` to be an array or an `ol/Collection.js`"),s=t.interactions)),void 0!==t.overlays?Array.isArray(t.overlays)?o=new Dk(t.overlays.slice()):(sE("function"==typeof t.overlays.getArray,"Expected `overlays` to be an array or an `ol/Collection.js`"),o=t.overlays):o=new Dk,{controls:r,interactions:s,keyboardEventTarget:e,overlays:o,values:n}}(t);this.renderComplete_=!1,this.loaded_=!0,this.boundHandleBrowserEvent_=this.handleBrowserEvent.bind(this),this.maxTilesLoading_=void 0!==t.maxTilesLoading?t.maxTilesLoading:16,this.pixelRatio_=void 0!==t.pixelRatio?t.pixelRatio:Gk,this.postRenderTimeoutHandle_,this.animationDelayKey_,this.animationDelay_=this.animationDelay_.bind(this),this.coordinateToPixelTransform_=[1,0,0,1,0,0],this.pixelToCoordinateTransform_=[1,0,0,1,0,0],this.frameIndex_=0,this.frameState_=null,this.previousExtent_=null,this.viewPropertyListenerKey_=null,this.viewChangeListenerKey_=null,this.layerGroupPropertyListenerKeys_=null,Wk||(this.viewport_=document.createElement("div"),this.viewport_.className="ol-viewport"+("ontouchstart"in window?" ol-touch":""),this.viewport_.style.position="relative",this.viewport_.style.overflow="hidden",this.viewport_.style.width="100%",this.viewport_.style.height="100%",this.overlayContainer_=document.createElement("div"),this.overlayContainer_.style.position="absolute",this.overlayContainer_.style.zIndex="0",this.overlayContainer_.style.width="100%",this.overlayContainer_.style.height="100%",this.overlayContainer_.style.pointerEvents="none",this.overlayContainer_.className="ol-overlaycontainer",this.viewport_.appendChild(this.overlayContainer_),this.overlayContainerStopEvent_=document.createElement("div"),this.overlayContainerStopEvent_.style.position="absolute",this.overlayContainerStopEvent_.style.zIndex="0",this.overlayContainerStopEvent_.style.width="100%",this.overlayContainerStopEvent_.style.height="100%",this.overlayContainerStopEvent_.style.pointerEvents="none",this.overlayContainerStopEvent_.className="ol-overlaycontainer-stopevent",this.viewport_.appendChild(this.overlayContainerStopEvent_)),this.mapBrowserEventHandler_=null,this.moveTolerance_=t.moveTolerance,this.keyboardEventTarget_=e.keyboardEventTarget,this.targetChangeHandlerKeys_=null,this.targetElement_=null,Wk||(this.resizeObserver_=new ResizeObserver(()=>this.updateSize())),this.controls=e.controls||(Wk?new Dk:aR()),this.interactions=e.interactions||(Wk?new Dk:BR({onFocusOnly:!0})),this.overlays_=e.overlays,this.overlayIdIndex_={},this.renderer_=null,this.postRenderFunctions_=[],this.tileQueue_=new lE(this.getTilePriority.bind(this),this.handleTileChange_.bind(this)),this.addChangeListener(eE,this.handleLayerGroupChanged_),this.addChangeListener(rE,this.handleViewChanged_),this.addChangeListener(nE,this.handleSizeChanged_),this.addChangeListener(iE,this.handleTargetChanged_),this.setProperties(e.values);const n=this;!t.view||t.view instanceof zM||t.view.then(function(t){n.setView(new zM(t))}),this.controls.addEventListener(ek,t=>{t.element.setMap(this)}),this.controls.addEventListener(nk,t=>{t.element.setMap(null)}),this.interactions.addEventListener(ek,t=>{t.element.setMap(this)}),this.interactions.addEventListener(nk,t=>{t.element.setMap(null)}),this.overlays_.addEventListener(ek,t=>{this.addOverlayInternal_(t.element)}),this.overlays_.addEventListener(nk,t=>{const e=t.element.getId();void 0!==e&&delete this.overlayIdIndex_[e.toString()],t.element.setMap(null)}),this.controls.forEach(t=>{t.setMap(this)}),this.interactions.forEach(t=>{t.setMap(this)}),this.overlays_.forEach(this.addOverlayInternal_.bind(this))}addControl(t){this.getControls().push(t)}addInteraction(t){this.getInteractions().push(t)}addLayer(t){this.getLayerGroup().getLayers().push(t)}handleLayerAdd_(t){OA(t.layer,this)}addOverlay(t){this.getOverlays().push(t)}addOverlayInternal_(t){const e=t.getId();void 0!==e&&(this.overlayIdIndex_[e.toString()]=t),t.setMap(this)}disposeInternal(){this.controls.clear(),this.interactions.clear(),this.overlays_.clear(),this.resizeObserver_?.disconnect(),this.setTarget(null),super.disposeInternal()}forEachFeatureAtPixel(t,e,n){if(!this.frameState_||!this.renderer_)return;const i=this.getCoordinateFromPixelInternal(t),r=void 0!==(n=void 0!==n?n:{}).hitTolerance?n.hitTolerance:0,s=void 0!==n.layerFilter?n.layerFilter:vk,o=!1!==n.checkWrapped;return this.renderer_.forEachFeatureAtCoordinate(i,this.frameState_,r,o,e,null,s,null)}getFeaturesAtPixel(t,e){const n=[];return this.forEachFeatureAtPixel(t,function(t){n.push(t)},e),n}getAllLayers(){const t=[];return function e(n){n.forEach(function(n){n instanceof eP?e(n.getLayers()):t.push(n)})}(this.getLayers()),t}hasFeatureAtPixel(t,e){if(!this.frameState_||!this.renderer_)return!1;const n=this.getCoordinateFromPixelInternal(t),i=void 0!==(e=void 0!==e?e:{}).layerFilter?e.layerFilter:vk,r=void 0!==e.hitTolerance?e.hitTolerance:0,s=!1!==e.checkWrapped;return this.renderer_.hasFeatureAtCoordinate(n,this.frameState_,r,s,i,null)}getEventCoordinate(t){return this.getCoordinateFromPixel(this.getEventPixel(t))}getEventCoordinateInternal(t){return this.getCoordinateFromPixelInternal(this.getEventPixel(t))}getEventPixel(t){const e=this.viewport_.getBoundingClientRect(),n=this.getSize(),i=e.width/n[0],r=e.height/n[1],s="changedTouches"in t?t.changedTouches[0]:t;return[(s.clientX-e.left)/i,(s.clientY-e.top)/r]}getTarget(){return this.get(iE)}getTargetElement(){return this.targetElement_}getCoordinateFromPixel(t){return xL(this.getCoordinateFromPixelInternal(t),this.getView().getProjection())}getCoordinateFromPixelInternal(t){const e=this.frameState_;return e?IL(e.pixelToCoordinateTransform,t.slice()):null}getControls(){return this.controls}getOverlays(){return this.overlays_}getOverlayById(t){const e=this.overlayIdIndex_[t.toString()];return void 0!==e?e:null}getInteractions(){return this.interactions}getLayerGroup(){return this.get(eE)}setLayers(t){const e=this.getLayerGroup();if(t instanceof Dk)return void e.setLayers(t);const n=e.getLayers();n.clear(),n.extend(t)}getLayers(){return this.getLayerGroup().getLayers()}getLoadingOrNotReady(){const t=this.getLayerGroup().getLayerStatesArray();for(let e=0,n=t.length;e<n;++e){const n=t[e];if(!n.visible)continue;const i=n.layer.getRenderer();if(i&&!i.ready)return!0;const r=n.layer.getSource();if(r&&r.loading)return!0}return!1}getPixelFromCoordinate(t){const e=CL(t,this.getView().getProjection());return this.getPixelFromCoordinateInternal(e)}getPixelFromCoordinateInternal(t){const e=this.frameState_;return e?IL(e.coordinateToPixelTransform,t.slice(0,2)):null}getRenderer(){return this.renderer_}getSize(){return this.get(nE)}getView(){return this.get(rE)}getViewport(){return this.viewport_}getOverlayContainer(){return this.overlayContainer_}getOverlayContainerStopEvent(){return this.overlayContainerStopEvent_}getOwnerDocument(){const t=this.getTargetElement();return t?t.ownerDocument:document}getTilePriority(t,e,n,i){return function(t,e,n,i,r){if(!t||!(n in t.wantedTiles))return oE;if(!t.wantedTiles[n][e.getKey()])return oE;const s=t.viewState.center,o=i[0]-s[0],a=i[1]-s[1];return 65536*Math.log(r)+Math.sqrt(o*o+a*a)/r}(this.frameState_,t,e,n,i)}handleBrowserEvent(t,e){e=e||t.type;const n=new Bk(e,this,t);this.handleMapBrowserEvent(n)}handleMapBrowserEvent(t){if(!this.frameState_)return;const e=t.originalEvent,n=e.type;if(n===Yk||n===hk||n===ak){const t=this.getOwnerDocument(),n=this.viewport_.getRootNode?this.viewport_.getRootNode():t,i=e.target,r=n instanceof ShadowRoot?n.host===i?n.host.ownerDocument:n:n===t?t.documentElement:n;if(this.overlayContainerStopEvent_.contains(i)||!r.contains(i))return}if(t.frameState=this.frameState_,!1!==this.dispatchEvent(t)){const e=this.getInteractions().getArray().slice();for(let n=e.length-1;n>=0;n--){const i=e[n];if(i.getMap()===this&&i.getActive()&&this.getTargetElement()&&(!i.handleEvent(t)||t.propagationStopped))break}}}handlePostRender(){const t=this.frameState_,e=this.tileQueue_;if(!e.isEmpty()){let n=this.maxTilesLoading_,i=n;if(t){const e=t.viewHints;if(e[0]||e[1]){const e=Date.now()-t.time>8;n=e?0:8,i=e?0:2}}e.getTilesLoading()<n&&(e.reprioritize(),e.loadMoreTiles(n,i))}t&&this.renderer_&&!t.animate&&(this.renderComplete_?(this.hasListener(sP)&&this.renderer_.dispatchRenderEvent(sP,t),!1===this.loaded_&&(this.loaded_=!0,this.dispatchEvent(new Nk(tE,this,t)))):!0===this.loaded_&&(this.loaded_=!1,this.dispatchEvent(new Nk(Qk,this,t))));const n=this.postRenderFunctions_;if(t)for(let i=0,r=n.length;i<r;++i)n[i](this,t);n.length=0}handleSizeChanged_(){this.getView()&&!this.getView().getAnimating()&&this.getView().resolveConstraints(0),this.render()}handleTargetChanged_(){if(this.mapBrowserEventHandler_){for(let t=0,e=this.targetChangeHandlerKeys_.length;t<e;++t)Mk(this.targetChangeHandlerKeys_[t]);this.targetChangeHandlerKeys_=null,this.viewport_.removeEventListener(sk,this.boundHandleBrowserEvent_),this.viewport_.removeEventListener(hk,this.boundHandleBrowserEvent_),this.mapBrowserEventHandler_.dispose(),this.mapBrowserEventHandler_=null,this.viewport_.remove()}if(this.targetElement_&&!nR(this.targetElement_)){this.resizeObserver_?.unobserve(this.targetElement_);const t=this.targetElement_.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.unobserve(t.host),this.setSize(void 0)}const t=this.getTarget(),e="string"==typeof t?document.getElementById(t):t;if(this.targetElement_=e,e){if(nR(e)||e.appendChild(this.viewport_),this.renderer_||(this.renderer_=new PA(this)),!nR(e)){this.mapBrowserEventHandler_=new Xk(this,this.moveTolerance_);for(const e in Uk)this.mapBrowserEventHandler_.addEventListener(Uk[e],this.handleMapBrowserEvent.bind(this));let t;if(this.viewport_.addEventListener(sk,this.boundHandleBrowserEvent_,!1),this.viewport_.addEventListener(hk,this.boundHandleBrowserEvent_,!!Kk&&{passive:!1}),this.keyboardEventTarget_)t=this.keyboardEventTarget_;else{const n=e.getRootNode();t=n instanceof ShadowRoot?n.host:e}if(this.targetChangeHandlerKeys_=[Tk(t,ak,this.handleBrowserEvent,this),Tk(t,lk,this.handleBrowserEvent,this)],e instanceof HTMLElement){const t=e.getRootNode();t instanceof ShadowRoot&&this.resizeObserver_.observe(t.host),this.resizeObserver_?.observe(e)}}this.updateSize()}else this.renderer_&&(clearTimeout(this.postRenderTimeoutHandle_),this.postRenderTimeoutHandle_=void 0,this.postRenderFunctions_.length=0,this.renderer_.dispose(),this.renderer_=null),this.animationDelayKey_&&(cancelAnimationFrame(this.animationDelayKey_),this.animationDelayKey_=void 0)}handleTileChange_(){this.render()}handleViewPropertyChanged_(){this.render()}handleViewChanged_(){this.viewPropertyListenerKey_&&(Mk(this.viewPropertyListenerKey_),this.viewPropertyListenerKey_=null),this.viewChangeListenerKey_&&(Mk(this.viewChangeListenerKey_),this.viewChangeListenerKey_=null);const t=this.getView();t&&(this.updateViewportSize_(this.getSize()),this.viewPropertyListenerKey_=Tk(t,ik,this.handleViewPropertyChanged_,this),this.viewChangeListenerKey_=Tk(t,rk,this.handleViewPropertyChanged_,this),t.resolveConstraints(0)),this.render()}handleLayerGroupChanged_(){this.layerGroupPropertyListenerKeys_&&(this.layerGroupPropertyListenerKeys_.forEach(Mk),this.layerGroupPropertyListenerKeys_=null);const t=this.getLayerGroup();t&&(this.handleLayerAdd_(new QR("addlayer",t)),this.layerGroupPropertyListenerKeys_=[Tk(t,ik,this.render,this),Tk(t,rk,this.render,this),Tk(t,"addlayer",this.handleLayerAdd_,this),Tk(t,"removelayer",this.handleLayerRemove_,this)]),this.render()}isRendered(){return!!this.frameState_}animationDelay_(){this.animationDelayKey_=void 0,this.renderFrame_(Date.now())}renderSync(){this.animationDelayKey_&&cancelAnimationFrame(this.animationDelayKey_),this.animationDelay_()}redrawText(){if(!this.frameState_)return;const t=this.frameState_.layerStatesArray;for(let e=0,n=t.length;e<n;++e){const n=t[e].layer;n.hasRenderer()&&n.getRenderer().handleFontsChanged()}}render(){this.renderer_&&void 0===this.animationDelayKey_&&(this.animationDelayKey_=requestAnimationFrame(this.animationDelay_))}removeControl(t){return this.getControls().remove(t)}removeInteraction(t){return this.getInteractions().remove(t)}removeLayer(t){return this.getLayerGroup().getLayers().remove(t)}handleLayerRemove_(t){IA(t.layer)}removeOverlay(t){return this.getOverlays().remove(t)}renderFrame_(t){const e=this.getSize(),n=this.getView(),i=this.frameState_;let r=null;if(void 0!==e&&WP(e)&&n&&n.isDef()){const i=n.getHints(this.frameState_?this.frameState_.viewHints:void 0),s=n.getState();if(r={animate:!1,coordinateToPixelTransform:this.coordinateToPixelTransform_,declutter:null,extent:WE(s.center,s.resolution,s.rotation,e),index:this.frameIndex_++,layerIndex:0,layerStatesArray:this.getLayerGroup().getLayerStatesArray(),pixelRatio:this.pixelRatio_,pixelToCoordinateTransform:this.pixelToCoordinateTransform_,postRenderFunctions:[],size:e,tileQueue:this.tileQueue_,time:t,usedTiles:{},viewState:s,viewHints:i,wantedTiles:{},mapId:Ok(this),renderTargets:{}},s.nextCenter&&s.nextResolution){const t=isNaN(s.nextRotation)?s.rotation:s.nextRotation;r.nextExtent=WE(s.nextCenter,s.nextResolution,t,e)}}this.frameState_=r,this.renderer_.renderFrame(r),r&&(r.animate&&this.render(),Array.prototype.push.apply(this.postRenderFunctions_,r.postRenderFunctions),i&&(!this.previousExtent_||!tT(this.previousExtent_)&&!zE(r.extent,this.previousExtent_))&&(this.dispatchEvent(new Nk("movestart",this,i)),this.previousExtent_=IE(this.previousExtent_)),this.previousExtent_&&!r.viewHints[0]&&!r.viewHints[1]&&!zE(r.extent,this.previousExtent_)&&(this.dispatchEvent(new Nk("moveend",this,r)),kE(r.extent,this.previousExtent_))),this.dispatchEvent(new Nk(Jk,this,r)),this.renderComplete_=(this.hasListener(Qk)||this.hasListener(tE)||this.hasListener(sP))&&!this.tileQueue_.getTilesLoading()&&!this.tileQueue_.getCount()&&!this.getLoadingOrNotReady(),this.postRenderTimeoutHandle_||(this.postRenderTimeoutHandle_=setTimeout(()=>{this.postRenderTimeoutHandle_=void 0,this.handlePostRender()},0))}setLayerGroup(t){const e=this.getLayerGroup();e&&this.handleLayerRemove_(new QR("removelayer",e)),this.set(eE,t)}setSize(t){this.set(nE,t)}setTarget(t){this.set(iE,t)}setView(t){if(!t||t instanceof zM)return void this.set(rE,t);this.set(rE,new zM);const e=this;t.then(function(t){e.setView(new zM(t))})}updateSize(){const t=this.getTargetElement();let e;if(t){let n,i;if(nR(t))n=t.width,i=t.height;else{const e=getComputedStyle(t);n=t.offsetWidth-parseFloat(e.borderLeftWidth)-parseFloat(e.paddingLeft)-parseFloat(e.paddingRight)-parseFloat(e.borderRightWidth),i=t.offsetHeight-parseFloat(e.borderTopWidth)-parseFloat(e.paddingTop)-parseFloat(e.paddingBottom)-parseFloat(e.borderBottomWidth)}isNaN(n)||isNaN(i)||(e=[Math.max(0,n),Math.max(0,i)],!WP(e)&&(t.offsetWidth||t.offsetHeight||t.getClientRects().length)&&fT("No map visible because the map container's width or height are 0."))}const n=this.getSize();!e||n&&yk(e,n)||(this.setSize(e),this.updateViewportSize_(e))}updateViewportSize_(t){const e=this.getView();e&&e.setViewportSize(t)}};const zA="element",FA="map",jA="offset",DA="position",NA="positioning";class BA extends zk{constructor(t){super(),this.on,this.once,this.un,this.options=t,this.id=t.id,this.insertFirst=void 0===t.insertFirst||t.insertFirst,this.stopEvent=void 0===t.stopEvent||t.stopEvent,this.element=document.createElement("div"),this.element.className=void 0!==t.className?t.className:"ol-overlay-container ol-selectable",this.element.style.position="absolute",this.element.style.pointerEvents="auto",this.autoPan=!0===t.autoPan?{}:t.autoPan||void 0,this.rendered={transform_:"",visible:!0},this.mapPostrenderListenerKey=null,this.addChangeListener(zA,this.handleElementChanged),this.addChangeListener(FA,this.handleMapChanged),this.addChangeListener(jA,this.handleOffsetChanged),this.addChangeListener(DA,this.handlePositionChanged),this.addChangeListener(NA,this.handlePositioningChanged),void 0!==t.element&&this.setElement(t.element),this.setOffset(void 0!==t.offset?t.offset:[0,0]),this.setPositioning(t.positioning||"top-left"),void 0!==t.position&&this.setPosition(t.position)}getElement(){return this.get(zA)}getId(){return this.id}getMap(){return this.get(FA)||null}getOffset(){return this.get(jA)}getPosition(){return this.get(DA)}getPositioning(){return this.get(NA)}handleElementChanged(){tR(this.element);const t=this.getElement();t&&this.element.appendChild(t)}handleMapChanged(){this.mapPostrenderListenerKey&&(this.element?.remove(),Mk(this.mapPostrenderListenerKey),this.mapPostrenderListenerKey=null);const t=this.getMap();if(t){this.mapPostrenderListenerKey=Tk(t,Jk,this.render,this),this.updatePixelPosition();const e=this.stopEvent?t.getOverlayContainerStopEvent():t.getOverlayContainer();this.insertFirst?e.insertBefore(this.element,e.childNodes[0]||null):e.appendChild(this.element),this.performAutoPan()}}render(){this.updatePixelPosition()}handleOffsetChanged(){this.updatePixelPosition()}handlePositionChanged(){this.updatePixelPosition(),this.performAutoPan()}handlePositioningChanged(){this.updatePixelPosition()}setElement(t){this.set(zA,t)}setMap(t){this.set(FA,t)}setOffset(t){this.set(jA,t)}setPosition(t){this.set(DA,t)}performAutoPan(){this.autoPan&&this.panIntoView(this.autoPan)}panIntoView(t){const e=this.getMap();if(!e||!e.getTargetElement()||!this.get(DA))return;const n=this.getRect(e.getTargetElement(),e.getSize()),i=this.getElement(),r=this.getRect(i,[XM(i),JM(i)]),s=void 0===(t=t||{}).margin?20:t.margin;if(!LE(n,r)){const i=r[0]-n[0],o=n[2]-r[2],a=r[1]-n[1],l=n[3]-r[3],c=[0,0];if(i<0?c[0]=i-s:o<0&&(c[0]=Math.abs(o)+s),a<0?c[1]=a-s:l<0&&(c[1]=Math.abs(l)+s),0!==c[0]||0!==c[1]){const n=e.getView().getCenterInternal(),i=e.getPixelFromCoordinateInternal(n);if(!i)return;const r=[i[0]+c[0],i[1]+c[1]],s=t.animation||{};e.getView().animateInternal({center:e.getCoordinateFromPixelInternal(r),duration:s.duration,easing:s.easing})}}}getRect(t,e){const n=t.getBoundingClientRect(),i=n.left+window.pageXOffset,r=n.top+window.pageYOffset;return[i,r,i+e[0],r+e[1]]}setPositioning(t){this.set(NA,t)}setVisible(t){this.rendered.visible!==t&&(this.element.style.display=t?"":"none",this.rendered.visible=t)}updatePixelPosition(){const t=this.getMap(),e=this.getPosition();if(!t||!t.isRendered()||!e)return void this.setVisible(!1);const n=t.getPixelFromCoordinate(e),i=t.getSize();this.updateRenderedPosition(n,i)}updateRenderedPosition(t,e){const n=this.element.style,i=this.getOffset(),r=this.getPositioning();this.setVisible(!0);let s="0%",o="0%";"bottom-right"==r||"center-right"==r||"top-right"==r?s="-100%":"bottom-center"!=r&&"center-center"!=r&&"top-center"!=r||(s="-50%"),"bottom-left"==r||"bottom-center"==r||"bottom-right"==r?o="-100%":"center-left"!=r&&"center-center"!=r&&"center-right"!=r||(o="-50%");const a=`translate(${s}, ${o}) translate(${t[0]+i[0]}px, ${t[1]+i[1]}px)`;this.rendered.transform_!=a&&(this.rendered.transform_=a,n.transform=a)}getOptions(){return this.options}}class UA extends zk{constructor(t){if(super(),this.on,this.once,this.un,this.id_=void 0,this.geometryName_="geometry",this.style_=null,this.styleFunction_=void 0,this.geometryChangeKey_=null,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),t)if("function"==typeof t.getSimplifiedGeometry){const e=t;this.setGeometry(e)}else{const e=t;this.setProperties(e)}}clone(){const t=new UA(this.hasProperties()?this.getProperties():null);t.setGeometryName(this.getGeometryName());const e=this.getGeometry();e&&t.setGeometry(e.clone());const n=this.getStyle();return n&&t.setStyle(n),t}getGeometry(){return this.get(this.geometryName_)}getId(){return this.id_}getGeometryName(){return this.geometryName_}getStyle(){return this.style_}getStyleFunction(){return this.styleFunction_}handleGeometryChange_(){this.changed()}handleGeometryChanged_(){this.geometryChangeKey_&&(Mk(this.geometryChangeKey_),this.geometryChangeKey_=null);const t=this.getGeometry();t&&(this.geometryChangeKey_=Tk(t,rk,this.handleGeometryChange_,this)),this.changed()}setGeometry(t){this.set(this.geometryName_,t)}setStyle(t){this.style_=t,this.styleFunction_=t?function(t){if("function"==typeof t)return t;let e;return Array.isArray(t)?e=t:(sE("function"==typeof t.getZIndex,"Expected an `ol/style/Style` or an array of `ol/style/Style.js`"),e=[t]),function(){return e}}(t):void 0,this.changed()}setId(t){this.id_=t,this.changed()}setGeometryName(t){this.removeChangeListener(this.geometryName_,this.handleGeometryChanged_),this.geometryName_=t,this.addChangeListener(this.geometryName_,this.handleGeometryChanged_),this.handleGeometryChanged_()}}function qA(t,e,n,i,r,s,o){let a,l;const c=(n-e)/i;if(1===c)a=e;else if(2===c)a=e,l=r;else if(0!==c){let s=t[e],o=t[e+1],c=0;const h=[0];for(let r=e+i;r<n;r+=i){const e=t[r],n=t[r+1];c+=Math.sqrt((e-s)*(e-s)+(n-o)*(n-o)),h.push(c),s=e,o=n}const u=r*c,d=function(t,e,n){let i,r;n=n||dk;let s=0,o=t.length,a=!1;for(;s<o;)i=s+(o-s>>1),r=+n(t[i],e),r<0?s=i+1:(o=i,a=!r);return a?s:~s}(h,u);d<0?(l=(u-h[-d-2])/(h[-d-1]-h[-d-2]),a=e+(-d-2)*i):a=e+d*i}o=o>1?o:2,s=s||new Array(o);for(let h=0;h<o;++h)s[h]=void 0===a?NaN:void 0===l?t[a+h]:mE(t[a+h],t[a+i+h],l);return s}function VA(t,e,n,i,r,s){if(n==e)return null;let o;if(r<t[e+i-1])return s?(o=t.slice(e,e+i),o[i-1]=r,o):null;if(t[n-1]<r)return s?(o=t.slice(n-i,n),o[i-1]=r,o):null;if(r==t[e+i-1])return t.slice(e,e+i);let a=e/i,l=n/i;for(;a<l;){const e=a+l>>1;r<t[(e+1)*i-1]?l=e:a=e+1}const c=t[a*i-1];if(r==c)return t.slice((a-1)*i,(a-1)*i+i);const h=(r-c)/(t[(a+1)*i-1]-c);o=[];for(let u=0;u<i-1;++u)o.push(mE(t[(a-1)*i+u],t[a*i+u],h));return o.push(r),o}function $A(t,e,n,i){let r=t[e],s=t[e+1],o=0;for(let a=e+i;a<n;a+=i){const e=t[a],n=t[a+1];o+=Math.sqrt((e-r)*(e-r)+(n-s)*(n-s)),r=e,s=n}return o}class GA extends VL{constructor(t,e){super(),this.flatMidpoint_=null,this.flatMidpointRevision_=-1,this.maxDelta_=-1,this.maxDeltaRevision_=-1,void 0===e||Array.isArray(t[0])?this.setCoordinates(t,e):this.setFlatCoordinates(e,t)}appendCoordinate(t){mk(this.flatCoordinates,t),this.changed()}clone(){const t=new GA(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<EE(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(KL(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),XL(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,this.maxDelta_,!1,t,e,n,i))}forEachSegment(t){return yM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t)}getCoordinateAtM(t,e){return"XYM"!=this.layout&&"XYZM"!=this.layout?null:(e=void 0!==e&&e,VA(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e))}getCoordinates(){return nM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getCoordinateAt(t,e){return qA(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,this.stride)}getLength(){return $A(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getFlatMidpoint(){return this.flatMidpointRevision_!=this.getRevision()&&(this.flatMidpoint_=this.getCoordinateAt(.5,this.flatMidpoint_??void 0),this.flatMidpointRevision_=this.getRevision()),this.flatMidpoint_}getSimplifiedGeometryInternal(t){const e=[];return e.length=sM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,e,0),new GA(e,"XY")}getType(){return"LineString"}intersectsExtent(t){return vM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride,t,this.getExtent())}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=QL(this.flatCoordinates,0,t,this.stride),this.changed()}}class WA extends VL{constructor(t,e,n){if(super(),this.ends_=[],this.maxDelta_=-1,this.maxDeltaRevision_=-1,Array.isArray(t[0]))this.setCoordinates(t,e);else if(void 0!==e&&n)this.setFlatCoordinates(e,t),this.ends_=n;else{const e=t,n=[],i=[];for(let t=0,s=e.length;t<s;++t)mk(n,e[t].getFlatCoordinates()),i.push(n.length);const r=0===e.length?this.getLayout():e[0].getLayout();this.setFlatCoordinates(r,n),this.ends_=i}}appendLineString(t){mk(this.flatCoordinates,t.getFlatCoordinates().slice()),this.ends_.push(this.flatCoordinates.length),this.changed()}clone(){const t=new WA(this.flatCoordinates.slice(),this.layout,this.ends_.slice());return t.applyProperties(this),t}closestPointXY(t,e,n,i){return i<EE(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(YL(this.flatCoordinates,0,this.ends_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),JL(this.flatCoordinates,0,this.ends_,this.stride,this.maxDelta_,!1,t,e,n,i))}getCoordinateAtM(t,e,n){return"XYM"!=this.layout&&"XYZM"!=this.layout||0===this.flatCoordinates.length?null:(e=void 0!==e&&e,n=void 0!==n&&n,function(t,e,n,i,r,s,o){if(o)return VA(t,e,n[n.length-1],i,r,s);let a;if(r<t[i-1])return s?(a=t.slice(0,i),a[i-1]=r,a):null;if(t[t.length-1]<r)return s?(a=t.slice(t.length-i),a[i-1]=r,a):null;for(let l=0,c=n.length;l<c;++l){const s=n[l];if(e!=s){if(r<t[e+i-1])return null;if(r<=t[s-1])return VA(t,e,s,i,r,!1);e=s}}return null}(this.flatCoordinates,0,this.ends_,this.stride,t,e,n))}getCoordinates(){return iM(this.flatCoordinates,0,this.ends_,this.stride)}getEnds(){return this.ends_}getLineString(t){return t<0||this.ends_.length<=t?null:new GA(this.flatCoordinates.slice(0===t?0:this.ends_[t-1],this.ends_[t]),this.layout)}getLineStrings(){const t=this.flatCoordinates,e=this.ends_,n=this.layout,i=[];let r=0;for(let s=0,o=e.length;s<o;++s){const o=e[s],a=new GA(t.slice(r,o),n);i.push(a),r=o}return i}getLength(){const t=this.ends_;let e=0,n=0;for(let i=0,r=t.length;i<r;++i)n+=$A(this.flatCoordinates,e,t[i],this.stride),e=t[i];return n}getFlatMidpoints(){const t=[],e=this.flatCoordinates;let n=0;const i=this.ends_,r=this.stride;for(let s=0,o=i.length;s<o;++s){const o=i[s];mk(t,qA(e,n,o,r,.5)),n=o}return t}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=oM(this.flatCoordinates,0,this.ends_,this.stride,t,e,0,n),new WA(e,"XY",n)}getType(){return"MultiLineString"}intersectsExtent(t){return function(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){if(vM(t,e,n[s],i,r))return!0;e=n[s]}return!1}(this.flatCoordinates,0,this.ends_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,2),this.flatCoordinates||(this.flatCoordinates=[]);const n=tM(this.flatCoordinates,0,t,this.stride,this.ends_);this.flatCoordinates.length=0===n.length?0:n[n.length-1],this.changed()}}class HA extends VL{constructor(t,e){super(),e&&!Array.isArray(t[0])?this.setFlatCoordinates(e,t):this.setCoordinates(t,e)}appendPoint(t){mk(this.flatCoordinates,t.getFlatCoordinates()),this.changed()}clone(){const t=new HA(this.flatCoordinates.slice(),this.layout);return t.applyProperties(this),t}closestPointXY(t,e,n,i){if(i<EE(this.getExtent(),t,e))return i;const r=this.flatCoordinates,s=this.stride;for(let o=0,a=r.length;o<a;o+=s){const a=dE(t,e,r[o],r[o+1]);if(a<i){i=a;for(let t=0;t<s;++t)n[t]=r[o+t];n.length=s}}return i}getCoordinates(){return nM(this.flatCoordinates,0,this.flatCoordinates.length,this.stride)}getPoint(t){const e=this.flatCoordinates.length/this.stride;return t<0||e<=t?null:new uM(this.flatCoordinates.slice(t*this.stride,(t+1)*this.stride),this.layout)}getPoints(){const t=this.flatCoordinates,e=this.layout,n=this.stride,i=[];for(let r=0,s=t.length;r<s;r+=n){const s=new uM(t.slice(r,r+n),e);i.push(s)}return i}getType(){return"MultiPoint"}intersectsExtent(t){const e=this.flatCoordinates,n=this.stride;for(let i=0,r=e.length;i<r;i+=n)if(ME(t,e[i],e[i+1]))return!0;return!1}setCoordinates(t,e){this.setLayout(e,t,1),this.flatCoordinates||(this.flatCoordinates=[]),this.flatCoordinates.length=QL(this.flatCoordinates,0,t,this.stride),this.changed()}}function ZA(t,e,n,i){const r=[];let s=[1/0,1/0,-1/0,-1/0];for(let o=0,a=n.length;o<a;++o){const a=n[o];s=AE(t,e,a[0],i),r.push((s[0]+s[2])/2,(s[1]+s[3])/2),e=a[a.length-1]}return r}class KA extends VL{constructor(t,e,n){if(super(),this.endss_=[],this.flatInteriorPointsRevision_=-1,this.flatInteriorPoints_=null,this.maxDelta_=-1,this.maxDeltaRevision_=-1,this.orientedRevision_=-1,this.orientedFlatCoordinates_=null,!n&&!Array.isArray(t[0])){const i=t,r=[],s=[];for(let t=0,e=i.length;t<e;++t){const e=i[t],n=r.length,o=e.getEnds();for(let t=0,i=o.length;t<i;++t)o[t]+=n;mk(r,e.getFlatCoordinates()),s.push(o)}e=0===i.length?this.getLayout():i[0].getLayout(),t=r,n=s}void 0!==e&&n?(this.setFlatCoordinates(e,t),this.endss_=n):this.setCoordinates(t,e)}appendPolygon(t){let e;if(this.flatCoordinates){const n=this.flatCoordinates.length;mk(this.flatCoordinates,t.getFlatCoordinates()),e=t.getEnds().slice();for(let t=0,i=e.length;t<i;++t)e[t]+=n}else this.flatCoordinates=t.getFlatCoordinates().slice(),e=t.getEnds().slice(),this.endss_.push();this.endss_.push(e),this.changed()}clone(){const t=this.endss_.length,e=new Array(t);for(let i=0;i<t;++i)e[i]=this.endss_[i].slice();const n=new KA(this.flatCoordinates.slice(),this.layout,e);return n.applyProperties(this),n}closestPointXY(t,e,n,i){return i<EE(this.getExtent(),t,e)?i:(this.maxDeltaRevision_!=this.getRevision()&&(this.maxDelta_=Math.sqrt(function(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){const o=n[s];r=YL(t,e,o,i,r),e=o[o.length-1]}return r}(this.flatCoordinates,0,this.endss_,this.stride,0)),this.maxDeltaRevision_=this.getRevision()),function(t,e,n,i,r,s,o,a,l,c,h){h=h||[NaN,NaN];for(let u=0,d=n.length;u<d;++u){const s=n[u];c=JL(t,e,s,i,r,!0,o,a,l,c,h),e=s[s.length-1]}return c}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,this.maxDelta_,0,t,e,n,i))}containsXY(t,e){return function(t,e,n,i,r,s){if(0===n.length)return!1;for(let o=0,a=n.length;o<a;++o){const a=n[o];if(fM(t,e,a,i,r,s))return!0;e=a[a.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t,e)}getArea(){return function(t,e,n,i){let r=0;for(let s=0,o=n.length;s<o;++s){const o=n[s];r+=HL(t,e,o,i),e=o[o.length-1]}return r}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride)}getCoordinates(t){let e;return void 0!==t?(e=this.getOrientedFlatCoordinates().slice(),EM(e,0,this.endss_,this.stride,t)):e=this.flatCoordinates,rM(e,0,this.endss_,this.stride)}getEndss(){return this.endss_}getFlatInteriorPoints(){if(this.flatInteriorPointsRevision_!=this.getRevision()){const t=ZA(this.flatCoordinates,0,this.endss_,this.stride);this.flatInteriorPoints_=mM(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t),this.flatInteriorPointsRevision_=this.getRevision()}return this.flatInteriorPoints_}getInteriorPoints(){return new HA(this.getFlatInteriorPoints().slice(),"XYM")}getOrientedFlatCoordinates(){if(this.orientedRevision_!=this.getRevision()){const t=this.flatCoordinates;SM(t,0,this.endss_,this.stride)?this.orientedFlatCoordinates_=t:(this.orientedFlatCoordinates_=t.slice(),this.orientedFlatCoordinates_.length=EM(this.orientedFlatCoordinates_,0,this.endss_,this.stride)),this.orientedRevision_=this.getRevision()}return this.orientedFlatCoordinates_}getSimplifiedGeometryInternal(t){const e=[],n=[];return e.length=function(t,e,n,i,r,s,o,a){for(let l=0,c=n.length;l<c;++l){const c=n[l],h=[];o=cM(t,e,c,i,r,s,o,h),a.push(h),e=c[c.length-1]}return o}(this.flatCoordinates,0,this.endss_,this.stride,Math.sqrt(t),e,0,n),new KA(e,"XY",n)}getPolygon(t){if(t<0||this.endss_.length<=t)return null;let e;if(0===t)e=0;else{const n=this.endss_[t-1];e=n[n.length-1]}const n=this.endss_[t].slice(),i=n[n.length-1];if(0!==e)for(let r=0,s=n.length;r<s;++r)n[r]-=e;return new LM(this.flatCoordinates.slice(e,i),this.layout,n)}getPolygons(){const t=this.layout,e=this.flatCoordinates,n=this.endss_,i=[];let r=0;for(let s=0,o=n.length;s<o;++s){const o=n[s].slice(),a=o[o.length-1];if(0!==r)for(let t=0,e=o.length;t<e;++t)o[t]-=r;const l=new LM(e.slice(r,a),t,o);i.push(l),r=a}return i}getType(){return"MultiPolygon"}intersectsExtent(t){return function(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){const o=n[s];if(bM(t,e,o,i,r))return!0;e=o[o.length-1]}return!1}(this.getOrientedFlatCoordinates(),0,this.endss_,this.stride,t)}setCoordinates(t,e){this.setLayout(e,t,3),this.flatCoordinates||(this.flatCoordinates=[]);const n=eM(this.flatCoordinates,0,t,this.stride,this.endss_);if(0===n.length)this.flatCoordinates.length=0;else{const t=n[n.length-1];this.flatCoordinates.length=0===t.length?0:t[t.length-1]}this.changed()}}class YA{drawCustom(t,e,n,i,r){}drawGeometry(t){}setStyle(t){}drawCircle(t,e,n){}drawFeature(t,e,n){}drawGeometryCollection(t,e,n){}drawLineString(t,e,n){}drawMultiLineString(t,e,n){}drawMultiPoint(t,e,n){}drawMultiPolygon(t,e,n){}drawPoint(t,e,n){}drawPolygon(t,e,n){}drawText(t,e,n){}setFillStrokeStyle(t,e){}setImageStyle(t,e){}setTextStyle(t,e){}}const XA=11,JA=[8],QA=[12],tz=[1],ez=[3];class nz extends YA{constructor(t,e,n,i){super(),this.tolerance=t,this.maxExtent=e,this.pixelRatio=i,this.maxLineWidth=0,this.resolution=n,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_=null,this.bufferedMaxExtent_=null,this.instructions=[],this.coordinates=[],this.tmpCoordinate_=[],this.hitDetectionInstructions=[],this.state={}}applyPixelRatio(t){const e=this.pixelRatio;return 1==e?t:t.map(function(t){return t*e})}appendFlatPointCoordinates(t,e){const n=this.getBufferedMaxExtent(),i=this.tmpCoordinate_,r=this.coordinates;let s=r.length;for(let o=0,a=t.length;o<a;o+=e)i[0]=t[o],i[1]=t[o+1],TE(n,i)&&(r[s++]=i[0],r[s++]=i[1]);return s}appendFlatLineCoordinates(t,e,n,i,r,s){const o=this.coordinates;let a=o.length;const l=this.getBufferedMaxExtent();s&&(e+=i);let c=t[e],h=t[e+1];const u=this.tmpCoordinate_;let d,p,f,g=!0;for(d=e+i;d<n;d+=i)u[0]=t[d],u[1]=t[d+1],f=RE(l,u),f!==p?(g&&(o[a++]=c,o[a++]=h,g=!1),o[a++]=u[0],o[a++]=u[1]):1===f?(o[a++]=u[0],o[a++]=u[1],g=!1):g=!0,c=u[0],h=u[1],p=f;return(r&&g||d===e+i)&&(o[a++]=c,o[a++]=h),a}drawCustomCoordinates_(t,e,n,i,r){for(let s=0,o=n.length;s<o;++s){const o=n[s],a=this.appendFlatLineCoordinates(t,e,o,i,!1,!1);r.push(a),e=o}return e}drawCustom(t,e,n,i,r){this.beginGeometry(t,e,r);const s=t.getType(),o=t.getStride(),a=this.coordinates.length;let l,c,h,u,d;switch(s){case"MultiPolygon":l=t.getOrientedFlatCoordinates(),u=[];const e=t.getEndss();d=0;for(let t=0,n=e.length;t<n;++t){const n=[];d=this.drawCustomCoordinates_(l,d,e[t],o,n),u.push(n)}this.instructions.push([4,a,u,t,n,rM,r]),this.hitDetectionInstructions.push([4,a,u,t,i||n,rM,r]);break;case"Polygon":case"MultiLineString":h=[],l="Polygon"==s?t.getOrientedFlatCoordinates():t.getFlatCoordinates(),d=this.drawCustomCoordinates_(l,0,t.getEnds(),o,h),this.instructions.push([4,a,h,t,n,iM,r]),this.hitDetectionInstructions.push([4,a,h,t,i||n,iM,r]);break;case"LineString":case"Circle":l=t.getFlatCoordinates(),c=this.appendFlatLineCoordinates(l,0,l.length,o,!1,!1),this.instructions.push([4,a,c,t,n,nM,r]),this.hitDetectionInstructions.push([4,a,c,t,i||n,nM,r]);break;case"MultiPoint":l=t.getFlatCoordinates(),c=this.appendFlatPointCoordinates(l,o),c>a&&(this.instructions.push([4,a,c,t,n,nM,r]),this.hitDetectionInstructions.push([4,a,c,t,i||n,nM,r]));break;case"Point":l=t.getFlatCoordinates(),this.coordinates.push(l[0],l[1]),c=this.coordinates.length,this.instructions.push([4,a,c,t,n,void 0,r]),this.hitDetectionInstructions.push([4,a,c,t,i||n,void 0,r])}this.endGeometry(e)}beginGeometry(t,e,n){this.beginGeometryInstruction1_=[0,e,0,t,n],this.instructions.push(this.beginGeometryInstruction1_),this.beginGeometryInstruction2_=[0,e,0,t,n],this.hitDetectionInstructions.push(this.beginGeometryInstruction2_)}finish(){return{instructions:this.instructions,hitDetectionInstructions:this.hitDetectionInstructions,coordinates:this.coordinates}}reverseHitDetectionInstructions(){const t=this.hitDetectionInstructions;let e;t.reverse();const n=t.length;let i,r,s=-1;for(e=0;e<n;++e)i=t[e],r=i[0],7==r?s=e:0==r&&(i[2]=e,gk(this.hitDetectionInstructions,s,e),s=-1)}fillStyleToState(t,e={}){if(t){const n=t.getColor();e.fillPatternScale=n&&"object"==typeof n&&"src"in n?this.pixelRatio:1,e.fillStyle=SO(n||EO)}else e.fillStyle=void 0;return e}strokeStyleToState(t,e={}){if(t){const n=t.getColor();e.strokeStyle=SO(n||RO);const i=t.getLineCap();e.lineCap=void 0!==i?i:TO;const r=t.getLineDash();e.lineDash=r?r.slice():LO;const s=t.getLineDashOffset();e.lineDashOffset=s||0;const o=t.getLineJoin();e.lineJoin=void 0!==o?o:MO;const a=t.getWidth();e.lineWidth=void 0!==a?a:1;const l=t.getMiterLimit();e.miterLimit=void 0!==l?l:10,e.lineWidth>this.maxLineWidth&&(this.maxLineWidth=e.lineWidth,this.bufferedMaxExtent_=null)}else e.strokeStyle=void 0,e.lineCap=void 0,e.lineDash=null,e.lineDashOffset=void 0,e.lineJoin=void 0,e.lineWidth=void 0,e.miterLimit=void 0;return e}setFillStrokeStyle(t,e){const n=this.state;this.fillStyleToState(t,n),this.strokeStyleToState(e,n)}createFill(t){const e=t.fillStyle,n=[10,e];return"string"!=typeof e&&n.push(t.fillPatternScale),n}applyStroke(t){this.instructions.push(this.createStroke(t))}createStroke(t){return[XA,t.strokeStyle,t.lineWidth*this.pixelRatio,t.lineCap,t.lineJoin,t.miterLimit,t.lineDash?this.applyPixelRatio(t.lineDash):null,t.lineDashOffset*this.pixelRatio]}updateFillStyle(t,e){const n=t.fillStyle;"string"==typeof n&&t.currentFillStyle==n||(this.instructions.push(e.call(this,t)),t.currentFillStyle=n)}updateStrokeStyle(t,e){const n=t.strokeStyle,i=t.lineCap,r=t.lineDash,s=t.lineDashOffset,o=t.lineJoin,a=t.lineWidth,l=t.miterLimit;(t.currentStrokeStyle!=n||t.currentLineCap!=i||r!=t.currentLineDash&&!yk(t.currentLineDash,r)||t.currentLineDashOffset!=s||t.currentLineJoin!=o||t.currentLineWidth!=a||t.currentMiterLimit!=l)&&(e.call(this,t),t.currentStrokeStyle=n,t.currentLineCap=i,t.currentLineDash=r,t.currentLineDashOffset=s,t.currentLineJoin=o,t.currentLineWidth=a,t.currentMiterLimit=l)}endGeometry(t){this.beginGeometryInstruction1_[2]=this.instructions.length,this.beginGeometryInstruction1_=null,this.beginGeometryInstruction2_[2]=this.hitDetectionInstructions.length,this.beginGeometryInstruction2_=null;const e=[7,t];this.instructions.push(e),this.hitDetectionInstructions.push(e)}getBufferedMaxExtent(){if(!this.bufferedMaxExtent_&&(this.bufferedMaxExtent_=kE(this.maxExtent),this.maxLineWidth>0)){const t=this.resolution*(this.maxLineWidth+1)/2;SE(this.bufferedMaxExtent_,t,this.bufferedMaxExtent_)}return this.bufferedMaxExtent_}}class iz extends nz{constructor(t,e,n,i){super(t,e,n,i)}drawFlatCoordinatess_(t,e,n,i){const r=this.state,s=void 0!==r.fillStyle,o=void 0!==r.strokeStyle,a=n.length;this.instructions.push(tz),this.hitDetectionInstructions.push(tz);for(let l=0;l<a;++l){const r=n[l],s=[9,this.coordinates.length,this.appendFlatLineCoordinates(t,e,r,i,!0,!o)];this.instructions.push(s),this.hitDetectionInstructions.push(s),o&&(this.instructions.push(ez),this.hitDetectionInstructions.push(ez)),e=r}return s&&(this.instructions.push(JA),this.hitDetectionInstructions.push(JA)),o&&(this.instructions.push(QA),this.hitDetectionInstructions.push(QA)),e}drawCircle(t,e,n){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([10,EO]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([XA,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,LO,0]);const o=t.getFlatCoordinates(),a=t.getStride(),l=this.coordinates.length;this.appendFlatLineCoordinates(o,0,o.length,a,!1,!1);const c=[2,l];this.instructions.push(tz,c),this.hitDetectionInstructions.push(tz,c),void 0!==i.fillStyle&&(this.instructions.push(JA),this.hitDetectionInstructions.push(JA)),void 0!==i.strokeStyle&&(this.instructions.push(QA),this.hitDetectionInstructions.push(QA)),this.endGeometry(e)}drawPolygon(t,e,n){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([10,EO]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([XA,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,LO,0]);const o=t.getEnds(),a=t.getOrientedFlatCoordinates(),l=t.getStride();this.drawFlatCoordinatess_(a,0,o,l),this.endGeometry(e)}drawMultiPolygon(t,e,n){const i=this.state,r=i.fillStyle,s=i.strokeStyle;if(void 0===r&&void 0===s)return;this.setFillStrokeStyles_(),this.beginGeometry(t,e,n),void 0!==i.fillStyle&&this.hitDetectionInstructions.push([10,EO]),void 0!==i.strokeStyle&&this.hitDetectionInstructions.push([XA,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,LO,0]);const o=t.getEndss(),a=t.getOrientedFlatCoordinates(),l=t.getStride();let c=0;for(let h=0,u=o.length;h<u;++h)c=this.drawFlatCoordinatess_(a,c,o[h],l);this.endGeometry(e)}finish(){this.reverseHitDetectionInstructions(),this.state=null;const t=this.tolerance;if(0!==t){const e=this.coordinates;for(let n=0,i=e.length;n<i;++n)e[n]=aM(e[n],t)}return super.finish()}setFillStrokeStyles_(){const t=this.state;this.updateFillStyle(t,this.createFill),this.updateStrokeStyle(t,this.applyStroke)}}function rz(t,e,n,i,r){const s=[];let o=n,a=0,l=e.slice(n,2);for(;a<t&&o+r<i;){const[n,i]=l.slice(-2),c=e[o+r],h=e[o+r+1],u=Math.sqrt((c-n)*(c-n)+(h-i)*(h-i));if(a+=u,a>=t){const e=(t-a+u)/u,d=mE(n,c,e),p=mE(i,h,e);l.push(d,p),s.push(l),l=[d,p],a==t&&(o+=r),a=0}else if(a<t)l.push(e[o+r],e[o+r+1]),o+=r;else{const t=u-a,e=mE(n,c,t/u),d=mE(i,h,t/u);l.push(e,d),s.push(l),l=[e,d],a=0,o+=r}}return a>0&&s.push(l),s}function sz(t,e,n,i,r){let s,o,a,l,c,h,u,d,p,f,g=n,m=n,y=0,v=0,_=n;for(o=n;o<i;o+=r){const n=e[o],i=e[o+1];void 0!==c&&(p=n-c,f=i-h,l=Math.sqrt(p*p+f*f),void 0!==u&&(v+=a,s=Math.acos((u*p+d*f)/(a*l)),s>t&&(v>y&&(y=v,g=_,m=o),v=0,_=o-r)),a=l,u=p,d=f),c=n,h=i}return v+=l,v>y?[_,o]:[g,m]}const oz={left:0,center:.5,right:1,top:0,middle:.5,hanging:.2,alphabetic:.8,ideographic:.8,bottom:1},az={Circle:iz,Default:nz,Image:class extends nz{constructor(t,e,n,i){super(t,e,n,i),this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.anchorX_=void 0,this.anchorY_=void 0,this.height_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.scale_=void 0,this.width_=void 0,this.declutterMode_=void 0,this.declutterImageWithText_=void 0}drawPoint(t,e,n){if(!this.image_||this.maxExtent&&!TE(this.maxExtent,t.getFlatCoordinates()))return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),r=t.getStride(),s=this.coordinates.length,o=this.appendFlatPointCoordinates(i,r);this.instructions.push([6,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([6,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}drawMultiPoint(t,e,n){if(!this.image_)return;this.beginGeometry(t,e,n);const i=t.getFlatCoordinates(),r=[];for(let a=0,l=i.length;a<l;a+=t.getStride())this.maxExtent&&!TE(this.maxExtent,i.slice(a,a+2))||r.push(i[a],i[a+1]);const s=this.coordinates.length,o=this.appendFlatPointCoordinates(r,2);this.instructions.push([6,s,o,this.image_,this.anchorX_*this.imagePixelRatio_,this.anchorY_*this.imagePixelRatio_,Math.ceil(this.height_*this.imagePixelRatio_),this.opacity_,this.originX_*this.imagePixelRatio_,this.originY_*this.imagePixelRatio_,this.rotateWithView_,this.rotation_,[this.scale_[0]*this.pixelRatio/this.imagePixelRatio_,this.scale_[1]*this.pixelRatio/this.imagePixelRatio_],Math.ceil(this.width_*this.imagePixelRatio_),this.declutterMode_,this.declutterImageWithText_]),this.hitDetectionInstructions.push([6,s,o,this.hitDetectionImage_,this.anchorX_,this.anchorY_,this.height_,1,this.originX_,this.originY_,this.rotateWithView_,this.rotation_,this.scale_,this.width_,this.declutterMode_,this.declutterImageWithText_]),this.endGeometry(e)}finish(){return this.reverseHitDetectionInstructions(),this.anchorX_=void 0,this.anchorY_=void 0,this.hitDetectionImage_=null,this.image_=null,this.imagePixelRatio_=void 0,this.height_=void 0,this.scale_=void 0,this.opacity_=void 0,this.originX_=void 0,this.originY_=void 0,this.rotateWithView_=void 0,this.rotation_=void 0,this.width_=void 0,super.finish()}setImageStyle(t,e){const n=t.getAnchor(),i=t.getSize(),r=t.getOrigin();this.imagePixelRatio_=t.getPixelRatio(this.pixelRatio),this.anchorX_=n[0],this.anchorY_=n[1],this.hitDetectionImage_=t.getHitDetectionImage(),this.image_=t.getImage(this.pixelRatio),this.height_=i[1],this.opacity_=t.getOpacity(),this.originX_=r[0],this.originY_=r[1],this.rotateWithView_=t.getRotateWithView(),this.rotation_=t.getRotation(),this.scale_=t.getScaleArray(),this.width_=i[0],this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}},LineString:class extends nz{constructor(t,e,n,i){super(t,e,n,i)}drawFlatCoordinates_(t,e,n,i){const r=[9,this.coordinates.length,this.appendFlatLineCoordinates(t,e,n,i,!1,!1)];return this.instructions.push(r),this.hitDetectionInstructions.push(r),n}drawLineString(t,e,n){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([XA,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,LO,0],tz);const o=t.getFlatCoordinates(),a=t.getStride();this.drawFlatCoordinates_(o,0,o.length,a),this.hitDetectionInstructions.push(QA),this.endGeometry(e)}drawMultiLineString(t,e,n){const i=this.state,r=i.strokeStyle,s=i.lineWidth;if(void 0===r||void 0===s)return;this.updateStrokeStyle(i,this.applyStroke),this.beginGeometry(t,e,n),this.hitDetectionInstructions.push([XA,i.strokeStyle,i.lineWidth,i.lineCap,i.lineJoin,i.miterLimit,LO,0],tz);const o=t.getEnds(),a=t.getFlatCoordinates(),l=t.getStride();let c=0;for(let h=0,u=o.length;h<u;++h)c=this.drawFlatCoordinates_(a,c,o[h],l);this.hitDetectionInstructions.push(QA),this.endGeometry(e)}finish(){const t=this.state;return null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&this.instructions.push(QA),this.reverseHitDetectionInstructions(),this.state=null,super.finish()}applyStroke(t){null!=t.lastStroke&&t.lastStroke!=this.coordinates.length&&(this.instructions.push(QA),t.lastStroke=this.coordinates.length),t.lastStroke=0,super.applyStroke(t),this.instructions.push(tz)}},Polygon:iz,Text:class extends nz{constructor(t,e,n,i){super(t,e,n,i),this.labels_=null,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=void 0,this.textKeepUpright_=void 0,this.textRotation_=0,this.textFillState_=null,this.fillStates={},this.fillStates[EO]={fillStyle:EO},this.textStrokeState_=null,this.strokeStates={},this.textState_={},this.textStates={},this.textKey_="",this.fillKey_="",this.strokeKey_="",this.declutterMode_=void 0,this.declutterImageWithText_=void 0}finish(){const t=super.finish();return t.textStates=this.textStates,t.fillStates=this.fillStates,t.strokeStates=this.strokeStates,t}drawText(t,e,n){const i=this.textFillState_,r=this.textStrokeState_,s=this.textState_;if(""===this.text_||!s||!i&&!r)return;const o=this.coordinates;let a=o.length;const l=t.getType();let c=null,h=t.getStride();if("line"!==s.placement||"LineString"!=l&&"MultiLineString"!=l&&"Polygon"!=l&&"MultiPolygon"!=l){let i=s.overflow?null:[];switch(l){case"Point":case"MultiPoint":c=t.getFlatCoordinates();break;case"LineString":c=t.getFlatMidpoint();break;case"Circle":c=t.getCenter();break;case"MultiLineString":c=t.getFlatMidpoints(),h=2;break;case"Polygon":c=t.getFlatInteriorPoint(),s.overflow||i.push(c[2]/this.resolution),h=3;break;case"MultiPolygon":const e=t.getFlatInteriorPoints();c=[];for(let t=0,n=e.length;t<n;t+=3)s.overflow||i.push(e[t+2]/this.resolution),c.push(e[t],e[t+1]);if(0===c.length)return;h=2}const r=this.appendFlatPointCoordinates(c,h);if(r===a)return;if(i&&(r-a)/2!==c.length/h){let t=a/2;i=i.filter((e,n)=>{const i=o[2*(t+n)]===c[n*h]&&o[2*(t+n)+1]===c[n*h+1];return i||--t,i})}this.saveTextStates_();const u=s.backgroundFill?this.createFill(this.fillStyleToState(s.backgroundFill)):null,d=s.backgroundStroke?this.createStroke(this.strokeStyleToState(s.backgroundStroke)):null;this.beginGeometry(t,e,n);let p=s.padding;if(p!=OO&&(s.scale[0]<0||s.scale[1]<0)){let t=s.padding[0],e=s.padding[1],n=s.padding[2],i=s.padding[3];s.scale[0]<0&&(e=-e,i=-i),s.scale[1]<0&&(t=-t,n=-n),p=[t,e,n,i]}const f=this.pixelRatio;this.instructions.push([6,a,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[1,1],NaN,this.declutterMode_,this.declutterImageWithText_,p==OO?OO:p.map(function(t){return t*f}),u,d,this.text_,this.textKey_,this.strokeKey_,this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]);const g=1/f,m=u?u.slice(0):null;m&&(m[1]=EO),this.hitDetectionInstructions.push([6,a,r,null,NaN,NaN,NaN,1,0,0,this.textRotateWithView_,this.textRotation_,[g,g],NaN,this.declutterMode_,this.declutterImageWithText_,p,m,d,this.text_,this.textKey_,this.strokeKey_,this.fillKey_?EO:this.fillKey_,this.textOffsetX_,this.textOffsetY_,i]),this.endGeometry(e)}else{if(!QE(this.maxExtent,t.getExtent()))return;let i;if(c=t.getFlatCoordinates(),"LineString"==l)i=[c.length];else if("MultiLineString"==l)i=t.getEnds();else if("Polygon"==l)i=t.getEnds().slice(0,1);else if("MultiPolygon"==l){const e=t.getEndss();i=[];for(let t=0,n=e.length;t<n;++t)i.push(e[t][0])}this.beginGeometry(t,e,n);const r=s.repeat,u=r?void 0:s.textAlign;let d=0;for(let t=0,e=i.length;t<e;++t){let e;e=r?rz(r*this.resolution,c,d,i[t],h):[c.slice(d,i[t])];for(let n=0,r=e.length;n<r;++n){const r=e[n];let l=0,c=r.length;if(null==u){const t=sz(s.maxAngle,r,0,r.length,2);l=t[0],c=t[1]}for(let t=l;t<c;t+=h)o.push(r[t],r[t+1]);const p=o.length;d=i[t],this.drawChars_(a,p),a=p}}this.endGeometry(e)}}saveTextStates_(){const t=this.textStrokeState_,e=this.textState_,n=this.textFillState_,i=this.strokeKey_;t&&(i in this.strokeStates||(this.strokeStates[i]={strokeStyle:t.strokeStyle,lineCap:t.lineCap,lineDashOffset:t.lineDashOffset,lineWidth:t.lineWidth,lineJoin:t.lineJoin,miterLimit:t.miterLimit,lineDash:t.lineDash}));const r=this.textKey_;r in this.textStates||(this.textStates[r]={font:e.font,textAlign:e.textAlign||PO,justify:e.justify,textBaseline:e.textBaseline||IO,scale:e.scale});const s=this.fillKey_;n&&(s in this.fillStates||(this.fillStates[s]={fillStyle:n.fillStyle}))}drawChars_(t,e){const n=this.textStrokeState_,i=this.textState_,r=this.strokeKey_,s=this.textKey_,o=this.fillKey_;this.saveTextStates_();const a=this.pixelRatio,l=oz[i.textBaseline],c=this.textOffsetY_*a,h=this.text_,u=n?n.lineWidth*Math.abs(i.scale[0])/2:0;this.instructions.push([5,t,e,l,i.overflow,o,i.maxAngle,a,c,r,u*a,h,s,1,this.declutterMode_,this.textKeepUpright_]),this.hitDetectionInstructions.push([5,t,e,l,i.overflow,o?EO:o,i.maxAngle,a,c,r,u*a,h,s,1/a,this.declutterMode_,this.textKeepUpright_])}setTextStyle(t,e){let n,i,r;if(t){const e=t.getFill();e?(i=this.textFillState_,i||(i={},this.textFillState_=i),i.fillStyle=SO(e.getColor()||EO)):(i=null,this.textFillState_=i);const s=t.getStroke();if(s){r=this.textStrokeState_,r||(r={},this.textStrokeState_=r);const t=s.getLineDash(),e=s.getLineDashOffset(),n=s.getWidth(),i=s.getMiterLimit();r.lineCap=s.getLineCap()||TO,r.lineDash=t?t.slice():LO,r.lineDashOffset=void 0===e?0:e,r.lineJoin=s.getLineJoin()||MO,r.lineWidth=void 0===n?1:n,r.miterLimit=void 0===i?10:i,r.strokeStyle=SO(s.getColor()||RO)}else r=null,this.textStrokeState_=r;n=this.textState_;const o=t.getFont()||kO;BO(o);const a=t.getScaleArray();n.overflow=t.getOverflow(),n.font=o,n.maxAngle=t.getMaxAngle(),n.placement=t.getPlacement(),n.textAlign=t.getTextAlign(),n.repeat=t.getRepeat(),n.justify=t.getJustify(),n.textBaseline=t.getTextBaseline()||IO,n.backgroundFill=t.getBackgroundFill(),n.backgroundStroke=t.getBackgroundStroke(),n.padding=t.getPadding()||OO,n.scale=void 0===a?[1,1]:a;const l=t.getOffsetX(),c=t.getOffsetY(),h=t.getRotateWithView(),u=t.getKeepUpright(),d=t.getRotation();this.text_=t.getText()||"",this.textOffsetX_=void 0===l?0:l,this.textOffsetY_=void 0===c?0:c,this.textRotateWithView_=void 0!==h&&h,this.textKeepUpright_=void 0===u||u,this.textRotation_=void 0===d?0:d,this.strokeKey_=r?("string"==typeof r.strokeStyle?r.strokeStyle:Ok(r.strokeStyle))+r.lineCap+r.lineDashOffset+"|"+r.lineWidth+r.lineJoin+r.miterLimit+"["+r.lineDash.join()+"]":"",this.textKey_=n.font+n.scale+(n.textAlign||"?")+(n.repeat||"?")+(n.justify||"?")+(n.textBaseline||"?"),this.fillKey_=i&&i.fillStyle?"string"==typeof i.fillStyle?i.fillStyle:"|"+Ok(i.fillStyle):""}else this.text_="";this.declutterMode_=t.getDeclutterMode(),this.declutterImageWithText_=e}}};class lz{constructor(t,e,n,i){this.tolerance_=t,this.maxExtent_=e,this.pixelRatio_=i,this.resolution_=n,this.buildersByZIndex_={}}finish(){const t={};for(const e in this.buildersByZIndex_){t[e]=t[e]||{};const n=this.buildersByZIndex_[e];for(const i in n){const r=n[i].finish();t[e][i]=r}}return t}getBuilder(t,e){const n=void 0!==t?t.toString():"0";let i=this.buildersByZIndex_[n];void 0===i&&(i={},this.buildersByZIndex_[n]=i);let r=i[e];return void 0===r&&(r=new(0,az[e])(this.tolerance_,this.maxExtent_,this.resolution_,this.pixelRatio_),i[e]=r),r}}function cz(t,e,n,i,r,s,o,a,l,c,h,u,d=!0){let p=t[e],f=t[e+1],g=0,m=0,y=0,v=0;function _(){g=p,m=f,p=t[e+=i],f=t[e+1],v+=y,y=Math.sqrt((p-g)*(p-g)+(f-m)*(f-m))}do{_()}while(e<n-i&&v+y<s);let b=0===y?0:(s-v)/y;const w=mE(g,p,b),x=mE(m,f,b),C=e-i,S=v,k=s+a*l(c,r,h);for(;e<n-i&&v+y<k;)_();b=0===y?0:(k-v)/y;const E=mE(g,p,b),T=mE(m,f,b);let L=!1;if(d)if(u){const t=[w,x,E,T];NL(t,0,4,2,u,t,t),L=t[0]>t[2]}else L=w>E;const M=Math.PI,R=[],P=C+i===e;let I;if(y=0,v=S,p=t[e=C],f=t[e+1],P){_(),I=Math.atan2(f-m,p-g),L&&(I+=I>0?-M:M);const t=(E+w)/2,e=(T+x)/2;return R[0]=[t,e,(k-s)/2,I,r],R}for(let O=0,A=(r=r.replace(/\n/g," ")).length;O<A;){_();let t=Math.atan2(f-m,p-g);if(L&&(t+=t>0?-M:M),void 0!==I){let e=t-I;if(e+=e>M?-2*M:e<-M?2*M:0,Math.abs(e)>o)return null}I=t;const u=O;let d=0;for(;O<A;++O){const t=a*l(c,r[L?A-O-1:O],h);if(e+i<n&&v+y<s+d+t/2)break;d+=t}if(O===u)continue;const w=L?r.substring(A-u,A-O):r.substring(u,O);b=0===y?0:(s+d/2-v)/y;const x=mE(g,p,b),C=mE(m,f,b);R.push([x,C,d/2,t,w]),s+=d}return R}class hz{constructor(){this.instructions_=[],this.zIndex=0,this.offset_=0,this.context_=new Proxy(KM(),{get:(t,e)=>{if("function"==typeof KM()[e])return this.push_(e),this.pushMethodArgs_},set:(t,e,n)=>(this.push_(e,n),!0)})}push_(...t){const e=this.instructions_,n=this.zIndex+this.offset_;e[n]||(e[n]=[]),e[n].push(...t)}pushMethodArgs_=(...t)=>(this.push_(t),this);pushFunction(t){this.push_(t)}getContext(){return this.context_}draw(t){this.instructions_.forEach(e=>{for(let n=0,i=e.length;n<i;++n){const i=e[n];if("function"==typeof i){i(t);continue}const r=e[++n];if("function"==typeof t[i])t[i](...r);else{if("function"==typeof r){t[i]=r(t);continue}t[i]=r}}})}clear(){this.instructions_.length=0,this.zIndex=0,this.offset_=0}offset(){this.offset_=this.instructions_.length,this.zIndex=0}}const uz=[1/0,1/0,-1/0,-1/0],dz=[],pz=[],fz=[],gz=[];function mz(t){return t[3].declutterBox}const yz=new RegExp("["+String.fromCharCode(1425)+"-"+String.fromCharCode(2303)+String.fromCharCode(64285)+"-"+String.fromCharCode(65023)+String.fromCharCode(65136)+"-"+String.fromCharCode(65276)+String.fromCharCode(67584)+"-"+String.fromCharCode(69631)+String.fromCharCode(124928)+"-"+String.fromCharCode(126975)+"]");function vz(t,e){return"start"===e?e=yz.test(t)?"right":"left":"end"===e&&(e=yz.test(t)?"left":"right"),oz[e]}function _z(t,e,n){return n>0&&t.push("\n",""),t.push(e,""),t}function bz(t,e,n){return n%2==0&&(t+=e),t}class wz{constructor(t,e,n,i,r){this.overlaps=n,this.pixelRatio=e,this.resolution=t,this.alignAndScaleFill_,this.instructions=i.instructions,this.coordinates=i.coordinates,this.coordinateCache_={},this.renderedTransform_=[1,0,0,1,0,0],this.hitDetectionInstructions=i.hitDetectionInstructions,this.pixelCoordinates_=null,this.viewRotation_=0,this.fillStates=i.fillStates||{},this.strokeStates=i.strokeStates||{},this.textStates=i.textStates||{},this.widths_={},this.labels_={},this.zIndexContext_=r?new hz:null}getZIndexContext(){return this.zIndexContext_}createLabel(t,e,n,i){const r=t+e+n+i;if(this.labels_[r])return this.labels_[r];const s=i?this.strokeStates[i]:null,o=n?this.fillStates[n]:null,a=this.textStates[e],l=this.pixelRatio,c=[a.scale[0]*l,a.scale[1]*l],h=a.justify?oz[a.justify]:vz(Array.isArray(t)?t[0]:t,a.textAlign||PO),u=i&&s.lineWidth?s.lineWidth:0,d=Array.isArray(t)?t:String(t).split("\n").reduce(_z,[]),{width:p,height:f,widths:g,heights:m,lineWidths:y}=function(t,e){const n=[],i=[],r=[];let s=0,o=0,a=0,l=0;for(let c=0,h=e.length;c<=h;c+=2){const u=e[c];if("\n"===u||c===h){s=Math.max(s,o),r.push(o),o=0,a+=l,l=0;continue}const d=e[c+1]||t.font,p=VO(d,u);n.push(p),o+=p;const f=UO(d);i.push(f),l=Math.max(l,f)}return{width:s,height:a,widths:n,heights:i,lineWidths:r}}(a,d),v=p+u,_=[],b=(v+2)*c[0],w=(f+u)*c[1],x={width:b<0?Math.floor(b):Math.ceil(b),height:w<0?Math.floor(w):Math.ceil(w),contextInstructions:_};1==c[0]&&1==c[1]||_.push("scale",c),i&&(_.push("strokeStyle",s.strokeStyle),_.push("lineWidth",u),_.push("lineCap",s.lineCap),_.push("lineJoin",s.lineJoin),_.push("miterLimit",s.miterLimit),_.push("setLineDash",[s.lineDash]),_.push("lineDashOffset",s.lineDashOffset)),n&&_.push("fillStyle",o.fillStyle),_.push("textBaseline","middle"),_.push("textAlign","center");const C=.5-h;let S=h*v+C*u;const k=[],E=[];let T,L=0,M=0,R=0,P=0;for(let I=0,O=d.length;I<O;I+=2){const t=d[I];if("\n"===t){M+=L,L=0,S=h*v+C*u,++P;continue}const e=d[I+1]||a.font;e!==T&&(i&&k.push("font",e),n&&E.push("font",e),T=e),L=Math.max(L,m[R]);const r=[t,S+C*g[R]+h*(g[R]-y[P]),.5*(u+L)+M];S+=g[R],i&&k.push("strokeText",r),n&&E.push("fillText",r),++R}return Array.prototype.push.apply(_,k),Array.prototype.push.apply(_,E),this.labels_[r]=x,x}replayTextBackground_(t,e,n,i,r,s,o){t.beginPath(),t.moveTo.apply(t,e),t.lineTo.apply(t,n),t.lineTo.apply(t,i),t.lineTo.apply(t,r),t.lineTo.apply(t,e),s&&(this.alignAndScaleFill_=s[2],t.fillStyle=s[1],this.fill_(t)),o&&(this.setStrokeStyle_(t,o),t.stroke())}calculateImageOrLabelDimensions_(t,e,n,i,r,s,o,a,l,c,h,u,d,p,f,g){let m=n-(o*=u[0]),y=i-(a*=u[1]);const v=r+l>t?t-l:r,_=s+c>e?e-c:s,b=p[3]+v*u[0]+p[1],w=p[0]+_*u[1]+p[2],x=m-p[3],C=y-p[0];let S;return(f||0!==h)&&(dz[0]=x,gz[0]=x,dz[1]=C,pz[1]=C,pz[0]=x+b,fz[0]=pz[0],fz[1]=C+w,gz[1]=fz[1]),0!==h?(S=AL([1,0,0,1,0,0],n,i,1,1,h,-n,-i),IL(S,dz),IL(S,pz),IL(S,fz),IL(S,gz),PE(Math.min(dz[0],pz[0],fz[0],gz[0]),Math.min(dz[1],pz[1],fz[1],gz[1]),Math.max(dz[0],pz[0],fz[0],gz[0]),Math.max(dz[1],pz[1],fz[1],gz[1]),uz)):PE(Math.min(x,x+b),Math.min(C,C+w),Math.max(x,x+b),Math.max(C,C+w),uz),d&&(m=Math.round(m),y=Math.round(y)),{drawImageX:m,drawImageY:y,drawImageW:v,drawImageH:_,originX:l,originY:c,declutterBox:{minX:uz[0],minY:uz[1],maxX:uz[2],maxY:uz[3],value:g},canvasTransform:S,scale:u}}replayImageOrLabel_(t,e,n,i,r,s,o){const a=!(!s&&!o),l=i.declutterBox,c=o?o[2]*i.scale[0]/2:0;return l.minX-c<=e[0]&&l.maxX+c>=0&&l.minY-c<=e[1]&&l.maxY+c>=0&&(a&&this.replayTextBackground_(t,dz,pz,fz,gz,s,o),function(t,e,n,i,r,s,o,a,l,c,h){t.save(),1!==n&&(void 0===t.globalAlpha?t.globalAlpha=t=>t.globalAlpha*=n:t.globalAlpha*=n),e&&t.transform.apply(t,e),i.contextInstructions?(t.translate(l,c),t.scale(h[0],h[1]),function(t,e){const n=t.contextInstructions;for(let i=0,r=n.length;i<r;i+=2)Array.isArray(n[i+1])?e[n[i]].apply(e,n[i+1]):e[n[i]]=n[i+1]}(i,t)):h[0]<0||h[1]<0?(t.translate(l,c),t.scale(h[0],h[1]),t.drawImage(i,r,s,o,a,0,0,o,a)):t.drawImage(i,r,s,o,a,l,c,o*h[0],a*h[1]),t.restore()}(t,i.canvasTransform,r,n,i.originX,i.originY,i.drawImageW,i.drawImageH,i.drawImageX,i.drawImageY,i.scale)),!0}fill_(t){const e=this.alignAndScaleFill_;if(e){const n=IL(this.renderedTransform_,[0,0]),i=512*this.pixelRatio;t.save(),t.translate(n[0]%i,n[1]%i),1!==e&&t.scale(e,e),t.rotate(this.viewRotation_)}t.fill(),e&&t.restore()}setStrokeStyle_(t,e){t.strokeStyle=e[1],e[1]&&(t.lineWidth=e[2],t.lineCap=e[3],t.lineJoin=e[4],t.miterLimit=e[5],t.lineDashOffset=e[7],t.setLineDash(e[6]))}drawLabelWithPointPlacement_(t,e,n,i){const r=this.textStates[e],s=this.createLabel(t,e,i,n),o=this.strokeStates[n],a=this.pixelRatio,l=vz(Array.isArray(t)?t[0]:t,r.textAlign||PO),c=oz[r.textBaseline||IO],h=o&&o.lineWidth?o.lineWidth:0;return{label:s,anchorX:l*(s.width/a-2*r.scale[0])+2*(.5-l)*h,anchorY:c*s.height/a+2*(.5-c)*h}}execute_(t,e,n,i,r,s,o,a){const l=this.zIndexContext_;let c;var h,u;this.pixelCoordinates_&&yk(n,this.renderedTransform_)?c=this.pixelCoordinates_:(this.pixelCoordinates_||(this.pixelCoordinates_=[]),c=DL(this.coordinates,0,this.coordinates.length,2,n,this.pixelCoordinates_),u=n,(h=this.renderedTransform_)[0]=u[0],h[1]=u[1],h[2]=u[2],h[3]=u[3],h[4]=u[4],h[5]=u[5]);let d=0;const p=i.length;let f,g,m,y,v,_,b,w,x,C,S,k,E,T=0,L=0,M=0;const R=this.coordinateCache_,P=this.viewRotation_,I=Math.round(1e12*Math.atan2(-n[1],n[0]))/1e12,O={context:t,pixelRatio:this.pixelRatio,resolution:this.resolution,rotation:P},A=this.instructions!=i||this.overlaps?0:200;let z,F,j,D;for(;d<p;){const n=i[d];switch(n[0]){case 0:z=n[1],D=n[3],z.getGeometry()?void 0===o||QE(o,D.getExtent())?++d:d=n[2]+1:d=n[2],l&&(l.zIndex=n[4]);break;case 1:L>A&&(this.fill_(t),L=0),M>A&&(t.stroke(),M=0),L||M||(t.beginPath(),v=NaN,_=NaN),++d;break;case 2:T=n[1];const i=c[T],h=c[T+1],u=c[T+2]-i,p=c[T+3]-h,N=Math.sqrt(u*u+p*p);t.moveTo(i+N,h),t.arc(i,h,N,0,2*Math.PI,!0),++d;break;case 3:t.closePath(),++d;break;case 4:T=n[1],f=n[2];const B=n[3],U=n[4],q=n[5];O.geometry=B,O.feature=z,d in R||(R[d]=[]);const V=R[d];q?q(c,T,f,2,V):(V[0]=c[T],V[1]=c[T+1],V.length=2),l&&(l.zIndex=n[6]),U(V,O),++d;break;case 6:T=n[1],f=n[2],x=n[3],g=n[4],m=n[5];let $=n[6];const G=n[7],W=n[8],H=n[9],Z=n[10];let K=n[11];const Y=n[12];let X=n[13];y=n[14]||"declutter";const J=n[15];if(!x&&n.length>=20){C=n[19],S=n[20],k=n[21],E=n[22];const t=this.drawLabelWithPointPlacement_(C,S,k,E);x=t.label,n[3]=x;const e=n[23];g=(t.anchorX-e)*this.pixelRatio,n[4]=g;const i=n[24];m=(t.anchorY-i)*this.pixelRatio,n[5]=m,$=x.height,n[6]=$,X=x.width,n[13]=X}let Q,tt,et,nt;n.length>25&&(Q=n[25]),n.length>17?(tt=n[16],et=n[17],nt=n[18]):(tt=OO,et=null,nt=null),Z&&I?K+=P:Z||I||(K-=P);let it=0;for(;T<f;T+=2){if(Q&&Q[it++]<X/this.pixelRatio)continue;const n=this.calculateImageOrLabelDimensions_(x.width,x.height,c[T],c[T+1],X,$,g,m,W,H,K,Y,r,tt,!!et||!!nt,z),i=[t,e,x,n,G,et,nt];if(a){let t,e,r,s,o;if(J){const n=f-T;if(!J[n]){J[n]={args:i,declutterMode:y};continue}const s=J[n];t=s.args,e=s.declutterMode,delete J[n],r=mz(t)}if(!t||"declutter"===e&&a.collides(r)||(s=!0),"declutter"===y&&a.collides(n.declutterBox)||(o=!0),"declutter"===e&&"declutter"===y){const t=s&&o;s=t,o=t}s&&("none"!==e&&a.insert(r),this.replayImageOrLabel_.apply(this,t)),o&&("none"!==y&&a.insert(n.declutterBox),this.replayImageOrLabel_.apply(this,i))}else this.replayImageOrLabel_.apply(this,i)}++d;break;case 5:const rt=n[1],st=n[2],ot=n[3],at=n[4];E=n[5];const lt=n[6],ct=n[7],ht=n[8];k=n[9];const ut=n[10];C=n[11],Array.isArray(C)&&(C=C.reduce(bz,"")),S=n[12];const dt=[n[13],n[13]];y=n[14]||"declutter";const pt=n[15],ft=this.textStates[S],gt=ft.font,mt=[ft.scale[0]*ct,ft.scale[1]*ct];let yt;gt in this.widths_?yt=this.widths_[gt]:(yt={},this.widths_[gt]=yt);const vt=$A(c,rt,st,2),_t=Math.abs(mt[0])*$O(gt,C,yt);if(at||_t<=vt){const n=cz(c,rt,st,2,C,(vt-_t)*vz(C,this.textStates[S].textAlign),lt,Math.abs(mt[0]),$O,gt,yt,I?0:this.viewRotation_,pt);t:if(n){const i=[];let r,s,o,l,c;if(k)for(r=0,s=n.length;r<s;++r){c=n[r],o=c[4],l=this.createLabel(o,S,"",k),g=c[2]+(mt[0]<0?-ut:ut),m=ot*l.height+2*(.5-ot)*ut*mt[1]/mt[0]-ht;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,c[0],c[1],l.width,l.height,g,m,0,0,c[3],dt,!1,OO,!1,z);if(a&&"declutter"===y&&a.collides(s.declutterBox))break t;i.push([t,e,l,s,1,null,null])}if(E)for(r=0,s=n.length;r<s;++r){c=n[r],o=c[4],l=this.createLabel(o,S,E,""),g=c[2],m=ot*l.height-ht;const s=this.calculateImageOrLabelDimensions_(l.width,l.height,c[0],c[1],l.width,l.height,g,m,0,0,c[3],dt,!1,OO,!1,z);if(a&&"declutter"===y&&a.collides(s.declutterBox))break t;i.push([t,e,l,s,1,null,null])}a&&"none"!==y&&a.load(i.map(mz));for(let t=0,e=i.length;t<e;++t)this.replayImageOrLabel_.apply(this,i[t])}}++d;break;case 7:if(void 0!==s){z=n[1];const t=s(z,D,y);if(t)return t}++d;break;case 8:A?L++:this.fill_(t),++d;break;case 9:for(T=n[1],f=n[2],F=c[T],j=c[T+1],t.moveTo(F,j),v=F+.5|0,_=j+.5|0,T+=2;T<f;T+=2)F=c[T],j=c[T+1],b=F+.5|0,w=j+.5|0,T!=f-2&&b===v&&w===_||(t.lineTo(F,j),v=b,_=w);++d;break;case 10:this.alignAndScaleFill_=n[2],L&&(this.fill_(t),L=0,M&&(t.stroke(),M=0)),t.fillStyle=n[1],++d;break;case XA:M&&(t.stroke(),M=0),this.setStrokeStyle_(t,n),++d;break;case 12:A?M++:t.stroke(),++d;break;default:++d}}L&&this.fill_(t),M&&t.stroke()}execute(t,e,n,i,r,s){this.viewRotation_=i,this.execute_(t,e,n,this.instructions,r,void 0,void 0,s)}executeHitDetection(t,e,n,i,r){return this.viewRotation_=n,this.execute_(t,[t.canvas.width,t.canvas.height],e,this.hitDetectionInstructions,!0,i,r)}}const xz=["Polygon","Circle","LineString","Image","Text","Default"],Cz=["Image","Text"],Sz=xz.filter(t=>!Cz.includes(t));class kz{constructor(t,e,n,i,r,s,o){this.maxExtent_=t,this.overlaps_=i,this.pixelRatio_=n,this.resolution_=e,this.renderBuffer_=s,this.executorsByZIndex_={},this.hitDetectionContext_=null,this.hitDetectionTransform_=[1,0,0,1,0,0],this.renderedContext_=null,this.deferredZIndexContexts_={},this.createExecutors_(r,o)}clip(t,e){const n=this.getClipCoords(e);t.beginPath(),t.moveTo(n[0],n[1]),t.lineTo(n[2],n[3]),t.lineTo(n[4],n[5]),t.lineTo(n[6],n[7]),t.clip()}createExecutors_(t,e){for(const n in t){let i=this.executorsByZIndex_[n];void 0===i&&(i={},this.executorsByZIndex_[n]=i);const r=t[n];for(const t in r){const n=r[t];i[t]=new wz(this.resolution_,this.pixelRatio_,this.overlaps_,n,e)}}}hasExecutors(t){for(const e in this.executorsByZIndex_){const n=this.executorsByZIndex_[e];for(let e=0,i=t.length;e<i;++e)if(t[e]in n)return!0}return!1}forEachFeatureAtCoordinate(t,e,n,i,r,s){const o=2*(i=Math.round(i))+1,a=AL(this.hitDetectionTransform_,i+.5,i+.5,1/e,-1/e,-n,-t[0],-t[1]),l=!this.hitDetectionContext_;l&&(this.hitDetectionContext_=HM(o,o));const c=this.hitDetectionContext_;let h;c.canvas.width!==o||c.canvas.height!==o?(c.canvas.width=o,c.canvas.height=o):l||c.clearRect(0,0,o,o),void 0!==this.renderBuffer_&&(h=[1/0,1/0,-1/0,-1/0],jE(h,t),SE(h,e*(this.renderBuffer_+i),h));const u=function(t){if(void 0!==Ez[t])return Ez[t];const e=2*t+1,n=t*t,i=new Array(n+1);for(let s=0;s<=t;++s)for(let r=0;r<=t;++r){const o=s*s+r*r;if(o>n)break;let a=i[o];a||(a=[],i[o]=a),a.push(4*((t+s)*e+(t+r))+3),s>0&&a.push(4*((t-s)*e+(t+r))+3),r>0&&(a.push(4*((t+s)*e+(t-r))+3),s>0&&a.push(4*((t-s)*e+(t-r))+3))}const r=[];for(let s=0,o=i.length;s<o;++s)i[s]&&r.push(...i[s]);return Ez[t]=r,r}(i);let d;function p(t,e,n){const a=c.getImageData(0,0,o,o).data;for(let l=0,h=u.length;l<h;l++)if(a[u[l]]>0){if(!s||"none"===n||"Image"!==d&&"Text"!==d||s.includes(t)){const n=(u[l]-3)/4,s=i-n%o,a=i-(n/o|0),c=r(t,e,s*s+a*a);if(c)return c}c.clearRect(0,0,o,o);break}}const f=Object.keys(this.executorsByZIndex_).map(Number);let g,m,y,v,_;for(f.sort(dk),g=f.length-1;g>=0;--g){const t=f[g].toString();for(y=this.executorsByZIndex_[t],m=xz.length-1;m>=0;--m)if(d=xz[m],v=y[d],void 0!==v&&(_=v.executeHitDetection(c,a,n,p,h),_))return _}}getClipCoords(t){const e=this.maxExtent_;if(!e)return null;const n=e[0],i=e[1],r=e[2],s=e[3],o=[n,i,n,s,r,s,r,i];return DL(o,0,8,2,t,o),o}isEmpty(){return Sk(this.executorsByZIndex_)}execute(t,e,n,i,r,s,o){const a=Object.keys(this.executorsByZIndex_).map(Number);a.sort(o?pk:dk),s=s||xz;const l=xz.length;for(let c=0,h=a.length;c<h;++c){const h=a[c].toString(),u=this.executorsByZIndex_[h];for(let d=0,p=s.length;d<p;++d){const h=s[d],p=u[h];if(void 0!==p){const s=null===o?void 0:p.getZIndexContext(),u=s?s.getContext():t,d=this.maxExtent_&&"Image"!==h&&"Text"!==h;if(d&&(u.save(),this.clip(u,n)),s&&"Text"!==h&&"Image"!==h?s.pushFunction(t=>p.execute(t,e,n,i,r,o)):p.execute(u,e,n,i,r,o),d&&u.restore(),s){s.offset();const t=a[c]*l+xz.indexOf(h);this.deferredZIndexContexts_[t]||(this.deferredZIndexContexts_[t]=[]),this.deferredZIndexContexts_[t].push(s)}}}}this.renderedContext_=t}getDeferredZIndexContexts(){return this.deferredZIndexContexts_}getRenderedContext(){return this.renderedContext_}renderDeferred(){const t=this.deferredZIndexContexts_,e=Object.keys(t).map(Number).sort(dk);for(let n=0,i=e.length;n<i;++n)t[e[n]].forEach(t=>{t.draw(this.renderedContext_),t.clear()}),t[e[n]].length=0}}const Ez={};class Tz extends YA{constructor(t,e,n,i,r,s,o){super(),this.context_=t,this.pixelRatio_=e,this.extent_=n,this.transform_=i,this.transformRotation_=i?yE(Math.atan2(i[1],i[0]),10):0,this.viewRotation_=r,this.squaredTolerance_=s,this.userTransform_=o,this.contextFillState_=null,this.contextStrokeState_=null,this.contextTextState_=null,this.fillState_=null,this.strokeState_=null,this.image_=null,this.imageAnchorX_=0,this.imageAnchorY_=0,this.imageHeight_=0,this.imageOpacity_=0,this.imageOriginX_=0,this.imageOriginY_=0,this.imageRotateWithView_=!1,this.imageRotation_=0,this.imageScale_=[0,0],this.imageWidth_=0,this.text_="",this.textOffsetX_=0,this.textOffsetY_=0,this.textRotateWithView_=!1,this.textRotation_=0,this.textScale_=[0,0],this.textFillState_=null,this.textStrokeState_=null,this.textState_=null,this.pixelCoordinates_=[],this.tmpLocalTransform_=[1,0,0,1,0,0]}drawImages_(t,e,n,i){if(!this.image_)return;const r=DL(t,e,n,i,this.transform_,this.pixelCoordinates_),s=this.context_,o=this.tmpLocalTransform_,a=s.globalAlpha;1!=this.imageOpacity_&&(s.globalAlpha=a*this.imageOpacity_);let l=this.imageRotation_;0===this.transformRotation_&&(l-=this.viewRotation_),this.imageRotateWithView_&&(l+=this.viewRotation_);for(let c=0,h=r.length;c<h;c+=2){const t=r[c]-this.imageAnchorX_,e=r[c+1]-this.imageAnchorY_;if(0!==l||1!=this.imageScale_[0]||1!=this.imageScale_[1]){const n=t+this.imageAnchorX_,i=e+this.imageAnchorY_;AL(o,n,i,1,1,l,-n,-i),s.save(),s.transform.apply(s,o),s.translate(n,i),s.scale(this.imageScale_[0],this.imageScale_[1]),s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,-this.imageAnchorX_,-this.imageAnchorY_,this.imageWidth_,this.imageHeight_),s.restore()}else s.drawImage(this.image_,this.imageOriginX_,this.imageOriginY_,this.imageWidth_,this.imageHeight_,t,e,this.imageWidth_,this.imageHeight_)}1!=this.imageOpacity_&&(s.globalAlpha=a)}drawText_(t,e,n,i){if(!this.textState_||""===this.text_)return;this.textFillState_&&this.setContextFillState_(this.textFillState_),this.textStrokeState_&&this.setContextStrokeState_(this.textStrokeState_),this.setContextTextState_(this.textState_);const r=DL(t,e,n,i,this.transform_,this.pixelCoordinates_),s=this.context_;let o=this.textRotation_;for(0===this.transformRotation_&&(o-=this.viewRotation_),this.textRotateWithView_&&(o+=this.viewRotation_);e<n;e+=i){const t=r[e]+this.textOffsetX_,n=r[e+1]+this.textOffsetY_;0!==o||1!=this.textScale_[0]||1!=this.textScale_[1]?(s.save(),s.translate(t-this.textOffsetX_,n-this.textOffsetY_),s.rotate(o),s.translate(this.textOffsetX_,this.textOffsetY_),s.scale(this.textScale_[0],this.textScale_[1]),this.textStrokeState_&&s.strokeText(this.text_,0,0),this.textFillState_&&s.fillText(this.text_,0,0),s.restore()):(this.textStrokeState_&&s.strokeText(this.text_,t,n),this.textFillState_&&s.fillText(this.text_,t,n))}}moveToLineTo_(t,e,n,i,r){const s=this.context_,o=DL(t,e,n,i,this.transform_,this.pixelCoordinates_);s.moveTo(o[0],o[1]);let a=o.length;r&&(a-=2);for(let l=2;l<a;l+=2)s.lineTo(o[l],o[l+1]);return r&&s.closePath(),n}drawRings_(t,e,n,i){for(let r=0,s=n.length;r<s;++r)e=this.moveToLineTo_(t,e,n[r],i,!0);return e}drawCircle(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),QE(this.extent_,t.getExtent())){if(this.fillState_||this.strokeState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=function(t,e,n){const i=t.getFlatCoordinates();if(!i)return null;const r=t.getStride();return DL(i,0,i.length,r,e,n)}(t,this.transform_,this.pixelCoordinates_),n=e[2]-e[0],i=e[3]-e[1],r=Math.sqrt(n*n+i*i),s=this.context_;s.beginPath(),s.arc(e[0],e[1],r,0,2*Math.PI),this.fillState_&&s.fill(),this.strokeState_&&s.stroke()}""!==this.text_&&this.drawText_(t.getCenter(),0,2,2)}}setStyle(t){this.setFillStrokeStyle(t.getFill(),t.getStroke()),this.setImageStyle(t.getImage()),this.setTextStyle(t.getText())}setTransform(t){this.transform_=t}drawGeometry(t){switch(t.getType()){case"Point":this.drawPoint(t);break;case"LineString":this.drawLineString(t);break;case"Polygon":this.drawPolygon(t);break;case"MultiPoint":this.drawMultiPoint(t);break;case"MultiLineString":this.drawMultiLineString(t);break;case"MultiPolygon":this.drawMultiPolygon(t);break;case"GeometryCollection":this.drawGeometryCollection(t);break;case"Circle":this.drawCircle(t)}}drawFeature(t,e){const n=e.getGeometryFunction()(t);n&&(this.setStyle(e),this.drawGeometry(n))}drawGeometryCollection(t){const e=t.getGeometriesArray();for(let n=0,i=e.length;n<i;++n)this.drawGeometry(e[n])}drawPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)}drawMultiPoint(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getFlatCoordinates(),n=t.getStride();this.image_&&this.drawImages_(e,0,e.length,n),""!==this.text_&&this.drawText_(e,0,e.length,n)}drawLineString(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),QE(this.extent_,t.getExtent())){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();e.beginPath(),this.moveToLineTo_(n,0,n.length,t.getStride(),!1),e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoint();this.drawText_(e,0,2,2)}}}drawMultiLineString(t){this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_));const e=t.getExtent();if(QE(this.extent_,e)){if(this.strokeState_){this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getFlatCoordinates();let i=0;const r=t.getEnds(),s=t.getStride();e.beginPath();for(let t=0,o=r.length;t<o;++t)i=this.moveToLineTo_(n,i,r[t],s,!1);e.stroke()}if(""!==this.text_){const e=t.getFlatMidpoints();this.drawText_(e,0,e.length,2)}}}drawPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),QE(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_;e.beginPath(),this.drawRings_(t.getOrientedFlatCoordinates(),0,t.getEnds(),t.getStride()),this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoint();this.drawText_(e,0,2,2)}}}drawMultiPolygon(t){if(this.squaredTolerance_&&(t=t.simplifyTransformed(this.squaredTolerance_,this.userTransform_)),QE(this.extent_,t.getExtent())){if(this.strokeState_||this.fillState_){this.fillState_&&this.setContextFillState_(this.fillState_),this.strokeState_&&this.setContextStrokeState_(this.strokeState_);const e=this.context_,n=t.getOrientedFlatCoordinates();let i=0;const r=t.getEndss(),s=t.getStride();e.beginPath();for(let t=0,o=r.length;t<o;++t){const e=r[t];i=this.drawRings_(n,i,e,s)}this.fillState_&&e.fill(),this.strokeState_&&e.stroke()}if(""!==this.text_){const e=t.getFlatInteriorPoints();this.drawText_(e,0,e.length,2)}}}setContextFillState_(t){const e=this.context_,n=this.contextFillState_;n?n.fillStyle!=t.fillStyle&&(n.fillStyle=t.fillStyle,e.fillStyle=t.fillStyle):(e.fillStyle=t.fillStyle,this.contextFillState_={fillStyle:t.fillStyle})}setContextStrokeState_(t){const e=this.context_,n=this.contextStrokeState_;n?(n.lineCap!=t.lineCap&&(n.lineCap=t.lineCap,e.lineCap=t.lineCap),yk(n.lineDash,t.lineDash)||e.setLineDash(n.lineDash=t.lineDash),n.lineDashOffset!=t.lineDashOffset&&(n.lineDashOffset=t.lineDashOffset,e.lineDashOffset=t.lineDashOffset),n.lineJoin!=t.lineJoin&&(n.lineJoin=t.lineJoin,e.lineJoin=t.lineJoin),n.lineWidth!=t.lineWidth&&(n.lineWidth=t.lineWidth,e.lineWidth=t.lineWidth),n.miterLimit!=t.miterLimit&&(n.miterLimit=t.miterLimit,e.miterLimit=t.miterLimit),n.strokeStyle!=t.strokeStyle&&(n.strokeStyle=t.strokeStyle,e.strokeStyle=t.strokeStyle)):(e.lineCap=t.lineCap,e.setLineDash(t.lineDash),e.lineDashOffset=t.lineDashOffset,e.lineJoin=t.lineJoin,e.lineWidth=t.lineWidth,e.miterLimit=t.miterLimit,e.strokeStyle=t.strokeStyle,this.contextStrokeState_={lineCap:t.lineCap,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,lineJoin:t.lineJoin,lineWidth:t.lineWidth,miterLimit:t.miterLimit,strokeStyle:t.strokeStyle})}setContextTextState_(t){const e=this.context_,n=this.contextTextState_,i=t.textAlign?t.textAlign:PO;n?(n.font!=t.font&&(n.font=t.font,e.font=t.font),n.textAlign!=i&&(n.textAlign=i,e.textAlign=i),n.textBaseline!=t.textBaseline&&(n.textBaseline=t.textBaseline,e.textBaseline=t.textBaseline)):(e.font=t.font,e.textAlign=i,e.textBaseline=t.textBaseline,this.contextTextState_={font:t.font,textAlign:i,textBaseline:t.textBaseline})}setFillStrokeStyle(t,e){if(t){const e=t.getColor();this.fillState_={fillStyle:SO(e||EO)}}else this.fillState_=null;if(e){const t=e.getColor(),n=e.getLineCap(),i=e.getLineDash(),r=e.getLineDashOffset(),s=e.getLineJoin(),o=e.getWidth(),a=e.getMiterLimit(),l=i||LO;this.strokeState_={lineCap:void 0!==n?n:TO,lineDash:1===this.pixelRatio_?l:l.map(t=>t*this.pixelRatio_),lineDashOffset:(r||0)*this.pixelRatio_,lineJoin:void 0!==s?s:MO,lineWidth:(void 0!==o?o:1)*this.pixelRatio_,miterLimit:void 0!==a?a:10,strokeStyle:SO(t||RO)}}else this.strokeState_=null}setImageStyle(t){let e;if(!t||!(e=t.getSize()))return void(this.image_=null);const n=t.getPixelRatio(this.pixelRatio_),i=t.getAnchor(),r=t.getOrigin();this.image_=t.getImage(this.pixelRatio_),this.imageAnchorX_=i[0]*n,this.imageAnchorY_=i[1]*n,this.imageHeight_=e[1]*n,this.imageOpacity_=t.getOpacity(),this.imageOriginX_=r[0],this.imageOriginY_=r[1],this.imageRotateWithView_=t.getRotateWithView(),this.imageRotation_=t.getRotation();const s=t.getScaleArray();this.imageScale_=[s[0]*this.pixelRatio_/n,s[1]*this.pixelRatio_/n],this.imageWidth_=e[0]*n}setTextStyle(t){if(t){const e=t.getFill();if(e){const t=e.getColor();this.textFillState_={fillStyle:SO(t||EO)}}else this.textFillState_=null;const n=t.getStroke();if(n){const t=n.getColor(),e=n.getLineCap(),i=n.getLineDash(),r=n.getLineDashOffset(),s=n.getLineJoin(),o=n.getWidth(),a=n.getMiterLimit();this.textStrokeState_={lineCap:void 0!==e?e:TO,lineDash:i||LO,lineDashOffset:r||0,lineJoin:void 0!==s?s:MO,lineWidth:void 0!==o?o:1,miterLimit:void 0!==a?a:10,strokeStyle:SO(t||RO)}}else this.textStrokeState_=null;const i=t.getFont(),r=t.getOffsetX(),s=t.getOffsetY(),o=t.getRotateWithView(),a=t.getRotation(),l=t.getScaleArray(),c=t.getText(),h=t.getTextAlign(),u=t.getTextBaseline();this.textState_={font:void 0!==i?i:kO,textAlign:void 0!==h?h:PO,textBaseline:void 0!==u?u:IO},this.text_=void 0!==c?Array.isArray(c)?c.reduce((t,e,n)=>t+(n%2?" ":e),""):c:"",this.textOffsetX_=void 0!==r?this.pixelRatio_*r:0,this.textOffsetY_=void 0!==s?this.pixelRatio_*s:0,this.textRotateWithView_=void 0!==o&&o,this.textRotation_=void 0!==a?a:0,this.textScale_=[this.pixelRatio_*l[0],this.pixelRatio_*l[1]]}else this.text_=""}}const Lz=.5;function Mz(t,e,n,i,r,s,o,a,l){const c=r,h=HM(t[0]*Lz,t[1]*Lz);h.imageSmoothingEnabled=!1;const u=h.canvas,d=new Tz(h,Lz,r,null,o,a,l?yL(null,l):null),p=n.length,f=Math.floor(16777215/p),g={};for(let y=1;y<=p;++y){const t=n[y-1],e=t.getStyleFunction()||i;if(!e)continue;let r=e(t,s);if(!r)continue;Array.isArray(r)||(r=[r]);const o=(y*f).toString(16).padStart(7,"#00000");for(let n=0,i=r.length;n<i;++n){const e=r[n],i=e.getGeometryFunction()(t);if(!i||!QE(c,i.getExtent()))continue;const s=e.clone(),a=s.getFill();a&&a.setColor(o);const l=s.getStroke();l&&(l.setColor(o),l.setLineDash(null)),s.setText(void 0);const h=e.getImage();if(h){const t=h.getImageSize();if(!t)continue;const e=HM(t[0],t[1],void 0,{alpha:!1}),n=e.canvas;e.fillStyle=o,e.fillRect(0,0,n.width,n.height),s.setImage(new YO({img:n,anchor:h.getAnchor(),anchorXUnits:"pixels",anchorYUnits:"pixels",offset:h.getOrigin(),opacity:1,size:h.getSize(),scale:h.getScale(),rotation:h.getRotation(),rotateWithView:h.getRotateWithView()}))}const u=s.getZIndex()||0;let d=g[u];d||(d={},g[u]=d,d.Polygon=[],d.Circle=[],d.LineString=[],d.Point=[]);const p=i.getType();if("GeometryCollection"===p){const t=i.getGeometriesArrayRecursive();for(let e=0,n=t.length;e<n;++e){const n=t[e];d[n.getType().replace("Multi","")].push(n,s)}}else d[p.replace("Multi","")].push(i,s)}}const m=Object.keys(g).map(Number).sort(dk);for(let y=0,v=m.length;y<v;++y){const t=g[m[y]];for(const n in t){const i=t[n];for(let t=0,n=i.length;t<n;t+=2){d.setStyle(i[t+1]);for(let n=0,r=e.length;n<r;++n)d.setTransform(e[n]),d.drawGeometry(i[t])}}}return h.getImageData(0,0,u.width,u.height)}function Rz(t,e,n){const i=[];if(n){const r=Math.floor(Math.round(t[0])*Lz),s=Math.floor(Math.round(t[1])*Lz),o=4*(hE(r,0,n.width-1)+hE(s,0,n.height-1)*n.width),a=n.data[o],l=n.data[o+1],c=n.data[o+2]+256*(l+256*a),h=Math.floor(16777215/e.length);c&&c%h===0&&i.push(e[c/h-1])}return i}const Pz={Point:function(t,e,n,i,r,s){const o=n.getImage(),a=n.getText(),l=a&&a.getText(),c=s&&o&&l?{}:void 0;if(o){if(2!=o.getImageState())return;const s=t.getBuilder(n.getZIndex(),"Image");s.setImageStyle(o,c),s.drawPoint(e,i,r)}if(l){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(a,c),s.drawText(e,i,r)}},LineString:function(t,e,n,i,r){const s=n.getStroke();if(s){const o=t.getBuilder(n.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawLineString(e,i,r)}const o=n.getText();if(o&&o.getText()){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,i,r)}},Polygon:function(t,e,n,i,r){const s=n.getFill(),o=n.getStroke();if(s||o){const a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawPolygon(e,i,r)}const a=n.getText();if(a&&a.getText()){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,i,r)}},MultiPoint:function(t,e,n,i,r,s){const o=n.getImage(),a=o&&0!==o.getOpacity(),l=n.getText(),c=l&&l.getText(),h=s&&a&&c?{}:void 0;if(a){if(2!=o.getImageState())return;const s=t.getBuilder(n.getZIndex(),"Image");s.setImageStyle(o,h),s.drawMultiPoint(e,i,r)}if(c){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(l,h),s.drawText(e,i,r)}},MultiLineString:function(t,e,n,i,r){const s=n.getStroke();if(s){const o=t.getBuilder(n.getZIndex(),"LineString");o.setFillStrokeStyle(null,s),o.drawMultiLineString(e,i,r)}const o=n.getText();if(o&&o.getText()){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(o),s.drawText(e,i,r)}},MultiPolygon:function(t,e,n,i,r){const s=n.getFill(),o=n.getStroke();if(o||s){const a=t.getBuilder(n.getZIndex(),"Polygon");a.setFillStrokeStyle(s,o),a.drawMultiPolygon(e,i,r)}const a=n.getText();if(a&&a.getText()){const s=t.getBuilder(n.getZIndex(),"Text");s.setTextStyle(a),s.drawText(e,i,r)}},GeometryCollection:function(t,e,n,i,r,s){const o=e.getGeometriesArray();let a,l;for(a=0,l=o.length;a<l;++a)(0,Pz[o[a].getType()])(t,o[a],n,i,r,s)},Circle:function(t,e,n,i,r){const s=n.getFill(),o=n.getStroke();if(s||o){const a=t.getBuilder(n.getZIndex(),"Circle");a.setFillStrokeStyle(s,o),a.drawCircle(e,i,r)}const a=n.getText();if(a&&a.getText()){const r=t.getBuilder(n.getZIndex(),"Text");r.setTextStyle(a),r.drawText(e,i)}}};function Iz(t,e){return parseInt(Ok(t),10)-parseInt(Ok(e),10)}function Oz(t,e){const n=Az(t,e);return n*n}function Az(t,e){return.5*t/e}function zz(t,e,n,i,r,s,o,a){const l=[],c=n.getImage();if(c){let t=!0;const e=c.getImageState();2==e||3==e?t=!1:0==e&&c.load(),t&&l.push(c.ready())}const h=n.getFill();h&&h.loading()&&l.push(h.ready());const u=l.length>0;return u&&Promise.all(l).then(()=>r(null)),function(t,e,n,i,r,s,o){const a=n.getGeometryFunction()(e);if(!a)return;const l=a.simplifyTransformed(i,r);n.getRenderer()?Fz(t,l,n,e,o):(0,Pz[l.getType()])(t,l,n,e,o,s)}(t,e,n,i,s,o,a),u}function Fz(t,e,n,i,r){if("GeometryCollection"==e.getType()){const s=e.getGeometries();for(let e=0,o=s.length;e<o;++e)Fz(t,s[e],n,i,r);return}t.getBuilder(n.getZIndex(),"Default").drawCustom(e,i,n.getRenderer(),n.getHitDetectionRenderer(),r)}class jz extends Rk{constructor(t){super(),this.ready=!0,this.boundHandleImageChange_=this.handleImageChange_.bind(this),this.layer_=t,this.staleKeys_=new Array,this.maxStaleKeys=5}getStaleKeys(){return this.staleKeys_}prependStaleKey(t){this.staleKeys_.unshift(t),this.staleKeys_.length>this.maxStaleKeys&&(this.staleKeys_.length=this.maxStaleKeys)}getFeatures(t){return Pk()}getData(t){return null}prepareFrame(t){return Pk()}renderFrame(t,e){return Pk()}forEachFeatureAtCoordinate(t,e,n,i,r){}getLayer(){return this.layer_}handleFontsChanged(){}handleImageChange_(t){const e=t.target;2!==e.getState()&&3!==e.getState()||this.renderIfReadyAndVisible()}loadImage(t){let e=t.getState();return 2!=e&&3!=e&&t.addEventListener(rk,this.boundHandleImageChange_),0==e&&(t.load(),e=t.getState()),2==e}renderIfReadyAndVisible(){const t=this.getLayer();t&&t.getVisible()&&"ready"===t.getSourceState()&&t.changed()}renderDeferred(t){}disposeInternal(){delete this.layer_,super.disposeInternal()}}const Dz=[];let Nz=null;class Bz extends jz{constructor(t){super(t),this.container=null,this.renderedResolution,this.tempTransform=[1,0,0,1,0,0],this.pixelTransform=[1,0,0,1,0,0],this.inversePixelTransform=[1,0,0,1,0,0],this.context=null,this.deferredContext_=null,this.containerReused=!1,this.frameState=null}getImageData(t,e,n){let i;Nz||(Nz=HM(1,1,void 0,{willReadFrequently:!0})),Nz.clearRect(0,0,1,1);try{Nz.drawImage(t,e,n,1,1,0,0,1,1),i=Nz.getImageData(0,0,1,1).data}catch{return Nz=null,null}return i}getBackground(t){let e=this.getLayer().getBackground();return"function"==typeof e&&(e=e(t.viewState.resolution)),e||void 0}useContainer(t,e,n){const i=this.getLayer().getClassName();let r,s;if(t&&t.className===i&&(!n||t&&t.style.backgroundColor&&yk($P(t.style.backgroundColor),$P(n)))){const e=t.firstElementChild;nR(e)&&(s=e.getContext("2d"))}if(s&&function(t,e){const n=jL(t),i=jL(e);for(let r=0;r<6;++r)if(0!==Math.round((n[r]-i[r])*FL[r]))return!1;return!0}(s.canvas.style.transform,e)?(this.container=t,this.context=s,this.containerReused=!0):this.containerReused?(this.container=null,this.context=null,this.containerReused=!1):this.container&&(this.container.style.backgroundColor=null),!this.container){r=Wk?eR():document.createElement("div"),r.className=i;let t=r.style;t.position="absolute",t.width="100%",t.height="100%",s=HM();const e=s.canvas;r.appendChild(e),t=e.style,t.position="absolute",t.left="0",t.transformOrigin="top left",this.container=r,this.context=s}this.containerReused||!n||this.container.style.backgroundColor||(this.container.style.backgroundColor=n)}clipUnrotated(t,e,n){const i=YE(n),r=XE(n),s=VE(n),o=qE(n);IL(e.coordinateToPixelTransform,i),IL(e.coordinateToPixelTransform,r),IL(e.coordinateToPixelTransform,s),IL(e.coordinateToPixelTransform,o);const a=this.inversePixelTransform;IL(a,i),IL(a,r),IL(a,s),IL(a,o),t.save(),t.beginPath(),t.moveTo(Math.round(i[0]),Math.round(i[1])),t.lineTo(Math.round(r[0]),Math.round(r[1])),t.lineTo(Math.round(s[0]),Math.round(s[1])),t.lineTo(Math.round(o[0]),Math.round(o[1])),t.clip()}prepareContainer(t,e){const n=t.extent,i=t.viewState.resolution,r=t.viewState.rotation,s=t.pixelRatio,o=Math.round(JE(n)/i*s),a=Math.round(ZE(n)/i*s);AL(this.pixelTransform,t.size[0]/2,t.size[1]/2,1/s,1/s,r,-o/2,-a/2),zL(this.inversePixelTransform,this.pixelTransform);const l="matrix("+this.pixelTransform.join(", ")+")";if(this.useContainer(e,l,this.getBackground(t)),!this.containerReused){const t=this.context.canvas;t.width!=o||t.height!=a?(t.width=o,t.height=a):this.context.clearRect(0,0,o,a),l!==t.style.transform&&(t.style.transform=l)}}dispatchRenderEvent_(t,e,n){const i=this.getLayer();if(i.hasListener(t)){const r=new LA(t,this.inversePixelTransform,n,e);i.dispatchEvent(r)}}preRender(t,e){this.frameState=e,e.declutter||this.dispatchRenderEvent_(nP,t,e)}postRender(t,e){e.declutter||this.dispatchRenderEvent_(iP,t,e)}renderDeferredInternal(t){}getRenderContext(t){return t.declutter&&!this.deferredContext_&&(this.deferredContext_=new hz),t.declutter?this.deferredContext_.getContext():this.context}renderDeferred(t){t.declutter&&(this.dispatchRenderEvent_(nP,this.context,t),t.declutter&&this.deferredContext_&&(this.deferredContext_.draw(this.context),this.deferredContext_.clear()),this.renderDeferredInternal(t),this.dispatchRenderEvent_(iP,this.context,t))}getRenderTransform(t,e,n,i,r,s,o){const a=r/2,l=s/2,c=i/e,h=-c,u=-t[0]+o,d=-t[1];return AL(this.tempTransform,a,l,c,h,-n,u,d)}disposeInternal(){delete this.frameState,super.disposeInternal()}}class Uz extends Bz{constructor(t){super(t),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.animatingOrInteracting_,this.hitDetectionImageData_=null,this.clipped_=!1,this.renderedFeatures_=null,this.renderedRevision_=-1,this.renderedResolution_=NaN,this.renderedExtent_=[1/0,1/0,-1/0,-1/0],this.wrappedRenderedExtent_=[1/0,1/0,-1/0,-1/0],this.renderedRotation_,this.renderedCenter_=null,this.renderedProjection_=null,this.renderedPixelRatio_=1,this.renderedRenderOrder_=null,this.renderedFrameDeclutter_,this.replayGroup_=null,this.replayGroupChanged=!0,this.clipping=!0,this.targetContext_=null,this.opacity_=1}renderWorlds(t,e,n){const i=e.extent,r=e.viewState,s=r.center,o=r.resolution,a=r.projection,l=r.rotation,c=a.getExtent(),h=this.getLayer().getSource(),u=this.getLayer().getDeclutter(),d=e.pixelRatio,p=e.viewHints,f=!(p[0]||p[1]),g=this.context,m=Math.round(JE(i)/o*d),y=Math.round(ZE(i)/o*d),v=h.getWrapX()&&a.canWrapX(),_=v?JE(c):null,b=v?Math.ceil((i[2]-c[2])/_)+1:1;let w=v?Math.floor((i[0]-c[0])/_):0;do{let i=this.getRenderTransform(s,o,0,d,m,y,w*_);e.declutter&&(i=i.slice(0)),t.execute(g,[g.canvas.width,g.canvas.height],i,l,f,void 0===n?xz:n?Cz:Sz,n?u&&e.declutter[u]:void 0)}while(++w<b)}setDrawContext_(){1!==this.opacity_&&(this.targetContext_=this.context,this.context=HM(this.context.canvas.width,this.context.canvas.height,Dz))}resetDrawContext_(){if(1!==this.opacity_&&this.targetContext_){const t=this.targetContext_.globalAlpha;this.targetContext_.globalAlpha=this.opacity_,this.targetContext_.drawImage(this.context.canvas,0,0),this.targetContext_.globalAlpha=t,YM(this.context),Dz.push(this.context.canvas),this.context=this.targetContext_,this.targetContext_=null}}renderDeclutter(t){this.replayGroup_&&this.getLayer().getDeclutter()&&this.renderWorlds(this.replayGroup_,t,!0)}renderDeferredInternal(t){this.replayGroup_&&(this.replayGroup_.renderDeferred(),this.clipped_&&this.context.restore(),this.resetDrawContext_())}renderFrame(t,e){const n=t.layerStatesArray[t.layerIndex];this.opacity_=n.opacity;const i=t.viewState;this.prepareContainer(t,e);const r=this.context,s=this.replayGroup_;let o=s&&!s.isEmpty();if(!o&&!this.getLayer().hasListener(nP)&&!this.getLayer().hasListener(iP))return this.container;if(this.setDrawContext_(),this.preRender(r,t),i.projection,this.clipped_=!1,o&&n.extent&&this.clipping){const e=n.extent;o=QE(e,t.extent),this.clipped_=o&&!LE(e,t.extent),this.clipped_&&this.clipUnrotated(r,t,e)}return o&&this.renderWorlds(s,t,!this.getLayer().getDeclutter()&&void 0),!t.declutter&&this.clipped_&&r.restore(),this.postRender(r,t),this.renderedRotation_!==i.rotation&&(this.renderedRotation_=i.rotation,this.hitDetectionImageData_=null),t.declutter||this.resetDrawContext_(),this.container}getFeatures(t){return new Promise(e=>{if(this.frameState&&!this.hitDetectionImageData_&&!this.animatingOrInteracting_){const t=this.frameState.size.slice(),e=this.renderedCenter_,n=this.renderedResolution_,i=this.renderedRotation_,r=this.renderedProjection_,s=this.wrappedRenderedExtent_,o=this.getLayer(),a=[],l=t[0]*Lz,c=t[1]*Lz;a.push(this.getRenderTransform(e,n,i,Lz,l,c,0).slice());const h=o.getSource(),u=r.getExtent();if(h.getWrapX()&&r.canWrapX()&&!LE(u,s)){let t=s[0];const r=JE(u);let o,h=0;for(;t<u[0];)--h,o=r*h,a.push(this.getRenderTransform(e,n,i,Lz,l,c,o).slice()),t+=r;for(h=0,t=s[2];t>u[2];)++h,o=r*h,a.push(this.getRenderTransform(e,n,i,Lz,l,c,o).slice()),t-=r}this.hitDetectionImageData_=Mz(t,a,this.renderedFeatures_,o.getStyleFunction(),s,n,i,Oz(n,this.renderedPixelRatio_),null)}e(Rz(t,this.renderedFeatures_,this.hitDetectionImageData_))})}forEachFeatureAtCoordinate(t,e,n,i,r){if(!this.replayGroup_)return;const s=e.viewState.resolution,o=e.viewState.rotation,a=this.getLayer(),l={},c=this.getLayer().getDeclutter();return this.replayGroup_.forEachFeatureAtCoordinate(t,s,o,n,function(t,e,n){const s=Ok(t),o=l[s];if(o){if(!0!==o&&n<o.distanceSq){if(0===n)return l[s]=!0,r.splice(r.lastIndexOf(o),1),i(t,a,e);o.geometry=e,o.distanceSq=n}}else{if(0===n)return l[s]=!0,i(t,a,e);r.push(l[s]={feature:t,layer:a,geometry:e,distanceSq:n,callback:i})}},c?e.declutter?.[c]?.all().map(t=>t.value):null)}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&this.replayGroup_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}prepareFrame(t){const e=this.getLayer(),n=e.getSource();if(!n)return!1;const i=t.viewHints[0],r=t.viewHints[1],s=e.getUpdateWhileAnimating(),o=e.getUpdateWhileInteracting();if(this.ready&&!s&&i||!o&&r)return this.animatingOrInteracting_=!0,!0;this.animatingOrInteracting_=!1;const a=t.extent,l=t.viewState,c=l.projection,h=l.resolution,u=t.pixelRatio,d=e.getRevision(),p=e.getRenderBuffer();let f=e.getRenderOrder();void 0===f&&(f=Iz);const g=l.center.slice(),m=SE(a,p*h),y=m.slice(),v=[m.slice()],_=c.getExtent();if(n.getWrapX()&&c.canWrapX()&&!LE(_,t.extent)){const t=JE(_),e=Math.max(JE(m)/2,t);m[0]=_[0]-e,m[2]=_[2]+e,oT(g,c);const n=nT(v[0],c);n[0]<_[0]&&n[2]<_[2]?v.push([n[0]+t,n[1],n[2]+t,n[3]]):n[0]>_[0]&&n[2]>_[2]&&v.push([n[0]-t,n[1],n[2]-t,n[3]])}if(this.ready&&this.renderedResolution_==h&&this.renderedRevision_==d&&this.renderedRenderOrder_==f&&this.renderedFrameDeclutter_===!!t.declutter&&LE(this.wrappedRenderedExtent_,m))return yk(this.renderedExtent_,y)||(this.hitDetectionImageData_=null,this.renderedExtent_=y),this.renderedCenter_=g,this.replayGroupChanged=!1,!0;this.replayGroup_=null;const b=new lz(Az(h,u),m,h,u);for(let L=0,M=v.length;L<M;++L)n.loadFeatures(v[L],h,c);const w=Oz(h,u);let x=!0;const C=(t,n)=>{let i;const r=t.getStyleFunction()||e.getStyleFunction();if(r&&(i=r(t,h)),i){const e=this.renderFeature(t,w,i,b,void 0,this.getLayer().getDeclutter(),n);x=x&&!e}},S=m,k=n.getFeaturesInExtent(S);f&&k.sort(f);for(let L=0,M=k.length;L<M;++L)C(k[L],L);this.renderedFeatures_=k,this.ready=x;const E=b.finish(),T=new kz(m,h,u,n.getOverlaps(),E,e.getRenderBuffer(),!!t.declutter);return this.renderedResolution_=h,this.renderedRevision_=d,this.renderedRenderOrder_=f,this.renderedFrameDeclutter_=!!t.declutter,this.renderedExtent_=y,this.wrappedRenderedExtent_=m,this.renderedCenter_=g,this.renderedProjection_=c,this.renderedPixelRatio_=u,this.replayGroup_=T,this.hitDetectionImageData_=null,this.replayGroupChanged=!0,!0}renderFeature(t,e,n,i,r,s,o){if(!n)return!1;let a=!1;if(Array.isArray(n))for(let l=0,c=n.length;l<c;++l)a=zz(i,t,n[l],e,this.boundHandleStyleImageChange_,r,s,o)||a;else a=zz(i,t,n,e,this.boundHandleStyleImageChange_,r,s,o);return a}}class qz extends TA{constructor(t){super(t)}createRenderer(){return new Uz(this)}}function Vz(t,e,n,i,r,s,o){const a=new XMLHttpRequest;a.open("GET","function"==typeof t?t(n,i,r):t,!0),"arraybuffer"==e.getType()&&(a.responseType="arraybuffer"),a.withCredentials=!1,a.onload=function(){if(!a.status||a.status>=200&&a.status<300){const t=e.getType();try{let i;"text"==t||"json"==t?i=a.responseText:"xml"==t?i=a.responseXML||a.responseText:"arraybuffer"==t&&(i=a.response),i?s(e.readFeatures(i,{extent:n,featureProjection:r}),e.readProjection(i)):o()}catch{o()}}else o()},a.onerror=o,a.send()}function $z(t,e){return function(n,i,r,s,o){Vz(t,e,n,i,r,t=>{this.addFeatures(t),void 0!==s&&s(t)},()=>{this.changed(),void 0!==o&&o()})}}function Gz(){return[[-1/0,-1/0,1/0,1/0]]}function Wz(t){return[t]}class Hz extends qL{constructor(t){super(),this.geometries_=t,this.changeEventsKeys_=[],this.listenGeometriesChange_()}unlistenGeometriesChange_(){this.changeEventsKeys_.forEach(Mk),this.changeEventsKeys_.length=0}listenGeometriesChange_(){const t=this.geometries_;for(let e=0,n=t.length;e<n;++e)this.changeEventsKeys_.push(Tk(t[e],rk,this.changed,this))}clone(){const t=new Hz(Zz(this.geometries_));return t.applyProperties(this),t}closestPointXY(t,e,n,i){if(i<EE(this.getExtent(),t,e))return i;const r=this.geometries_;for(let s=0,o=r.length;s<o;++s)i=r[s].closestPointXY(t,e,n,i);return i}containsXY(t,e){const n=this.geometries_;for(let i=0,r=n.length;i<r;++i)if(n[i].containsXY(t,e))return!0;return!1}computeExtent(t){IE(t);const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)FE(t,e[n].getExtent());return t}getGeometries(){return Zz(this.geometries_)}getGeometriesArray(){return this.geometries_}getGeometriesArrayRecursive(){let t=[];const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)e[n].getType()===this.getType()?t=t.concat(e[n].getGeometriesArrayRecursive()):t.push(e[n]);return t}getSimplifiedGeometry(t){if(this.simplifiedGeometryRevision!==this.getRevision()&&(this.simplifiedGeometryMaxMinSquaredTolerance=0,this.simplifiedGeometryRevision=this.getRevision()),t<0||0!==this.simplifiedGeometryMaxMinSquaredTolerance&&t<this.simplifiedGeometryMaxMinSquaredTolerance)return this;const e=[],n=this.geometries_;let i=!1;for(let r=0,s=n.length;r<s;++r){const s=n[r],o=s.getSimplifiedGeometry(t);e.push(o),o!==s&&(i=!0)}return i?new Hz(e):(this.simplifiedGeometryMaxMinSquaredTolerance=t,this)}getType(){return"GeometryCollection"}intersectsExtent(t){const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)if(e[n].intersectsExtent(t))return!0;return!1}isEmpty(){return 0===this.geometries_.length}rotate(t,e){const n=this.geometries_;for(let i=0,r=n.length;i<r;++i)n[i].rotate(t,e);this.changed()}scale(t,e,n){n||(n=$E(this.getExtent()));const i=this.geometries_;for(let r=0,s=i.length;r<s;++r)i[r].scale(t,e,n);this.changed()}setGeometries(t){this.setGeometriesArray(Zz(t))}setGeometriesArray(t){this.unlistenGeometriesChange_(),this.geometries_=t,this.listenGeometriesChange_(),this.changed()}applyTransform(t){const e=this.geometries_;for(let n=0,i=e.length;n<i;++n)e[n].applyTransform(t);this.changed()}translate(t,e){const n=this.geometries_;for(let i=0,r=n.length;i<r;++i)n[i].translate(t,e);this.changed()}disposeInternal(){this.unlistenGeometriesChange_(),super.disposeInternal()}}function Zz(t){return t.map(t=>t.clone())}const Kz=[1,0,0,1,0,0];class Yz{constructor(t,e,n,i,r,s){this.styleFunction,this.extent_,this.id_=s,this.type_=t,this.flatCoordinates_=e,this.flatInteriorPoints_=null,this.flatMidpoints_=null,this.ends_=n||null,this.properties_=r,this.squaredTolerance_,this.stride_=i,this.simplifiedGeometry_}get(t){return this.properties_[t]}getExtent(){return this.extent_||(this.extent_="Point"===this.type_?OE(this.flatCoordinates_):AE(this.flatCoordinates_,0,this.flatCoordinates_.length,2)),this.extent_}getFlatInteriorPoint(){if(!this.flatInteriorPoints_){const t=$E(this.getExtent());this.flatInteriorPoints_=gM(this.flatCoordinates_,0,this.ends_,2,t,0)}return this.flatInteriorPoints_}getFlatInteriorPoints(){if(!this.flatInteriorPoints_){const t=TM(this.flatCoordinates_,this.ends_),e=ZA(this.flatCoordinates_,0,t,2);this.flatInteriorPoints_=mM(this.flatCoordinates_,0,t,2,e)}return this.flatInteriorPoints_}getFlatMidpoint(){return this.flatMidpoints_||(this.flatMidpoints_=qA(this.flatCoordinates_,0,this.flatCoordinates_.length,2,.5)),this.flatMidpoints_}getFlatMidpoints(){if(!this.flatMidpoints_){this.flatMidpoints_=[];const t=this.flatCoordinates_;let e=0;const n=this.ends_;for(let i=0,r=n.length;i<r;++i){const r=n[i],s=qA(t,e,r,2,.5);mk(this.flatMidpoints_,s),e=r}}return this.flatMidpoints_}getId(){return this.id_}getOrientedFlatCoordinates(){return this.flatCoordinates_}getGeometry(){return this}getSimplifiedGeometry(t){return this}simplifyTransformed(t,e){return this}getProperties(){return this.properties_}getPropertiesInternal(){return this.properties_}getStride(){return this.stride_}getStyleFunction(){return this.styleFunction}getType(){return this.type_}transform(t){const e=(t=hL(t)).getExtent(),n=t.getWorldExtent();if(e&&n){const t=ZE(n)/ZE(e);AL(Kz,n[0],n[3],t,-t,0,0,0),DL(this.flatCoordinates_,0,this.flatCoordinates_.length,2,Kz,this.flatCoordinates_)}}applyTransform(t){t(this.flatCoordinates_,this.flatCoordinates_,this.stride_)}clone(){return new Yz(this.type_,this.flatCoordinates_.slice(),this.ends_?.slice(),this.stride_,Object.assign({},this.properties_),this.id_)}getEnds(){return this.ends_}enableSimplifyTransformed(){return this.simplifyTransformed=wk((t,e)=>{if(t===this.squaredTolerance_)return this.simplifiedGeometry_;this.simplifiedGeometry_=this.clone(),e&&this.simplifiedGeometry_.applyTransform(e);const n=this.simplifiedGeometry_.getFlatCoordinates();let i;switch(this.type_){case"LineString":n.length=sM(n,0,this.simplifiedGeometry_.flatCoordinates_.length,this.simplifiedGeometry_.stride_,t,n,0),i=[n.length];break;case"MultiLineString":i=[],n.length=oM(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,t,n,0,i);break;case"Polygon":i=[],n.length=cM(n,0,this.simplifiedGeometry_.ends_,this.simplifiedGeometry_.stride_,Math.sqrt(t),n,0,i)}return i&&(this.simplifiedGeometry_=new Yz(this.type_,n,i,2,this.properties_,this.id_)),this.squaredTolerance_=t,this.simplifiedGeometry_}),this}}Yz.prototype.getFlatCoordinates=Yz.prototype.getOrientedFlatCoordinates;class Xz{constructor(t){this.rbush_=new uP(t),this.items_={}}insert(t,e){const n={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3],value:e};this.rbush_.insert(n),this.items_[Ok(e)]=n}load(t,e){const n=new Array(e.length);for(let i=0,r=e.length;i<r;i++){const r=t[i],s=e[i],o={minX:r[0],minY:r[1],maxX:r[2],maxY:r[3],value:s};n[i]=o,this.items_[Ok(s)]=o}this.rbush_.load(n)}remove(t){const e=Ok(t),n=this.items_[e];return delete this.items_[e],null!==this.rbush_.remove(n)}update(t,e){const n=this.items_[Ok(e)];zE([n.minX,n.minY,n.maxX,n.maxY],t)||(this.remove(e),this.insert(t,e))}getAll(){return this.rbush_.all().map(function(t){return t.value})}getInExtent(t){const e={minX:t[0],minY:t[1],maxX:t[2],maxY:t[3]};return this.rbush_.search(e).map(function(t){return t.value})}forEach(t){return this.forEach_(this.getAll(),t)}forEachInExtent(t,e){return this.forEach_(this.getInExtent(t),e)}forEach_(t,e){let n;for(let i=0,r=t.length;i<r;i++)if(n=e(t[i]),n)return n;return n}isEmpty(){return Sk(this.items_)}clear(){this.rbush_.clear(),this.items_={}}getExtent(t){const e=this.rbush_.toJSON();return PE(e.minX,e.minY,e.maxX,e.maxY,t)}concat(t){this.rbush_.load(t.rbush_.all());for(const e in t.items_)this.items_[e]=t.items_[e]}}class Jz extends zk{constructor(t){super(),this.projection=hL(t.projection),this.attributions_=Qz(t.attributions),this.attributionsCollapsible_=t.attributionsCollapsible??!0,this.loading=!1,this.state_=void 0!==t.state?t.state:"ready",this.wrapX_=void 0!==t.wrapX&&t.wrapX,this.interpolate_=!!t.interpolate,this.viewResolver=null,this.viewRejector=null;const e=this;this.viewPromise_=new Promise(function(t,n){e.viewResolver=t,e.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(t){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(t){this.attributions_=Qz(t),this.changed()}setState(t){this.state_=t,this.changed()}}function Qz(t){return t?"function"==typeof t?t:(Array.isArray(t)||(t=[t]),()=>t):null}const tF="addfeature",eF="removefeature";class nF extends kk{constructor(t,e,n){super(t),this.feature=e,this.features=n}}class iF extends Jz{constructor(t){super({attributions:(t=t||{}).attributions,interpolate:!0,projection:void 0,state:"ready",wrapX:void 0===t.wrapX||t.wrapX}),this.on,this.once,this.un,this.loader_=bk,this.format_=t.format||null,this.overlaps_=void 0===t.overlaps||t.overlaps,this.url_=t.url,void 0!==t.loader?this.loader_=t.loader:void 0!==this.url_&&(sE(this.format_,"`format` must be set when `url` is set"),this.loader_=$z(this.url_,this.format_)),this.strategy_=void 0!==t.strategy?t.strategy:Gz;const e=void 0===t.useSpatialIndex||t.useSpatialIndex;let n,i;this.featuresRtree_=e?new Xz:null,this.loadedExtentsRtree_=new Xz,this.loadingExtentsCount_=0,this.nullGeometryFeatures_={},this.idIndex_={},this.uidIndex_={},this.featureChangeKeys_={},this.featuresCollection_=null,Array.isArray(t.features)?i=t.features:t.features&&(n=t.features,i=n.getArray()),e||void 0!==n||(n=new Dk(i)),void 0!==i&&this.addFeaturesInternal(i),void 0!==n&&this.bindFeaturesCollection_(n)}addFeature(t){this.addFeatureInternal(t),this.changed()}addFeatureInternal(t){const e=Ok(t);if(!this.addToIndex_(e,t))return void(this.featuresCollection_&&this.featuresCollection_.remove(t));this.setupChangeEvents_(e,t);const n=t.getGeometry();if(n){const e=n.getExtent();this.featuresRtree_&&this.featuresRtree_.insert(e,t)}else this.nullGeometryFeatures_[e]=t;this.dispatchEvent(new nF(tF,t))}setupChangeEvents_(t,e){e instanceof Yz||(this.featureChangeKeys_[t]=[Tk(e,rk,this.handleFeatureChange_,this),Tk(e,ik,this.handleFeatureChange_,this)])}addToIndex_(t,e){let n=!0;if(void 0!==e.getId()){const t=String(e.getId());if(t in this.idIndex_)if(e instanceof Yz){const i=this.idIndex_[t];i instanceof Yz?Array.isArray(i)?i.push(e):this.idIndex_[t]=[i,e]:n=!1}else n=!1;else this.idIndex_[t]=e}return n&&(sE(!(t in this.uidIndex_),"The passed `feature` was already added to the source"),this.uidIndex_[t]=e),n}addFeatures(t){this.addFeaturesInternal(t),this.changed()}addFeaturesInternal(t){const e=[],n=[],i=[];for(let r=0,s=t.length;r<s;r++){const e=t[r],i=Ok(e);this.addToIndex_(i,e)&&n.push(e)}for(let r=0,s=n.length;r<s;r++){const t=n[r],s=Ok(t);this.setupChangeEvents_(s,t);const o=t.getGeometry();if(o){const n=o.getExtent();e.push(n),i.push(t)}else this.nullGeometryFeatures_[s]=t}if(this.featuresRtree_&&this.featuresRtree_.load(e,i),this.hasListener(tF))for(let r=0,s=n.length;r<s;r++)this.dispatchEvent(new nF(tF,n[r]))}bindFeaturesCollection_(t){let e=!1;this.addEventListener(tF,function(n){e||(e=!0,t.push(n.feature),e=!1)}),this.addEventListener(eF,function(n){e||(e=!0,t.remove(n.feature),e=!1)}),t.addEventListener(ek,t=>{e||(e=!0,this.addFeature(t.element),e=!1)}),t.addEventListener(nk,t=>{e||(e=!0,this.removeFeature(t.element),e=!1)}),this.featuresCollection_=t}clear(t){if(t){for(const t in this.featureChangeKeys_)this.featureChangeKeys_[t].forEach(Mk);this.featuresCollection_||(this.featureChangeKeys_={},this.idIndex_={},this.uidIndex_={})}else if(this.featuresRtree_){this.featuresRtree_.forEach(t=>{this.removeFeatureInternal(t)});for(const t in this.nullGeometryFeatures_)this.removeFeatureInternal(this.nullGeometryFeatures_[t])}this.featuresCollection_&&this.featuresCollection_.clear(),this.featuresRtree_&&this.featuresRtree_.clear(),this.nullGeometryFeatures_={};const e=new nF("clear");this.dispatchEvent(e),this.changed()}forEachFeature(t){if(this.featuresRtree_)return this.featuresRtree_.forEach(t);this.featuresCollection_&&this.featuresCollection_.forEach(t)}forEachFeatureAtCoordinateDirect(t,e){const n=[t[0],t[1],t[0],t[1]];return this.forEachFeatureInExtent(n,function(n){const i=n.getGeometry();if(i instanceof Yz||i.intersectsCoordinate(t))return e(n)})}forEachFeatureInExtent(t,e){if(this.featuresRtree_)return this.featuresRtree_.forEachInExtent(t,e);this.featuresCollection_&&this.featuresCollection_.forEach(e)}forEachFeatureIntersectingExtent(t,e){return this.forEachFeatureInExtent(t,function(n){const i=n.getGeometry();if(i instanceof Yz||i.intersectsExtent(t)){const t=e(n);if(t)return t}})}getFeaturesCollection(){return this.featuresCollection_}getFeatures(){let t;return this.featuresCollection_?t=this.featuresCollection_.getArray().slice(0):this.featuresRtree_&&(t=this.featuresRtree_.getAll(),Sk(this.nullGeometryFeatures_)||mk(t,Object.values(this.nullGeometryFeatures_))),t}getFeaturesAtCoordinate(t){const e=[];return this.forEachFeatureAtCoordinateDirect(t,function(t){e.push(t)}),e}getFeaturesInExtent(t,e){if(this.featuresRtree_){if(!(e&&e.canWrapX()&&this.getWrapX()))return this.featuresRtree_.getInExtent(t);const n=iT(t,e);return[].concat(...n.map(t=>this.featuresRtree_.getInExtent(t)))}return this.featuresCollection_?this.featuresCollection_.getArray().slice(0):[]}getClosestFeatureToCoordinate(t,e){const n=t[0],i=t[1];let r=null;const s=[NaN,NaN];let o=1/0;const a=[-1/0,-1/0,1/0,1/0];return e=e||vk,this.featuresRtree_.forEachInExtent(a,function(t){if(e(t)){const e=t.getGeometry(),l=o;if(o=e instanceof Yz?0:e.closestPointXY(n,i,s,o),o<l){r=t;const e=Math.sqrt(o);a[0]=n-e,a[1]=i-e,a[2]=n+e,a[3]=i+e}}}),r}getExtent(t){return this.featuresRtree_.getExtent(t)}getFeatureById(t){const e=this.idIndex_[t.toString()];return void 0!==e?e:null}getFeatureByUid(t){const e=this.uidIndex_[t];return void 0!==e?e:null}getFormat(){return this.format_}getOverlaps(){return this.overlaps_}getUrl(){return this.url_}handleFeatureChange_(t){const e=t.target,n=Ok(e),i=e.getGeometry();if(i){const t=i.getExtent();n in this.nullGeometryFeatures_?(delete this.nullGeometryFeatures_[n],this.featuresRtree_&&this.featuresRtree_.insert(t,e)):this.featuresRtree_&&this.featuresRtree_.update(t,e)}else n in this.nullGeometryFeatures_||(this.featuresRtree_&&this.featuresRtree_.remove(e),this.nullGeometryFeatures_[n]=e);const r=e.getId();if(void 0!==r){const t=r.toString();this.idIndex_[t]!==e&&(this.removeFromIdIndex_(e),this.idIndex_[t]=e)}else this.removeFromIdIndex_(e),this.uidIndex_[n]=e;this.changed(),this.dispatchEvent(new nF("changefeature",e))}hasFeature(t){const e=t.getId();return void 0!==e?e in this.idIndex_:Ok(t)in this.uidIndex_}isEmpty(){return this.featuresRtree_?this.featuresRtree_.isEmpty()&&Sk(this.nullGeometryFeatures_):!this.featuresCollection_||0===this.featuresCollection_.getLength()}loadFeatures(t,e,n){const i=this.loadedExtentsRtree_,r=this.strategy_(t,e,n);for(let s=0,o=r.length;s<o;++s){const t=r[s];i.forEachInExtent(t,function(e){return LE(e.extent,t)})||(++this.loadingExtentsCount_,this.dispatchEvent(new nF("featuresloadstart")),this.loader_.call(this,t,e,n,t=>{--this.loadingExtentsCount_,this.dispatchEvent(new nF("featuresloadend",void 0,t))},()=>{--this.loadingExtentsCount_,this.dispatchEvent(new nF("featuresloaderror"))}),i.insert(t,{extent:t.slice()}))}this.loading=!(this.loader_.length<4)&&this.loadingExtentsCount_>0}refresh(){this.clear(!0),this.loadedExtentsRtree_.clear(),super.refresh()}removeLoadedExtent(t){const e=this.loadedExtentsRtree_,n=e.forEachInExtent(t,function(e){if(zE(e.extent,t))return e});n&&e.remove(n)}removeFeatures(t){let e=!1;for(let n=0,i=t.length;n<i;++n)e=this.removeFeatureInternal(t[n])||e;e&&this.changed()}removeFeature(t){t&&this.removeFeatureInternal(t)&&this.changed()}removeFeatureInternal(t){const e=Ok(t);if(!(e in this.uidIndex_))return!1;e in this.nullGeometryFeatures_?delete this.nullGeometryFeatures_[e]:this.featuresRtree_&&this.featuresRtree_.remove(t);const n=this.featureChangeKeys_[e];n?.forEach(Mk),delete this.featureChangeKeys_[e];const i=t.getId();if(void 0!==i){const e=i.toString(),n=this.idIndex_[e];n===t?delete this.idIndex_[e]:Array.isArray(n)&&(n.splice(n.indexOf(t),1),1===n.length&&(this.idIndex_[e]=n[0]))}return delete this.uidIndex_[e],this.hasListener(eF)&&this.dispatchEvent(new nF(eF,t)),!0}removeFromIdIndex_(t){for(const e in this.idIndex_)if(this.idIndex_[e]===t){delete this.idIndex_[e];break}}setLoader(t){this.loader_=t}setUrl(t){sE(this.format_,"`format` must be set when `url` is set"),this.url_=t,this.setLoader($z(t,this.format_))}setOverlaps(t){this.overlaps_=t,this.changed()}}class rF{constructor(){this.dataProjection=void 0,this.defaultFeatureProjection=void 0,this.featureClass=UA,this.supportedMediaTypes=null}getReadOptions(t,e){if(e){let n=e.dataProjection?hL(e.dataProjection):this.readProjection(t);e.extent&&n&&"tile-pixels"===n.getUnits()&&(n=hL(n),n.setWorldExtent(e.extent)),e={dataProjection:n,featureProjection:e.featureProjection}}return this.adaptOptions(e)}adaptOptions(t){return Object.assign({dataProjection:this.dataProjection,featureProjection:this.defaultFeatureProjection,featureClass:this.featureClass},t)}getType(){return Pk()}readFeature(t,e){return Pk()}readFeatures(t,e){return Pk()}readGeometry(t,e){return Pk()}readProjection(t){return Pk()}writeFeature(t,e){return Pk()}writeFeatures(t,e){return Pk()}writeGeometry(t,e){return Pk()}}function sF(t,e,n){const i=n?hL(n.featureProjection):null,r=n?hL(n.dataProjection):null;let s=t;if(i&&r&&!mL(i,r)){e&&(s=t.clone());const n=e?i:r,o=e?r:i;"tile-pixels"===n.getUnits()?s.transform(n,o):s.applyTransform(_L(n,o))}if(e&&n&&void 0!==n.decimals){const e=Math.pow(10,n.decimals),i=function(t){for(let n=0,i=t.length;n<i;++n)t[n]=Math.round(t[n]*e)/e;return t};s===t&&(s=t.clone()),s.applyTransform(i)}return s}const oF={Point:uM,LineString:GA,Polygon:LM,MultiPoint:HA,MultiLineString:WA,MultiPolygon:KA};function aF(t,e){const n=t.geometry;if(!n)return[];if(Array.isArray(n))return n.map(e=>aF({...t,geometry:e})).flat();const i="MultiPolygon"===n.type?"Polygon":n.type;if("GeometryCollection"===i||"Circle"===i)throw new Error("Unsupported geometry type: "+i);const r=n.layout.length;return sF(new Yz(i,"Polygon"===i?function(t,e,n){return Array.isArray(e[0])?(SM(t,0,e,n)||EM(t=t.slice(),0,e,n),t):(CM(t,0,e,n)||kM(t=t.slice(),0,e,n),t)}(n.flatCoordinates,n.ends,r):n.flatCoordinates,n.ends?.flat(),r,t.properties||{},t.id).enableSimplifyTransformed(),!1,e)}function lF(t,e){if(!t)return null;if(Array.isArray(t)){const n=t.map(t=>lF(t,e));return new Hz(n)}return sF(new(0,oF[t.type])(t.flatCoordinates,t.layout||"XY",t.ends),!1,e)}class cF extends rF{constructor(){super()}getType(){return"json"}readFeature(t,e){return this.readFeatureFromObject(hF(t),this.getReadOptions(t,e))}readFeatures(t,e){return this.readFeaturesFromObject(hF(t),this.getReadOptions(t,e))}readFeatureFromObject(t,e){return Pk()}readFeaturesFromObject(t,e){return Pk()}readGeometry(t,e){return this.readGeometryFromObject(hF(t),this.getReadOptions(t,e))}readGeometryFromObject(t,e){return Pk()}readProjection(t){return this.readProjectionFromObject(hF(t))}readProjectionFromObject(t){return Pk()}writeFeature(t,e){return JSON.stringify(this.writeFeatureObject(t,e))}writeFeatureObject(t,e){return Pk()}writeFeatures(t,e){return JSON.stringify(this.writeFeaturesObject(t,e))}writeFeaturesObject(t,e){return Pk()}writeGeometry(t,e){return JSON.stringify(this.writeGeometryObject(t,e))}writeGeometryObject(t,e){return Pk()}}function hF(t){return"string"==typeof t?JSON.parse(t)||null:null!==t?t:null}class uF extends cF{constructor(t){t=t||{},super(),this.dataProjection=hL(t.dataProjection?t.dataProjection:"EPSG:4326"),t.featureProjection&&(this.defaultFeatureProjection=hL(t.featureProjection)),t.featureClass&&(this.featureClass=t.featureClass),this.geometryName_=t.geometryName,this.extractGeometryName_=t.extractGeometryName,this.supportedMediaTypes=["application/geo+json","application/vnd.geo+json"]}readFeatureFromObject(t,e){let n=null;n="Feature"===t.type?t:{type:"Feature",geometry:t,properties:null};const i=dF(n.geometry);if(this.featureClass===Yz)return aF({geometry:i,id:n.id,properties:n.properties},e);const r=new UA;return this.geometryName_?r.setGeometryName(this.geometryName_):this.extractGeometryName_&&n.geometry_name&&r.setGeometryName(n.geometry_name),r.setGeometry(lF(i,e)),"id"in n&&r.setId(n.id),n.properties&&r.setProperties(n.properties,!0),r}readFeaturesFromObject(t,e){let n=null;if("FeatureCollection"===t.type){n=[];const i=t.features;for(let t=0,r=i.length;t<r;++t){const r=this.readFeatureFromObject(i[t],e);r&&n.push(r)}}else n=[this.readFeatureFromObject(t,e)];return n.flat()}readGeometryFromObject(t,e){return function(t,e){return lF(dF(t),e)}(t,e)}readProjectionFromObject(t){const e=t.crs;let n;if(e)if("name"==e.type)n=hL(e.properties.name);else{if("EPSG"!==e.type)throw new Error("Unknown SRS type");n=hL("EPSG:"+e.properties.code)}else n=this.dataProjection;return n}writeFeatureObject(t,e){e=this.adaptOptions(e);const n={type:"Feature",geometry:null,properties:null},i=t.getId();if(void 0!==i&&(n.id=i),!t.hasProperties())return n;const r=t.getProperties(),s=t.getGeometry();return s&&(n.geometry=pF(s,e),delete r[t.getGeometryName()]),Sk(r)||(n.properties=r),n}writeFeaturesObject(t,e){e=this.adaptOptions(e);const n=[];for(let i=0,r=t.length;i<r;++i)n.push(this.writeFeatureObject(t[i],e));return{type:"FeatureCollection",features:n}}writeGeometryObject(t,e){return pF(t,this.adaptOptions(e))}}function dF(t){if(!t)return null;let e;switch(t.type){case"Point":e=function(t){const e=t.coordinates;return{type:"Point",flatCoordinates:e,layout:$L(e.length)}}(t);break;case"LineString":e=function(t){const e=t.coordinates,n=e.flat();return{type:"LineString",flatCoordinates:n,ends:[n.length],layout:$L(e[0]?.length||2)}}(t);break;case"Polygon":e=function(t){const e=t.coordinates,n=[],i=e[0]?.[0]?.length;return{type:"Polygon",flatCoordinates:n,ends:tM(n,0,e,i),layout:$L(i)}}(t);break;case"MultiPoint":e=function(t){const e=t.coordinates;return{type:"MultiPoint",flatCoordinates:e.flat(),layout:$L(e[0]?.length||2)}}(t);break;case"MultiLineString":e=function(t){const e=t.coordinates,n=e[0]?.[0]?.length||2,i=[];return{type:"MultiLineString",flatCoordinates:i,ends:tM(i,0,e,n),layout:$L(n)}}(t);break;case"MultiPolygon":e=function(t){const e=t.coordinates,n=[],i=e[0]?.[0]?.[0].length||2;return{type:"MultiPolygon",flatCoordinates:n,ends:eM(n,0,e,i),layout:$L(i)}}(t);break;case"GeometryCollection":e=function(t){const e=t.geometries.map(function(t){return dF(t)});return e}(t);break;default:throw new Error("Unsupported GeoJSON type: "+t.type)}return e}function pF(t,e){const n=(t=sF(t,!0,e)).getType();let i;switch(n){case"Point":i=function(t){return{type:"Point",coordinates:t.getCoordinates()}}(t);break;case"LineString":i=function(t){return{type:"LineString",coordinates:t.getCoordinates()}}(t);break;case"Polygon":i=function(t,e){let n;return e&&(n=e.rightHanded),{type:"Polygon",coordinates:t.getCoordinates(n)}}(t,e);break;case"MultiPoint":i=function(t){return{type:"MultiPoint",coordinates:t.getCoordinates()}}(t);break;case"MultiLineString":i=function(t){return{type:"MultiLineString",coordinates:t.getCoordinates()}}(t);break;case"MultiPolygon":i=function(t,e){let n;return e&&(n=e.rightHanded),{type:"MultiPolygon",coordinates:t.getCoordinates(n)}}(t,e);break;case"GeometryCollection":i=function(t,e){return delete(e=Object.assign({},e)).featureProjection,{type:"GeometryCollection",geometries:t.getGeometriesArray().map(function(t){return pF(t,e)})}}(t,e);break;case"Circle":i={type:"GeometryCollection",geometries:[]};break;default:throw new Error("Unsupported geometry type: "+n)}return i}const fF="accuracy",gF="accuracyGeometry",mF="altitude",yF="altitudeAccuracy",vF="heading",_F="position",bF="projection",wF="speed",xF="tracking",CF="trackingOptions";class SF extends kk{constructor(t){super("error"),this.code=t.code,this.message=t.message}}class kF extends zk{constructor(t){super(),this.on,this.once,this.un,t=t||{},this.position_=null,this.transform_=lL,this.watchId_=void 0,this.addChangeListener(bF,this.handleProjectionChanged_),this.addChangeListener(xF,this.handleTrackingChanged_),void 0!==t.projection&&this.setProjection(t.projection),void 0!==t.trackingOptions&&this.setTrackingOptions(t.trackingOptions),this.setTracking(void 0!==t.tracking&&t.tracking)}disposeInternal(){this.setTracking(!1),super.disposeInternal()}handleProjectionChanged_(){const t=this.getProjection();t&&(this.transform_=yL(hL("EPSG:4326"),t),this.position_&&this.set(_F,this.transform_(this.position_)))}handleTrackingChanged_(){if("geolocation"in navigator){const t=this.getTracking();t&&void 0===this.watchId_?this.watchId_=navigator.geolocation.watchPosition(this.positionChange_.bind(this),this.positionError_.bind(this),this.getTrackingOptions()):t||void 0===this.watchId_||(navigator.geolocation.clearWatch(this.watchId_),this.watchId_=void 0)}}positionChange_(t){const e=t.coords;this.set(fF,e.accuracy),this.set(mF,null===e.altitude?void 0:e.altitude),this.set(yF,null===e.altitudeAccuracy?void 0:e.altitudeAccuracy),this.set(vF,null===e.heading?void 0:fE(e.heading)),this.position_?(this.position_[0]=e.longitude,this.position_[1]=e.latitude):this.position_=[e.longitude,e.latitude];const n=this.transform_(this.position_);this.set(_F,n.slice()),this.set(wF,null===e.speed?void 0:e.speed);const i=function(t,e,n){n=n||32;const i=[];for(let r=0;r<n;++r)mk(i,pT(t,e,2*Math.PI*r/n,void 0));return i.push(i[0],i[1]),new LM(i,"XY",[i.length])}(this.position_,e.accuracy);i.applyTransform(this.transform_),this.set(gF,i),this.changed()}positionError_(t){this.dispatchEvent(new SF(t))}getAccuracy(){return this.get(fF)}getAccuracyGeometry(){return this.get(gF)||null}getAltitude(){return this.get(mF)}getAltitudeAccuracy(){return this.get(yF)}getHeading(){return this.get(vF)}getPosition(){return this.get(_F)}getProjection(){return this.get(bF)}getSpeed(){return this.get(wF)}getTracking(){return this.get(xF)}getTrackingOptions(){return this.get(CF)}setProjection(t){this.set(bF,hL(t))}setTracking(t){this.set(xF,t)}setTrackingOptions(t){this.set(CF,t)}}const EF=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function TF(t,e){const n={};for(const i in t)"ref"!==i&&(n[i]=t[i]);return EF.forEach(t=>{t in e&&(n[t]=e[t])}),n}function LF(t){t=t.slice();const e=Object.create(null);for(let n=0;n<t.length;n++)e[t[n].id]=t[n];for(let n=0;n<t.length;n++)"ref"in t[n]&&(t[n]=TF(t[n],e[t[n].ref]));return t}class MF extends Error{constructor(t,e){super(e),this.message=e,this.key=t}}class RF{constructor(t,e=[]){this.parent=t,this.bindings={};for(const[n,i]of e)this.bindings[n]=i}concat(t){return new RF(this,t)}get(t){if(this.bindings[t])return this.bindings[t];if(this.parent)return this.parent.get(t);throw new Error(`${t} not found in scope.`)}has(t){return!!this.bindings[t]||!!this.parent&&this.parent.has(t)}}const PF={kind:"null"},IF={kind:"number"},OF={kind:"string"},AF={kind:"boolean"},zF={kind:"color"},FF={kind:"projectionDefinition"},jF={kind:"object"},DF={kind:"value"},NF={kind:"collator"},BF={kind:"formatted"},UF={kind:"padding"},qF={kind:"colorArray"},VF={kind:"numberArray"},$F={kind:"resolvedImage"},GF={kind:"variableAnchorOffsetCollection"};function WF(t,e){return{kind:"array",itemType:t,N:e}}function HF(t){if("array"===t.kind){const e=HF(t.itemType);return"number"==typeof t.N?`array<${e}, ${t.N}>`:"value"===t.itemType.kind?"array":`array<${e}>`}return t.kind}const ZF=[PF,IF,OF,AF,zF,FF,BF,jF,WF(DF),UF,VF,qF,$F,GF];function KF(t,e){if("error"===e.kind)return null;if("array"===t.kind){if("array"===e.kind&&(0===e.N&&"value"===e.itemType.kind||!KF(t.itemType,e.itemType))&&("number"!=typeof t.N||t.N===e.N))return null}else{if(t.kind===e.kind)return null;if("value"===t.kind)for(const t of ZF)if(!KF(t,e))return null}return`Expected ${HF(t)} but found ${HF(e)} instead.`}function YF(t,e){return e.some(e=>e.kind===t.kind)}function XF(t,e){return e.some(e=>"null"===e?null===t:"array"===e?Array.isArray(t):"object"===e?t&&!Array.isArray(t)&&"object"==typeof t:e===typeof t)}function JF(t,e){return"array"===t.kind&&"array"===e.kind?t.itemType.kind===e.itemType.kind&&"number"==typeof t.N:t.kind===e.kind}const QF=.96422,tj=.82521,ej=4/29,nj=6/29,ij=3*nj*nj,rj=nj*nj*nj,sj=Math.PI/180,oj=180/Math.PI;function aj(t){return(t%=360)<0&&(t+=360),t}function lj([t,e,n,i]){let r,s;const o=hj((.2225045*(t=cj(t))+.7168786*(e=cj(e))+.0606169*(n=cj(n)))/1);t===e&&e===n?r=s=o:(r=hj((.4360747*t+.3850649*e+.1430804*n)/QF),s=hj((.0139322*t+.0971045*e+.7141733*n)/tj));const a=116*o-16;return[a<0?0:a,500*(r-o),200*(o-s),i]}function cj(t){return t<=.04045?t/12.92:Math.pow((t+.055)/1.055,2.4)}function hj(t){return t>rj?Math.pow(t,1/3):t/ij+ej}function uj([t,e,n,i]){let r=(t+16)/116,s=isNaN(e)?r:r+e/500,o=isNaN(n)?r:r-n/200;return r=1*pj(r),s=QF*pj(s),o=tj*pj(o),[dj(3.1338561*s-1.6168667*r-.4906146*o),dj(-.9787684*s+1.9161415*r+.033454*o),dj(.0719453*s-.2289914*r+1.4052427*o),i]}function dj(t){return(t=t<=.00304?12.92*t:1.055*Math.pow(t,1/2.4)-.055)<0?0:t>1?1:t}function pj(t){return t>nj?t*t*t:ij*(t-ej)}const fj=Object.hasOwn||function(t,e){return Object.prototype.hasOwnProperty.call(t,e)};function gj(t,e){return fj(t,e)?t[e]:void 0}function mj(t){return parseInt(t.padEnd(2,t),16)/255}function yj(t,e){return vj(e?t/100:t,0,1)}function vj(t,e,n){return Math.min(Math.max(e,t),n)}function _j(t){return!t.some(Number.isNaN)}const bj={aliceblue:[240,248,255],antiquewhite:[250,235,215],aqua:[0,255,255],aquamarine:[127,255,212],azure:[240,255,255],beige:[245,245,220],bisque:[255,228,196],black:[0,0,0],blanchedalmond:[255,235,205],blue:[0,0,255],blueviolet:[138,43,226],brown:[165,42,42],burlywood:[222,184,135],cadetblue:[95,158,160],chartreuse:[127,255,0],chocolate:[210,105,30],coral:[255,127,80],cornflowerblue:[100,149,237],cornsilk:[255,248,220],crimson:[220,20,60],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgoldenrod:[184,134,11],darkgray:[169,169,169],darkgreen:[0,100,0],darkgrey:[169,169,169],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkseagreen:[143,188,143],darkslateblue:[72,61,139],darkslategray:[47,79,79],darkslategrey:[47,79,79],darkturquoise:[0,206,209],darkviolet:[148,0,211],deeppink:[255,20,147],deepskyblue:[0,191,255],dimgray:[105,105,105],dimgrey:[105,105,105],dodgerblue:[30,144,255],firebrick:[178,34,34],floralwhite:[255,250,240],forestgreen:[34,139,34],fuchsia:[255,0,255],gainsboro:[220,220,220],ghostwhite:[248,248,255],gold:[255,215,0],goldenrod:[218,165,32],gray:[128,128,128],green:[0,128,0],greenyellow:[173,255,47],grey:[128,128,128],honeydew:[240,255,240],hotpink:[255,105,180],indianred:[205,92,92],indigo:[75,0,130],ivory:[255,255,240],khaki:[240,230,140],lavender:[230,230,250],lavenderblush:[255,240,245],lawngreen:[124,252,0],lemonchiffon:[255,250,205],lightblue:[173,216,230],lightcoral:[240,128,128],lightcyan:[224,255,255],lightgoldenrodyellow:[250,250,210],lightgray:[211,211,211],lightgreen:[144,238,144],lightgrey:[211,211,211],lightpink:[255,182,193],lightsalmon:[255,160,122],lightseagreen:[32,178,170],lightskyblue:[135,206,250],lightslategray:[119,136,153],lightslategrey:[119,136,153],lightsteelblue:[176,196,222],lightyellow:[255,255,224],lime:[0,255,0],limegreen:[50,205,50],linen:[250,240,230],magenta:[255,0,255],maroon:[128,0,0],mediumaquamarine:[102,205,170],mediumblue:[0,0,205],mediumorchid:[186,85,211],mediumpurple:[147,112,219],mediumseagreen:[60,179,113],mediumslateblue:[123,104,238],mediumspringgreen:[0,250,154],mediumturquoise:[72,209,204],mediumvioletred:[199,21,133],midnightblue:[25,25,112],mintcream:[245,255,250],mistyrose:[255,228,225],moccasin:[255,228,181],navajowhite:[255,222,173],navy:[0,0,128],oldlace:[253,245,230],olive:[128,128,0],olivedrab:[107,142,35],orange:[255,165,0],orangered:[255,69,0],orchid:[218,112,214],palegoldenrod:[238,232,170],palegreen:[152,251,152],paleturquoise:[175,238,238],palevioletred:[219,112,147],papayawhip:[255,239,213],peachpuff:[255,218,185],peru:[205,133,63],pink:[255,192,203],plum:[221,160,221],powderblue:[176,224,230],purple:[128,0,128],rebeccapurple:[102,51,153],red:[255,0,0],rosybrown:[188,143,143],royalblue:[65,105,225],saddlebrown:[139,69,19],salmon:[250,128,114],sandybrown:[244,164,96],seagreen:[46,139,87],seashell:[255,245,238],sienna:[160,82,45],silver:[192,192,192],skyblue:[135,206,235],slateblue:[106,90,205],slategray:[112,128,144],slategrey:[112,128,144],snow:[255,250,250],springgreen:[0,255,127],steelblue:[70,130,180],tan:[210,180,140],teal:[0,128,128],thistle:[216,191,216],tomato:[255,99,71],turquoise:[64,224,208],violet:[238,130,238],wheat:[245,222,179],white:[255,255,255],whitesmoke:[245,245,245],yellow:[255,255,0],yellowgreen:[154,205,50]};function wj(t,e,n){return t+n*(e-t)}function xj(t,e,n){return t.map((t,i)=>wj(t,e[i],n))}class Cj{constructor(t,e,n,i=1,r=!0){this.r=t,this.g=e,this.b=n,this.a=i,r||(this.r*=i,this.g*=i,this.b*=i,i||this.overwriteGetter("rgb",[t,e,n,i]))}static parse(t){if(t instanceof Cj)return t;if("string"!=typeof t)return;const e=function(t){if("transparent"===(t=t.toLowerCase().trim()))return[0,0,0,0];const e=gj(bj,t);if(e){const[t,n,i]=e;return[t/255,n/255,i/255,1]}if(t.startsWith("#")&&/^#(?:[0-9a-f]{3,4}|[0-9a-f]{6}|[0-9a-f]{8})$/.test(t)){const e=t.length<6?1:2;let n=1;return[mj(t.slice(n,n+=e)),mj(t.slice(n,n+=e)),mj(t.slice(n,n+=e)),mj(t.slice(n,n+e)||"ff")]}if(t.startsWith("rgb")){const e=/^rgba?\(\s*([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s+|\s*(,)\s*)([\de.+-]+)(%)?(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/,n=t.match(e);if(n){const[t,e,i,r,s,o,a,l,c,h,u,d]=n,p=[r||" ",a||" ",h].join("");if(" "===p||" /"===p||",,"===p||",,,"===p){const t=[i,o,c].join(""),n="%%%"===t?100:""===t?255:0;if(n){const t=[vj(+e/n,0,1),vj(+s/n,0,1),vj(+l/n,0,1),u?yj(+u,d):1];if(_j(t))return t}}return}}const n=t.match(/^hsla?\(\s*([\de.+-]+)(?:deg)?(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s+|\s*(,)\s*)([\de.+-]+)%(?:\s*([,\/])\s*([\de.+-]+)(%)?)?\s*\)$/);if(n){const[t,e,i,r,s,o,a,l,c]=n,h=[i||" ",s||" ",a].join("");if(" "===h||" /"===h||",,"===h||",,,"===h){const t=[+e,vj(+r,0,100),vj(+o,0,100),l?yj(+l,c):1];if(_j(t))return function([t,e,n,i]){function r(i){const r=(i+t/30)%12,s=e*Math.min(n,1-n);return n-s*Math.max(-1,Math.min(r-3,9-r,1))}return t=aj(t),e/=100,n/=100,[r(0),r(8),r(4),i]}(t)}}}(t);return e?new Cj(...e,!1):void 0}get rgb(){const{r:t,g:e,b:n,a:i}=this,r=i||1/0;return this.overwriteGetter("rgb",[t/r,e/r,n/r,i])}get hcl(){return this.overwriteGetter("hcl",function(t){const[e,n,i,r]=lj(t),s=Math.sqrt(n*n+i*i);return[Math.round(1e4*s)?aj(Math.atan2(i,n)*oj):NaN,s,e,r]}(this.rgb))}get lab(){return this.overwriteGetter("lab",lj(this.rgb))}overwriteGetter(t,e){return Object.defineProperty(this,t,{value:e}),e}toString(){const[t,e,n,i]=this.rgb;return`rgba(${[t,e,n].map(t=>Math.round(255*t)).join(",")},${i})`}static interpolate(t,e,n,i="rgb"){switch(i){case"rgb":{const[i,r,s,o]=xj(t.rgb,e.rgb,n);return new Cj(i,r,s,o,!1)}case"hcl":{const[i,r,s,o]=t.hcl,[a,l,c,h]=e.hcl;let u,d;if(isNaN(i)||isNaN(a))isNaN(i)?isNaN(a)?u=NaN:(u=a,1!==s&&0!==s||(d=l)):(u=i,1!==c&&0!==c||(d=r));else{let t=a-i;a>i&&t>180?t-=360:a<i&&i-a>180&&(t+=360),u=i+n*t}const[p,f,g,m]=function([t,e,n,i]){return t=isNaN(t)?0:t*sj,uj([n,Math.cos(t)*e,Math.sin(t)*e,i])}([u,null!=d?d:wj(r,l,n),wj(s,c,n),wj(o,h,n)]);return new Cj(p,f,g,m,!1)}case"lab":{const[i,r,s,o]=uj(xj(t.lab,e.lab,n));return new Cj(i,r,s,o,!1)}}}}Cj.black=new Cj(0,0,0,1),Cj.white=new Cj(1,1,1,1),Cj.transparent=new Cj(0,0,0,0),Cj.red=new Cj(1,0,0,1);class Sj{constructor(t,e,n){this.sensitivity=t?e?"variant":"case":e?"accent":"base",this.locale=n,this.collator=new Intl.Collator(this.locale?this.locale:[],{sensitivity:this.sensitivity,usage:"search"})}compare(t,e){return this.collator.compare(t,e)}resolvedLocale(){return new Intl.Collator(this.locale?this.locale:[]).resolvedOptions().locale}}const kj=["bottom","center","top"];class Ej{constructor(t,e,n,i,r,s){this.text=t,this.image=e,this.scale=n,this.fontStack=i,this.textColor=r,this.verticalAlign=s}}class Tj{constructor(t){this.sections=t}static fromString(t){return new Tj([new Ej(t,null,null,null,null,null)])}isEmpty(){return 0===this.sections.length||!this.sections.some(t=>0!==t.text.length||t.image&&0!==t.image.name.length)}static factory(t){return t instanceof Tj?t:Tj.fromString(t)}toString(){return 0===this.sections.length?"":this.sections.map(t=>t.text).join("")}}class Lj{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Lj)return t;if("number"==typeof t)return new Lj([t,t,t,t]);if(Array.isArray(t)&&!(t.length<1||t.length>4)){for(const e of t)if("number"!=typeof e)return;switch(t.length){case 1:t=[t[0],t[0],t[0],t[0]];break;case 2:t=[t[0],t[1],t[0],t[1]];break;case 3:t=[t[0],t[1],t[2],t[1]]}return new Lj(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,n){return new Lj(xj(t.values,e.values,n))}}class Mj{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Mj)return t;if("number"==typeof t)return new Mj([t]);if(Array.isArray(t)){for(const e of t)if("number"!=typeof e)return;return new Mj(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,n){return new Mj(xj(t.values,e.values,n))}}class Rj{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Rj)return t;if("string"==typeof t){const e=Cj.parse(t);if(!e)return;return new Rj([e])}if(!Array.isArray(t))return;const e=[];for(const n of t){if("string"!=typeof n)return;const t=Cj.parse(n);if(!t)return;e.push(t)}return new Rj(e)}toString(){return JSON.stringify(this.values)}static interpolate(t,e,n,i="rgb"){const r=[];if(t.values.length!=e.values.length)throw new Error(`colorArray: Arrays have mismatched length (${t.values.length} vs. ${e.values.length}), cannot interpolate.`);for(let s=0;s<t.values.length;s++)r.push(Cj.interpolate(t.values[s],e.values[s],n,i));return new Rj(r)}}class Pj extends Error{constructor(t){super(t),this.name="RuntimeError"}toJSON(){return this.message}}const Ij=new Set(["center","left","right","top","bottom","top-left","top-right","bottom-left","bottom-right"]);class Oj{constructor(t){this.values=t.slice()}static parse(t){if(t instanceof Oj)return t;if(Array.isArray(t)&&!(t.length<1)&&t.length%2==0){for(let e=0;e<t.length;e+=2){const n=t[e],i=t[e+1];if("string"!=typeof n||!Ij.has(n))return;if(!Array.isArray(i)||2!==i.length||"number"!=typeof i[0]||"number"!=typeof i[1])return}return new Oj(t)}}toString(){return JSON.stringify(this.values)}static interpolate(t,e,n){const i=t.values,r=e.values;if(i.length!==r.length)throw new Pj(`Cannot interpolate values of different length. from: ${t.toString()}, to: ${e.toString()}`);const s=[];for(let o=0;o<i.length;o+=2){if(i[o]!==r[o])throw new Pj(`Cannot interpolate values containing mismatched anchors. from[${o}]: ${i[o]}, to[${o}]: ${r[o]}`);s.push(i[o]);const[t,e]=i[o+1],[a,l]=r[o+1];s.push([wj(t,a,n),wj(e,l,n)])}return new Oj(s)}}class Aj{constructor(t){this.name=t.name,this.available=t.available}toString(){return this.name}static fromString(t){return t?new Aj({name:t,available:!1}):null}}class zj{constructor(t,e,n){this.from=t,this.to=e,this.transition=n}static interpolate(t,e,n){return new zj(t,e,n)}static parse(t){return t instanceof zj?t:Array.isArray(t)&&3===t.length&&"string"==typeof t[0]&&"string"==typeof t[1]&&"number"==typeof t[2]?new zj(t[0],t[1],t[2]):"object"==typeof t&&"string"==typeof t.from&&"string"==typeof t.to&&"number"==typeof t.transition?new zj(t.from,t.to,t.transition):"string"==typeof t?new zj(t,t,1):void 0}}function Fj(t,e,n,i){return"number"==typeof t&&t>=0&&t<=255&&"number"==typeof e&&e>=0&&e<=255&&"number"==typeof n&&n>=0&&n<=255?void 0===i||"number"==typeof i&&i>=0&&i<=1?null:`Invalid rgba value [${[t,e,n,i].join(", ")}]: 'a' must be between 0 and 1.`:`Invalid rgba value [${("number"==typeof i?[t,e,n,i]:[t,e,n]).join(", ")}]: 'r', 'g', and 'b' must be between 0 and 255.`}function jj(t){if(null===t||"string"==typeof t||"boolean"==typeof t||"number"==typeof t||t instanceof zj||t instanceof Cj||t instanceof Sj||t instanceof Tj||t instanceof Lj||t instanceof Mj||t instanceof Rj||t instanceof Oj||t instanceof Aj)return!0;if(Array.isArray(t)){for(const e of t)if(!jj(e))return!1;return!0}if("object"==typeof t){for(const e in t)if(!jj(t[e]))return!1;return!0}return!1}function Dj(t){if(null===t)return PF;if("string"==typeof t)return OF;if("boolean"==typeof t)return AF;if("number"==typeof t)return IF;if(t instanceof Cj)return zF;if(t instanceof zj)return FF;if(t instanceof Sj)return NF;if(t instanceof Tj)return BF;if(t instanceof Lj)return UF;if(t instanceof Mj)return VF;if(t instanceof Rj)return qF;if(t instanceof Oj)return GF;if(t instanceof Aj)return $F;if(Array.isArray(t)){const e=t.length;let n;for(const i of t){const t=Dj(i);if(n){if(n===t)continue;n=DF;break}n=t}return WF(n||DF,e)}return jF}function Nj(t){const e=typeof t;return null===t?"":"string"===e||"number"===e||"boolean"===e?String(t):t instanceof Cj||t instanceof zj||t instanceof Tj||t instanceof Lj||t instanceof Mj||t instanceof Rj||t instanceof Oj||t instanceof Aj?t.toString():JSON.stringify(t)}class Bj{constructor(t,e){this.type=t,this.value=e}static parse(t,e){if(2!==t.length)return e.error(`'literal' expression requires exactly one argument, but found ${t.length-1} instead.`);if(!jj(t[1]))return e.error("invalid value");const n=t[1];let i=Dj(n);const r=e.expectedType;return"array"!==i.kind||0!==i.N||!r||"array"!==r.kind||"number"==typeof r.N&&0!==r.N||(i=r),new Bj(i,n)}evaluate(){return this.value}eachChild(){}outputDefined(){return!0}}const Uj={string:OF,number:IF,boolean:AF,object:jF};class qj{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let n,i=1;const r=t[0];if("array"===r){let r,s;if(t.length>2){const n=t[1];if("string"!=typeof n||!(n in Uj)||"object"===n)return e.error('The item type argument of "array" must be one of string, number, boolean',1);r=Uj[n],i++}else r=DF;if(t.length>3){if(null!==t[2]&&("number"!=typeof t[2]||t[2]<0||t[2]!==Math.floor(t[2])))return e.error('The length argument to "array" must be a positive integer literal',2);s=t[2],i++}n=WF(r,s)}else{if(!Uj[r])throw new Error(`Types doesn't contain name = ${r}`);n=Uj[r]}const s=[];for(;i<t.length;i++){const n=e.parse(t[i],i,DF);if(!n)return null;s.push(n)}return new qj(n,s)}evaluate(t){for(let e=0;e<this.args.length;e++){const n=this.args[e].evaluate(t);if(!KF(this.type,Dj(n)))return n;if(e===this.args.length-1)throw new Pj(`Expected value to be of type ${HF(this.type)}, but found ${HF(Dj(n))} instead.`)}throw new Error}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Vj={"to-boolean":AF,"to-color":zF,"to-number":IF,"to-string":OF};class $j{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[0];if(!Vj[n])throw new Error(`Can't parse ${n} as it is not part of the known types`);if(("to-boolean"===n||"to-string"===n)&&2!==t.length)return e.error("Expected one argument.");const i=Vj[n],r=[];for(let s=1;s<t.length;s++){const n=e.parse(t[s],s,DF);if(!n)return null;r.push(n)}return new $j(i,r)}evaluate(t){switch(this.type.kind){case"boolean":return Boolean(this.args[0].evaluate(t));case"color":{let e,n;for(const i of this.args){if(e=i.evaluate(t),n=null,e instanceof Cj)return e;if("string"==typeof e){const n=t.parseColor(e);if(n)return n}else if(Array.isArray(e)&&(n=e.length<3||e.length>4?`Invalid rgba value ${JSON.stringify(e)}: expected an array containing either three or four numeric values.`:Fj(e[0],e[1],e[2],e[3]),!n))return new Cj(e[0]/255,e[1]/255,e[2]/255,e[3])}throw new Pj(n||`Could not parse color from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"padding":{let e;for(const n of this.args){e=n.evaluate(t);const i=Lj.parse(e);if(i)return i}throw new Pj(`Could not parse padding from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"numberArray":{let e;for(const n of this.args){e=n.evaluate(t);const i=Mj.parse(e);if(i)return i}throw new Pj(`Could not parse numberArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"colorArray":{let e;for(const n of this.args){e=n.evaluate(t);const i=Rj.parse(e);if(i)return i}throw new Pj(`Could not parse colorArray from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"variableAnchorOffsetCollection":{let e;for(const n of this.args){e=n.evaluate(t);const i=Oj.parse(e);if(i)return i}throw new Pj(`Could not parse variableAnchorOffsetCollection from value '${"string"==typeof e?e:JSON.stringify(e)}'`)}case"number":{let e=null;for(const n of this.args){if(e=n.evaluate(t),null===e)return 0;const i=Number(e);if(!isNaN(i))return i}throw new Pj(`Could not convert ${JSON.stringify(e)} to number.`)}case"formatted":return Tj.fromString(Nj(this.args[0].evaluate(t)));case"resolvedImage":return Aj.fromString(Nj(this.args[0].evaluate(t)));case"projectionDefinition":return this.args[0].evaluate(t);default:return Nj(this.args[0].evaluate(t))}}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}const Gj=["Unknown","Point","LineString","Polygon"];class Wj{constructor(){this.globals=null,this.feature=null,this.featureState=null,this.formattedSection=null,this._parseColorCache=new Map,this.availableImages=null,this.canonical=null}id(){return this.feature&&"id"in this.feature?this.feature.id:null}geometryType(){return this.feature?"number"==typeof this.feature.type?Gj[this.feature.type]:this.feature.type:null}geometry(){return this.feature&&"geometry"in this.feature?this.feature.geometry:null}canonicalID(){return this.canonical}properties(){return this.feature&&this.feature.properties||{}}parseColor(t){let e=this._parseColorCache.get(t);return e||(e=Cj.parse(t),this._parseColorCache.set(t,e)),e}}class Hj{constructor(t,e,n=[],i,r=new RF,s=[]){this.registry=t,this.path=n,this.key=n.map(t=>`[${t}]`).join(""),this.scope=r,this.errors=s,this.expectedType=i,this._isConstant=e}parse(t,e,n,i,r={}){return e?this.concat(e,n,i)._parse(t,r):this._parse(t,r)}_parse(t,e){function n(t,e,n){return"assert"===n?new qj(e,[t]):"coerce"===n?new $j(e,[t]):t}if(null!==t&&"string"!=typeof t&&"boolean"!=typeof t&&"number"!=typeof t||(t=["literal",t]),Array.isArray(t)){if(0===t.length)return this.error('Expected an array with at least one element. If you wanted a literal array, use ["literal", []].');const r=t[0];if("string"!=typeof r)return this.error(`Expression name must be a string, but found ${typeof r} instead. If you wanted a literal array, use ["literal", [...]].`,0),null;const s=this.registry[r];if(s){let r=s.parse(t,this);if(!r)return null;if(this.expectedType){const t=this.expectedType,i=r.type;if("string"!==t.kind&&"number"!==t.kind&&"boolean"!==t.kind&&"object"!==t.kind&&"array"!==t.kind||"value"!==i.kind){if("projectionDefinition"===t.kind&&["string","array"].includes(i.kind)||["color","formatted","resolvedImage"].includes(t.kind)&&["value","string"].includes(i.kind)||["padding","numberArray"].includes(t.kind)&&["value","number","array"].includes(i.kind)||"colorArray"===t.kind&&["value","string","array"].includes(i.kind)||"variableAnchorOffsetCollection"===t.kind&&["value","array"].includes(i.kind))r=n(r,t,e.typeAnnotation||"coerce");else if(this.checkSubtype(t,i))return null}else r=n(r,t,e.typeAnnotation||"assert")}if(!(r instanceof Bj)&&"resolvedImage"!==r.type.kind&&this._isConstant(r)){const t=new Wj;try{r=new Bj(r.type,r.evaluate(t))}catch(i){return this.error(i.message),null}}return r}return this.error(`Unknown expression "${r}". If you wanted a literal array, use ["literal", [...]].`,0)}return void 0===t?this.error("'undefined' value invalid. Use null instead."):"object"==typeof t?this.error('Bare objects invalid. Use ["literal", {...}] instead.'):this.error(`Expected an array, but found ${typeof t} instead.`)}concat(t,e,n){const i="number"==typeof t?this.path.concat(t):this.path,r=n?this.scope.concat(n):this.scope;return new Hj(this.registry,this._isConstant,i,e||null,r,this.errors)}error(t,...e){const n=`${this.key}${e.map(t=>`[${t}]`).join("")}`;this.errors.push(new MF(n,t))}checkSubtype(t,e){const n=KF(t,e);return n&&this.error(n),n}}class Zj{constructor(t,e){this.type=e.type,this.bindings=[].concat(t),this.result=e}evaluate(t){return this.result.evaluate(t)}eachChild(t){for(const e of this.bindings)t(e[1]);t(this.result)}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found ${t.length-1} instead.`);const n=[];for(let r=1;r<t.length-1;r+=2){const i=t[r];if("string"!=typeof i)return e.error(`Expected string, but found ${typeof i} instead.`,r);if(/[^a-zA-Z0-9_]/.test(i))return e.error("Variable names must contain only alphanumeric characters or '_'.",r);const s=e.parse(t[r+1],r+1);if(!s)return null;n.push([i,s])}const i=e.parse(t[t.length-1],t.length-1,e.expectedType,n);return i?new Zj(n,i):null}outputDefined(){return this.result.outputDefined()}}class Kj{constructor(t,e){this.type=e.type,this.name=t,this.boundExpression=e}static parse(t,e){if(2!==t.length||"string"!=typeof t[1])return e.error("'var' expression requires exactly one string literal argument.");const n=t[1];return e.scope.has(n)?new Kj(n,e.scope.get(n)):e.error(`Unknown variable "${n}". Make sure "${n}" has been bound in an enclosing "let" expression before using it.`,1)}evaluate(t){return this.boundExpression.evaluate(t)}eachChild(){}outputDefined(){return!1}}class Yj{constructor(t,e,n){this.type=t,this.index=e,this.input=n}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,IF),i=e.parse(t[2],2,WF(e.expectedType||DF));if(!n||!i)return null;const r=i.type;return new Yj(r.itemType,n,i)}evaluate(t){const e=this.index.evaluate(t),n=this.input.evaluate(t);if(e<0)throw new Pj(`Array index out of bounds: ${e} < 0.`);if(e>=n.length)throw new Pj(`Array index out of bounds: ${e} > ${n.length-1}.`);if(e!==Math.floor(e))throw new Pj(`Array index must be an integer, but found ${e} instead.`);return n[e]}eachChild(t){t(this.index),t(this.input)}outputDefined(){return!1}}class Xj{constructor(t,e){this.type=AF,this.needle=t,this.haystack=e}static parse(t,e){if(3!==t.length)return e.error(`Expected 2 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,DF),i=e.parse(t[2],2,DF);return n&&i?YF(n.type,[AF,OF,IF,PF,DF])?new Xj(n,i):e.error(`Expected first argument to be of type boolean, string, number or null, but found ${HF(n.type)} instead`):null}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!n)return!1;if(!XF(e,["boolean","string","number","null"]))throw new Pj(`Expected first argument to be of type boolean, string, number or null, but found ${HF(Dj(e))} instead.`);if(!XF(n,["string","array"]))throw new Pj(`Expected second argument to be of type array or string, but found ${HF(Dj(n))} instead.`);return n.indexOf(e)>=0}eachChild(t){t(this.needle),t(this.haystack)}outputDefined(){return!0}}class Jj{constructor(t,e,n){this.type=IF,this.needle=t,this.haystack=e,this.fromIndex=n}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,DF),i=e.parse(t[2],2,DF);if(!n||!i)return null;if(!YF(n.type,[AF,OF,IF,PF,DF]))return e.error(`Expected first argument to be of type boolean, string, number or null, but found ${HF(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,IF);return r?new Jj(n,i,r):null}return new Jj(n,i)}evaluate(t){const e=this.needle.evaluate(t),n=this.haystack.evaluate(t);if(!XF(e,["boolean","string","number","null"]))throw new Pj(`Expected first argument to be of type boolean, string, number or null, but found ${HF(Dj(e))} instead.`);let i;if(this.fromIndex&&(i=this.fromIndex.evaluate(t)),XF(n,["string"])){const t=n.indexOf(e,i);return-1===t?-1:[...n.slice(0,t)].length}if(XF(n,["array"]))return n.indexOf(e,i);throw new Pj(`Expected second argument to be of type array or string, but found ${HF(Dj(n))} instead.`)}eachChild(t){t(this.needle),t(this.haystack),this.fromIndex&&t(this.fromIndex)}outputDefined(){return!1}}class Qj{constructor(t,e,n,i,r,s){this.inputType=t,this.type=e,this.input=n,this.cases=i,this.outputs=r,this.otherwise=s}static parse(t,e){if(t.length<5)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if(t.length%2!=1)return e.error("Expected an even number of arguments.");let n,i;e.expectedType&&"value"!==e.expectedType.kind&&(i=e.expectedType);const r={},s=[];for(let l=2;l<t.length-1;l+=2){let o=t[l];const a=t[l+1];Array.isArray(o)||(o=[o]);const c=e.concat(l);if(0===o.length)return c.error("Expected at least one branch label.");for(const t of o){if("number"!=typeof t&&"string"!=typeof t)return c.error("Branch labels must be numbers or strings.");if("number"==typeof t&&Math.abs(t)>Number.MAX_SAFE_INTEGER)return c.error(`Branch labels must be integers no larger than ${Number.MAX_SAFE_INTEGER}.`);if("number"==typeof t&&Math.floor(t)!==t)return c.error("Numeric branch labels must be integer values.");if(n){if(c.checkSubtype(n,Dj(t)))return null}else n=Dj(t);if(void 0!==r[String(t)])return c.error("Branch labels must be unique.");r[String(t)]=s.length}const h=e.parse(a,l,i);if(!h)return null;i=i||h.type,s.push(h)}const o=e.parse(t[1],1,DF);if(!o)return null;const a=e.parse(t[t.length-1],t.length-1,i);return a?"value"!==o.type.kind&&e.concat(1).checkSubtype(n,o.type)?null:new Qj(n,i,o,r,s,a):null}evaluate(t){const e=this.input.evaluate(t);return(Dj(e)===this.inputType&&this.outputs[this.cases[e]]||this.otherwise).evaluate(t)}eachChild(t){t(this.input),this.outputs.forEach(t),t(this.otherwise)}outputDefined(){return this.outputs.every(t=>t.outputDefined())&&this.otherwise.outputDefined()}}class tD{constructor(t,e,n){this.type=t,this.branches=e,this.otherwise=n}static parse(t,e){if(t.length<4)return e.error(`Expected at least 3 arguments, but found only ${t.length-1}.`);if(t.length%2!=0)return e.error("Expected an odd number of arguments.");let n;e.expectedType&&"value"!==e.expectedType.kind&&(n=e.expectedType);const i=[];for(let s=1;s<t.length-1;s+=2){const r=e.parse(t[s],s,AF);if(!r)return null;const o=e.parse(t[s+1],s+1,n);if(!o)return null;i.push([r,o]),n=n||o.type}const r=e.parse(t[t.length-1],t.length-1,n);if(!r)return null;if(!n)throw new Error("Can't infer output type");return new tD(n,i,r)}evaluate(t){for(const[e,n]of this.branches)if(e.evaluate(t))return n.evaluate(t);return this.otherwise.evaluate(t)}eachChild(t){for(const[e,n]of this.branches)t(e),t(n);t(this.otherwise)}outputDefined(){return this.branches.every(([t,e])=>e.outputDefined())&&this.otherwise.outputDefined()}}class eD{constructor(t,e,n,i){this.type=t,this.input=e,this.beginIndex=n,this.endIndex=i}static parse(t,e){if(t.length<=2||t.length>=5)return e.error(`Expected 3 or 4 arguments, but found ${t.length-1} instead.`);const n=e.parse(t[1],1,DF),i=e.parse(t[2],2,IF);if(!n||!i)return null;if(!YF(n.type,[WF(DF),OF,DF]))return e.error(`Expected first argument to be of type array or string, but found ${HF(n.type)} instead`);if(4===t.length){const r=e.parse(t[3],3,IF);return r?new eD(n.type,n,i,r):null}return new eD(n.type,n,i)}evaluate(t){const e=this.input.evaluate(t),n=this.beginIndex.evaluate(t);let i;if(this.endIndex&&(i=this.endIndex.evaluate(t)),XF(e,["string"]))return[...e].slice(n,i).join("");if(XF(e,["array"]))return e.slice(n,i);throw new Pj(`Expected first argument to be of type array or string, but found ${HF(Dj(e))} instead.`)}eachChild(t){t(this.input),t(this.beginIndex),this.endIndex&&t(this.endIndex)}outputDefined(){return!1}}function nD(t,e){const n=t.length-1;let i,r,s=0,o=n,a=0;for(;s<=o;)if(a=Math.floor((s+o)/2),i=t[a],r=t[a+1],i<=e){if(a===n||e<r)return a;s=a+1}else{if(!(i>e))throw new Pj("Input is not a number.");o=a-1}return 0}class iD{constructor(t,e,n){this.type=t,this.input=e,this.labels=[],this.outputs=[];for(const[i,r]of n)this.labels.push(i),this.outputs.push(r)}static parse(t,e){if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");const n=e.parse(t[1],1,IF);if(!n)return null;const i=[];let r=null;e.expectedType&&"value"!==e.expectedType.kind&&(r=e.expectedType);for(let s=1;s<t.length;s+=2){const n=1===s?-1/0:t[s],o=t[s+1],a=s,l=s+1;if("number"!=typeof n)return e.error('Input/output pairs for "step" expressions must be defined using literal numeric values (not computed expressions) for the input values.',a);if(i.length&&i[i.length-1][0]>=n)return e.error('Input/output pairs for "step" expressions must be arranged with input values in strictly ascending order.',a);const c=e.parse(o,l,r);if(!c)return null;r=r||c.type,i.push([n,c])}return new iD(r,n,i)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;return i>=e[r-1]?n[r-1].evaluate(t):n[nD(e,i)].evaluate(t)}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function rD(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var sD,oD,aD=function(){if(oD)return sD;function t(t,e,n,i){this.cx=3*t,this.bx=3*(n-t)-this.cx,this.ax=1-this.cx-this.bx,this.cy=3*e,this.by=3*(i-e)-this.cy,this.ay=1-this.cy-this.by,this.p1x=t,this.p1y=e,this.p2x=n,this.p2y=i}return oD=1,sD=t,t.prototype={sampleCurveX:function(t){return((this.ax*t+this.bx)*t+this.cx)*t},sampleCurveY:function(t){return((this.ay*t+this.by)*t+this.cy)*t},sampleCurveDerivativeX:function(t){return(3*this.ax*t+2*this.bx)*t+this.cx},solveCurveX:function(t,e){if(void 0===e&&(e=1e-6),t<0)return 0;if(t>1)return 1;for(var n=t,i=0;i<8;i++){var r=this.sampleCurveX(n)-t;if(Math.abs(r)<e)return n;var s=this.sampleCurveDerivativeX(n);if(Math.abs(s)<1e-6)break;n-=r/s}var o=0,a=1;for(n=t,i=0;i<20&&(r=this.sampleCurveX(n),!(Math.abs(r-t)<e));i++)t>r?o=n:a=n,n=.5*(a-o)+o;return n},solve:function(t,e){return this.sampleCurveY(this.solveCurveX(t,e))}},sD}(),lD=rD(aD);class cD{constructor(t,e,n,i,r){this.type=t,this.operator=e,this.interpolation=n,this.input=i,this.labels=[],this.outputs=[];for(const[s,o]of r)this.labels.push(s),this.outputs.push(o)}static interpolationFactor(t,e,n,i){let r=0;if("exponential"===t.name)r=hD(e,t.base,n,i);else if("linear"===t.name)r=hD(e,1,n,i);else if("cubic-bezier"===t.name){const s=t.controlPoints;r=new lD(s[0],s[1],s[2],s[3]).solve(hD(e,1,n,i))}return r}static parse(t,e){let[n,i,r,...s]=t;if(!Array.isArray(i)||0===i.length)return e.error("Expected an interpolation type expression.",1);if("linear"===i[0])i={name:"linear"};else if("exponential"===i[0]){const t=i[1];if("number"!=typeof t)return e.error("Exponential interpolation requires a numeric base.",1,1);i={name:"exponential",base:t}}else{if("cubic-bezier"!==i[0])return e.error(`Unknown interpolation type ${String(i[0])}`,1,0);{const t=i.slice(1);if(4!==t.length||t.some(t=>"number"!=typeof t||t<0||t>1))return e.error("Cubic bezier interpolation requires four numeric arguments with values between 0 and 1.",1);i={name:"cubic-bezier",controlPoints:t}}}if(t.length-1<4)return e.error(`Expected at least 4 arguments, but found only ${t.length-1}.`);if((t.length-1)%2!=0)return e.error("Expected an even number of arguments.");if(r=e.parse(r,2,IF),!r)return null;const o=[];let a=null;"interpolate-hcl"!==n&&"interpolate-lab"!==n||e.expectedType==qF?e.expectedType&&"value"!==e.expectedType.kind&&(a=e.expectedType):a=zF;for(let l=0;l<s.length;l+=2){const t=s[l],n=s[l+1],i=l+3,r=l+4;if("number"!=typeof t)return e.error('Input/output pairs for "interpolate" expressions must be defined using literal numeric values (not computed expressions) for the input values.',i);if(o.length&&o[o.length-1][0]>=t)return e.error('Input/output pairs for "interpolate" expressions must be arranged with input values in strictly ascending order.',i);const c=e.parse(n,r,a);if(!c)return null;a=a||c.type,o.push([t,c])}return JF(a,IF)||JF(a,FF)||JF(a,zF)||JF(a,UF)||JF(a,VF)||JF(a,qF)||JF(a,GF)||JF(a,WF(IF))?new cD(a,n,i,r,o):e.error(`Type ${HF(a)} is not interpolatable.`)}evaluate(t){const e=this.labels,n=this.outputs;if(1===e.length)return n[0].evaluate(t);const i=this.input.evaluate(t);if(i<=e[0])return n[0].evaluate(t);const r=e.length;if(i>=e[r-1])return n[r-1].evaluate(t);const s=nD(e,i),o=e[s],a=e[s+1],l=cD.interpolationFactor(this.interpolation,i,o,a),c=n[s].evaluate(t),h=n[s+1].evaluate(t);switch(this.operator){case"interpolate":switch(this.type.kind){case"number":return wj(c,h,l);case"color":return Cj.interpolate(c,h,l);case"padding":return Lj.interpolate(c,h,l);case"colorArray":return Rj.interpolate(c,h,l);case"numberArray":return Mj.interpolate(c,h,l);case"variableAnchorOffsetCollection":return Oj.interpolate(c,h,l);case"array":return xj(c,h,l);case"projectionDefinition":return zj.interpolate(c,h,l)}case"interpolate-hcl":switch(this.type.kind){case"color":return Cj.interpolate(c,h,l,"hcl");case"colorArray":return Rj.interpolate(c,h,l,"hcl")}case"interpolate-lab":switch(this.type.kind){case"color":return Cj.interpolate(c,h,l,"lab");case"colorArray":return Rj.interpolate(c,h,l,"lab")}}}eachChild(t){t(this.input);for(const e of this.outputs)t(e)}outputDefined(){return this.outputs.every(t=>t.outputDefined())}}function hD(t,e,n,i){const r=i-n,s=t-n;return 0===r?0:1===e?s/r:(Math.pow(e,s)-1)/(Math.pow(e,r)-1)}class uD{constructor(t,e){this.type=t,this.args=e}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");let n=null;const i=e.expectedType;i&&"value"!==i.kind&&(n=i);const r=[];for(const o of t.slice(1)){const t=e.parse(o,1+r.length,n,void 0,{typeAnnotation:"omit"});if(!t)return null;n=n||t.type,r.push(t)}if(!n)throw new Error("No output type");const s=i&&r.some(t=>KF(i,t.type));return new uD(s?DF:n,r)}evaluate(t){let e,n=null,i=0;for(const r of this.args)if(i++,n=r.evaluate(t),n&&n instanceof Aj&&!n.available&&(e||(e=n.name),n=null,i===this.args.length&&(n=e)),null!==n)break;return n}eachChild(t){this.args.forEach(t)}outputDefined(){return this.args.every(t=>t.outputDefined())}}function dD(t,e){return"=="===t||"!="===t?"boolean"===e.kind||"string"===e.kind||"number"===e.kind||"null"===e.kind||"value"===e.kind:"string"===e.kind||"number"===e.kind||"value"===e.kind}function pD(t,e,n,i){return 0===i.compare(e,n)}function fD(t,e,n){const i="=="!==t&&"!="!==t;return class r{constructor(t,e,n){this.type=AF,this.lhs=t,this.rhs=e,this.collator=n,this.hasUntypedArgument="value"===t.type.kind||"value"===e.type.kind}static parse(t,e){if(3!==t.length&&4!==t.length)return e.error("Expected two or three arguments.");const n=t[0];let s=e.parse(t[1],1,DF);if(!s)return null;if(!dD(n,s.type))return e.concat(1).error(`"${n}" comparisons are not supported for type '${HF(s.type)}'.`);let o=e.parse(t[2],2,DF);if(!o)return null;if(!dD(n,o.type))return e.concat(2).error(`"${n}" comparisons are not supported for type '${HF(o.type)}'.`);if(s.type.kind!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error(`Cannot compare types '${HF(s.type)}' and '${HF(o.type)}'.`);i&&("value"===s.type.kind&&"value"!==o.type.kind?s=new qj(o.type,[s]):"value"!==s.type.kind&&"value"===o.type.kind&&(o=new qj(s.type,[o])));let a=null;if(4===t.length){if("string"!==s.type.kind&&"string"!==o.type.kind&&"value"!==s.type.kind&&"value"!==o.type.kind)return e.error("Cannot use collator to compare non-string types.");if(a=e.parse(t[3],3,NF),!a)return null}return new r(s,o,a)}evaluate(r){const s=this.lhs.evaluate(r),o=this.rhs.evaluate(r);if(i&&this.hasUntypedArgument){const e=Dj(s),n=Dj(o);if(e.kind!==n.kind||"string"!==e.kind&&"number"!==e.kind)throw new Pj(`Expected arguments for "${t}" to be (string, string) or (number, number), but found (${e.kind}, ${n.kind}) instead.`)}if(this.collator&&!i&&this.hasUntypedArgument){const t=Dj(s),n=Dj(o);if("string"!==t.kind||"string"!==n.kind)return e(r,s,o)}return this.collator?n(r,s,o,this.collator.evaluate(r)):e(r,s,o)}eachChild(t){t(this.lhs),t(this.rhs),this.collator&&t(this.collator)}outputDefined(){return!0}}}const gD=fD("==",function(t,e,n){return e===n},pD),mD=fD("!=",function(t,e,n){return e!==n},function(t,e,n,i){return!pD(0,e,n,i)}),yD=fD("<",function(t,e,n){return e<n},function(t,e,n,i){return i.compare(e,n)<0}),vD=fD(">",function(t,e,n){return e>n},function(t,e,n,i){return i.compare(e,n)>0}),_D=fD("<=",function(t,e,n){return e<=n},function(t,e,n,i){return i.compare(e,n)<=0}),bD=fD(">=",function(t,e,n){return e>=n},function(t,e,n,i){return i.compare(e,n)>=0});class wD{constructor(t,e,n){this.type=NF,this.locale=n,this.caseSensitive=t,this.diacriticSensitive=e}static parse(t,e){if(2!==t.length)return e.error("Expected one argument.");const n=t[1];if("object"!=typeof n||Array.isArray(n))return e.error("Collator options argument must be an object.");const i=e.parse(void 0!==n["case-sensitive"]&&n["case-sensitive"],1,AF);if(!i)return null;const r=e.parse(void 0!==n["diacritic-sensitive"]&&n["diacritic-sensitive"],1,AF);if(!r)return null;let s=null;return n.locale&&(s=e.parse(n.locale,1,OF),!s)?null:new wD(i,r,s)}evaluate(t){return new Sj(this.caseSensitive.evaluate(t),this.diacriticSensitive.evaluate(t),this.locale?this.locale.evaluate(t):null)}eachChild(t){t(this.caseSensitive),t(this.diacriticSensitive),this.locale&&t(this.locale)}outputDefined(){return!1}}class xD{constructor(t,e,n,i,r){this.type=OF,this.number=t,this.locale=e,this.currency=n,this.minFractionDigits=i,this.maxFractionDigits=r}static parse(t,e){if(3!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,IF);if(!n)return null;const i=t[2];if("object"!=typeof i||Array.isArray(i))return e.error("NumberFormat options argument must be an object.");let r=null;if(i.locale&&(r=e.parse(i.locale,1,OF),!r))return null;let s=null;if(i.currency&&(s=e.parse(i.currency,1,OF),!s))return null;let o=null;if(i["min-fraction-digits"]&&(o=e.parse(i["min-fraction-digits"],1,IF),!o))return null;let a=null;return i["max-fraction-digits"]&&(a=e.parse(i["max-fraction-digits"],1,IF),!a)?null:new xD(n,r,s,o,a)}evaluate(t){return new Intl.NumberFormat(this.locale?this.locale.evaluate(t):[],{style:this.currency?"currency":"decimal",currency:this.currency?this.currency.evaluate(t):void 0,minimumFractionDigits:this.minFractionDigits?this.minFractionDigits.evaluate(t):void 0,maximumFractionDigits:this.maxFractionDigits?this.maxFractionDigits.evaluate(t):void 0}).format(this.number.evaluate(t))}eachChild(t){t(this.number),this.locale&&t(this.locale),this.currency&&t(this.currency),this.minFractionDigits&&t(this.minFractionDigits),this.maxFractionDigits&&t(this.maxFractionDigits)}outputDefined(){return!1}}class CD{constructor(t){this.type=BF,this.sections=t}static parse(t,e){if(t.length<2)return e.error("Expected at least one argument.");const n=t[1];if(!Array.isArray(n)&&"object"==typeof n)return e.error("First argument must be an image or text section.");const i=[];let r=!1;for(let s=1;s<=t.length-1;++s){const n=t[s];if(r&&"object"==typeof n&&!Array.isArray(n)){r=!1;let t=null;if(n["font-scale"]&&(t=e.parse(n["font-scale"],1,IF),!t))return null;let s=null;if(n["text-font"]&&(s=e.parse(n["text-font"],1,WF(OF)),!s))return null;let o=null;if(n["text-color"]&&(o=e.parse(n["text-color"],1,zF),!o))return null;let a=null;if(n["vertical-align"]){if("string"==typeof n["vertical-align"]&&!kj.includes(n["vertical-align"]))return e.error(`'vertical-align' must be one of: 'bottom', 'center', 'top' but found '${n["vertical-align"]}' instead.`);if(a=e.parse(n["vertical-align"],1,OF),!a)return null}const l=i[i.length-1];l.scale=t,l.font=s,l.textColor=o,l.verticalAlign=a}else{const n=e.parse(t[s],1,DF);if(!n)return null;const o=n.type.kind;if("string"!==o&&"value"!==o&&"null"!==o&&"resolvedImage"!==o)return e.error("Formatted text type must be 'string', 'value', 'image' or 'null'.");r=!0,i.push({content:n,scale:null,font:null,textColor:null,verticalAlign:null})}}return new CD(i)}evaluate(t){return new Tj(this.sections.map(e=>{const n=e.content.evaluate(t);return Dj(n)===$F?new Ej("",n,null,null,null,e.verticalAlign?e.verticalAlign.evaluate(t):null):new Ej(Nj(n),null,e.scale?e.scale.evaluate(t):null,e.font?e.font.evaluate(t).join(","):null,e.textColor?e.textColor.evaluate(t):null,e.verticalAlign?e.verticalAlign.evaluate(t):null)}))}eachChild(t){for(const e of this.sections)t(e.content),e.scale&&t(e.scale),e.font&&t(e.font),e.textColor&&t(e.textColor),e.verticalAlign&&t(e.verticalAlign)}outputDefined(){return!1}}class SD{constructor(t){this.type=$F,this.input=t}static parse(t,e){if(2!==t.length)return e.error("Expected two arguments.");const n=e.parse(t[1],1,OF);return n?new SD(n):e.error("No image name provided.")}evaluate(t){const e=this.input.evaluate(t),n=Aj.fromString(e);return n&&t.availableImages&&(n.available=t.availableImages.indexOf(e)>-1),n}eachChild(t){t(this.input)}outputDefined(){return!1}}class kD{constructor(t){this.type=IF,this.input=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const n=e.parse(t[1],1);return n?"array"!==n.type.kind&&"string"!==n.type.kind&&"value"!==n.type.kind?e.error(`Expected argument of type string or array, but found ${HF(n.type)} instead.`):new kD(n):null}evaluate(t){const e=this.input.evaluate(t);if("string"==typeof e)return[...e].length;if(Array.isArray(e))return e.length;throw new Pj(`Expected value to be of type string or array, but found ${HF(Dj(e))} instead.`)}eachChild(t){t(this.input)}outputDefined(){return!1}}const ED=8192;function TD(t,e){const n=(180+t[0])/360,i=(r=t[1],(180-180/Math.PI*Math.log(Math.tan(Math.PI/4+r*Math.PI/360)))/360);var r;const s=Math.pow(2,e.z);return[Math.round(n*s*ED),Math.round(i*s*ED)]}function LD(t,e){const n=Math.pow(2,e.z);return[(r=(t[0]/ED+e.x)/n,360*r-180),(i=(t[1]/ED+e.y)/n,360/Math.PI*Math.atan(Math.exp((180-360*i)*Math.PI/180))-90)];var i,r}function MD(t,e){t[0]=Math.min(t[0],e[0]),t[1]=Math.min(t[1],e[1]),t[2]=Math.max(t[2],e[0]),t[3]=Math.max(t[3],e[1])}function RD(t,e){return!(t[0]<=e[0]||t[2]>=e[2]||t[1]<=e[1]||t[3]>=e[3])}function PD(t,e,n){return e[1]>t[1]!=n[1]>t[1]&&t[0]<(n[0]-e[0])*(t[1]-e[1])/(n[1]-e[1])+e[0]}function ID(t,e,n){const i=t[0]-e[0],r=t[1]-e[1],s=t[0]-n[0],o=t[1]-n[1];return i*o-s*r===0&&i*s<=0&&r*o<=0}function OD(t,e,n,i){const r=[e[0]-t[0],e[1]-t[1]];return 0!==(s=[i[0]-n[0],i[1]-n[1]])[0]*(o=r)[1]-s[1]*o[0]&&!(!ND(t,e,n,i)||!ND(n,i,t,e));var s,o}function AD(t,e,n){for(const i of n)for(let n=0;n<i.length-1;++n)if(OD(t,e,i[n],i[n+1]))return!0;return!1}function zD(t,e,n=!1){let i=!1;for(const r of e)for(let e=0;e<r.length-1;e++){if(ID(t,r[e],r[e+1]))return n;PD(t,r[e],r[e+1])&&(i=!i)}return i}function FD(t,e){for(const n of e)if(zD(t,n))return!0;return!1}function jD(t,e){for(const n of t)if(!zD(n,e))return!1;for(let n=0;n<t.length-1;++n)if(AD(t[n],t[n+1],e))return!1;return!0}function DD(t,e){for(const n of e)if(jD(t,n))return!0;return!1}function ND(t,e,n,i){const r=t[0]-n[0],s=t[1]-n[1],o=e[0]-n[0],a=e[1]-n[1],l=i[0]-n[0],c=i[1]-n[1],h=r*c-l*s,u=o*c-l*a;return h>0&&u<0||h<0&&u>0}function BD(t,e,n){const i=[];for(let r=0;r<t.length;r++){const s=[];for(let i=0;i<t[r].length;i++){const o=TD(t[r][i],n);MD(e,o),s.push(o)}i.push(s)}return i}function UD(t,e,n){const i=[];for(let r=0;r<t.length;r++){const s=BD(t[r],e,n);i.push(s)}return i}function qD(t,e,n,i){if(t[0]<n[0]||t[0]>n[2]){const e=.5*i;let r=t[0]-n[0]>e?-i:n[0]-t[0]>e?i:0;0===r&&(r=t[0]-n[2]>e?-i:n[2]-t[0]>e?i:0),t[0]+=r}MD(e,t)}function VD(t,e,n,i){const r=Math.pow(2,i.z)*ED,s=[i.x*ED,i.y*ED],o=[];for(const a of t)for(const t of a){const i=[t.x+s[0],t.y+s[1]];qD(i,e,n,r),o.push(i)}return o}function $D(t,e,n,i){const r=Math.pow(2,i.z)*ED,s=[i.x*ED,i.y*ED],o=[];for(const a of t){const t=[];for(const n of a){const i=[n.x+s[0],n.y+s[1]];MD(e,i),t.push(i)}o.push(t)}if(e[2]-e[0]<=r/2){!function(t){t[0]=t[1]=1/0,t[2]=t[3]=-1/0}(e);for(const t of o)for(const i of t)qD(i,e,n,r)}return o}class GD{constructor(t,e){this.type=AF,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'within' expression requires exactly one argument, but found ${t.length-1} instead.`);if(jj(t[1])){const e=t[1];if("FeatureCollection"===e.type){const t=[];for(const n of e.features){const{type:e,coordinates:i}=n.geometry;"Polygon"===e&&t.push(i),"MultiPolygon"===e&&t.push(...i)}if(t.length)return new GD(e,{type:"MultiPolygon",coordinates:t})}else if("Feature"===e.type){const t=e.geometry.type;if("Polygon"===t||"MultiPolygon"===t)return new GD(e,e.geometry)}else if("Polygon"===e.type||"MultiPolygon"===e.type)return new GD(e,e)}return e.error("'within' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const s=BD(e.coordinates,i,r),o=VD(t.geometry(),n,i,r);if(!RD(n,i))return!1;for(const t of o)if(!zD(t,s))return!1}if("MultiPolygon"===e.type){const s=UD(e.coordinates,i,r),o=VD(t.geometry(),n,i,r);if(!RD(n,i))return!1;for(const t of o)if(!FD(t,s))return!1}return!0}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=[1/0,1/0,-1/0,-1/0],i=[1/0,1/0,-1/0,-1/0],r=t.canonicalID();if("Polygon"===e.type){const s=BD(e.coordinates,i,r),o=$D(t.geometry(),n,i,r);if(!RD(n,i))return!1;for(const t of o)if(!jD(t,s))return!1}if("MultiPolygon"===e.type){const s=UD(e.coordinates,i,r),o=$D(t.geometry(),n,i,r);if(!RD(n,i))return!1;for(const t of o)if(!DD(t,s))return!1}return!0}(t,this.geometries)}return!1}eachChild(){}outputDefined(){return!0}}class WD{constructor(t=[],e=(t,e)=>t<e?-1:t>e?1:0){if(this.data=t,this.length=this.data.length,this.compare=e,this.length>0)for(let n=(this.length>>1)-1;n>=0;n--)this._down(n)}push(t){this.data.push(t),this._up(this.length++)}pop(){if(0===this.length)return;const t=this.data[0],e=this.data.pop();return--this.length>0&&(this.data[0]=e,this._down(0)),t}peek(){return this.data[0]}_up(t){const{data:e,compare:n}=this,i=e[t];for(;t>0;){const r=t-1>>1,s=e[r];if(n(i,s)>=0)break;e[t]=s,t=r}e[t]=i}_down(t){const{data:e,compare:n}=this,i=this.length>>1,r=e[t];for(;t<i;){let i=1+(t<<1);const s=i+1;if(s<this.length&&n(e[s],e[i])<0&&(i=s),n(e[i],r)>=0)break;e[t]=e[i],t=i}e[t]=r}}function HD(t){let e=0;for(let n,i,r=0,s=t.length,o=s-1;r<s;o=r++)n=t[r],i=t[o],e+=(i.x-n.x)*(n.y+i.y);return e}const ZD=1/298.257223563,KD=ZD*(2-ZD),YD=Math.PI/180;class XD{constructor(t){const e=6378.137*YD*1e3,n=Math.cos(t*YD),i=1/(1-KD*(1-n*n)),r=Math.sqrt(i);this.kx=e*r*n,this.ky=e*r*i*(1-KD)}distance(t,e){const n=this.wrap(t[0]-e[0])*this.kx,i=(t[1]-e[1])*this.ky;return Math.sqrt(n*n+i*i)}pointOnLine(t,e){let n,i,r,s,o=1/0;for(let a=0;a<t.length-1;a++){let l=t[a][0],c=t[a][1],h=this.wrap(t[a+1][0]-l)*this.kx,u=(t[a+1][1]-c)*this.ky,d=0;0===h&&0===u||(d=(this.wrap(e[0]-l)*this.kx*h+(e[1]-c)*this.ky*u)/(h*h+u*u),d>1?(l=t[a+1][0],c=t[a+1][1]):d>0&&(l+=h/this.kx*d,c+=u/this.ky*d)),h=this.wrap(e[0]-l)*this.kx,u=(e[1]-c)*this.ky;const p=h*h+u*u;p<o&&(o=p,n=l,i=c,r=a,s=d)}return{point:[n,i],index:r,t:Math.max(0,Math.min(1,s))}}wrap(t){for(;t<-180;)t+=360;for(;t>180;)t-=360;return t}}function JD(t,e){return e[0]-t[0]}function QD(t){return t[1]-t[0]+1}function tN(t,e){return t[1]>=t[0]&&t[1]<e}function eN(t,e){if(t[0]>t[1])return[null,null];const n=QD(t);if(e){if(2===n)return[t,null];const e=Math.floor(n/2);return[[t[0],t[0]+e],[t[0]+e,t[1]]]}if(1===n)return[t,null];const i=Math.floor(n/2)-1;return[[t[0],t[0]+i],[t[0]+i+1,t[1]]]}function nN(t,e){if(!tN(e,t.length))return[1/0,1/0,-1/0,-1/0];const n=[1/0,1/0,-1/0,-1/0];for(let i=e[0];i<=e[1];++i)MD(n,t[i]);return n}function iN(t){const e=[1/0,1/0,-1/0,-1/0];for(const n of t)for(const t of n)MD(e,t);return e}function rN(t){return t[0]!==-1/0&&t[1]!==-1/0&&t[2]!==1/0&&t[3]!==1/0}function sN(t,e,n){if(!rN(t)||!rN(e))return NaN;let i=0,r=0;return t[2]<e[0]&&(i=e[0]-t[2]),t[0]>e[2]&&(i=t[0]-e[2]),t[1]>e[3]&&(r=t[1]-e[3]),t[3]<e[1]&&(r=e[1]-t[3]),n.distance([0,0],[i,r])}function oN(t,e,n){const i=n.pointOnLine(e,t);return n.distance(t,i.point)}function aN(t,e,n,i,r){const s=Math.min(oN(t,[n,i],r),oN(e,[n,i],r)),o=Math.min(oN(n,[t,e],r),oN(i,[t,e],r));return Math.min(s,o)}function lN(t,e,n,i,r){if(!tN(e,t.length)||!tN(i,n.length))return 1/0;let s=1/0;for(let o=e[0];o<e[1];++o){const e=t[o],a=t[o+1];for(let t=i[0];t<i[1];++t){const i=n[t],o=n[t+1];if(OD(e,a,i,o))return 0;s=Math.min(s,aN(e,a,i,o,r))}}return s}function cN(t,e,n,i,r){if(!tN(e,t.length)||!tN(i,n.length))return NaN;let s=1/0;for(let o=e[0];o<=e[1];++o)for(let e=i[0];e<=i[1];++e)if(s=Math.min(s,r.distance(t[o],n[e])),0===s)return s;return s}function hN(t,e,n){if(zD(t,e,!0))return 0;let i=1/0;for(const r of e){const e=r[0],s=r[r.length-1];if(e!==s&&(i=Math.min(i,oN(t,[s,e],n)),0===i))return i;const o=n.pointOnLine(r,t);if(i=Math.min(i,n.distance(t,o.point)),0===i)return i}return i}function uN(t,e,n,i){if(!tN(e,t.length))return NaN;for(let s=e[0];s<=e[1];++s)if(zD(t[s],n,!0))return 0;let r=1/0;for(let s=e[0];s<e[1];++s){const e=t[s],o=t[s+1];for(const t of n)for(let n=0,s=t.length,a=s-1;n<s;a=n++){const s=t[a],l=t[n];if(OD(e,o,s,l))return 0;r=Math.min(r,aN(e,o,s,l,i))}}return r}function dN(t,e){for(const n of t)for(const t of n)if(zD(t,e,!0))return!0;return!1}function pN(t,e,n,i=1/0){const r=iN(t),s=iN(e);if(i!==1/0&&sN(r,s,n)>=i)return i;if(RD(r,s)){if(dN(t,e))return 0}else if(dN(e,t))return 0;let o=1/0;for(const a of t)for(let t=0,i=a.length,r=i-1;t<i;r=t++){const i=a[r],s=a[t];for(const t of e)for(let e=0,r=t.length,a=r-1;e<r;a=e++){const r=t[a],l=t[e];if(OD(i,s,r,l))return 0;o=Math.min(o,aN(i,s,r,l,n))}}return o}function fN(t,e,n,i,r,s){if(!s)return;const o=sN(nN(i,s),r,n);o<e&&t.push([o,s,[0,0]])}function gN(t,e,n,i,r,s,o){if(!s||!o)return;const a=sN(nN(i,s),nN(r,o),n);a<e&&t.push([a,s,o])}function mN(t,e,n,i,r=1/0){let s=Math.min(i.distance(t[0],n[0][0]),r);if(0===s)return s;const o=new WD([[0,[0,t.length-1],[0,0]]],JD),a=iN(n);for(;o.length>0;){const r=o.pop();if(r[0]>=s)continue;const l=r[1],c=e?50:100;if(QD(l)<=c){if(!tN(l,t.length))return NaN;if(e){const e=uN(t,l,n,i);if(isNaN(e)||0===e)return e;s=Math.min(s,e)}else for(let e=l[0];e<=l[1];++e){const r=hN(t[e],n,i);if(s=Math.min(s,r),0===s)return 0}}else{const n=eN(l,e);fN(o,s,i,t,a,n[0]),fN(o,s,i,t,a,n[1])}}return s}function yN(t,e,n,i,r,s=1/0){let o=Math.min(s,r.distance(t[0],n[0]));if(0===o)return o;const a=new WD([[0,[0,t.length-1],[0,n.length-1]]],JD);for(;a.length>0;){const s=a.pop();if(s[0]>=o)continue;const l=s[1],c=s[2],h=e?50:100,u=i?50:100;if(QD(l)<=h&&QD(c)<=u){if(!tN(l,t.length)&&tN(c,n.length))return NaN;let s;if(e&&i)s=lN(t,l,n,c,r),o=Math.min(o,s);else if(e&&!i){const e=t.slice(l[0],l[1]+1);for(let t=c[0];t<=c[1];++t)if(s=oN(n[t],e,r),o=Math.min(o,s),0===o)return o}else if(!e&&i){const e=n.slice(c[0],c[1]+1);for(let n=l[0];n<=l[1];++n)if(s=oN(t[n],e,r),o=Math.min(o,s),0===o)return o}else s=cN(t,l,n,c,r),o=Math.min(o,s)}else{const s=eN(l,e),h=eN(c,i);gN(a,o,r,t,n,s[0],h[0]),gN(a,o,r,t,n,s[0],h[1]),gN(a,o,r,t,n,s[1],h[0]),gN(a,o,r,t,n,s[1],h[1])}}return o}function vN(t){return"MultiPolygon"===t.type?t.coordinates.map(t=>({type:"Polygon",coordinates:t})):"MultiLineString"===t.type?t.coordinates.map(t=>({type:"LineString",coordinates:t})):"MultiPoint"===t.type?t.coordinates.map(t=>({type:"Point",coordinates:t})):[t]}class _N{constructor(t,e){this.type=IF,this.geojson=t,this.geometries=e}static parse(t,e){if(2!==t.length)return e.error(`'distance' expression requires exactly one argument, but found ${t.length-1} instead.`);if(jj(t[1])){const e=t[1];if("FeatureCollection"===e.type)return new _N(e,e.features.map(t=>vN(t.geometry)).flat());if("Feature"===e.type)return new _N(e,vN(e.geometry));if("type"in e&&"coordinates"in e)return new _N(e,vN(e))}return e.error("'distance' expression requires valid geojson object that contains polygon geometry type.")}evaluate(t){if(null!=t.geometry()&&null!=t.canonicalID()){if("Point"===t.geometryType())return function(t,e){const n=t.geometry(),i=n.flat().map(e=>LD([e.x,e.y],t.canonical));if(0===n.length)return NaN;const r=new XD(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,yN(i,!1,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,yN(i,!1,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,mN(i,!1,o.coordinates,r,s))}if(0===s)return s}return s}(t,this.geometries);if("LineString"===t.geometryType())return function(t,e){const n=t.geometry(),i=n.flat().map(e=>LD([e.x,e.y],t.canonical));if(0===n.length)return NaN;const r=new XD(i[0][1]);let s=1/0;for(const o of e){switch(o.type){case"Point":s=Math.min(s,yN(i,!0,[o.coordinates],!1,r,s));break;case"LineString":s=Math.min(s,yN(i,!0,o.coordinates,!0,r,s));break;case"Polygon":s=Math.min(s,mN(i,!0,o.coordinates,r,s))}if(0===s)return s}return s}(t,this.geometries);if("Polygon"===t.geometryType())return function(t,e){const n=t.geometry();if(0===n.length||0===n[0].length)return NaN;const i=function(t){if(t.length<=1)return[t];const e=[];let n,i;for(const r of t){const t=HD(r);0!==t&&(r.area=Math.abs(t),void 0===i&&(i=t<0),i===t<0?(n&&e.push(n),n=[r]):n.push(r))}return n&&e.push(n),e}(n).map(e=>e.map(e=>e.map(e=>LD([e.x,e.y],t.canonical)))),r=new XD(i[0][0][0][1]);let s=1/0;for(const o of e)for(const t of i){switch(o.type){case"Point":s=Math.min(s,mN([o.coordinates],!1,t,r,s));break;case"LineString":s=Math.min(s,mN(o.coordinates,!0,t,r,s));break;case"Polygon":s=Math.min(s,pN(t,o.coordinates,r,s))}if(0===s)return s}return s}(t,this.geometries)}return NaN}eachChild(){}outputDefined(){return!0}}class bN{constructor(t){this.type=DF,this.key=t}static parse(t,e){if(2!==t.length)return e.error(`Expected 1 argument, but found ${t.length-1} instead.`);const n=t[1];return null==n?e.error("Global state property must be defined."):"string"!=typeof n?e.error(`Global state property must be string, but found ${typeof t[1]} instead.`):new bN(n)}evaluate(t){var e;const n=null===(e=t.globals)||void 0===e?void 0:e.globalState;return n&&0!==Object.keys(n).length?gj(n,this.key):null}eachChild(){}outputDefined(){return!1}}const wN={"==":gD,"!=":mD,">":vD,"<":yD,">=":bD,"<=":_D,array:qj,at:Yj,boolean:qj,case:tD,coalesce:uD,collator:wD,format:CD,image:SD,in:Xj,"index-of":Jj,interpolate:cD,"interpolate-hcl":cD,"interpolate-lab":cD,length:kD,let:Zj,literal:Bj,match:Qj,number:qj,"number-format":xD,object:qj,slice:eD,step:iD,string:qj,"to-boolean":$j,"to-color":$j,"to-number":$j,"to-string":$j,var:Kj,within:GD,distance:_N,"global-state":bN};class xN{constructor(t,e,n,i){this.name=t,this.type=e,this._evaluate=n,this.args=i}evaluate(t){return this._evaluate(t,this.args)}eachChild(t){this.args.forEach(t)}outputDefined(){return!1}static parse(t,e){const n=t[0],i=xN.definitions[n];if(!i)return e.error(`Unknown expression "${n}". If you wanted a literal array, use ["literal", [...]].`,0);const r=Array.isArray(i)?i[0]:i.type,s=Array.isArray(i)?[[i[1],i[2]]]:i.overloads,o=s.filter(([e])=>!Array.isArray(e)||e.length===t.length-1);let a=null;for(const[l,c]of o){a=new Hj(e.registry,TN,e.path,null,e.scope);const i=[];let s=!1;for(let e=1;e<t.length;e++){const n=t[e],r=Array.isArray(l)?l[e-1]:l.type,o=a.parse(n,1+i.length,r);if(!o){s=!0;break}i.push(o)}if(!s)if(Array.isArray(l)&&l.length!==i.length)a.error(`Expected ${l.length} arguments, but found ${i.length} instead.`);else{for(let t=0;t<i.length;t++){const e=Array.isArray(l)?l[t]:l.type,n=i[t];a.concat(t+1).checkSubtype(e,n.type)}if(0===a.errors.length)return new xN(n,r,c,i)}}if(1===o.length)e.errors.push(...a.errors);else{const n=(o.length?o:s).map(([t])=>{return e=t,Array.isArray(e)?`(${e.map(HF).join(", ")})`:`(${HF(e.type)}...)`;var e}).join(" | "),i=[];for(let r=1;r<t.length;r++){const n=e.parse(t[r],1+i.length);if(!n)return null;i.push(HF(n.type))}e.error(`Expected arguments of type ${n}, but found (${i.join(", ")}) instead.`)}return null}static register(t,e){xN.definitions=e;for(const n in e)t[n]=xN}}function CN(t,[e,n,i,r]){e=e.evaluate(t),n=n.evaluate(t),i=i.evaluate(t);const s=r?r.evaluate(t):1,o=Fj(e,n,i,s);if(o)throw new Pj(o);return new Cj(e/255,n/255,i/255,s,!1)}function SN(t,e){return t in e}function kN(t,e){const n=e[t];return void 0===n?null:n}function EN(t){return{type:t}}function TN(t){if(t instanceof Kj)return TN(t.boundExpression);if(t instanceof xN&&"error"===t.name)return!1;if(t instanceof wD)return!1;if(t instanceof GD)return!1;if(t instanceof _N)return!1;if(t instanceof bN)return!1;const e=t instanceof $j||t instanceof qj;let n=!0;return t.eachChild(t=>{n=e?n&&TN(t):n&&t instanceof Bj}),!!n&&LN(t)&&RN(t,["zoom","heatmap-density","elevation","line-progress","accumulated","is-supported-script"])}function LN(t){if(t instanceof xN){if("get"===t.name&&1===t.args.length)return!1;if("feature-state"===t.name)return!1;if("has"===t.name&&1===t.args.length)return!1;if("properties"===t.name||"geometry-type"===t.name||"id"===t.name)return!1;if(/^filter-/.test(t.name))return!1}if(t instanceof GD)return!1;if(t instanceof _N)return!1;let e=!0;return t.eachChild(t=>{e&&!LN(t)&&(e=!1)}),e}function MN(t){if(t instanceof xN&&"feature-state"===t.name)return!1;let e=!0;return t.eachChild(t=>{e&&!MN(t)&&(e=!1)}),e}function RN(t,e){if(t instanceof xN&&e.indexOf(t.name)>=0)return!1;let n=!0;return t.eachChild(t=>{n&&!RN(t,e)&&(n=!1)}),n}function PN(t){return{result:"success",value:t}}function IN(t){return{result:"error",value:t}}function ON(t){return"object"==typeof t&&null!==t&&!Array.isArray(t)&&Dj(t)===jF}xN.register(wN,{error:[{kind:"error"},[OF],(t,[e])=>{throw new Pj(e.evaluate(t))}],typeof:[OF,[DF],(t,[e])=>HF(Dj(e.evaluate(t)))],"to-rgba":[WF(IF,4),[zF],(t,[e])=>{const[n,i,r,s]=e.evaluate(t).rgb;return[255*n,255*i,255*r,s]}],rgb:[zF,[IF,IF,IF],CN],rgba:[zF,[IF,IF,IF,IF],CN],has:{type:AF,overloads:[[[OF],(t,[e])=>SN(e.evaluate(t),t.properties())],[[OF,jF],(t,[e,n])=>SN(e.evaluate(t),n.evaluate(t))]]},get:{type:DF,overloads:[[[OF],(t,[e])=>kN(e.evaluate(t),t.properties())],[[OF,jF],(t,[e,n])=>kN(e.evaluate(t),n.evaluate(t))]]},"feature-state":[DF,[OF],(t,[e])=>kN(e.evaluate(t),t.featureState||{})],properties:[jF,[],t=>t.properties()],"geometry-type":[OF,[],t=>t.geometryType()],id:[DF,[],t=>t.id()],zoom:[IF,[],t=>t.globals.zoom],"heatmap-density":[IF,[],t=>t.globals.heatmapDensity||0],elevation:[IF,[],t=>t.globals.elevation||0],"line-progress":[IF,[],t=>t.globals.lineProgress||0],accumulated:[DF,[],t=>void 0===t.globals.accumulated?null:t.globals.accumulated],"+":[IF,EN(IF),(t,e)=>{let n=0;for(const i of e)n+=i.evaluate(t);return n}],"*":[IF,EN(IF),(t,e)=>{let n=1;for(const i of e)n*=i.evaluate(t);return n}],"-":{type:IF,overloads:[[[IF,IF],(t,[e,n])=>e.evaluate(t)-n.evaluate(t)],[[IF],(t,[e])=>-e.evaluate(t)]]},"/":[IF,[IF,IF],(t,[e,n])=>e.evaluate(t)/n.evaluate(t)],"%":[IF,[IF,IF],(t,[e,n])=>e.evaluate(t)%n.evaluate(t)],ln2:[IF,[],()=>Math.LN2],pi:[IF,[],()=>Math.PI],e:[IF,[],()=>Math.E],"^":[IF,[IF,IF],(t,[e,n])=>Math.pow(e.evaluate(t),n.evaluate(t))],sqrt:[IF,[IF],(t,[e])=>Math.sqrt(e.evaluate(t))],log10:[IF,[IF],(t,[e])=>Math.log(e.evaluate(t))/Math.LN10],ln:[IF,[IF],(t,[e])=>Math.log(e.evaluate(t))],log2:[IF,[IF],(t,[e])=>Math.log(e.evaluate(t))/Math.LN2],sin:[IF,[IF],(t,[e])=>Math.sin(e.evaluate(t))],cos:[IF,[IF],(t,[e])=>Math.cos(e.evaluate(t))],tan:[IF,[IF],(t,[e])=>Math.tan(e.evaluate(t))],asin:[IF,[IF],(t,[e])=>Math.asin(e.evaluate(t))],acos:[IF,[IF],(t,[e])=>Math.acos(e.evaluate(t))],atan:[IF,[IF],(t,[e])=>Math.atan(e.evaluate(t))],min:[IF,EN(IF),(t,e)=>Math.min(...e.map(e=>e.evaluate(t)))],max:[IF,EN(IF),(t,e)=>Math.max(...e.map(e=>e.evaluate(t)))],abs:[IF,[IF],(t,[e])=>Math.abs(e.evaluate(t))],round:[IF,[IF],(t,[e])=>{const n=e.evaluate(t);return n<0?-Math.round(-n):Math.round(n)}],floor:[IF,[IF],(t,[e])=>Math.floor(e.evaluate(t))],ceil:[IF,[IF],(t,[e])=>Math.ceil(e.evaluate(t))],"filter-==":[AF,[OF,DF],(t,[e,n])=>t.properties()[e.value]===n.value],"filter-id-==":[AF,[DF],(t,[e])=>t.id()===e.value],"filter-type-==":[AF,[OF],(t,[e])=>t.geometryType()===e.value],"filter-<":[AF,[OF,DF],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<r}],"filter-id-<":[AF,[DF],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<i}],"filter->":[AF,[OF,DF],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>r}],"filter-id->":[AF,[DF],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>i}],"filter-<=":[AF,[OF,DF],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i<=r}],"filter-id-<=":[AF,[DF],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n<=i}],"filter->=":[AF,[OF,DF],(t,[e,n])=>{const i=t.properties()[e.value],r=n.value;return typeof i==typeof r&&i>=r}],"filter-id->=":[AF,[DF],(t,[e])=>{const n=t.id(),i=e.value;return typeof n==typeof i&&n>=i}],"filter-has":[AF,[DF],(t,[e])=>e.value in t.properties()],"filter-has-id":[AF,[],t=>null!==t.id()&&void 0!==t.id()],"filter-type-in":[AF,[WF(OF)],(t,[e])=>e.value.indexOf(t.geometryType())>=0],"filter-id-in":[AF,[WF(DF)],(t,[e])=>e.value.indexOf(t.id())>=0],"filter-in-small":[AF,[OF,WF(DF)],(t,[e,n])=>n.value.indexOf(t.properties()[e.value])>=0],"filter-in-large":[AF,[OF,WF(DF)],(t,[e,n])=>function(t,e,n,i){for(;n<=i;){const r=n+i>>1;if(e[r]===t)return!0;e[r]>t?i=r-1:n=r+1}return!1}(t.properties()[e.value],n.value,0,n.value.length-1)],all:{type:AF,overloads:[[[AF,AF],(t,[e,n])=>e.evaluate(t)&&n.evaluate(t)],[EN(AF),(t,e)=>{for(const n of e)if(!n.evaluate(t))return!1;return!0}]]},any:{type:AF,overloads:[[[AF,AF],(t,[e,n])=>e.evaluate(t)||n.evaluate(t)],[EN(AF),(t,e)=>{for(const n of e)if(n.evaluate(t))return!0;return!1}]]},"!":[AF,[AF],(t,[e])=>!e.evaluate(t)],"is-supported-script":[AF,[OF],(t,[e])=>{const n=t.globals&&t.globals.isSupportedScript;return!n||n(e.evaluate(t))}],upcase:[OF,[OF],(t,[e])=>e.evaluate(t).toUpperCase()],downcase:[OF,[OF],(t,[e])=>e.evaluate(t).toLowerCase()],concat:[OF,EN(DF),(t,e)=>e.map(e=>Nj(e.evaluate(t))).join("")],"resolved-locale":[OF,[NF],(t,[e])=>e.evaluate(t).resolvedLocale()]});class AN{constructor(t,e){this.expression=t,this._warningHistory={},this._evaluator=new Wj,this._defaultValue=e?function(t){if("color"===t.type&&ON(t.default))return new Cj(0,0,0,0);switch(t.type){case"color":return Cj.parse(t.default)||null;case"padding":return Lj.parse(t.default)||null;case"numberArray":return Mj.parse(t.default)||null;case"colorArray":return Rj.parse(t.default)||null;case"variableAnchorOffsetCollection":return Oj.parse(t.default)||null;case"projectionDefinition":return zj.parse(t.default)||null;default:return void 0===t.default?null:t.default}}(e):null,this._enumValues=e&&"enum"===e.type?e.values:null}evaluateWithoutErrorHandling(t,e,n,i,r,s){return this._evaluator.globals=t,this._evaluator.feature=e,this._evaluator.featureState=n,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s,this.expression.evaluate(this._evaluator)}evaluate(t,e,n,i,r,s){this._evaluator.globals=t,this._evaluator.feature=e||null,this._evaluator.featureState=n||null,this._evaluator.canonical=i,this._evaluator.availableImages=r||null,this._evaluator.formattedSection=s||null;try{const t=this.expression.evaluate(this._evaluator);if(null==t||"number"==typeof t&&t!=t)return this._defaultValue;if(this._enumValues&&!(t in this._enumValues))throw new Pj(`Expected value to be one of ${Object.keys(this._enumValues).map(t=>JSON.stringify(t)).join(", ")}, but found ${JSON.stringify(t)} instead.`);return t}catch(o){return this._warningHistory[o.message]||(this._warningHistory[o.message]=!0,"undefined"!=typeof console&&console.warn(o.message)),this._defaultValue}}}function zN(t,e){const n=new Hj(wN,TN,[],e?function(t){const e={color:zF,string:OF,number:IF,enum:OF,boolean:AF,formatted:BF,padding:UF,numberArray:VF,colorArray:qF,projectionDefinition:FF,resolvedImage:$F,variableAnchorOffsetCollection:GF};return"array"===t.type?WF(e[t.value]||DF,t.length):e[t.type]}(e):void 0),i=n.parse(t,void 0,void 0,void 0,e&&"string"===e.type?{typeAnnotation:"coerce"}:void 0);return i?PN(new AN(i,e)):IN(n.errors)}class FN{constructor(t,e){this.kind=t,this._styleExpression=e,this.isStateDependent="constant"!==t&&!MN(e.expression),this.globalStateRefs=BN(e.expression)}evaluateWithoutErrorHandling(t,e,n,i,r,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,s)}evaluate(t,e,n,i,r,s){return this._styleExpression.evaluate(t,e,n,i,r,s)}}class jN{constructor(t,e,n,i){this.kind=t,this.zoomStops=n,this._styleExpression=e,this.isStateDependent="camera"!==t&&!MN(e.expression),this.globalStateRefs=BN(e.expression),this.interpolationType=i}evaluateWithoutErrorHandling(t,e,n,i,r,s){return this._styleExpression.evaluateWithoutErrorHandling(t,e,n,i,r,s)}evaluate(t,e,n,i,r,s){return this._styleExpression.evaluate(t,e,n,i,r,s)}interpolationFactor(t,e,n){return this.interpolationType?cD.interpolationFactor(this.interpolationType,t,e,n):0}}function DN(t,e){const n=zN(t,e);if("error"===n.result)return n;const i=n.value.expression,r=LN(i);if(!r&&"data-driven"!==(s=e)["property-type"]&&"cross-faded-data-driven"!==s["property-type"])return IN([new MF("","data expressions not supported")]);var s;const o=RN(i,["zoom"]);if(!o&&!function(t){return!!t.expression&&t.expression.parameters.indexOf("zoom")>-1}(e))return IN([new MF("","zoom expressions not supported")]);const a=NN(i);if(!a&&!o)return IN([new MF("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.')]);if(a instanceof MF)return IN([a]);if(a instanceof cD&&!function(t){return!!t.expression&&t.expression.interpolated}(e))return IN([new MF("",'"interpolate" expressions cannot be used with this property')]);if(!a)return PN(new FN(r?"constant":"source",n.value));const l=a instanceof cD?a.interpolation:void 0;return PN(new jN(r?"camera":"composite",n.value,a.labels,l))}function NN(t){let e=null;if(t instanceof Zj)e=NN(t.result);else if(t instanceof uD){for(const n of t.args)if(e=NN(n),e)break}else(t instanceof iD||t instanceof cD)&&t.input instanceof xN&&"zoom"===t.input.name&&(e=t);return e instanceof MF||t.eachChild(t=>{const n=NN(t);n instanceof MF?e=n:!e&&n?e=new MF("",'"zoom" expression may only be used as input to a top-level "step" or "interpolate" expression.'):e&&n&&e!==n&&(e=new MF("",'Only one zoom-based "step" or "interpolate" subexpression may be used in an expression.'))}),e}function BN(t,e=new Set){return t instanceof bN&&e.add(t.key),t.eachChild(t=>{BN(t,e)}),e}function UN(t){if(!0===t||!1===t)return!0;if(!Array.isArray(t)||0===t.length)return!1;switch(t[0]){case"has":return t.length>=2&&"$id"!==t[1]&&"$type"!==t[1];case"in":return t.length>=3&&("string"!=typeof t[1]||Array.isArray(t[2]));case"!in":case"!has":case"none":return!1;case"==":case"!=":case">":case">=":case"<":case"<=":return 3!==t.length||Array.isArray(t[1])||Array.isArray(t[2]);case"any":case"all":for(const e of t.slice(1))if(!UN(e)&&"boolean"!=typeof e)return!1;return!0;default:return!0}}const qN={type:"boolean",default:!1,transition:!1,"property-type":"data-driven",expression:{interpolated:!1,parameters:["zoom","feature"]}};function VN(t){if(null==t)return{filter:()=>!0,needGeometry:!1,getGlobalStateRefs:()=>new Set};UN(t)||(t=WN(t));const e=zN(t,qN);if("error"===e.result)throw new Error(e.value.map(t=>`${t.key}: ${t.message}`).join(", "));return{filter:(t,n,i)=>e.value.evaluate(t,n,{},i),needGeometry:GN(t),getGlobalStateRefs:()=>BN(e.value.expression)}}function $N(t,e){return t<e?-1:t>e?1:0}function GN(t){if(!Array.isArray(t))return!1;if("within"===t[0]||"distance"===t[0])return!0;for(let e=1;e<t.length;e++)if(GN(t[e]))return!0;return!1}function WN(t){if(!t)return!0;const e=t[0];return t.length<=1?"any"!==e:"=="===e?HN(t[1],t[2],"=="):"!="===e?YN(HN(t[1],t[2],"==")):"<"===e||">"===e||"<="===e||">="===e?HN(t[1],t[2],e):"any"===e?(n=t.slice(1),["any"].concat(n.map(WN))):"all"===e?["all"].concat(t.slice(1).map(WN)):"none"===e?["all"].concat(t.slice(1).map(WN).map(YN)):"in"===e?ZN(t[1],t.slice(2)):"!in"===e?YN(ZN(t[1],t.slice(2))):"has"===e?KN(t[1]):"!has"!==e||YN(KN(t[1]));var n}function HN(t,e,n){switch(t){case"$type":return[`filter-type-${n}`,e];case"$id":return[`filter-id-${n}`,e];default:return[`filter-${n}`,t,e]}}function ZN(t,e){if(0===e.length)return!1;switch(t){case"$type":return["filter-type-in",["literal",e]];case"$id":return["filter-id-in",["literal",e]];default:return e.length>200&&!e.some(t=>typeof t!=typeof e[0])?["filter-in-large",t,["literal",e.sort($N)]]:["filter-in-small",t,["literal",e]]}}function KN(t){switch(t){case"$type":return!0;case"$id":return["filter-has-id"];default:return["filter-has",t]}}function YN(t){return["!",t]}function XN(t){return"object"==typeof t?["literal",t]:t}function JN(t){switch(t.colorSpace){case"hcl":return"interpolate-hcl";case"lab":return"interpolate-lab";default:return"interpolate"}}function QN(t,e){const n=XN((i=t.default,r=e.default,void 0!==i?i:void 0!==r?r:void 0));var i,r;return void 0===n&&"resolvedImage"===e.type?"":n}function tB(t,e,n){const i=iB(t,e),r=["get",t.property];if("categorical"===i&&"boolean"==typeof n[0][0]){const i=["case"];for(const t of n)i.push(["==",r,t[0]],t[1]);return i.push(QN(t,e)),i}if("categorical"===i){const i=["match",r];for(const t of n)nB(i,t[0],t[1],!1);return i.push(QN(t,e)),i}if("interval"===i){const e=["step",["number",r]];for(const t of n)nB(e,t[0],t[1],!0);return eB(e),void 0===t.default?e:["case",["==",["typeof",r],"number"],e,XN(t.default)]}if("exponential"===i){const e=void 0!==t.base?t.base:1,i=[JN(t),1===e?["linear"]:["exponential",e],["number",r]];for(const t of n)nB(i,t[0],t[1],!1);return void 0===t.default?i:["case",["==",["typeof",r],"number"],i,XN(t.default)]}throw new Error(`Unknown property function type ${i}`)}function eB(t){"step"===t[0]&&3===t.length&&(t.push(0),t.push(t[3]))}function nB(t,e,n,i){t.length>3&&e===t[t.length-2]||(i&&2===t.length||t.push(e),t.push(n))}function iB(t,e){return t.type?t.type:e.expression.interpolated?"exponential":"interval"}function rB(t){const e=["concat"],n=/{([^{}]+)}/g;let i=0;for(let r=n.exec(t);null!==r;r=n.exec(t)){const s=t.slice(i,n.lastIndex-r[0].length);i=n.lastIndex,s.length>0&&e.push(s),e.push(["get",r[1]])}if(1===e.length)return t;if(i<t.length)e.push(t.slice(i));else if(2===e.length)return["to-string",e[1]];return e}const sB={$version:8,$root:{version:{required:!0,type:"enum",values:[8]},name:{type:"string"},metadata:{type:"*"},center:{type:"array",value:"number"},centerAltitude:{type:"number"},zoom:{type:"number"},bearing:{type:"number",default:0,period:360,units:"degrees"},pitch:{type:"number",default:0,units:"degrees"},roll:{type:"number",default:0,units:"degrees"},state:{type:"state",default:{}},light:{type:"light"},sky:{type:"sky"},projection:{type:"projection"},terrain:{type:"terrain"},sources:{required:!0,type:"sources"},sprite:{type:"sprite"},glyphs:{type:"string"},transition:{type:"transition"},layers:{required:!0,type:"array",value:"layer"}},sources:{"*":{type:"source"}},source:["source_vector","source_raster","source_raster_dem","source_geojson","source_video","source_image"],source_vector:{type:{required:!0,type:"enum",values:{vector:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},attribution:{type:"string"},promoteId:{type:"promoteId"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster:{type:{required:!0,type:"enum",values:{raster:{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},scheme:{type:"enum",values:{xyz:{},tms:{}},default:"xyz"},attribution:{type:"string"},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_raster_dem:{type:{required:!0,type:"enum",values:{"raster-dem":{}}},url:{type:"string"},tiles:{type:"array",value:"string"},bounds:{type:"array",value:"number",length:4,default:[-180,-85.051129,180,85.051129]},minzoom:{type:"number",default:0},maxzoom:{type:"number",default:22},tileSize:{type:"number",default:512,units:"pixels"},attribution:{type:"string"},encoding:{type:"enum",values:{terrarium:{},mapbox:{},custom:{}},default:"mapbox"},redFactor:{type:"number",default:1},blueFactor:{type:"number",default:1},greenFactor:{type:"number",default:1},baseShift:{type:"number",default:0},volatile:{type:"boolean",default:!1},"*":{type:"*"}},source_geojson:{type:{required:!0,type:"enum",values:{geojson:{}}},data:{required:!0,type:"*"},maxzoom:{type:"number",default:18},attribution:{type:"string"},buffer:{type:"number",default:128,maximum:512,minimum:0},filter:{type:"*"},tolerance:{type:"number",default:.375},cluster:{type:"boolean",default:!1},clusterRadius:{type:"number",default:50,minimum:0},clusterMaxZoom:{type:"number"},clusterMinPoints:{type:"number"},clusterProperties:{type:"*"},lineMetrics:{type:"boolean",default:!1},generateId:{type:"boolean",default:!1},promoteId:{type:"promoteId"}},source_video:{type:{required:!0,type:"enum",values:{video:{}}},urls:{required:!0,type:"array",value:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},source_image:{type:{required:!0,type:"enum",values:{image:{}}},url:{required:!0,type:"string"},coordinates:{required:!0,type:"array",length:4,value:{type:"array",length:2,value:"number"}}},layer:{id:{type:"string",required:!0},type:{type:"enum",values:{fill:{},line:{},symbol:{},circle:{},heatmap:{},"fill-extrusion":{},raster:{},hillshade:{},"color-relief":{},background:{}},required:!0},metadata:{type:"*"},source:{type:"string"},"source-layer":{type:"string"},minzoom:{type:"number",minimum:0,maximum:24},maxzoom:{type:"number",minimum:0,maximum:24},filter:{type:"filter"},layout:{type:"layout"},paint:{type:"paint"}},layout:["layout_fill","layout_line","layout_circle","layout_heatmap","layout_fill-extrusion","layout_symbol","layout_raster","layout_hillshade","layout_color-relief","layout_background"],layout_background:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_fill:{"fill-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_circle:{"circle-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_heatmap:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_fill-extrusion":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_line:{"line-cap":{type:"enum",values:{butt:{},round:{},square:{}},default:"butt",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-join":{type:"enum",values:{bevel:{},round:{},miter:{}},default:"miter",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"line-miter-limit":{type:"number",default:2,requires:[{"line-join":"miter"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-round-limit":{type:"number",default:1.05,requires:[{"line-join":"round"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_symbol:{"symbol-placement":{type:"enum",values:{point:{},line:{},"line-center":{}},default:"point",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-spacing":{type:"number",default:250,minimum:1,units:"pixels",requires:[{"symbol-placement":"line"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"symbol-avoid-edges":{type:"boolean",default:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"symbol-sort-key":{type:"number",expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"symbol-z-order":{type:"enum",values:{auto:{},"viewport-y":{},source:{}},default:"auto",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-allow-overlap":{type:"boolean",default:!1,requires:["icon-image",{"!":"icon-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-ignore-placement":{type:"boolean",default:!1,requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-optional":{type:"boolean",default:!1,requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-rotation-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-size":{type:"number",default:1,minimum:0,units:"factor of the original icon size",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-text-fit":{type:"enum",values:{none:{},width:{},height:{},both:{}},default:"none",requires:["icon-image","text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-text-fit-padding":{type:"array",value:"number",length:4,default:[0,0,0,0],units:"pixels",requires:["icon-image","text-field",{"icon-text-fit":["both","width","height"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-image":{type:"resolvedImage",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-padding":{type:"padding",default:[2],units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-keep-upright":{type:"boolean",default:!1,requires:["icon-image",{"icon-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"icon-offset":{type:"array",value:"number",length:2,default:[0,0],requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"icon-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-pitch-alignment":{type:"enum",values:{map:{},viewport:{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotation-alignment":{type:"enum",values:{map:{},viewport:{},"viewport-glyph":{},auto:{}},default:"auto",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-field":{type:"formatted",default:"",tokens:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-font":{type:"array",value:"string",default:["Open Sans Regular","Arial Unicode MS Regular"],requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-size":{type:"number",default:16,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-width":{type:"number",default:10,minimum:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-line-height":{type:"number",default:1.2,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-letter-spacing":{type:"number",default:0,units:"ems",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-justify":{type:"enum",values:{auto:{},left:{},center:{},right:{}},default:"center",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-radial-offset":{type:"number",units:"ems",default:0,requires:["text-field"],"property-type":"data-driven",expression:{interpolated:!0,parameters:["zoom","feature"]}},"text-variable-anchor":{type:"array",value:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-variable-anchor-offset":{type:"variableAnchorOffsetCollection",requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-anchor":{type:"enum",values:{center:{},left:{},right:{},top:{},bottom:{},"top-left":{},"top-right":{},"bottom-left":{},"bottom-right":{}},default:"center",requires:["text-field",{"!":"text-variable-anchor"}],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-max-angle":{type:"number",default:45,units:"degrees",requires:["text-field",{"symbol-placement":["line","line-center"]}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-writing-mode":{type:"array",value:"enum",values:{horizontal:{},vertical:{}},requires:["text-field",{"symbol-placement":["point"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-rotate":{type:"number",default:0,period:360,units:"degrees",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-padding":{type:"number",default:2,minimum:0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-keep-upright":{type:"boolean",default:!0,requires:["text-field",{"text-rotation-alignment":"map"},{"symbol-placement":["line","line-center"]}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-transform":{type:"enum",values:{none:{},uppercase:{},lowercase:{}},default:"none",requires:["text-field"],expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-offset":{type:"array",value:"number",units:"ems",length:2,default:[0,0],requires:["text-field",{"!":"text-radial-offset"}],expression:{interpolated:!0,parameters:["zoom","feature"]},"property-type":"data-driven"},"text-allow-overlap":{type:"boolean",default:!1,requires:["text-field",{"!":"text-overlap"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-overlap":{type:"enum",values:{never:{},always:{},cooperative:{}},requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-ignore-placement":{type:"boolean",default:!1,requires:["text-field"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-optional":{type:"boolean",default:!1,requires:["text-field","icon-image"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_raster:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},layout_hillshade:{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},"layout_color-relief":{visibility:{type:"enum",values:{visible:{},none:{}},default:"visible","property-type":"constant"}},filter:{type:"array",value:"*"},filter_operator:{type:"enum",values:{"==":{},"!=":{},">":{},">=":{},"<":{},"<=":{},in:{},"!in":{},all:{},any:{},none:{},has:{},"!has":{}}},geometry_type:{type:"enum",values:{Point:{},LineString:{},Polygon:{}}},function:{expression:{type:"expression"},stops:{type:"array",value:"function_stop"},base:{type:"number",default:1,minimum:0},property:{type:"string",default:"$zoom"},type:{type:"enum",values:{identity:{},exponential:{},interval:{},categorical:{}},default:"exponential"},colorSpace:{type:"enum",values:{rgb:{},lab:{},hcl:{}},default:"rgb"},default:{type:"*",required:!1}},function_stop:{type:"array",minimum:0,maximum:24,value:["number","color"],length:2},expression:{type:"array",value:"*",minimum:1},light:{anchor:{type:"enum",default:"viewport",values:{map:{},viewport:{}},"property-type":"data-constant",transition:!1,expression:{interpolated:!1,parameters:["zoom"]}},position:{type:"array",default:[1.15,210,30],length:3,value:"number","property-type":"data-constant",transition:!0,expression:{interpolated:!0,parameters:["zoom"]}},color:{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},intensity:{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},sky:{"sky-color":{type:"color","property-type":"data-constant",default:"#88C6FC",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-color":{type:"color","property-type":"data-constant",default:"#ffffff",expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"fog-ground-blend":{type:"number","property-type":"data-constant",default:.5,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"horizon-fog-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"sky-horizon-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0},"atmosphere-blend":{type:"number","property-type":"data-constant",default:.8,minimum:0,maximum:1,expression:{interpolated:!0,parameters:["zoom"]},transition:!0}},terrain:{source:{type:"string",required:!0},exaggeration:{type:"number",minimum:0,default:1}},projection:{type:{type:"projectionDefinition",default:"mercator","property-type":"data-constant",transition:!1,expression:{interpolated:!0,parameters:["zoom"]}}},paint:["paint_fill","paint_line","paint_circle","paint_heatmap","paint_fill-extrusion","paint_symbol","paint_raster","paint_hillshade","paint_color-relief","paint_background"],paint_fill:{"fill-antialias":{type:"boolean",default:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-outline-color":{type:"color",transition:!0,requires:[{"!":"fill-pattern"},{"fill-antialias":!0}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"}},"paint_fill-extrusion":{"fill-extrusion-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"fill-extrusion-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["fill-extrusion-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"fill-extrusion-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"fill-extrusion-height":{type:"number",default:0,minimum:0,units:"meters",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-base":{type:"number",default:0,minimum:0,units:"meters",transition:!0,requires:["fill-extrusion-height"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"fill-extrusion-vertical-gradient":{type:"boolean",default:!0,transition:!1,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_line:{"line-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"line-pattern"}],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"line-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["line-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"line-width":{type:"number",default:1,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-gap-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-offset":{type:"number",default:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"line-dasharray":{type:"array",value:"number",minimum:0,transition:!0,units:"line widths",requires:[{"!":"line-pattern"}],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"line-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom","feature"]},"property-type":"cross-faded-data-driven"},"line-gradient":{type:"color",transition:!1,requires:[{"!":"line-dasharray"},{"!":"line-pattern"},{source:"geojson",has:{lineMetrics:!0}}],expression:{interpolated:!0,parameters:["line-progress"]},"property-type":"color-ramp"}},paint_circle:{"circle-radius":{type:"number",default:5,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-blur":{type:"number",default:0,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"circle-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["circle-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-scale":{type:"enum",values:{map:{},viewport:{}},default:"map",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-pitch-alignment":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"circle-stroke-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"circle-stroke-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"}},paint_heatmap:{"heatmap-radius":{type:"number",default:30,minimum:1,transition:!0,units:"pixels",expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-weight":{type:"number",default:1,minimum:0,transition:!1,expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"heatmap-intensity":{type:"number",default:1,minimum:0,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"heatmap-color":{type:"color",default:["interpolate",["linear"],["heatmap-density"],0,"rgba(0, 0, 255, 0)",.1,"royalblue",.3,"cyan",.5,"lime",.7,"yellow",1,"red"],transition:!1,expression:{interpolated:!0,parameters:["heatmap-density"]},"property-type":"color-ramp"},"heatmap-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_symbol:{"icon-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-color":{type:"color",default:"#000000",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"icon-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["icon-image"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"icon-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["icon-image","icon-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"text-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-color":{type:"color",default:"#000000",transition:!0,overridable:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-color":{type:"color",default:"rgba(0, 0, 0, 0)",transition:!0,requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-width":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-halo-blur":{type:"number",default:0,minimum:0,transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom","feature","feature-state"]},"property-type":"data-driven"},"text-translate":{type:"array",value:"number",length:2,default:[0,0],transition:!0,units:"pixels",requires:["text-field"],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"text-translate-anchor":{type:"enum",values:{map:{},viewport:{}},default:"map",requires:["text-field","text-translate"],expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},paint_raster:{"raster-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-hue-rotate":{type:"number",default:0,period:360,transition:!0,units:"degrees",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-min":{type:"number",default:0,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-brightness-max":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-saturation":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-contrast":{type:"number",default:0,minimum:-1,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"raster-resampling":{type:"enum",values:{linear:{},nearest:{}},default:"linear",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"raster-fade-duration":{type:"number",default:300,minimum:0,transition:!1,units:"milliseconds",expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},paint_hillshade:{"hillshade-illumination-direction":{type:"numberArray",default:335,minimum:0,maximum:359,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-altitude":{type:"numberArray",default:45,minimum:0,maximum:90,transition:!1,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-illumination-anchor":{type:"enum",values:{map:{},viewport:{}},default:"viewport",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-exaggeration":{type:"number",default:.5,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-shadow-color":{type:"colorArray",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-highlight-color":{type:"colorArray",default:"#FFFFFF",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-accent-color":{type:"color",default:"#000000",transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"hillshade-method":{type:"enum",values:{standard:{},basic:{},combined:{},igor:{},multidirectional:{}},default:"standard",expression:{interpolated:!1,parameters:["zoom"]},"property-type":"data-constant"}},"paint_color-relief":{"color-relief-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"color-relief-color":{type:"color",transition:!1,expression:{interpolated:!0,parameters:["elevation"]},"property-type":"color-ramp"}},paint_background:{"background-color":{type:"color",default:"#000000",transition:!0,requires:[{"!":"background-pattern"}],expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"},"background-pattern":{type:"resolvedImage",transition:!0,expression:{interpolated:!1,parameters:["zoom"]},"property-type":"cross-faded"},"background-opacity":{type:"number",default:1,minimum:0,maximum:1,transition:!0,expression:{interpolated:!0,parameters:["zoom"]},"property-type":"data-constant"}},transition:{duration:{type:"number",default:300,minimum:0,units:"milliseconds"},delay:{type:"number",default:0,minimum:0,units:"milliseconds"}},"property-type":{"data-driven":{type:"property-type"},"cross-faded":{type:"property-type"},"cross-faded-data-driven":{type:"property-type"},"color-ramp":{type:"property-type"},"data-constant":{type:"property-type"},constant:{type:"property-type"}},promoteId:{"*":{type:"string"}}};var oB={thin:100,hairline:100,"ultra-light":200,"extra-light":200,light:300,book:300,regular:400,normal:400,plain:400,roman:400,standard:400,medium:500,"semi-bold":600,"demi-bold":600,bold:700,"extra-bold":800,"ultra-bold":800,heavy:900,black:900,"heavy-black":900,fat:900,poster:900,"ultra-black":950,"extra-black":950},aB=" ",lB=/(italic|oblique)$/i,cB={};function hB(t,e,n){var i=cB[t];if(!i){Array.isArray(t)||(t=[t]);for(var r,s,o=400,a="normal",l=[],c=0,h=t.length;c<h;++c){var u=t[c].split(" "),d=u[u.length-1].toLowerCase();for(var p in"normal"==d||"italic"==d||"oblique"==d?(a=s?a:d,s=!0,u.pop(),d=u[u.length-1].toLowerCase()):lB.test(d)&&(d=d.replace(lB,""),a=s?a:u[u.length-1].replace(d,""),s=!0),oB){var f=u.length>1?u[u.length-2].toLowerCase():"";if(d==p||d==p.replace("-","")||f+"-"+d==p){o=r?o:oB[p],u.pop(),f&&p.startsWith(f)&&u.pop();break}}r||"number"!=typeof d||(o=d,r=!0);var g=u.join(aB).replace("Klokantech Noto Sans","Noto Sans").replace("DIN Pro","Barlow").replace("Arial Unicode MS","Arial");-1!==g.indexOf(aB)&&(g='"'+g+'"'),l.push(g)}i=cB[t]=[a,o,l]}return i[0]+aB+i[1]+aB+e+"px"+(n?"/"+n:"")+aB+i[2]}class uB extends vO{constructor(t,e,n,i,r){super(t,e,n,void 0!==r?0:2),this.loader_=void 0!==r?r:null,this.canvas_=i,this.error_=null}getError(){return this.error_}handleLoad_(t){t?(this.error_=t,this.state=3):this.state=2,this.changed()}load(){0==this.state&&(this.state=1,this.changed(),this.loader_(this.handleLoad_.bind(this)))}getImage(){return this.canvas_}}class dB extends Ek{constructor(t,e,n){super(),n=n||{},this.tileCoord=t,this.state=e,this.key="",this.transition_=void 0===n.transition?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(rk)}release(){this.setState(4)}getKey(){return this.key+"/"+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(t){if(4!==this.state){if(3!==this.state&&this.state>t)throw new Error("Tile load sequence violation");this.state=t,this.changed()}}load(){Pk()}getAlpha(t,e){if(!this.transition_)return 1;let n=this.transitionStarts_[t];if(n){if(-1===n)return 1}else n=e,this.transitionStarts_[t]=n;const i=e-n+1e3/60;return i>=this.transition_?1:aT(i/this.transition_)}inTransition(t){return!!this.transition_&&-1!==this.transitionStarts_[t]}endTransition(t){this.transition_&&(this.transitionStarts_[t]=-1)}disposeInternal(){this.release(),super.disposeInternal()}}class pB extends dB{constructor(t,e,n,i,r,s){super(t,e,s),this.crossOrigin_=i,this.src_=n,this.key=n,this.image_,Wk?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,null!==i&&(this.image_.crossOrigin=i)),this.unlisten_=null,this.tileLoadFunction_=r}getImage(){return this.image_}setImage(t){this.image_=t,this.state=2,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}handleImageError_(){this.state=3,this.unlistenImage_(),this.image_=function(){const t=HM(1,1);return t.fillStyle="rgba(0,0,0,0)",t.fillRect(0,0,1,1),t.canvas}(),this.changed()}handleImageLoad_(){if(Wk)this.state=2;else{const t=this.image_;t.naturalWidth&&t.naturalHeight?this.state=2:this.state=4}this.unlistenImage_(),this.changed()}load(){3==this.state&&(this.state=0,this.image_=new Image,null!==this.crossOrigin_&&(this.image_.crossOrigin=this.crossOrigin_)),0==this.state&&(this.state=1,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=function(t,e,n){const i=t;let r=!0,s=!1,o=!1;const a=[Lk(i,"load",function(){o=!0,s||e()})];return i.src&&Hk?(s=!0,i.decode().then(function(){r&&e()}).catch(function(){r&&(o?e():n())})):a.push(Lk(i,"error",n)),function(){r=!1,a.forEach(Mk)}}(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&(this.unlisten_(),this.unlisten_=null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}}class fB{constructor(t,e,n,i){this.minX=t,this.maxX=e,this.minY=n,this.maxY=i}contains(t){return this.containsXY(t[1],t[2])}containsTileRange(t){return this.minX<=t.minX&&t.maxX<=this.maxX&&this.minY<=t.minY&&t.maxY<=this.maxY}containsXY(t,e){return this.minX<=t&&t<=this.maxX&&this.minY<=e&&e<=this.maxY}equals(t){return this.minX==t.minX&&this.minY==t.minY&&this.maxX==t.maxX&&this.maxY==t.maxY}extend(t){t.minX<this.minX&&(this.minX=t.minX),t.maxX>this.maxX&&(this.maxX=t.maxX),t.minY<this.minY&&(this.minY=t.minY),t.maxY>this.maxY&&(this.maxY=t.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(t){return this.minX<=t.maxX&&this.maxX>=t.minX&&this.minY<=t.maxY&&this.maxY>=t.minY}}function gB(t,e,n,i,r){return void 0!==r?(r.minX=t,r.maxX=e,r.minY=n,r.maxY=i,r):new fB(t,e,n,i)}const mB=[];class yB extends dB{constructor(t,e,n,i,r){super(t,e,{transition:0}),this.context_=null,this.executorGroups={},this.loadingSourceTiles=0,this.hitDetectionImageData={},this.replayState_={},this.sourceTiles=[],this.errorTileKeys={},this.wantedResolution,this.getSourceTiles=i.bind(void 0,this),this.removeSourceTiles_=r,this.wrappedTileCoord=n}getContext(){return this.context_||(this.context_=HM(1,1,mB)),this.context_}hasContext(){return!!this.context_}getImage(){return this.hasContext()?this.getContext().canvas:null}getReplayState(t){const e=Ok(t);return e in this.replayState_||(this.replayState_[e]={dirty:!1,renderedRenderOrder:null,renderedResolution:NaN,renderedRevision:-1,renderedTileResolution:NaN,renderedTileRevision:-1,renderedTileZ:-1}),this.replayState_[e]}load(){this.getSourceTiles()}release(){this.context_&&(YM(this.context_),mB.push(this.context_.canvas),this.context_=null),this.removeSourceTiles_(this),this.sourceTiles.length=0,super.release()}}let vB=class extends dB{constructor(t,e,n,i,r,s){super(t,e,s),this.extent=null,this.format_=i,this.features_=null,this.loader_,this.projection=null,this.resolution,this.tileLoadFunction_=r,this.url_=n,this.key=n}getTileUrl(){return this.url_}getFormat(){return this.format_}getFeatures(){return this.features_}load(){0==this.state&&(this.setState(1),this.tileLoadFunction_(this,this.url_),this.loader_&&this.loader_(this.extent,this.resolution,this.projection))}onLoad(t,e){this.setFeatures(t)}onError(){this.setState(3)}setFeatures(t){this.features_=t,this.setState(2)}setLoader(t){this.loader_=t}};const _B="https://api.mapbox.com";function bB(t){return 0!==t.indexOf("mapbox://")?"":t.slice(9)}function wB(t,e,n){const i=bB(t);if(!i)return decodeURI(new URL(t,n).href);if(0!==i.indexOf("sprites/"))throw new Error(`unexpected sprites url: ${t}`);const r=i.slice(8);return`${_B}/styles/v1/${r}/sprite?access_token=${e}`}function xB(t,e){const n=bB(t);if(!n)return decodeURI(new URL(t,location.href).href);if(0!==n.indexOf("styles/"))throw new Error(`unexpected style url: ${t}`);const i=n.slice(7);return`${_B}/styles/v1/${i}?&access_token=${e}`}const CB=["a","b","c","d"];function SB(t,e,n,i){const r=new URL(t,i||location.href),s=bB(t);if(!s)return e?(r.searchParams.has(n)||r.searchParams.set(n,e),[decodeURI(r.href)]):[decodeURI(r.href)];if("mapbox.satellite"===s){const t=window.devicePixelRatio>=1.5?"@2x":"";return[`https://api.mapbox.com/v4/${s}/{z}/{x}/{y}${t}.webp?access_token=${e}`]}return CB.map(t=>`https://${t}.tiles.mapbox.com/v4/${s}/{z}/{x}/{y}.vector.pbf?access_token=${e}`)}const kB=Object.freeze({}),EB={},TB={};let LB=0;function MB(t){return t.id||(t.id=LB++),t.id}function RB(t){let e=EB[t.id];return e||(e={},EB[MB(t)]=e),e}function PB(t){return t*Math.PI/180}const IB=function(){const t=[];for(let e=78271.51696402048;t.length<=24;e/=2)t.push(e);return t}();function OB(t,e){if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"undefined"!=typeof OffscreenCanvas)return new OffscreenCanvas(t,e);const n=document.createElement("canvas");return n.width=t,n.height=e,n}function AB(t,e){let n=0;const i=e.length;for(;n<i;++n)if(e[n]<t&&n+1<i){const i=e[n]/e[n+1];return n+Math.log(e[n]/t)/Math.log(i)}return i-1}function zB(t,e){const n=Math.floor(t),i=Math.pow(2,t-n);return e[n]/i}const FB={};function jB(t,e,n={},i){if(e in FB)return i&&(i.url=FB[e][0].url),FB[e][1];const r=n.transformRequest&&n.transformRequest(e,t)||e,s=function(){return delete FB[e],Promise.reject(new Error("Error fetching source "+e))},o=function(t){return delete FB[e],t.ok?t.json():Promise.reject(new Error("Error fetching source "+e))},a=xk(()=>r).then(t=>t instanceof Response?(i&&(i.url=t.url),o(t)):(t instanceof Request||(t=new Request(t)),t.headers.get("Accept")||t.headers.set("Accept","application/json"),i&&(i.url=t.url),fetch(t).then(o).catch(s))).catch(s);return FB[e]=[r,a],a}function DB(t,e){if("string"!=typeof t)return Promise.resolve(t);if(!t.trim().startsWith("{"))return jB("Style",t=xB(t,e.accessToken),e);try{const e=JSON.parse(t);return Promise.resolve(e)}catch(IN){return Promise.reject(IN)}}const NB={};function BB(t,e,n={}){const i=[e,JSON.stringify(t)].toString();let r=NB[i];if(!r||n.transformRequest){let s;n.transformRequest&&(s=(t,e)=>{const i=n.transformRequest&&n.transformRequest(e,"Tiles")||e;if(t instanceof vB)t.setLoader((e,n,r)=>{const s=function(n){n.arrayBuffer().then(n=>{const i=t.getFormat().readFeatures(n,{extent:e,featureProjection:r});t.setFeatures(i)})};xk(()=>i).then(e=>{if(e instanceof Response)return s(e);fetch(e).then(s).catch(()=>t.setState(3))}).catch(()=>t.setState(3))});else{const e=t.getImage();xk(()=>i).then(n=>{if("string"==typeof n)return void(e.src=n);const i=t=>t.blob().then(t=>{const n=URL.createObjectURL(t);e.addEventListener("load",()=>URL.revokeObjectURL(n)),e.addEventListener("error",()=>URL.revokeObjectURL(n)),e.src=n});if(n instanceof Response)return i(n);fetch(n).then(i).catch(()=>t.setState(3))}).catch(()=>t.setState(3))}});const o=t.url;if(o&&!t.tiles){const i=SB(o,n.accessToken,n.accessTokenParam||"access_token",e||location.href);if(o.startsWith("mapbox://"))r=Promise.resolve({tileJson:Object.assign({},t,{url:void 0,tiles:i}),tileLoadFunction:s});else{const t={};r=jB("Source",i[0],n,t).then(function(e){return e.tiles=e.tiles.map(function(i){return"tms"===e.scheme&&(i=i.replace("{y}","{-y}")),SB(i,n.accessToken,n.accessTokenParam||"access_token",t.url)[0]}),Promise.resolve({tileJson:e,tileLoadFunction:s})})}}else t.tiles?(t=Object.assign({},t,{tiles:t.tiles.map(function(i){return"tms"===t.scheme&&(i=i.replace("{y}","{-y}")),SB(i,n.accessToken,n.accessTokenParam||"access_token",e||location.href)[0]})}),r=Promise.resolve({tileJson:Object.assign({},t),tileLoadFunction:s})):r=Promise.reject(new Error("source has no `tiles` nor `url`"));NB[i]=r}return r}function UB(t,e,n,i){const r=[2*n*e.pixelRatio+e.width,2*n*e.pixelRatio+e.height],s=OB(r[0],r[1]),o=s.getContext("2d");o.drawImage(t,e.x,e.y,e.width,e.height,n*e.pixelRatio,n*e.pixelRatio,e.width,e.height);const a=o.getImageData(0,0,r[0],r[1]);o.globalCompositeOperation="destination-over",o.fillStyle=`rgba(${255*i.r},${255*i.g},${255*i.b},${i.a})`;const l=a.data;for(let c=0,h=a.width;c<h;++c)for(let t=0,i=a.height;t<i;++t)l[4*(t*h+c)+3]>0&&o.arc(c,t,n*e.pixelRatio,0,2*Math.PI);return o.fill(),s}function qB(t,e,n){const i=Math.max(0,Math.min(1,(n-t)/(e-t)));return i*i*(3-2*i)}function VB(t,e,n){const i=OB(e.width,e.height),r=i.getContext("2d");r.drawImage(t,e.x,e.y,e.width,e.height,0,0,e.width,e.height);const s=r.getImageData(0,0,e.width,e.height),o=s.data;for(let a=0,l=s.width;a<l;++a)for(let t=0,e=s.height;t<e;++t){const e=4*(t*l+a),i=.75,r=.1,s=qB(i-r,i+r,o[e+3]/255);s>0?(o[e+0]=Math.round(255*n.r*s),o[e+1]=Math.round(255*n.g*s),o[e+2]=Math.round(255*n.b*s),o[e+3]=Math.round(255*s)):o[e+3]=0}return r.putImageData(s,0,0),i}const $B=Array(256).join("");function GB(t,e){if(e>=.05){let n="";const i=t.split("\n"),r=$B.slice(0,Math.round(e/.1));for(let t=0,e=i.length;t<e;++t)t>0&&(n+="\n"),n+=i[t].split("").join(r);return n}return t}let WB;function HB(){return WB||(WB=OB(1,1).getContext("2d")),WB}function ZB(t,e){return HB().measureText(t).width+(t.length-1)*e}const KB={};function YB(t,e,n,i){if(-1!==t.indexOf("\n")){const r=t.split("\n"),s=[];for(let t=0,o=r.length;t<o;++t)s.push(YB(r[t],e,n,i));return s.join("\n")}const r=n+","+e+","+t+","+i;let s=KB[r];if(!s){const o=t.split(" ");if(o.length>1){const t=HB();t.font=e;const r=t.measureText("M").width*n;let a="";const l=[];for(let e=0,n=o.length;e<n;++e){const t=o[e],n=a+(a?" ":"")+t;ZB(n,i)<=r?a=n:(a&&l.push(a),a=t)}a&&l.push(a);for(let e=0,n=l.length;e<n&&n>1;++e){const t=l[e];if(ZB(t,i)<.35*r){const r=e>0?ZB(l[e-1],i):1/0,s=e<n-1?ZB(l[e+1],i):1/0;l.splice(e,1),n-=1,r<s?(l[e-1]+=" "+t,e-=1):l[e]=t+" "+l[e]}}for(let e=0,n=l.length-1;e<n;++e){const t=l[e],s=l[e+1];if(ZB(t,i)>.7*r&&ZB(s,i)<.6*r){const o=t.split(" "),a=o.pop();ZB(a,i)<.2*r&&(l[e]=o.join(" "),l[e+1]=a+" "+s),n-=1}}s=l.join("\n")}else s=t;s=GB(s,i),KB[r]=s}return s}AO.on("propertychange",()=>{for(const t in KB)delete KB[t]});const XB=["Arial","Courier New","Times New Roman","Verdana","sans-serif","serif","monospace","cursive","fantasy"],JB={},QB={Point:1,MultiPoint:1,LineString:2,MultiLineString:2,Polygon:3,MultiPolygon:3},tU={center:[.5,.5],left:[0,.5],right:[1,.5],top:[.5,0],bottom:[.5,1],"top-left":[0,0],"top-right":[1,0],"bottom-left":[0,1],"bottom-right":[1,1]},eU={zoom:0,distanceFromCenter:0};let nU,iU;function rU(t,e,n,i,r,s){const o=t.id;r||(r={},console.warn("No functionCache provided to getValue()")),r[o]||(r[o]={});const a=r[o];if(!a[n]){let i=(t[e]||kB)[n];const r=sB[`${e}_${t.type}`][n];void 0===i&&(i=r.default);let s=(l=i,Array.isArray(l)&&l.length>0&&"string"==typeof l[0]&&l[0]in wN);if(!s&&ON(i)&&(i=function(t,e){let n=t.stops;if(!n)return function(t,e){const n=["get",t.property];if(void 0===t.default)return"string"===e.type?["string",n]:n;if("enum"===e.type)return["match",n,Object.keys(e.values),n,t.default];{const i=["color"===e.type?"to-color":e.type,n,XN(t.default)];return"array"===e.type&&i.splice(1,0,e.value,e.length||null),i}}(t,e);const i=n&&"object"==typeof n[0][0],r=i||void 0!==t.property,s=i||!r;return n=n.map(t=>!r&&e.tokens&&"string"==typeof t[1]?[t[0],rB(t[1])]:[t[0],XN(t[1])]),i?function(t,e,n){const i={},r={},s=[];for(let o=0;o<n.length;o++){const e=n[o],a=e[0].zoom;void 0===i[a]&&(i[a]={zoom:a,type:t.type,property:t.property,default:t.default},r[a]=[],s.push(a)),r[a].push([e[0].value,e[1]])}if("exponential"===iB({},e)){const n=[JN(t),["linear"],["zoom"]];for(const t of s)nB(n,t,tB(i[t],e,r[t]),!1);return n}{const t=["step",["zoom"]];for(const n of s)nB(t,n,tB(i[n],e,r[n]),!0);return eB(t),t}}(t,e,n):s?function(t,e,n,i=["zoom"]){const r=iB(t,e);let s,o=!1;if("interval"===r)s=["step",i],o=!0;else{if("exponential"!==r)throw new Error(`Unknown zoom function type "${r}"`);{const e=void 0!==t.base?t.base:1;s=[JN(t),1===e?["linear"]:["exponential",e],i]}}for(const a of n)nB(s,a[0],a[1],o);return eB(s),s}(t,e,n):tB(t,e,n)}(i,r),s=!0),s){const t=function(t,e){const n=DN(t,e);if("error"===n.result)throw new Error(n.value.map(t=>`${t.key}: ${t.message}`).join(", "));return n.value}(i,r);a[n]=t.evaluate.bind(t)}else{const t=r.type;"color"!==t&&"colorArray"!==t||(i=Cj.parse(i)),a[n]=function(){return i}}}var l;return a[n](eU,i,s)}function sU(t,e,n,i){return rU(t,"layout",`${n}-allow-overlap`,e,i)?rU(t,"layout",`${n}-ignore-placement`,e,i)?"none":"obstacle":"declutter"}function oU(t,e,n,i){if(i||console.warn("No filterCache provided to evaluateFilter()"),!(t in i))try{i[t]=VN(e).filter}catch(r){console.warn("Filter will evaluate to false: "+r.message),i[t]=function(){return!1}}return i[t](eU,n)}function aU(t,e){if(t){if(0===t.a||0===e)return;const n=t.a;return e=void 0===e?1:e,0===n?"transparent":"rgba("+Math.round(255*t.r/n)+","+Math.round(255*t.g/n)+","+Math.round(255*t.b/n)+","+n*e+")"}return t}xN.register(wN,{...xN.definitions,pitch:[{kind:"number"},[],()=>eU.pitch||90],"distance-from-center":[{kind:"number"},[],()=>eU.distanceFromCenter||0]});const lU=/\{[^{}}]*\}/g;function cU(t,e){return t.replace(lU,function(t){return e[t.slice(1,-1)]||""})}function hU(t,e){let n=t.split(":")[0];return n===t&&(n="default"),e[n]}const uU={},dU=4294967296,pU=1/dU,fU="undefined"==typeof TextDecoder?null:new TextDecoder("utf-8");class gU{constructor(t=new Uint8Array(16)){this.buf=ArrayBuffer.isView(t)?t:new Uint8Array(t),this.dataView=new DataView(this.buf.buffer),this.pos=0,this.type=0,this.length=this.buf.length}readFields(t,e,n=this.length){for(;this.pos<n;){const n=this.readVarint(),i=n>>3,r=this.pos;this.type=7&n,t(i,e,this),this.pos===r&&this.skip(n)}return e}readMessage(t,e){return this.readFields(t,e,this.readVarint()+this.pos)}readFixed32(){const t=this.dataView.getUint32(this.pos,!0);return this.pos+=4,t}readSFixed32(){const t=this.dataView.getInt32(this.pos,!0);return this.pos+=4,t}readFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getUint32(this.pos+4,!0)*dU;return this.pos+=8,t}readSFixed64(){const t=this.dataView.getUint32(this.pos,!0)+this.dataView.getInt32(this.pos+4,!0)*dU;return this.pos+=8,t}readFloat(){const t=this.dataView.getFloat32(this.pos,!0);return this.pos+=4,t}readDouble(){const t=this.dataView.getFloat64(this.pos,!0);return this.pos+=8,t}readVarint(t){const e=this.buf;let n,i;return i=e[this.pos++],n=127&i,i<128?n:(i=e[this.pos++],n|=(127&i)<<7,i<128?n:(i=e[this.pos++],n|=(127&i)<<14,i<128?n:(i=e[this.pos++],n|=(127&i)<<21,i<128?n:(i=e[this.pos],n|=(15&i)<<28,function(t,e,n){const i=n.buf;let r,s;if(s=i[n.pos++],r=(112&s)>>4,s<128)return mU(t,r,e);if(s=i[n.pos++],r|=(127&s)<<3,s<128)return mU(t,r,e);if(s=i[n.pos++],r|=(127&s)<<10,s<128)return mU(t,r,e);if(s=i[n.pos++],r|=(127&s)<<17,s<128)return mU(t,r,e);if(s=i[n.pos++],r|=(127&s)<<24,s<128)return mU(t,r,e);if(s=i[n.pos++],r|=(1&s)<<31,s<128)return mU(t,r,e);throw new Error("Expected varint not more than 10 bytes")}(n,t,this)))))}readVarint64(){return this.readVarint(!0)}readSVarint(){const t=this.readVarint();return t%2==1?(t+1)/-2:t/2}readBoolean(){return Boolean(this.readVarint())}readString(){const t=this.readVarint()+this.pos,e=this.pos;return this.pos=t,t-e>=12&&fU?fU.decode(this.buf.subarray(e,t)):function(t,e,n){let i="",r=e;for(;r<n;){const e=t[r];let s,o,a,l=null,c=e>239?4:e>223?3:e>191?2:1;if(r+c>n)break;1===c?e<128&&(l=e):2===c?(s=t[r+1],128==(192&s)&&(l=(31&e)<<6|63&s,l<=127&&(l=null))):3===c?(s=t[r+1],o=t[r+2],128==(192&s)&&128==(192&o)&&(l=(15&e)<<12|(63&s)<<6|63&o,(l<=2047||l>=55296&&l<=57343)&&(l=null))):4===c&&(s=t[r+1],o=t[r+2],a=t[r+3],128==(192&s)&&128==(192&o)&&128==(192&a)&&(l=(15&e)<<18|(63&s)<<12|(63&o)<<6|63&a,(l<=65535||l>=1114112)&&(l=null))),null===l?(l=65533,c=1):l>65535&&(l-=65536,i+=String.fromCharCode(l>>>10&1023|55296),l=56320|1023&l),i+=String.fromCharCode(l),r+=c}return i}(this.buf,e,t)}readBytes(){const t=this.readVarint()+this.pos,e=this.buf.subarray(this.pos,t);return this.pos=t,e}readPackedVarint(t=[],e){const n=this.readPackedEnd();for(;this.pos<n;)t.push(this.readVarint(e));return t}readPackedSVarint(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSVarint());return t}readPackedBoolean(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readBoolean());return t}readPackedFloat(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFloat());return t}readPackedDouble(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readDouble());return t}readPackedFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed32());return t}readPackedSFixed32(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed32());return t}readPackedFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readFixed64());return t}readPackedSFixed64(t=[]){const e=this.readPackedEnd();for(;this.pos<e;)t.push(this.readSFixed64());return t}readPackedEnd(){return 2===this.type?this.readVarint()+this.pos:this.pos+1}skip(t){const e=7&t;if(0===e)for(;this.buf[this.pos++]>127;);else if(2===e)this.pos=this.readVarint()+this.pos;else if(5===e)this.pos+=4;else{if(1!==e)throw new Error(`Unimplemented type: ${e}`);this.pos+=8}}writeTag(t,e){this.writeVarint(t<<3|e)}realloc(t){let e=this.length||16;for(;e<this.pos+t;)e*=2;if(e!==this.length){const t=new Uint8Array(e);t.set(this.buf),this.buf=t,this.dataView=new DataView(t.buffer),this.length=e}}finish(){return this.length=this.pos,this.pos=0,this.buf.subarray(0,this.length)}writeFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeSFixed32(t){this.realloc(4),this.dataView.setInt32(this.pos,t,!0),this.pos+=4}writeFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*pU),!0),this.pos+=8}writeSFixed64(t){this.realloc(8),this.dataView.setInt32(this.pos,-1&t,!0),this.dataView.setInt32(this.pos+4,Math.floor(t*pU),!0),this.pos+=8}writeVarint(t){(t=+t||0)>268435455||t<0?function(t,e){let n,i;if(t>=0?(n=t%4294967296|0,i=t/4294967296|0):(n=~(-t%4294967296),i=~(-t/4294967296),4294967295^n?n=n+1|0:(n=0,i=i+1|0)),t>=0x10000000000000000||t<-0x10000000000000000)throw new Error("Given varint doesn't fit into 10 bytes");e.realloc(10),function(t,e,n){n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos++]=127&t|128,t>>>=7,n.buf[n.pos]=127&t}(n,0,e),function(t,e){const n=(7&t)<<4;e.buf[e.pos++]|=n|((t>>>=3)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t|((t>>>=7)?128:0),t&&(e.buf[e.pos++]=127&t)))))}(i,e)}(t,this):(this.realloc(4),this.buf[this.pos++]=127&t|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=127&(t>>>=7)|(t>127?128:0),t<=127||(this.buf[this.pos++]=t>>>7&127))))}writeSVarint(t){this.writeVarint(t<0?2*-t-1:2*t)}writeBoolean(t){this.writeVarint(+t)}writeString(t){t=String(t),this.realloc(4*t.length),this.pos++;const e=this.pos;this.pos=function(t,e,n){for(let i,r,s=0;s<e.length;s++){if(i=e.charCodeAt(s),i>55295&&i<57344){if(!r){i>56319||s+1===e.length?(t[n++]=239,t[n++]=191,t[n++]=189):r=i;continue}if(i<56320){t[n++]=239,t[n++]=191,t[n++]=189,r=i;continue}i=r-55296<<10|i-56320|65536,r=null}else r&&(t[n++]=239,t[n++]=191,t[n++]=189,r=null);i<128?t[n++]=i:(i<2048?t[n++]=i>>6|192:(i<65536?t[n++]=i>>12|224:(t[n++]=i>>18|240,t[n++]=i>>12&63|128),t[n++]=i>>6&63|128),t[n++]=63&i|128)}return n}(this.buf,t,this.pos);const n=this.pos-e;n>=128&&yU(e,n,this),this.pos=e-1,this.writeVarint(n),this.pos+=n}writeFloat(t){this.realloc(4),this.dataView.setFloat32(this.pos,t,!0),this.pos+=4}writeDouble(t){this.realloc(8),this.dataView.setFloat64(this.pos,t,!0),this.pos+=8}writeBytes(t){const e=t.length;this.writeVarint(e),this.realloc(e);for(let n=0;n<e;n++)this.buf[this.pos++]=t[n]}writeRawMessage(t,e){this.pos++;const n=this.pos;t(e,this);const i=this.pos-n;i>=128&&yU(n,i,this),this.pos=n-1,this.writeVarint(i),this.pos+=i}writeMessage(t,e,n){this.writeTag(t,2),this.writeRawMessage(e,n)}writePackedVarint(t,e){e.length&&this.writeMessage(t,vU,e)}writePackedSVarint(t,e){e.length&&this.writeMessage(t,_U,e)}writePackedBoolean(t,e){e.length&&this.writeMessage(t,xU,e)}writePackedFloat(t,e){e.length&&this.writeMessage(t,bU,e)}writePackedDouble(t,e){e.length&&this.writeMessage(t,wU,e)}writePackedFixed32(t,e){e.length&&this.writeMessage(t,CU,e)}writePackedSFixed32(t,e){e.length&&this.writeMessage(t,SU,e)}writePackedFixed64(t,e){e.length&&this.writeMessage(t,kU,e)}writePackedSFixed64(t,e){e.length&&this.writeMessage(t,EU,e)}writeBytesField(t,e){this.writeTag(t,2),this.writeBytes(e)}writeFixed32Field(t,e){this.writeTag(t,5),this.writeFixed32(e)}writeSFixed32Field(t,e){this.writeTag(t,5),this.writeSFixed32(e)}writeFixed64Field(t,e){this.writeTag(t,1),this.writeFixed64(e)}writeSFixed64Field(t,e){this.writeTag(t,1),this.writeSFixed64(e)}writeVarintField(t,e){this.writeTag(t,0),this.writeVarint(e)}writeSVarintField(t,e){this.writeTag(t,0),this.writeSVarint(e)}writeStringField(t,e){this.writeTag(t,2),this.writeString(e)}writeFloatField(t,e){this.writeTag(t,5),this.writeFloat(e)}writeDoubleField(t,e){this.writeTag(t,1),this.writeDouble(e)}writeBooleanField(t,e){this.writeVarintField(t,+e)}}function mU(t,e,n){return n?4294967296*e+(t>>>0):4294967296*(e>>>0)+(t>>>0)}function yU(t,e,n){const i=e<=16383?1:e<=2097151?2:e<=268435455?3:Math.floor(Math.log(e)/(7*Math.LN2));n.realloc(i);for(let r=n.pos-1;r>=t;r--)n.buf[r+i]=n.buf[r]}function vU(t,e){for(let n=0;n<t.length;n++)e.writeVarint(t[n])}function _U(t,e){for(let n=0;n<t.length;n++)e.writeSVarint(t[n])}function bU(t,e){for(let n=0;n<t.length;n++)e.writeFloat(t[n])}function wU(t,e){for(let n=0;n<t.length;n++)e.writeDouble(t[n])}function xU(t,e){for(let n=0;n<t.length;n++)e.writeBoolean(t[n])}function CU(t,e){for(let n=0;n<t.length;n++)e.writeFixed32(t[n])}function SU(t,e){for(let n=0;n<t.length;n++)e.writeSFixed32(t[n])}function kU(t,e){for(let n=0;n<t.length;n++)e.writeFixed64(t[n])}function EU(t,e){for(let n=0;n<t.length;n++)e.writeSFixed64(t[n])}class TU extends rF{constructor(t){super(),t=t||{},this.dataProjection=new mT({code:"",units:"tile-pixels"}),this.featureClass=t.featureClass?t.featureClass:Yz,this.geometryName_=t.geometryName,this.layerName_=t.layerName?t.layerName:"layer",this.layers_=t.layers?t.layers:null,this.idProperty_=t.idProperty,this.supportedMediaTypes=["application/vnd.mapbox-vector-tile","application/x-protobuf"]}readRawGeometry_(t,e,n,i){t.pos=e.geometry;const r=t.readVarint()+t.pos;let s=1,o=0,a=0,l=0,c=0,h=0;for(;t.pos<r;){if(!o){const e=t.readVarint();s=7&e,o=e>>3}if(o--,1===s||2===s)a+=t.readSVarint(),l+=t.readSVarint(),1===s&&c>h&&(i.push(c),h=c),n.push(a,l),c+=2;else{if(7!==s)throw new Error("Invalid command found in the PBF");c>h&&(n.push(n[h],n[h+1]),c+=2)}}c>h&&(i.push(c),h=c)}createFeature_(t,e,n){const i=e.type;if(0===i)return null;let r;const s=e.properties;let o;this.idProperty_?(o=s[this.idProperty_],delete s[this.idProperty_]):o=e.id,s[this.layerName_]=e.layer.name;const a=[],l=[];this.readRawGeometry_(t,e,a,l);const c=function(t,e){let n;return 1===t?n=1===e?"Point":"MultiPoint":2===t?n=1===e?"LineString":"MultiLineString":3===t&&(n="Polygon"),n}(i,l.length);if(this.featureClass===Yz)r=new this.featureClass(c,a,l,2,s,o),r.transform(n.dataProjection);else{let t;if("Polygon"==c){const e=TM(a,l);t=e.length>1?new KA(a,"XY",e):new LM(a,"XY",l)}else t="Point"===c?new uM(a,"XY"):"LineString"===c?new GA(a,"XY"):"MultiPoint"===c?new HA(a,"XY"):"MultiLineString"===c?new WA(a,"XY",l):null;r=new(0,this.featureClass),this.geometryName_&&r.setGeometryName(this.geometryName_);const e=sF(t,!1,n);r.setGeometry(e),void 0!==o&&r.setId(o),r.setProperties(s,!0)}return r}getType(){return"arraybuffer"}readFeatures(t,e){const n=this.layers_,i=hL((e=this.adaptOptions(e)).dataProjection);i.setWorldExtent(e.extent),e.dataProjection=i;const r=new gU(t),s=r.readFields(LU,{}),o=[];for(const a in s){if(n&&!n.includes(a))continue;const t=s[a],l=t?[0,0,t.extent,t.extent]:null;i.setExtent(l);for(let n=0,i=t.length;n<i;++n){const i=PU(r,t,n),s=this.createFeature_(r,i,e);null!==s&&o.push(s)}}return o}readProjection(t){return this.dataProjection}setLayers(t){this.layers_=t}}function LU(t,e,n){if(3===t){const t={keys:[],values:[],features:[]},i=n.readVarint()+n.pos;n.readFields(MU,t,i),t.length=t.features.length,t.length&&(e[t.name]=t)}}function MU(t,e,n){if(15===t)e.version=n.readVarint();else if(1===t)e.name=n.readString();else if(5===t)e.extent=n.readVarint();else if(2===t)e.features.push(n.pos);else if(3===t)e.keys.push(n.readString());else if(4===t){let i=null;const r=n.readVarint()+n.pos;for(;n.pos<r;)i=1==(t=n.readVarint()>>3)?n.readString():2===t?n.readFloat():3===t?n.readDouble():4===t?n.readVarint64():5===t?n.readVarint():6===t?n.readSVarint():7===t?n.readBoolean():null;e.values.push(i)}}function RU(t,e,n){if(1==t)e.id=n.readVarint();else if(2==t){const t=n.readVarint()+n.pos;for(;n.pos<t;){const t=e.layer.keys[n.readVarint()],i=e.layer.values[n.readVarint()];e.properties[t]=i}}else 3==t?e.type=n.readVarint():4==t&&(e.geometry=n.pos)}function PU(t,e,n){t.pos=e.features[n];const i=t.readVarint()+t.pos,r={layer:e,type:0,properties:{}};return t.readFields(RU,r,i),r}class IU extends Bz{constructor(t){super(t),this.image=null}getImage(){return this.image?this.image.getImage():null}prepareFrame(t){const e=t.layerStatesArray[t.layerIndex],n=t.pixelRatio,i=t.viewState,r=i.resolution,s=this.getLayer().getSource(),o=t.viewHints;let a=t.extent;if(void 0!==e.extent&&(a=KE(a,SL(e.extent,i.projection))),!o[0]&&!o[1]&&!tT(a))if(s){const t=i.projection,e=s.getImage(a,r,n,t);e&&(this.loadImage(e)?this.image=e:4===e.getState()&&(this.image=null))}else this.image=null;return!!this.image}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=IL(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!TE(r,i))return null;const s=this.image.getExtent(),o=this.image.getImage(),a=JE(s),l=Math.floor(o.width*((i[0]-s[0])/a));if(l<0||l>=o.width)return null;const c=ZE(s),h=Math.floor(o.height*((s[3]-i[1])/c));return h<0||h>=o.height?null:this.getImageData(o,l,h)}renderFrame(t,e){const n=this.image,i=n.getExtent(),r=n.getResolution(),[s,o]=Array.isArray(r)?r:[r,r],a=n.getPixelRatio(),l=t.layerStatesArray[t.layerIndex],c=t.pixelRatio,h=t.viewState,u=h.center,d=h.resolution,p=c*s/(d*a),f=c*o/(d*a);this.prepareContainer(t,e);const g=this.context.canvas.width,m=this.context.canvas.height,y=this.getRenderContext(t);let v=!1,_=!0;if(l.extent){const e=SL(l.extent,h.projection);_=QE(e,t.extent),v=_&&!LE(e,t.extent),v&&this.clipUnrotated(y,t,e)}const b=n.getImage(),w=AL(this.tempTransform,g/2,m/2,p,f,0,a*(i[0]-u[0])/s,a*(u[1]-i[3])/o);this.renderedResolution=o*c/a;const x=b.width*w[0],C=b.height*w[3];if(this.getLayer().getSource().getInterpolate()||(y.imageSmoothingEnabled=!1),this.preRender(y,t),_&&x>=.5&&C>=.5){const t=w[4],e=w[5],n=l.opacity;1!==n&&(y.save(),y.globalAlpha=n),y.drawImage(b,0,0,+b.width,+b.height,t,e,x,C),1!==n&&y.restore()}return this.postRender(this.context,t),v&&y.restore(),y.imageSmoothingEnabled=!0,this.container}}class OU extends oP{constructor(t){super(t=t||{})}}class AU extends OU{constructor(t){super(t)}createRenderer(){return new IU(this)}getData(t){return super.getData(t)}}function zU(t){return t instanceof Image||t instanceof HTMLCanvasElement||t instanceof HTMLVideoElement||t instanceof ImageBitmap?t:null}const FU=new Error("disposed"),jU=[256,256];class DU extends dB{constructor(t){super(t.tileCoord,0,{transition:t.transition,interpolate:t.interpolate}),this.loader_=t.loader,this.data_=null,this.error_=null,this.size_=t.size||null,this.controller_=t.controller||null}getSize(){if(this.size_)return this.size_;const t=zU(this.data_);return t?[t.width,t.height]:jU}getData(){return this.data_}getError(){return this.error_}load(){if(0!==this.state&&3!==this.state)return;this.state=1,this.changed();const t=this;this.loader_().then(function(e){t.data_=e,t.state=2,t.changed()}).catch(function(e){t.error_=e,t.state=3,t.changed()})}disposeInternal(){this.controller_&&(this.controller_.abort(FU),this.controller_=null),super.disposeInternal()}}let NU;const BU=[];function UU(t,e,n,i,r){t.beginPath(),t.moveTo(0,0),t.lineTo(e,n),t.lineTo(i,r),t.closePath(),t.save(),t.clip(),t.fillRect(0,0,Math.max(e,i)+1,Math.max(n,r)),t.restore()}function qU(t,e){return Math.abs(t[4*e]-210)>2||Math.abs(t[4*e+3]-191.25)>2}function VU(t,e,n,i){const r=bL(n,e,t);let s=uL(e,i,n);const o=e.getMetersPerUnit();void 0!==o&&(s*=o);const a=t.getMetersPerUnit();void 0!==a&&(s/=a);const l=t.getExtent();if(!l||TE(l,r)){const e=uL(t,s,r)/s;isFinite(e)&&e>0&&(s/=e)}return s}function $U(t,e,n,i,r,s,o,a,l,c,h,u,d){const p=HM(Math.round(n*t),Math.round(n*e),BU);if(u||(p.imageSmoothingEnabled=!1),0===l.length)return p.canvas;function f(t){return Math.round(t*n)/n}p.scale(n,n),p.globalCompositeOperation="lighter";const g=[1/0,1/0,-1/0,-1/0];let m;l.forEach(function(t){FE(g,t.extent)});const y=n/i,v=(u?1:1+Math.pow(2,-24))/y;d&&1===l.length&&0===c||(m=HM(Math.round(JE(g)*y),Math.round(ZE(g)*y),BU),u||(m.imageSmoothingEnabled=!1),l.forEach(function(t){if(t.image.width>0&&t.image.height>0){if(t.clipExtent){m.save();const e=(t.clipExtent[0]-g[0])*y,n=-(t.clipExtent[3]-g[3])*y,i=JE(t.clipExtent)*y,r=ZE(t.clipExtent)*y;m.rect(u?e:Math.round(e),u?n:Math.round(n),u?i:Math.round(e+i)-Math.round(e),u?r:Math.round(n+r)-Math.round(n)),m.clip()}const e=(t.extent[0]-g[0])*y,n=-(t.extent[3]-g[3])*y,i=JE(t.extent)*y,r=ZE(t.extent)*y;m.drawImage(t.image,c,c,t.image.width-2*c,t.image.height-2*c,u?e:Math.round(e),u?n:Math.round(n),u?i:Math.round(e+i)-Math.round(e),u?r:Math.round(n+r)-Math.round(n)),t.clipExtent&&m.restore()}}));const _=YE(o);return a.getTriangles().forEach(function(t){const e=t.source,n=t.target;let i=e[0][0],r=e[0][1],o=e[1][0],a=e[1][1],c=e[2][0],h=e[2][1];const d=f((n[0][0]-_[0])/s),y=f(-(n[0][1]-_[1])/s),b=f((n[1][0]-_[0])/s),w=f(-(n[1][1]-_[1])/s),x=f((n[2][0]-_[0])/s),C=f(-(n[2][1]-_[1])/s),S=i,k=r;i=0,r=0,o-=S,a-=k,c-=S,h-=k;const E=function(t){const e=t.length;for(let i=0;i<e;i++){let n=i,r=Math.abs(t[i][i]);for(let o=i+1;o<e;o++){const e=Math.abs(t[o][i]);e>r&&(r=e,n=o)}if(0===r)return null;const s=t[n];t[n]=t[i],t[i]=s;for(let o=i+1;o<e;o++){const n=-t[o][i]/t[i][i];for(let r=i;r<e+1;r++)i==r?t[o][r]=0:t[o][r]+=n*t[i][r]}}const n=new Array(e);for(let i=e-1;i>=0;i--){n[i]=t[i][e]/t[i][i];for(let r=i-1;r>=0;r--)t[r][e]-=t[r][i]*n[i]}return n}([[o,a,0,0,b-d],[c,h,0,0,x-d],[0,0,o,a,w-y],[0,0,c,h,C-y]]);if(!E)return;if(p.save(),p.beginPath(),function(){if(void 0===NU){const t=HM(6,6,BU);t.globalCompositeOperation="lighter",t.fillStyle="rgba(210, 0, 0, 0.75)",UU(t,4,5,4,0),UU(t,4,5,0,5);const e=t.getImageData(0,0,3,3).data;NU=qU(e,0)||qU(e,4)||qU(e,8),YM(t),BU.push(t.canvas)}return NU}()||!u){p.moveTo(b,w);const t=4,e=d-b,n=y-w;for(let i=0;i<t;i++)p.lineTo(b+f((i+1)*e/t),w+f(i*n/(t-1))),i!=t-1&&p.lineTo(b+f((i+1)*e/t),w+f((i+1)*n/(t-1)));p.lineTo(x,C)}else p.moveTo(b,w),p.lineTo(d,y),p.lineTo(x,C);let T;if(p.clip(),p.transform(E[0],E[2],E[1],E[3],d,y),p.translate(g[0]-S,g[3]-k),m)T=m.canvas,p.scale(v,-v);else{const t=l[0],e=t.extent;T=t.image,p.scale(JE(e)/T.width,-ZE(e)/T.height)}p.drawImage(T,0,0),p.restore()}),m&&(YM(m),BU.push(m.canvas)),h&&(p.save(),p.globalCompositeOperation="source-over",p.strokeStyle="black",p.lineWidth=1,a.getTriangles().forEach(function(t){const e=t.target,n=(e[0][0]-_[0])/s,i=-(e[0][1]-_[1])/s,r=(e[1][0]-_[0])/s,o=-(e[1][1]-_[1])/s,a=(e[2][0]-_[0])/s,l=-(e[2][1]-_[1])/s;p.beginPath(),p.moveTo(r,o),p.lineTo(n,i),p.lineTo(a,l),p.closePath(),p.stroke()}),p.restore()),p.canvas}class GU{constructor(t,e,n,i,r,s,o){this.sourceProj_=t,this.targetProj_=e;let a={};const l=o?(c=t=>IL(o,bL(t,this.targetProj_,this.sourceProj_)),function(t,e,n,i){const r=t.length;n=void 0!==n?n:2,i=i??n,e=void 0!==e?e:new Array(r);for(let s=0;s<r;s+=i){const r=c(t.slice(s,s+n)),o=r.length;for(let n=0,a=i;n<a;++n)e[s+n]=n>=o?t[s+n]:r[n]}return e}):_L(this.targetProj_,this.sourceProj_);var c;this.transformInv_=function(t){const e=t[0]+"/"+t[1];return a[e]||(a[e]=l(t)),a[e]},this.maxSourceExtent_=i,this.errorThresholdSquared_=r*r,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!i&&!!this.sourceProj_.getExtent()&&JE(i)>=JE(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?JE(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?JE(this.targetProj_.getExtent()):null;const h=YE(n),u=XE(n),d=VE(n),p=qE(n),f=this.transformInv_(h),g=this.transformInv_(u),m=this.transformInv_(d),y=this.transformInv_(p),v=10+(s?Math.max(0,Math.ceil(Math.log2(UE(n)/(s*s*256*256)))):0);if(this.addQuad_(h,u,d,p,f,g,m,y,v),this.wrapsXInSource_){let t=1/0;this.triangles_.forEach(function(e){t=Math.min(t,e.source[0][0],e.source[1][0],e.source[2][0])}),this.triangles_.forEach(e=>{if(Math.max(e.source[0][0],e.source[1][0],e.source[2][0])-t>this.sourceWorldWidth_/2){const n=[[e.source[0][0],e.source[0][1]],[e.source[1][0],e.source[1][1]],[e.source[2][0],e.source[2][1]]];n[0][0]-t>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-t>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-t>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);const i=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-i<this.sourceWorldWidth_/2&&(e.source=n)}})}a={}}addTriangle_(t,e,n,i,r,s){this.triangles_.push({source:[i,r,s],target:[t,e,n]})}addQuad_(t,e,n,i,r,s,o,a,l){const c=CE([r,s,o,a]),h=this.sourceWorldWidth_?JE(c)/this.sourceWorldWidth_:null,u=this.sourceWorldWidth_,d=this.sourceProj_.canWrapX()&&h>.5&&h<1;let p=!1;if(l>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=JE(CE([t,e,n,i]))/this.targetWorldWidth_>.25||p),!d&&this.sourceProj_.isGlobal()&&h&&(p=h>.25||p)),!p&&this.maxSourceExtent_&&isFinite(c[0])&&isFinite(c[1])&&isFinite(c[2])&&isFinite(c[3])&&!QE(c,this.maxSourceExtent_))return;let f=0;if(!(p||isFinite(r[0])&&isFinite(r[1])&&isFinite(s[0])&&isFinite(s[1])&&isFinite(o[0])&&isFinite(o[1])&&isFinite(a[0])&&isFinite(a[1])))if(l>0)p=!0;else if(f=(isFinite(r[0])&&isFinite(r[1])?0:8)+(isFinite(s[0])&&isFinite(s[1])?0:4)+(isFinite(o[0])&&isFinite(o[1])?0:2)+(isFinite(a[0])&&isFinite(a[1])?0:1),1!=f&&2!=f&&4!=f&&8!=f)return;if(l>0){if(!p){const e=[(t[0]+n[0])/2,(t[1]+n[1])/2],i=this.transformInv_(e);let s;s=d?(gE(r[0],u)+gE(o[0],u))/2-gE(i[0],u):(r[0]+o[0])/2-i[0];const a=(r[1]+o[1])/2-i[1];p=s*s+a*a>this.errorThresholdSquared_}if(p){if(Math.abs(t[0]-n[0])<=Math.abs(t[1]-n[1])){const c=[(e[0]+n[0])/2,(e[1]+n[1])/2],h=this.transformInv_(c),u=[(i[0]+t[0])/2,(i[1]+t[1])/2],d=this.transformInv_(u);this.addQuad_(t,e,c,u,r,s,h,d,l-1),this.addQuad_(u,c,n,i,d,h,o,a,l-1)}else{const c=[(t[0]+e[0])/2,(t[1]+e[1])/2],h=this.transformInv_(c),u=[(n[0]+i[0])/2,(n[1]+i[1])/2],d=this.transformInv_(u);this.addQuad_(t,c,u,i,r,h,d,a,l-1),this.addQuad_(c,e,n,u,h,s,o,d,l-1)}return}}if(d){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}11&f||this.addTriangle_(t,n,i,r,o,a),14&f||this.addTriangle_(t,n,e,r,o,s),f&&(13&f||this.addTriangle_(e,i,t,s,a,r),7&f||this.addTriangle_(e,i,n,s,a,o))}calculateSourceExtent(){const t=[1/0,1/0,-1/0,-1/0];return this.triangles_.forEach(function(e){const n=e.source;jE(t,n[0]),jE(t,n[1]),jE(t,n[2])}),t}getTriangles(){return this.triangles_}}class WU extends dB{constructor(t,e,n,i,r,s,o,a,l,c,h,u){super(r,0,u),this.renderEdges_=void 0!==h&&h,this.pixelRatio_=o,this.gutter_=a,this.canvas_=null,this.sourceTileGrid_=e,this.targetTileGrid_=i,this.wrappedTileCoord_=s||r,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=t.canWrapX()?t.getExtent():void 0;const d=i.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent();let f=this.sourceTileGrid_.getExtent();const g=p?KE(d,p):d;if(0===UE(g))return void(this.state=4);const m=t.getExtent();m&&(f=f?KE(f,m):m);const y=i.getResolution(this.wrappedTileCoord_[0]),v=function(t,e,n,i){const r=$E(n);let s=VU(t,e,r,i);return(!isFinite(s)||s<=0)&&BE(n,function(n){return s=VU(t,e,n,i),isFinite(s)&&s>0}),s}(t,n,g,y);if(!isFinite(v)||v<=0)return void(this.state=4);const _=void 0!==c?c:.5;if(this.triangulation_=new GU(t,n,g,f,v*_,y),0===this.triangulation_.getTriangles().length)return void(this.state=4);this.sourceZ_=e.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(f&&(t.canWrapX()?(b[1]=hE(b[1],f[1],f[3]),b[3]=hE(b[3],f[1],f[3])):b=KE(b,f)),UE(b)){let n=0,i=0;t.canWrapX()&&(n=JE(m),i=Math.floor((b[0]-m[0])/n)),iT(b.slice(),t,!0).forEach(t=>{const r=e.getTileRangeForExtentAndZ(t,this.sourceZ_);for(let e=r.minX;e<=r.maxX;e++)for(let t=r.minY;t<=r.maxY;t++){const r=l(this.sourceZ_,e,t,o);if(r){const t=i*n;this.sourceTiles_.push({tile:r,offset:t})}}++i}),0===this.sourceTiles_.length&&(this.state=4)}else this.state=4}getImage(){return this.canvas_}reproject_(){const t=[];if(this.sourceTiles_.forEach(e=>{const n=e.tile;if(n&&2==n.getState()){const i=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);i[0]+=e.offset,i[2]+=e.offset;const r=this.clipExtent_?.slice();r&&(r[0]+=e.offset,r[2]+=e.offset),t.push({extent:i,clipExtent:r,image:n.getImage()})}}),this.sourceTiles_.length=0,0===t.length)this.state=3;else{const e=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(e),i="number"==typeof n?n:n[0],r="number"==typeof n?n:n[1],s=this.targetTileGrid_.getResolution(e),o=this.sourceTileGrid_.getResolution(this.sourceZ_),a=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=$U(i,r,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),s,a,this.triangulation_,t,this.gutter_,this.renderEdges_,this.interpolate),this.state=2}this.changed()}load(){if(0==this.state){this.state=1,this.changed();let t=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:e})=>{const n=e.getState();if(0==n||1==n){t++;const n=Tk(e,rk,()=>{const i=e.getState();2!=i&&3!=i&&4!=i||(Mk(n),t--,0===t&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),0===t?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:t}){0==t.getState()&&t.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(Mk),this.sourcesListenerKeys_=null}release(){this.canvas_&&(YM(this.canvas_.getContext("2d")),BU.push(this.canvas_),this.canvas_=null),super.release()}}class HU{constructor(t){this.highWaterMark=void 0!==t?t:2048,this.count_=0,this.entries_={},this.oldest_=null,this.newest_=null}deleteOldest(){const t=this.pop();t instanceof uk&&t.dispose()}canExpireCache(){return this.highWaterMark>0&&this.getCount()>this.highWaterMark}expireCache(t){for(;this.canExpireCache();)this.deleteOldest()}clear(){for(;this.oldest_;)this.deleteOldest()}containsKey(t){return this.entries_.hasOwnProperty(t)}forEach(t){let e=this.oldest_;for(;e;)t(e.value_,e.key_,this),e=e.newer}get(t,e){const n=this.entries_[t];return sE(void 0!==n,"Tried to get a value for a key that does not exist in the cache"),n===this.newest_||(n===this.oldest_?(this.oldest_=this.oldest_.newer,this.oldest_.older=null):(n.newer.older=n.older,n.older.newer=n.newer),n.newer=null,n.older=this.newest_,this.newest_.newer=n,this.newest_=n),n.value_}remove(t){const e=this.entries_[t];return sE(void 0!==e,"Tried to get a value for a key that does not exist in the cache"),e===this.newest_?(this.newest_=e.older,this.newest_&&(this.newest_.newer=null)):e===this.oldest_?(this.oldest_=e.newer,this.oldest_&&(this.oldest_.older=null)):(e.newer.older=e.older,e.older.newer=e.newer),delete this.entries_[t],--this.count_,e.value_}getCount(){return this.count_}getKeys(){const t=new Array(this.count_);let e,n=0;for(e=this.newest_;e;e=e.older)t[n++]=e.key_;return t}getValues(){const t=new Array(this.count_);let e,n=0;for(e=this.newest_;e;e=e.older)t[n++]=e.value_;return t}peekLast(){return this.oldest_.value_}peekLastKey(){return this.oldest_.key_}peekFirstKey(){return this.newest_.key_}peek(t){return this.entries_[t]?.value_}pop(){const t=this.oldest_;return delete this.entries_[t.key_],t.newer&&(t.newer.older=null),this.oldest_=t.newer,this.oldest_||(this.newest_=null),--this.count_,t.value_}replace(t,e){this.get(t),this.entries_[t].value_=e}set(t,e){sE(!(t in this.entries_),"Tried to set a value for a key that is used already");const n={key_:t,newer:null,older:this.newest_,value_:e};this.newest_?this.newest_.newer=n:this.oldest_=n,this.newest_=n,this.entries_[t]=n,++this.count_}setSize(t){this.highWaterMark=t}}function ZU(t,e,n,i){return void 0!==i?(i[0]=t,i[1]=e,i[2]=n,i):[t,e,n]}function KU(t,e,n,i,r){return`${Ok(t)},${e},${function(t,e,n){return t+"/"+e+"/"+n}(n,i,r)}`}function YU(t,e,n){if(!(n in t))return t[n]=new Set([e]),!0;const i=t[n],r=i.has(e);return r||i.add(e),!r}function XU(t,e,n){const i=t[n];return!!i&&i.delete(e)}function JU(t,e){const n=t.layerStatesArray[t.layerIndex];n.extent&&(e=KE(e,SL(n.extent,t.viewState.projection)));const i=n.layer.getRenderSource();if(!i.getWrapX()){const n=i.getTileGridForProjection(t.viewState.projection).getExtent();n&&(e=KE(e,n))}return e}class QU extends Bz{constructor(t,e){super(t),e=e||{},this.extentChanged=!0,this.renderComplete=!1,this.renderedExtent_=null,this.renderedPixelRatio,this.renderedProjection=null,this.renderedTiles=[],this.renderedSourceKey_,this.renderedSourceRevision_,this.tempExtent=[1/0,1/0,-1/0,-1/0],this.tempTileRange_=new fB(0,0,0,0),this.tempTileCoord_=ZU(0,0,0);const n=void 0!==e.cacheSize?e.cacheSize:512;this.tileCache_=new HU(n),this.sourceTileCache_=null,this.maxStaleKeys=.5*n}getTileCache(){return this.tileCache_}getSourceTileCache(){return this.sourceTileCache_||(this.sourceTileCache_=new HU(512)),this.sourceTileCache_}getOrCreateTile(t,e,n,i){const r=this.tileCache_,s=this.getLayer().getSource(),o=KU(s,s.getKey(),t,e,n);let a;if(r.containsKey(o))a=r.get(o);else{const l=i.viewState.projection,c=s.getProjection();if(a=s.getTile(t,e,n,i.pixelRatio,l,!c||mL(c,l)?void 0:this.getSourceTileCache()),!a)return null;r.set(o,a)}return a}getTile(t,e,n,i){return this.getOrCreateTile(t,e,n,i)||null}getData(t){const e=this.frameState;if(!e)return null;const n=this.getLayer(),i=IL(e.pixelToCoordinateTransform,t.slice()),r=n.getExtent();if(r&&!TE(r,i))return null;const s=e.viewState,o=n.getRenderSource(),a=o.getTileGridForProjection(s.projection),l=o.getTilePixelRatio(e.pixelRatio);for(let c=a.getZForResolution(s.resolution);c>=a.getMinZoom();--c){const t=a.getTileCoordForCoordAndZ(i,c),n=this.getTile(c,t[1],t[2],e);if(!n||2!==n.getState())continue;const r=a.getOrigin(c),h=HP(a.getTileSize(c)),u=a.getResolution(c);let d;if(n instanceof pB||n instanceof WU)d=n.getImage();else{if(!(n instanceof DU))continue;if(d=zU(n.getData()),!d)continue}const p=Math.floor(l*((i[0]-r[0])/u-t[1]*h[0])),f=Math.floor(l*((r[1]-i[1])/u-t[2]*h[1])),g=Math.round(l*o.getGutterForProjection(s.projection));return this.getImageData(d,p+g,f+g)}return null}prepareFrame(t){this.renderedProjection?t.viewState.projection!==this.renderedProjection&&(this.tileCache_.clear(),this.renderedProjection=t.viewState.projection):this.renderedProjection=t.viewState.projection;const e=this.getLayer().getSource();if(!e)return!1;const n=e.getRevision();return this.renderedSourceRevision_?this.renderedSourceRevision_!==n&&(this.renderedSourceRevision_=n,this.renderedSourceKey_===e.getKey()&&(this.tileCache_.clear(),this.sourceTileCache_?.clear())):this.renderedSourceRevision_=n,!0}enqueueTilesForNextExtent(){return!0}enqueueTiles(t,e,n,i,r){const s=t.viewState,o=this.getLayer(),a=o.getRenderSource(),l=a.getTileGridForProjection(s.projection),c=Ok(a);c in t.wantedTiles||(t.wantedTiles[c]={});const h=t.wantedTiles[c],u=o.getMapInternal(),d=Math.max(n-r,l.getMinZoom(),l.getZForResolution(Math.min(o.getMaxResolution(),u?u.getView().getResolutionForZoom(Math.max(o.getMinZoom(),0)):l.getResolution(0)),a.zDirection)),p=s.rotation,f=p?HE(s.center,s.resolution,p,t.size):void 0;for(let g=n;g>=d;--g){const n=l.getTileRangeForExtentAndZ(e,g,this.tempTileRange_),r=l.getResolution(g);for(let e=n.minX;e<=n.maxX;++e)for(let s=n.minY;s<=n.maxY;++s){if(p&&!l.tileCoordIntersectsViewport([g,e,s],f))continue;const n=this.getTile(g,e,s,t);if(!n)continue;if(!YU(i,n,g))continue;const o=n.getKey();if(h[o]=!0,0===n.getState()&&!t.tileQueue.isKeyQueued(o)){const i=ZU(g,e,s,this.tempTileCoord_);t.tileQueue.enqueue([n,c,l.getTileCoordCenter(i),r])}}}}findStaleTile_(t,e){const n=this.tileCache_,i=t[0],r=t[1],s=t[2],o=this.getStaleKeys();for(let a=0;a<o.length;++a){const t=KU(this.getLayer().getSource(),o[a],i,r,s);if(n.containsKey(t)){const r=n.peek(t);if(2===r.getState())return r.endTransition(Ok(this)),YU(e,r,i),!0}}return!1}findAltTiles_(t,e,n,i){const r=t.getTileRangeForTileCoordAndZ(e,n,this.tempTileRange_);if(!r)return!1;let s=!0;const o=this.tileCache_,a=this.getLayer().getRenderSource(),l=a.getKey();for(let c=r.minX;c<=r.maxX;++c)for(let t=r.minY;t<=r.maxY;++t){const e=KU(a,l,n,c,t);let r=!1;if(o.containsKey(e)){const t=o.peek(e);2===t.getState()&&(YU(i,t,n),r=!0)}r||(s=!1)}return s}renderFrame(t,e){this.renderComplete=!0;const n=t.layerStatesArray[t.layerIndex],i=t.viewState,r=i.projection,s=i.resolution,o=i.center,a=t.pixelRatio,l=this.getLayer(),c=l.getSource(),h=c.getTileGridForProjection(r),u=h.getZForResolution(s,c.zDirection),d=h.getResolution(u),p=c.getKey();this.renderedSourceKey_?this.renderedSourceKey_!==p&&(this.prependStaleKey(this.renderedSourceKey_),this.renderedSourceKey_=p):this.renderedSourceKey_=p;let f=t.extent;const g=c.getTilePixelRatio(a);this.prepareContainer(t,e);const m=this.context.canvas.width,y=this.context.canvas.height,v=n.extent&&n.extent;v&&(f=KE(f,n.extent));const _=d*m/2/g,b=d*y/2/g,w=[o[0]-_,o[1]-b,o[0]+_,o[1]+b],x={};this.renderedTiles.length=0;const C=l.getPreload();if(t.nextExtent&&this.enqueueTilesForNextExtent()){const e=h.getZForResolution(i.nextResolution,c.zDirection),n=JU(t,t.nextExtent);this.enqueueTiles(t,n,e,x,C)}const S=JU(t,f);if(this.enqueueTiles(t,S,u,x,0),C>0&&setTimeout(()=>{this.enqueueTiles(t,S,u-1,x,C-1)},0),!(u in x))return this.container;const k=Ok(this),E=t.time;for(const O of x[u]){const e=O.getState();if(4===e)continue;const n=O.tileCoord;if(2===e&&1===O.getAlpha(k,E)){O.endTransition(k);continue}if(3!==e&&(this.renderComplete=!1),this.findStaleTile_(n,x)){XU(x,O,u),t.animate=!0;continue}if(this.findAltTiles_(h,n,u+1,x))continue;const i=h.getMinZoom();for(let t=u-1;t>=i&&!this.findAltTiles_(h,n,t,x);--t);}const T=d/s*a/g,L=this.getRenderContext(t);AL(this.tempTransform,m/2,y/2,T,T,0,-m/2,-y/2),n.extent&&this.clipUnrotated(L,t,v),c.getInterpolate()||(L.imageSmoothingEnabled=!1),this.preRender(L,t);const M=Object.keys(x).map(Number);let R;M.sort(dk);const P=[],I=[];for(let O=M.length-1;O>=0;--O){const e=M[O],n=c.getTilePixelSize(e,a,r),i=h.getResolution(e)/d,s=n[0]*i*T,o=n[1]*i*T,l=h.getTileCoordForCoordAndZ(YE(w),e),u=h.getTileCoordExtent(l),p=IL(this.tempTransform,[g*(u[0]-w[0])/d,g*(w[3]-u[3])/d]),f=g*c.getGutterForProjection(r);for(const r of x[e]){if(2!==r.getState())continue;const n=r.tileCoord,i=l[1]-n[1],a=Math.round(p[0]-(i-1)*s),h=l[2]-n[2],u=Math.round(p[1]-(h-1)*o),d=Math.round(p[0]-i*s),g=Math.round(p[1]-h*o),m=a-d,y=u-g,v=1===M.length;let _=!1;R=[d,g,d+m,g,d+m,g+y,d,g+y];for(let t=0,r=P.length;t<r;++t)if(!v&&e<I[t]){const e=P[t];QE([d,g,d+m,g+y],[e[0],e[3],e[4],e[7]])&&(_||(L.save(),_=!0),L.beginPath(),L.moveTo(R[0],R[1]),L.lineTo(R[2],R[3]),L.lineTo(R[4],R[5]),L.lineTo(R[6],R[7]),L.moveTo(e[6],e[7]),L.lineTo(e[4],e[5]),L.lineTo(e[2],e[3]),L.lineTo(e[0],e[1]),L.clip())}P.push(R),I.push(e),this.drawTile(r,t,d,g,m,y,f,v),_&&L.restore(),this.renderedTiles.unshift(r),this.updateUsedTiles(t.usedTiles,c,r)}}if(this.renderedResolution=d,this.extentChanged=!this.renderedExtent_||!zE(this.renderedExtent_,w),this.renderedExtent_=w,this.renderedPixelRatio=a,this.postRender(this.context,t),n.extent&&L.restore(),L.imageSmoothingEnabled=!0,this.renderComplete){const e=(t,e)=>{const n=Ok(c),i=e.wantedTiles[n],r=i?Object.keys(i).length:0;this.updateCacheSize(r),this.tileCache_.expireCache(),this.sourceTileCache_?.expireCache()};t.postRenderFunctions.push(e)}return this.container}updateCacheSize(t){this.tileCache_.highWaterMark=Math.max(this.tileCache_.highWaterMark,2*t)}drawTile(t,e,n,i,r,s,o,a){let l;if(t instanceof DU){if(l=zU(t.getData()),!l)throw new Error("Rendering array data is not yet supported")}else l=this.getTileImage(t);if(!l)return;const c=this.getRenderContext(e),h=Ok(this),u=e.layerStatesArray[e.layerIndex],d=u.opacity*(a?t.getAlpha(h,e.time):1),p=d!==c.globalAlpha;p&&(c.save(),c.globalAlpha=d),c.drawImage(l,o,o,l.width-2*o,l.height-2*o,n,i,r,s),p&&c.restore(),d!==u.opacity?e.animate=!0:a&&t.endTransition(h)}getImage(){const t=this.context;return t?t.canvas:null}getTileImage(t){return t.getImage()}updateUsedTiles(t,e,n){const i=Ok(e);i in t||(t[i]={}),t[i][n.getKey()]=!0}}const tq="preload",eq="useInterimTilesOnError";class nq extends oP{constructor(t){t=t||{};const e=Object.assign({},t),n=t.cacheSize;delete t.cacheSize,delete e.preload,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n,this.setPreload(void 0!==t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError)}getCacheSize(){return this.cacheSize_}getPreload(){return this.get(tq)}setPreload(t){this.set(tq,t)}getUseInterimTilesOnError(){return this.get(eq)}setUseInterimTilesOnError(t){this.set(eq,t)}getData(t){return super.getData(t)}}class iq extends nq{constructor(t){super(t)}createRenderer(){return new QU(this,{cacheSize:this.getCacheSize()})}}const rq={image:["Polygon","Circle","LineString","Image","Text"],hybrid:["Polygon","LineString"],vector:[]},sq={hybrid:["Image","Text","Default"],vector:["Polygon","Circle","LineString","Image","Text","Default"]};class oq extends QU{constructor(t,e){super(t,e),this.boundHandleStyleImageChange_=this.handleStyleImageChange_.bind(this),this.renderedLayerRevision_,this.renderedPixelToCoordinateTransform_=null,this.renderedRotation_,this.renderedOpacity_=1,this.tmpTransform_=[1,0,0,1,0,0],this.tileClipContexts_=null}enqueueTilesForNextExtent(){return"vector"!==this.getLayer().getRenderMode()}drawTile(t,e,n,i,r,s,o,a){this.updateExecutorGroup_(t,e.pixelRatio,e.viewState.projection),this.tileImageNeedsRender_(t)&&this.renderTileImage_(t,e),super.drawTile(t,e,n,i,r,s,o,a)}getTile(t,e,n,i){const r=this.getOrCreateTile(t,e,n,i);if(!r)return null;const s=i.viewState,o=s.resolution,a=i.viewHints,l=this.getLayer().getSource(),c=l.getTileGridForProjection(s.projection),h=!(a[0]||a[1]),u=c.getZForResolution(o,l.zDirection)===t;return h&&u?r.wantedResolution=o:r.wantedResolution||(r.wantedResolution=c.getResolution(t)),r}prepareFrame(t){const e=this.getLayer().getRevision();return this.renderedLayerRevision_!==e&&(this.renderedLayerRevision_=e,this.renderedTiles.length=0),super.prepareFrame(t)}updateExecutorGroup_(t,e,n){const i=this.getLayer(),r=i.getRevision(),s=i.getRenderOrder()||null,o=t.wantedResolution,a=t.getReplayState(i);if(!a.dirty&&a.renderedResolution===o&&a.renderedRevision==r&&a.renderedRenderOrder==s)return;const l=i.getSource(),c=!!i.getDeclutter(),h=l.getTileGrid(),u=l.getTileGridForProjection(n).getTileCoordExtent(t.wrappedTileCoord),d=l.getSourceTiles(e,n,t),p=Ok(i);delete t.hitDetectionImageData[p],t.executorGroups[p]=[],a.dirty=!1;for(let f=0,g=d.length;f<g;++f){const r=d[f];if(2!=r.getState())continue;const g=l.getProjection(),m=r.tileCoord;let y=h.getTileCoordExtent(m);n&&g&&!mL(n,g)&&(y=wL(y,g,n,32));const v=KE(u,y),_=SE(v,i.getRenderBuffer()*o,this.tempExtent),b=zE(y,v)?null:_,w=new lz(0,v,o,e),x=Oz(o,e),C=function(t,e){let n;const r=t.getStyleFunction()||i.getStyleFunction();if(r&&(n=r(t,o)),n){const i=this.renderFeature(t,x,n,w,c,e);a.dirty=a.dirty||i}},S=r.getFeatures();s&&s!==a.renderedRenderOrder&&S.sort(s);for(let t=0,e=S.length;t<e;++t){let e=S[t];n&&r.projection&&!mL(n,r.projection)&&(e=e.clone(),e.getGeometry().applyTransform(_L(r.projection,n))),b&&!QE(b,e.getGeometry().getExtent())||C.call(this,e,t)}const k=w.finish(),E="vector"!==i.getRenderMode()&&c&&1===d.length?null:v,T=new kz(E,o,e,l.getOverlaps(),k,i.getRenderBuffer(),!0);t.executorGroups[p].push(T)}a.renderedRevision=r,a.renderedRenderOrder=s,a.renderedResolution=o}forEachFeatureAtCoordinate(t,e,n,i,r){const s=e.viewState.resolution,o=e.viewState.rotation;n=null==n?0:n;const a=this.getLayer(),l=a.getSource().getTileGridForProjection(e.viewState.projection),c=CE([t]);SE(c,s*n,c);const h={},u=function(t,e,n){let s=t.getId();void 0===s&&(s=Ok(t));const o=h[s];if(o){if(!0!==o&&n<o.distanceSq){if(0===n)return h[s]=!0,r.splice(r.lastIndexOf(o),1),i(t,a,e);o.geometry=e,o.distanceSq=n}}else{if(0===n)return h[s]=!0,i(t,a,e);r.push(h[s]={feature:t,layer:a,geometry:e,distanceSq:n,callback:i})}},d=this.renderedTiles,p=Ok(a),f=a.getDeclutter(),g=f?e.declutter?.[f]?.all().map(t=>t.value):null;let m;t:for(let y=0,v=d.length;y<v;++y){const e=d[y];if(!QE(l.getTileCoordExtent(e.wrappedTileCoord),c))continue;const i=e.executorGroups[p];for(let r=0,a=i.length;r<a;++r)if(m=i[r].forEachFeatureAtCoordinate(t,s,o,n,u,g),m)break t}return m}getFeatures(t){return 0===this.renderedTiles.length?Promise.resolve([]):new Promise(e=>{const n=this.getLayer(),i=n.getSource(),r=this.renderedProjection,s=r.getExtent(),o=this.renderedResolution,a=i.getTileGridForProjection(r),l=IL(this.renderedPixelToCoordinateTransform_,t.slice()),c=a.getTileCoordForCoordAndResolution(l,o).toString(),h=this.renderedTiles.find(t=>t.tileCoord.toString()===c&&2===t.getState());if(!h||h.loadingSourceTiles>0)return void e([]);i.getWrapX()&&r.canWrapX()&&!LE(s,a.getTileCoordExtent(h.tileCoord))&&oT(l,r);const u=Ok(n),d=YE(a.getTileCoordExtent(h.wrappedTileCoord)),p=[(l[0]-d[0])/o,(d[1]-l[1])/o],f=h.getSourceTiles().reduce((t,e)=>t.concat(e.getFeatures()),[]);let g=h.hitDetectionImageData[u];if(!g){const t=HP(a.getTileSize(a.getZForResolution(o,i.zDirection))),e=this.renderedRotation_;g=Mz(t,[this.getRenderTransform(a.getTileCoordCenter(h.wrappedTileCoord),o,0,Lz,t[0]*Lz,t[1]*Lz,0)],f,n.getStyleFunction(),a.getTileCoordExtent(h.wrappedTileCoord),h.getReplayState(n).renderedResolution,e),h.hitDetectionImageData[u]=g}e(Rz(p,f,g))})}getFeaturesInExtent(t){const e=[],n=this.getTileCache();if(0===n.getCount())return e;const i=this.getLayer().getSource().getTileGridForProjection(this.frameState.viewState.projection),r=i.getZForResolution(this.renderedResolution),s={};return n.forEach(n=>{if(n.tileCoord[0]!==r||2!==n.getState())return;const o=n.getSourceTiles();for(let r=0,a=o.length;r<a;++r){const n=o[r],a=n.getKey();if(a in s)continue;s[a]=!0;const l=n.tileCoord;if(QE(t,i.getTileCoordExtent(l))){const i=n.getFeatures();if(i)for(let n=0,r=i.length;n<r;++n){const r=i[n],s=r.getGeometry();QE(t,s.getExtent())&&e.push(r)}}}}),e}handleFontsChanged(){const t=this.getLayer();t.getVisible()&&void 0!==this.renderedLayerRevision_&&t.changed()}handleStyleImageChange_(t){this.renderIfReadyAndVisible()}renderDeclutter(t,e){const n=this.context,i=n.globalAlpha;n.globalAlpha=e.opacity;const r=t.viewHints,s=!(r[0]||r[1]),o=[this.context.canvas.width,this.context.canvas.height],a=this.getLayer().getDeclutter(),l=a?t.declutter?.[a]:void 0,c=Ok(this.getLayer()),h=this.renderedTiles;for(let u=0,d=h.length;u<d;++u){const e=h[u],n=e.executorGroups[c];if(n)for(let i=n.length-1;i>=0;--i)n[i].execute(this.context,o,this.getTileRenderTransform(e,t),t.viewState.rotation,s,Cz,l)}n.globalAlpha=i}renderDeferredInternal(t){const e=this.renderedTiles,n=Ok(this.getLayer()),i=e.reduce((t,e,i)=>(e.executorGroups[n].forEach(e=>t.push({executorGroup:e,index:i})),t),[]),r=i.map(({executorGroup:t})=>t.getDeferredZIndexContexts()),s={};for(let o=0,a=i.length;o<a;++o){const t=i[o].executorGroup.getDeferredZIndexContexts();for(const e in t)s[e]=!0}Object.keys(s).map(Number).sort(dk).forEach(t=>{r.forEach((e,n)=>{e[t]&&(e[t].forEach(t=>{const{executorGroup:e,index:r}=i[n],s=e.getRenderedContext(),o=s.globalAlpha;s.globalAlpha=this.renderedOpacity_;const a=this.tileClipContexts_[r];a&&a.draw(s),t.draw(s),a&&s.restore(),s.globalAlpha=o,t.clear()}),e[t].length=0)})})}getTileRenderTransform(t,e){const n=e.pixelRatio,i=e.viewState,r=i.center,s=i.resolution,o=i.rotation,a=e.size,l=Math.round(a[0]*n),c=Math.round(a[1]*n),h=this.getLayer().getSource().getTileGridForProjection(e.viewState.projection),u=t.tileCoord,d=h.getTileCoordExtent(t.wrappedTileCoord),p=h.getTileCoordExtent(u,this.tempExtent)[0]-d[0];return RL(OL(this.inversePixelTransform.slice(),1/n,1/n),this.getRenderTransform(r,s,o,n,l,c,p))}postRender(t,e){const n=e.viewHints,i=!(n[0]||n[1]);this.renderedPixelToCoordinateTransform_=e.pixelToCoordinateTransform.slice(),this.renderedRotation_=e.viewState.rotation,this.renderedOpacity_=e.layerStatesArray[e.layerIndex].opacity;const r=this.getLayer(),s=r.getRenderMode(),o=t.globalAlpha;t.globalAlpha=this.renderedOpacity_;const a=r.getDeclutter(),l=a?sq[s].filter(t=>!Cz.includes(t)):sq[s],c=e.viewState,h=c.rotation,u=r.getSource(),d=u.getTileGridForProjection(c.projection).getZForResolution(c.resolution,u.zDirection),p=this.renderedTiles,f=[],g=[],m=[],y=Ok(r);let v=!0;for(let _=p.length-1;_>=0;--_){const n=p[_];v=v&&!n.getReplayState(r).dirty;const s=n.executorGroups[y].filter(t=>t.hasExecutors(l));if(0===s.length)continue;const o=this.getTileRenderTransform(n,e),c=n.tileCoord[0];let u=!1;const b=s[0].getClipCoords(o);let w,x=t;if(b){w=new hz,x=w.getContext();for(let t=0,e=f.length;t<e;++t)if(d!==c&&c<g[t]){const e=f[t];QE([b[0],b[3],b[4],b[7]],[e[0],e[3],e[4],e[7]])&&(u||(x.save(),u=!0),x.beginPath(),x.moveTo(b[0],b[1]),x.lineTo(b[2],b[3]),x.lineTo(b[4],b[5]),x.lineTo(b[6],b[7]),x.moveTo(e[6],e[7]),x.lineTo(e[4],e[5]),x.lineTo(e[2],e[3]),x.lineTo(e[0],e[1]),x.clip())}f.push(b),g.push(c)}for(let r=0,d=s.length;r<d;++r)s[r].execute(t,[t.canvas.width,t.canvas.height],o,h,i,l,e.declutter?.[a]);u&&(x===t?x.restore():m[_]=w)}t.globalAlpha=o,this.ready=v,this.tileClipContexts_=m,e.declutter||this.renderDeferredInternal(e),super.postRender(t,e)}renderFeature(t,e,n,i,r,s){if(!n)return!1;let o=!1;if(Array.isArray(n))for(let a=0,l=n.length;a<l;++a)o=zz(i,t,n[a],e,this.boundHandleStyleImageChange_,void 0,r,s)||o;else o=zz(i,t,n,e,this.boundHandleStyleImageChange_,void 0,r,s);return o}tileImageNeedsRender_(t){const e=this.getLayer();if("vector"===e.getRenderMode())return!1;const n=t.getReplayState(e),i=e.getRevision(),r=t.wantedResolution;return n.renderedTileResolution!==r||n.renderedTileRevision!==i}renderTileImage_(t,e){const n=this.getLayer(),i=t.getReplayState(n),r=n.getRevision(),s=t.executorGroups[Ok(n)];i.renderedTileRevision=r;const o=t.wrappedTileCoord,a=o[0],l=n.getSource();let c=e.pixelRatio;const h=e.viewState.projection,u=l.getTileGridForProjection(h),d=u.getResolution(t.tileCoord[0]),p=e.pixelRatio/t.wantedResolution*d,f=u.getResolution(a),g=t.getContext();c=Math.round(Math.max(c,p/c));const m=l.getTilePixelSize(a,c,h);g.canvas.width=m[0],g.canvas.height=m[1];const y=c/p;if(1!==y){const t=ML(this.tmpTransform_);OL(t,y,y),g.setTransform.apply(g,t)}const v=u.getTileCoordExtent(o,this.tempExtent),_=p/f,b=ML(this.tmpTransform_);OL(b,_,-_),function(t,e,n){RL(t,PL(LL,1,0,0,1,e,n))}(b,-v[0],-v[3]);for(let w=0,x=s.length;w<x;++w)s[w].execute(g,[g.canvas.width*y,g.canvas.height*y],b,0,!0,rq[n.getRenderMode()],null);i.renderedTileResolution=t.wantedResolution}}class aq extends TA{constructor(t){t=t||{};const e=Object.assign({},t);delete e.preload;const n=void 0===t.cacheSize?0:t.cacheSize;delete t.cacheSize,delete e.useInterimTilesOnError,super(e),this.on,this.once,this.un,this.cacheSize_=n;const i=t.renderMode||"hybrid";sE("hybrid"==i||"vector"==i,"`renderMode` must be `'hybrid'` or `'vector'`"),this.renderMode_=i,this.setPreload(t.preload?t.preload:0),this.setUseInterimTilesOnError(void 0===t.useInterimTilesOnError||t.useInterimTilesOnError),this.getBackground,this.setBackground}createRenderer(){return new oq(this,{cacheSize:this.cacheSize_})}getFeatures(t){return super.getFeatures(t)}getFeaturesInExtent(t){return this.getRenderer().getFeaturesInExtent(t)}getRenderMode(){return this.renderMode_}getPreload(){return this.get(tq)}getUseInterimTilesOnError(){return this.get(eq)}setPreload(t){this.set(tq,t)}setUseInterimTilesOnError(t){this.set(eq,t)}}function lq(t){return Array.isArray(t)?Math.min(...t):t}class cq extends vO{constructor(t,e,n,i,r,s,o){let a=t.getExtent();a&&t.canWrapX()&&(a=a.slice(),a[0]=-1/0,a[2]=1/0);let l=e.getExtent();l&&e.canWrapX()&&(l=l.slice(),l[0]=-1/0,l[2]=1/0);const c=l?KE(n,l):n,h=VU(t,e,$E(c),i),u=new GU(t,e,c,a,.5*h,i),d=u.calculateSourceExtent(),p=tT(d)?null:s(d,h,r),f=p?0:4,g=p?p.getPixelRatio():1;super(n,i,g,f),this.targetProj_=e,this.maxSourceExtent_=a,this.triangulation_=u,this.targetResolution_=i,this.targetExtent_=n,this.sourceImage_=p,this.sourcePixelRatio_=g,this.interpolate_=o,this.canvas_=null,this.sourceListenerKey_=null}disposeInternal(){1==this.state&&this.unlistenSource_(),super.disposeInternal()}getImage(){return this.canvas_}getProjection(){return this.targetProj_}reproject_(){const t=this.sourceImage_.getState();if(2==t){const t=JE(this.targetExtent_)/this.targetResolution_,e=ZE(this.targetExtent_)/this.targetResolution_;this.canvas_=$U(t,e,this.sourcePixelRatio_,lq(this.sourceImage_.getResolution()),this.maxSourceExtent_,this.targetResolution_,this.targetExtent_,this.triangulation_,[{extent:this.sourceImage_.getExtent(),image:this.sourceImage_.getImage()}],0,void 0,this.interpolate_,!0)}this.state=t,this.changed()}load(){if(0==this.state){this.state=1,this.changed();const t=this.sourceImage_.getState();2==t||3==t?this.reproject_():(this.sourceListenerKey_=Tk(this.sourceImage_,rk,()=>{const t=this.sourceImage_.getState();2!=t&&3!=t||(this.unlistenSource_(),this.reproject_())}),this.sourceImage_.load())}}unlistenSource_(){Mk(this.sourceListenerKey_),this.sourceListenerKey_=null}}class hq extends kk{constructor(t,e){super(t),this.image=e}}class uq extends Jz{constructor(t){super({attributions:t.attributions,projection:t.projection,state:t.state,interpolate:void 0===t.interpolate||t.interpolate}),this.on,this.once,this.un,this.loader=t.loader||null,this.resolutions_=void 0!==t.resolutions?t.resolutions:null,this.reprojectedImage_=null,this.reprojectedRevision_=0,this.image=null,this.wantedExtent_,this.wantedResolution_,this.static_=!!t.loader&&0===t.loader.length,this.wantedProjection_=null}getResolutions(){return this.resolutions_}setResolutions(t){this.resolutions_=t}findNearestResolution(t){const e=this.getResolutions();return e&&(t=e[fk(e,t,0)]),t}getImage(t,e,n,i){const r=this.getProjection();if(!r||!i||mL(r,i))return r&&(i=r),this.getImageInternal(t,e,n,i);if(this.reprojectedImage_){if(this.reprojectedRevision_==this.getRevision()&&mL(this.reprojectedImage_.getProjection(),i)&&this.reprojectedImage_.getResolution()==e&&zE(this.reprojectedImage_.getExtent(),t))return this.reprojectedImage_;this.reprojectedImage_.dispose(),this.reprojectedImage_=null}return this.reprojectedImage_=new cq(r,i,t,e,n,(t,e,n)=>this.getImageInternal(t,e,n,r),this.getInterpolate()),this.reprojectedRevision_=this.getRevision(),this.reprojectedImage_}getImageInternal(t,e,n,i){if(this.loader){const r=function(t,e,n){const i=e/n,r=$E(t),s=_E(JE(t)/i,4),o=_E(ZE(t)/i,4);return WE(r,i,0,[s+2*_E(0*s/2,4),o+2*_E(0*o/2,4)])}(t,e,n),s=this.findNearestResolution(e);if(this.image&&(this.static_||this.wantedProjection_===i&&(this.wantedExtent_&&LE(this.wantedExtent_,r)||LE(this.image.getExtent(),r))&&(this.wantedResolution_&&lq(this.wantedResolution_)===s||lq(this.image.getResolution())===s)))return this.image;this.wantedProjection_=i,this.wantedExtent_=r,this.wantedResolution_=s,this.image=new vO(r,s,n,this.loader),this.image.addEventListener(rk,this.handleImageChange.bind(this))}return this.image}handleImageChange(t){const e=t.target;let n;switch(e.getState()){case 1:this.loading=!0,n="imageloadstart";break;case 2:this.loading=!1,n="imageloadend";break;case 3:this.loading=!1,n="imageloaderror";break;default:return}this.hasListener(n)&&this.dispatchEvent(new hq(n,e))}}const dq=[0,0,0];class pq{constructor(t){let e;if(this.minZoom=void 0!==t.minZoom?t.minZoom:0,this.resolutions_=t.resolutions,sE(function(t){const e=((t,e)=>e-t)||dk;return t.every(function(n,i){if(0===i)return!0;const r=e(t[i-1],n);return!(r>0||0===r)})}(this.resolutions_),"`resolutions` must be sorted in descending order"),!t.origins)for(let i=0,r=this.resolutions_.length-1;i<r;++i)if(e){if(this.resolutions_[i]/this.resolutions_[i+1]!==e){e=void 0;break}}else e=this.resolutions_[i]/this.resolutions_[i+1];this.zoomFactor_=e,this.maxZoom=this.resolutions_.length-1,this.origin_=void 0!==t.origin?t.origin:null,this.origins_=null,void 0!==t.origins&&(this.origins_=t.origins,sE(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));const n=t.extent;void 0===n||this.origin_||this.origins_||(this.origin_=YE(n)),sE(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,void 0!==t.tileSizes&&(this.tileSizes_=t.tileSizes,sE(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=void 0!==t.tileSize?t.tileSize:this.tileSizes_?null:256,sE(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=void 0!==n?n:null,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],void 0!==t.sizes?this.fullTileRanges_=t.sizes.map((t,e)=>{const i=new fB(Math.min(0,t[0]),Math.max(t[0]-1,-1),Math.min(0,t[1]),Math.max(t[1]-1,-1));if(n){const t=this.getTileRangeForExtentAndZ(n,e);i.minX=Math.max(t.minX,i.minX),i.maxX=Math.min(t.maxX,i.maxX),i.minY=Math.max(t.minY,i.minY),i.maxY=Math.min(t.maxY,i.maxY)}return i}):n&&this.calculateTileRanges_(n)}forEachTileCoord(t,e,n){const i=this.getTileRangeForExtentAndZ(t,e);for(let r=i.minX,s=i.maxX;r<=s;++r)for(let t=i.minY,o=i.maxY;t<=o;++t)n([e,r,t])}forEachTileCoordParentTileRange(t,e,n,i){let r,s,o,a=null,l=t[0]-1;for(2===this.zoomFactor_?(s=t[1],o=t[2]):a=this.getTileCoordExtent(t,i);l>=this.minZoom;){if(void 0!==s&&void 0!==o?(s=Math.floor(s/2),o=Math.floor(o/2),r=gB(s,s,o,o,n)):r=this.getTileRangeForExtentAndZ(a,l,n),e(l,r))return!0;--l}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(t){return this.origin_?this.origin_:this.origins_[t]}getResolution(t){return this.resolutions_[t]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(t,e,n){if(t[0]<this.maxZoom){if(2===this.zoomFactor_){const n=2*t[1],i=2*t[2];return gB(n,n+1,i,i+1,e)}const i=this.getTileCoordExtent(t,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(i,t[0]+1,e)}return null}getTileRangeForTileCoordAndZ(t,e,n){if(e>this.maxZoom||e<this.minZoom)return null;const i=t[0],r=t[1],s=t[2];if(e===i)return gB(r,s,r,s,n);if(this.zoomFactor_){const t=Math.pow(this.zoomFactor_,e-i),o=Math.floor(r*t),a=Math.floor(s*t);return e<i?gB(o,o,a,a,n):gB(o,Math.floor(t*(r+1))-1,a,Math.floor(t*(s+1))-1,n)}const o=this.getTileCoordExtent(t,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,e,n)}getTileRangeForExtentAndZ(t,e,n){this.getTileCoordForXYAndZ_(t[0],t[3],e,!1,dq);const i=dq[1],r=dq[2];return this.getTileCoordForXYAndZ_(t[2],t[1],e,!0,dq),gB(i,dq[1],r,dq[2],n)}getTileCoordCenter(t){const e=this.getOrigin(t[0]),n=this.getResolution(t[0]),i=HP(this.getTileSize(t[0]),this.tmpSize_);return[e[0]+(t[1]+.5)*i[0]*n,e[1]-(t[2]+.5)*i[1]*n]}getTileCoordExtent(t,e){const n=this.getOrigin(t[0]),i=this.getResolution(t[0]),r=HP(this.getTileSize(t[0]),this.tmpSize_),s=n[0]+t[1]*r[0]*i,o=n[1]-(t[2]+1)*r[1]*i;return PE(s,o,s+r[0]*i,o+r[1]*i,e)}getTileCoordForCoordAndResolution(t,e,n){return this.getTileCoordForXYAndResolution_(t[0],t[1],e,!1,n)}getTileCoordForXYAndResolution_(t,e,n,i,r){const s=this.getZForResolution(n),o=n/this.getResolution(s),a=this.getOrigin(s),l=HP(this.getTileSize(s),this.tmpSize_);let c=o*(t-a[0])/n/l[0],h=o*(a[1]-e)/n/l[1];return i?(c=_E(c,5)-1,h=_E(h,5)-1):(c=vE(c,5),h=vE(h,5)),ZU(s,c,h,r)}getTileCoordForXYAndZ_(t,e,n,i,r){const s=this.getOrigin(n),o=this.getResolution(n),a=HP(this.getTileSize(n),this.tmpSize_);let l=(t-s[0])/o/a[0],c=(s[1]-e)/o/a[1];return i?(l=_E(l,5)-1,c=_E(c,5)-1):(l=vE(l,5),c=vE(c,5)),ZU(n,l,c,r)}getTileCoordForCoordAndZ(t,e,n){return this.getTileCoordForXYAndZ_(t[0],t[1],e,!1,n)}getTileCoordResolution(t){return this.resolutions_[t[0]]}getTileSize(t){return this.tileSize_?this.tileSize_:this.tileSizes_[t]}getFullTileRange(t){return this.fullTileRanges_?this.fullTileRanges_[t]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,t):null}getZForResolution(t,e){return hE(fk(this.resolutions_,t,e||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(t,e){return _M(e,0,e.length,2,this.getTileCoordExtent(t))}calculateTileRanges_(t){const e=this.resolutions_.length,n=new Array(e);for(let i=this.minZoom;i<e;++i)n[i]=this.getTileRangeForExtentAndZ(t,i);this.fullTileRanges_=n}}function fq(t){let e=t.getDefaultTileGrid();return e||(e=function(t){return function(t,e,n,i){i=void 0!==i?i:"top-left";const r=mq(t,void 0,n);return new pq({extent:t,origin:GE(t,i),resolutions:r,tileSize:n})}(yq(t),0,void 0,void 0)}(t),t.setDefaultTileGrid(e)),e}function gq(t){const e=t||{},n=e.extent||hL("EPSG:3857").getExtent(),i={extent:n,minZoom:e.minZoom,tileSize:e.tileSize,resolutions:mq(n,e.maxZoom,e.tileSize,e.maxResolution)};return new pq(i)}function mq(t,e,n,i){e=void 0!==e?e:42,n=HP(void 0!==n?n:256);const r=ZE(t),s=JE(t);i=i>0?i:Math.max(s/n[0],r/n[1]);const o=e+1,a=new Array(o);for(let l=0;l<o;++l)a[l]=i/Math.pow(2,l);return a}function yq(t){let e=(t=hL(t)).getExtent();if(!e){const n=180*gT.degrees/t.getMetersPerUnit();e=PE(-n,-n,n,n)}return e}class vq extends Jz{constructor(t){super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,projection:t.projection,state:t.state,wrapX:t.wrapX,interpolate:t.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=void 0!==t.tilePixelRatio?t.tilePixelRatio:1,this.tileGrid=void 0!==t.tileGrid?t.tileGrid:null,this.tileGrid&&HP(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=t.key||Ok(this),this.tileOptions={transition:t.transition,interpolate:t.interpolate},this.zDirection=t.zDirection?t.zDirection:0}getGutterForProjection(t){return 0}getKey(){return this.key_}setKey(t){this.key_!==t&&(this.key_=t,this.changed())}getResolutions(t){const e=t?this.getTileGridForProjection(t):this.tileGrid;return e?e.getResolutions():null}getTile(t,e,n,i,r,s){return Pk()}getTileGrid(){return this.tileGrid}getTileGridForProjection(t){return this.tileGrid?this.tileGrid:fq(t)}getTilePixelRatio(t){return this.tilePixelRatio_}getTilePixelSize(t,e,n){const i=this.getTileGridForProjection(n),r=this.getTilePixelRatio(e),s=HP(i.getTileSize(t),this.tmpSize);return 1==r?s:(o=s,a=r,void 0===(l=this.tmpSize)&&(l=[0,0]),l[0]=o[0]*a+.5|0,l[1]=o[1]*a+.5|0,l);var o,a,l}getTileCoordForTileUrlFunction(t,e){const n=void 0!==e?e:this.getProjection(),i=void 0!==e?this.getTileGridForProjection(n):this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(t=function(t,e,n){const i=e[0],r=t.getTileCoordCenter(e),s=yq(n);if(!TE(s,r)){const e=JE(s),n=Math.ceil((s[0]-r[0])/e);return r[0]+=e*n,t.getTileCoordForCoordAndZ(r,i)}return e}(i,t,n)),function(t,e){const n=t[0],i=t[1],r=t[2];if(e.getMinZoom()>n||n>e.getMaxZoom())return!1;const s=e.getFullTileRange(n);return!s||s.containsXY(i,r)}(t,i)?t:null}clear(){}refresh(){this.clear(),super.refresh()}}class _q extends kk{constructor(t,e){super(t),this.tile=e}}function bq(t){return function(e){const n=e.buffers,i=e.meta,r=e.imageOps,s=e.width,o=e.height,a=n.length,l=n[0].byteLength;if(r){const e=new Array(a);for(let t=0;t<a;++t)e[t]=new ImageData(new Uint8ClampedArray(n[t]),s,o);return t(e,i).data.buffer}const c=new Uint8ClampedArray(l),h=new Array(a),u=new Array(a);for(let t=0;t<a;++t)h[t]=new Uint8ClampedArray(n[t]),u[t]=[0,0,0,0];for(let d=0;d<l;d+=4){for(let t=0;t<a;++t){const e=h[t];u[t][0]=e[d],u[t][1]=e[d+1],u[t][2]=e[d+2],u[t][3]=e[d+3]}const e=t(u,i);c[d]=e[0],c[d+1]=e[1],c[d+2]=e[2],c[d+3]=e[3]}return c.buffer}}function wq(t,e){const n=Object.keys(t.lib||{}).map(function(e){return"const "+e+" = "+t.lib[e].toString()+";"}),i=n.concat(["const __minion__ = ("+bq.toString()+")(",t.operation.toString(),");",'self.addEventListener("message", function(event) {'," const buffer = __minion__(event.data);"," self.postMessage({buffer: buffer, meta: event.data.meta}, [buffer]);","});"]),r=new Worker("undefined"==typeof Blob?"data:text/javascript;base64,"+Buffer.from(i.join("\n"),"binary").toString("base64"):URL.createObjectURL(new Blob(i,{type:"text/javascript"})));return r.addEventListener("message",e),r}class xq extends uk{constructor(t){let e;super(),this.imageOps_=!!t.imageOps,e=0===t.threads?0:this.imageOps_?1:t.threads||1;const n=new Array(e);if(e)for(let i=0;i<e;++i)n[i]=wq(t,this.onWorkerMessage_.bind(this,i));else n[0]=function(t,e){const n=bq(t.operation);let i=!1;return{postMessage:function(t){setTimeout(function(){i||e({data:{buffer:n(t),meta:t.meta}})},0)},terminate:function(){i=!0}}}(t,this.onWorkerMessage_.bind(this,0));this.workers_=n,this.queue_=[],this.maxQueueLength_=t.queue||1/0,this.running_=0,this.dataLookup_={},this.job_=null}process(t,e,n){this.enqueue_({inputs:t,meta:e,callback:n}),this.dispatch_()}enqueue_(t){for(this.queue_.push(t);this.queue_.length>this.maxQueueLength_;)this.queue_.shift().callback(null,null)}dispatch_(){if(this.running_||0===this.queue_.length)return;const t=this.queue_.shift();this.job_=t;const e=t.inputs[0].width,n=t.inputs[0].height,i=t.inputs.map(function(t){return t.data.buffer}),r=this.workers_.length;if(this.running_=r,1===r)return void this.workers_[0].postMessage({buffers:i,meta:t.meta,imageOps:this.imageOps_,width:e,height:n},i);const s=t.inputs[0].data.length,o=4*Math.ceil(s/4/r);for(let a=0;a<r;++a){const r=a*o,s=[];for(let t=0,e=i.length;t<e;++t)s.push(i[t].slice(r,r+o));this.workers_[a].postMessage({buffers:s,meta:t.meta,imageOps:this.imageOps_,width:e,height:n},s)}}onWorkerMessage_(t,e){this.disposed||(this.dataLookup_[t]=e.data,--this.running_,0===this.running_&&this.resolveJob_())}resolveJob_(){const t=this.job_,e=this.workers_.length;let n,i;if(1===e)n=new Uint8ClampedArray(this.dataLookup_[0].buffer),i=this.dataLookup_[0].meta;else{const r=t.inputs[0].data.length;n=new Uint8ClampedArray(r),i=new Array(e);const s=4*Math.ceil(r/4/e);for(let t=0;t<e;++t){const e=this.dataLookup_[t].buffer,r=t*s;n.set(new Uint8ClampedArray(e),r),i[t]=this.dataLookup_[t].meta}}this.job_=null,this.dataLookup_={},t.callback(null,new ImageData(n,t.inputs[0].width,t.inputs[0].height),i),this.dispatch_()}disposeInternal(){for(let t=0;t<this.workers_.length;++t)this.workers_[t].terminate();this.workers_.length=0}}class Cq extends kk{constructor(t,e,n){super(t),this.extent=e.extent,this.resolution=e.viewState.resolution/e.pixelRatio,this.data=n}}class Sq extends uq{constructor(t){super({projection:null}),this.on,this.once,this.un,this.processor_=null,this.operationType_=void 0!==t.operationType?t.operationType:"pixel",this.threads_=void 0!==t.threads?t.threads:1,this.layers_=function(t){const e=t.length,n=new Array(e);for(let i=0;i<e;++i)n[i]=Tq(t[i]);return n}(t.sources);const e=this.changed.bind(this);for(let i=0,r=this.layers_.length;i<r;++i)this.layers_[i].addEventListener(rk,e);var n;this.useResolutions_=null!==t.resolutions,this.tileQueue_=new lE(function(){return 1},this.processSources_.bind(this)),this.requestedFrameState_,this.renderedImageCanvas_=null,this.renderedRevision_,this.frameState_={animate:!1,coordinateToPixelTransform:[1,0,0,1,0,0],declutter:null,extent:null,index:0,layerIndex:0,layerStatesArray:(n=this.layers_,n.map(function(t){return t.getLayerState()})),pixelRatio:1,pixelToCoordinateTransform:[1,0,0,1,0,0],postRenderFunctions:[],size:[0,0],tileQueue:this.tileQueue_,time:Date.now(),usedTiles:{},viewState:{rotation:0},viewHints:[],wantedTiles:{},mapId:Ok(this),renderTargets:{}},this.setAttributions(function(e){const n=[];for(let i=0,r=t.sources.length;i<r;++i){const r=t.sources[i],s=r instanceof Jz?r:r.getSource();if(!s)continue;const o=s.getAttributions()?.(e);"string"==typeof o?n.push(o):void 0!==o&&n.push(...o)}return n}),void 0!==t.operation&&this.setOperation(t.operation,t.lib)}setOperation(t,e){this.processor_&&this.processor_.dispose(),this.processor_=new xq({operation:t,imageOps:"image"===this.operationType_,queue:1,lib:e,threads:this.threads_}),this.changed()}updateFrameState_(t,e,n){const i=Object.assign({},this.frameState_);i.viewState=Object.assign({},i.viewState);const r=$E(t);i.size[0]=Math.ceil(JE(t)/e),i.size[1]=Math.ceil(ZE(t)/e),i.extent=[r[0]-i.size[0]*e/2,r[1]-i.size[1]*e/2,r[0]+i.size[0]*e/2,r[1]+i.size[1]*e/2],i.time=Date.now();const s=i.viewState;return s.center=r,s.projection=n,s.resolution=e,i}allSourcesReady_(){let t,e=!0;for(let n=0,i=this.layers_.length;n<i;++n)if(t=this.layers_[n].getSource(),!t||"ready"!==t.getState()){e=!1;break}return e}getImage(t,e,n,i){if(!this.allSourcesReady_())return null;this.tileQueue_.loadMoreTiles(16,16),e=this.findNearestResolution(e);const r=this.updateFrameState_(t,e,i);if(this.requestedFrameState_=r,this.renderedImageCanvas_){const t=this.renderedImageCanvas_.getResolution(),n=this.renderedImageCanvas_.getExtent();e===t&&zE(r.extent,n)||(this.renderedImageCanvas_=null)}return this.renderedImageCanvas_&&this.getRevision()===this.renderedRevision_||this.processSources_(),r.animate&&requestAnimationFrame(this.changed.bind(this)),this.renderedImageCanvas_}processSources_(){const t=this.requestedFrameState_,e=this.layers_.length,n=new Array(e);for(let r=0;r<e;++r){t.layerIndex=r,t.renderTargets={};const e=Eq(this.layers_[r],t);if(!e)return;n[r]=e}const i={};this.dispatchEvent(new Cq("beforeoperations",t,i)),this.processor_.process(n,i,this.onWorkerComplete_.bind(this,t))}onWorkerComplete_(t,e,n,i){if(e||!n)return;const r=t.extent,s=t.viewState.resolution;if(s!==this.requestedFrameState_.viewState.resolution||!zE(r,this.requestedFrameState_.extent))return;let o;this.renderedImageCanvas_?o=this.renderedImageCanvas_.getImage().getContext("2d"):(o=HM(Math.round(JE(r)/s),Math.round(ZE(r)/s)),this.renderedImageCanvas_=new uB(r,s,1,o.canvas)),o.putImageData(n,0,0),t.animate?requestAnimationFrame(this.changed.bind(this)):this.changed(),this.renderedRevision_=this.getRevision(),this.dispatchEvent(new Cq("afteroperations",t,i))}getResolutions(t){if(!this.useResolutions_)return null;let e=super.getResolutions();if(!e)for(let n=0,i=this.layers_.length;n<i&&(e=this.layers_[n].getSource().getResolutions(t),!e);++n);return e}disposeInternal(){this.processor_&&this.processor_.dispose(),super.disposeInternal()}}Sq.prototype.dispose;let kq=null;function Eq(t,e){const n=t.getRenderer();if(!n)throw new Error("Unsupported layer type: "+t);if(!n.prepareFrame(e))return null;const i=e.size[0],r=e.size[1];if(0===i||0===r)return null;const s=n.renderFrame(e,null);let o;if(s instanceof HTMLCanvasElement)o=s;else{if(s&&(o=s.firstElementChild),!(o instanceof HTMLCanvasElement))throw new Error("Unsupported rendered element: "+o);if(o.width===i&&o.height===r)return o.getContext("2d").getImageData(0,0,i,r)}if(kq){const t=kq.canvas;t.width!==i||t.height!==r?kq=HM(i,r,void 0,{willReadFrequently:!0}):kq.clearRect(0,0,i,r)}else kq=HM(i,r,void 0,{willReadFrequently:!0});return kq.drawImage(o,0,0,i,r),kq.getImageData(0,0,i,r)}function Tq(t){let e;return t instanceof Jz?t instanceof vq?e=new iq({source:t}):t instanceof uq&&(e=new AU({source:t})):e=t,e}const Lq=/\{z\}/g,Mq=/\{x\}/g,Rq=/\{y\}/g,Pq=/\{-y\}/g;function Iq(t,e){return function(n){if(!n)return;let i;const r=n[0];if(e){const t=e.getFullTileRange(r);t&&(i=t.getHeight()-1)}return function(t,e,n,i,r){return t.replace(Lq,e.toString()).replace(Mq,n.toString()).replace(Rq,i.toString()).replace(Pq,function(){if(void 0===r)throw new Error("If the URL template has a {-y} placeholder, the grid extent must be known");return(r-i).toString()})}(t,r,n[1],n[2],i)}}function Oq(t,e){const n=t.length,i=new Array(n);for(let r=0;r<n;++r)i[r]=Iq(t[r],e);return function(t){return 1===t.length?t[0]:function(e,n,i){if(!e)return;const r=function(t){return e=t[0],(t[1]<<e)+t[2];var e}(e),s=gE(r,t.length);return t[s](e,n,i)}}(i)}class Aq extends vq{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tilePixelRatio:t.tilePixelRatio,wrapX:t.wrapX,transition:t.transition,interpolate:t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.generateTileUrlFunction_=this.tileUrlFunction===Aq.prototype.tileUrlFunction,this.tileLoadFunction=t.tileLoadFunction,t.tileUrlFunction&&(this.tileUrlFunction=t.tileUrlFunction),this.urls=null,t.urls?this.setUrls(t.urls):t.url&&this.setUrl(t.url),this.tileLoadingKeys_={}}getTileLoadFunction(){return this.tileLoadFunction}getTileUrlFunction(){return Object.getPrototypeOf(this).tileUrlFunction===this.tileUrlFunction?this.tileUrlFunction.bind(this):this.tileUrlFunction}getUrls(){return this.urls}handleTileChange(t){const e=t.target,n=Ok(e),i=e.getState();let r;1==i?(this.tileLoadingKeys_[n]=!0,r="tileloadstart"):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],r=3==i?"tileloaderror":2==i?"tileloadend":void 0),null!=r&&this.dispatchEvent(new _q(r,e))}setTileLoadFunction(t){this.tileLoadFunction=t,this.changed()}setTileUrlFunction(t,e){this.tileUrlFunction=t,void 0!==e?this.setKey(e):this.changed()}setUrl(t){const e=function(t){const e=[];let n=/\{([a-z])-([a-z])\}/.exec(t);if(n){const i=n[1].charCodeAt(0),r=n[2].charCodeAt(0);let s;for(s=i;s<=r;++s)e.push(t.replace(n[0],String.fromCharCode(s)));return e}if(n=/\{(\d+)-(\d+)\}/.exec(t),n){const i=parseInt(n[2],10);for(let r=parseInt(n[1],10);r<=i;r++)e.push(t.replace(n[0],r.toString()));return e}return e.push(t),e}(t);this.urls=e,this.setUrls(e)}setUrls(t){this.urls=t;const e=t.join("\n");this.generateTileUrlFunction_?this.setTileUrlFunction(Oq(t,this.tileGrid),e):this.setKey(e)}tileUrlFunction(t,e,n){}}class zq extends Aq{constructor(t){super({attributions:t.attributions,cacheSize:t.cacheSize,projection:t.projection,state:t.state,tileGrid:t.tileGrid,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Fq,tilePixelRatio:t.tilePixelRatio,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:t.wrapX,transition:t.transition,interpolate:void 0===t.interpolate||t.interpolate,key:t.key,attributionsCollapsible:t.attributionsCollapsible,zDirection:t.zDirection}),this.crossOrigin=void 0!==t.crossOrigin?t.crossOrigin:null,this.tileClass=void 0!==t.tileClass?t.tileClass:pB,this.tileGridForProjection={},this.reprojectionErrorThreshold_=t.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(t){return this.getProjection()&&t&&!mL(this.getProjection(),t)?0:this.getGutter()}getGutter(){return 0}getKey(){let t=super.getKey();return this.getInterpolate()||(t+=":disable-interpolation"),t}getTileGridForProjection(t){const e=this.getProjection();if(this.tileGrid&&(!e||mL(e,t)))return this.tileGrid;const n=Ok(t);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=fq(t)),this.tileGridForProjection[n]}createTile_(t,e,n,i,r,s){const o=[t,e,n],a=this.getTileCoordForTileUrlFunction(o,r),l=a?this.tileUrlFunction(a,i,r):void 0,c=new this.tileClass(o,void 0!==l?0:4,void 0!==l?l:"",this.crossOrigin,this.tileLoadFunction,this.tileOptions);return c.key=s,c.addEventListener(rk,this.handleTileChange.bind(this)),c}getTile(t,e,n,i,r,s){const o=this.getProjection();if(!o||!r||mL(o,r))return this.getTileInternal(t,e,n,i,o||r);const a=[t,e,n],l=this.getKey(),c=this.getTileGridForProjection(o),h=this.getTileGridForProjection(r),u=this.getTileCoordForTileUrlFunction(a,r),d=new WU(o,c,r,h,a,u,this.getTilePixelRatio(i),this.getGutter(),(t,e,n,i)=>this.getTileInternal(t,e,n,i,o,s),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return d.key=l,d}getTileInternal(t,e,n,i,r,s){const o=this.getKey(),a=KU(this,o,t,e,n);if(s&&s.containsKey(a))return s.get(a);const l=this.createTile_(t,e,n,i,r,o);return s?.set(a,l),l}setRenderReprojectionEdges(t){this.renderReprojectionEdges_!=t&&(this.renderReprojectionEdges_=t,this.changed())}setTileGridForProjection(t,e){const n=hL(t);if(n){const t=Ok(n);t in this.tileGridForProjection||(this.tileGridForProjection[t]=e)}}}function Fq(t,e){if(Wk){const n=t.getCrossOrigin();let i="same-origin",r="same-origin";return"anonymous"===n||""===n?(i="cors",r="omit"):"use-credentials"===n&&(i="cors",r="include"),void fetch(e,{mode:i,credentials:r}).then(t=>{if(!t.ok)throw new Error(`HTTP ${t.status}`);return t.blob()}).then(t=>createImageBitmap(t)).then(e=>{const n=t.getImage();n.width=e.width,n.height=e.height,n.getContext("2d").drawImage(e,0,0),e.close?.(),n.dispatchEvent(new Event("load"))}).catch(()=>{t.getImage().dispatchEvent(new Event("error"))})}t.getImage().src=e}class jq extends zq{constructor(t){if(super({attributions:t.attributions,cacheSize:t.cacheSize,crossOrigin:t.crossOrigin,interpolate:t.interpolate,projection:hL("EPSG:3857"),reprojectionErrorThreshold:t.reprojectionErrorThreshold,state:"loading",tileLoadFunction:t.tileLoadFunction,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:t.zDirection}),this.tileJSON_=null,this.tileSize_=t.tileSize,t.url)if(t.jsonp)!function(t,e,n){const i=document.createElement("script"),r="olc_"+Ok(e);function s(){delete window[r],i.parentNode.removeChild(i)}i.async=!0,i.src=t+(t.includes("?")?"&":"?")+"callback="+r;const o=setTimeout(function(){s(),n&&n()},1e4);window[r]=function(t){clearTimeout(o),s(),e(t)},document.head.appendChild(i)}(t.url,this.handleTileJSONResponse.bind(this),this.handleTileJSONError.bind(this));else{const e=new XMLHttpRequest;e.addEventListener("load",this.onXHRLoad_.bind(this)),e.addEventListener("error",this.onXHRError_.bind(this)),e.open("GET",t.url),e.send()}else{if(!t.tileJSON)throw new Error("Either `url` or `tileJSON` options must be provided");this.handleTileJSONResponse(t.tileJSON)}}onXHRLoad_(t){const e=t.target;if(!e.status||e.status>=200&&e.status<300){let t;try{t=JSON.parse(e.responseText)}catch{return void this.handleTileJSONError()}this.handleTileJSONResponse(t)}else this.handleTileJSONError()}onXHRError_(t){this.handleTileJSONError()}getTileJSON(){return this.tileJSON_}handleTileJSONResponse(t){const e=hL("EPSG:4326"),n=this.getProjection();let i;if(void 0!==t.bounds){const r=yL(e,n);i=eT(t.bounds,r)}const r=yq(n),s=t.minzoom||0,o=gq({extent:r,maxZoom:t.maxzoom||22,minZoom:s,tileSize:this.tileSize_});if(this.tileGrid=o,this.tileUrlFunction=Oq(t.tiles,o),t.attribution&&!this.getAttributions()){const e=void 0!==i?i:r;this.setAttributions(function(n){return QE(e,n.extent)?[t.attribution]:null})}this.tileJSON_=t,this.setState("ready")}handleTileJSONError(){this.setState("error")}}class Dq extends Aq{constructor(t){const e=t.projection||"EPSG:3857",n=t.extent||yq(e),i=t.tileGrid||gq({extent:n,maxResolution:t.maxResolution,maxZoom:void 0!==t.maxZoom?t.maxZoom:22,minZoom:t.minZoom,tileSize:t.tileSize||512});super({attributions:t.attributions,attributionsCollapsible:t.attributionsCollapsible,cacheSize:t.cacheSize,interpolate:!0,projection:e,state:t.state,tileGrid:i,tileLoadFunction:t.tileLoadFunction?t.tileLoadFunction:Nq,tileUrlFunction:t.tileUrlFunction,url:t.url,urls:t.urls,wrapX:void 0===t.wrapX||t.wrapX,transition:t.transition,zDirection:void 0===t.zDirection?1:t.zDirection}),this.format_=t.format?t.format:null,this.tileKeysBySourceTileUrl_={},this.sourceTiles_={},this.overlaps_=null==t.overlaps||t.overlaps,this.tileClass=t.tileClass?t.tileClass:vB,this.tileGrids_={}}getOverlaps(){return this.overlaps_}getSourceTiles(t,e,n){if(0===n.getState()){n.setState(1);const i=n.wrappedTileCoord,r=this.getTileGridForProjection(e);let s=r.getTileCoordExtent(i);const o=i[0],a=r.getResolution(o);SE(s,-a,s);const l=this.projection;e&&this.projection&&!mL(e,l)&&(s=wL(s,e,l));const c=this.tileGrid,h=c.getExtent();h&&KE(s,h,s);let u=a;e&&l&&!mL(e,l)&&(u=a/l.getMetersPerUnit()/e.getMetersPerUnit());const d=c.getZForResolution(u,this.zDirection);c.forEachTileCoord(s,d,i=>{const r=this.tileUrlFunction(i,t,e);this.sourceTiles_[r]||(this.sourceTiles_[r]=new this.tileClass(i,r?0:4,r,this.format_,this.tileLoadFunction));const s=this.sourceTiles_[r];n.sourceTiles.push(s),this.tileKeysBySourceTileUrl_[r]||(this.tileKeysBySourceTileUrl_[r]=[]),this.tileKeysBySourceTileUrl_[r].push(n.getKey());const o=s.getState();if(o<2){const t=e=>{this.handleTileChange(e);const i=s.getState();if(2===i||3===i){const e=s.getKey();e in n.errorTileKeys?2===s.getState()&&delete n.errorTileKeys[e]:n.loadingSourceTiles--,3===i?n.errorTileKeys[e]=!0:s.removeEventListener(rk,t),0===n.loadingSourceTiles&&n.setState(Sk(n.errorTileKeys)?2:3)}};s.addEventListener(rk,t),n.loadingSourceTiles++}0===o&&(s.extent=c.getTileCoordExtent(i),s.projection=this.projection,s.resolution=c.getResolution(i[0]),s.load())}),n.loadingSourceTiles||n.setState(n.sourceTiles.some(t=>3===t.getState())?3:2)}return n.sourceTiles}removeSourceTiles(t){const e=t.getKey(),n=t.sourceTiles;for(let i=0,r=n.length;i<r;++i){const t=n[i].getTileUrl();if(!this.tileKeysBySourceTileUrl_[t])return;const r=this.tileKeysBySourceTileUrl_[t].indexOf(e);-1!==r&&(this.tileKeysBySourceTileUrl_[t].splice(r,1),0===this.tileKeysBySourceTileUrl_[t].length&&(delete this.tileKeysBySourceTileUrl_[t],delete this.sourceTiles_[t]))}}getTile(t,e,n,i,r){const s=[t,e,n];let o=this.getTileCoordForTileUrlFunction(s,r);const a=this.getTileGrid().getExtent(),l=this.projection,c=this.getTileGridForProjection(r);if(o&&a){const e=c.getTileCoordExtent(o);SE(e,-c.getResolution(t),e),QE(a,r&&l&&!mL(r,l)?wL(e,r,l):e)||(o=null)}let h=!0;if(null!==o){const e=this.tileGrid,n=c.getResolution(t);let s=n;r&&l&&!mL(r,l)&&(s=n/l.getMetersPerUnit()/r.getMetersPerUnit());const a=e.getZForResolution(s,1),u=c.getTileCoordExtent(o);SE(u,-n,u),e.forEachTileCoord(r&&l&&!mL(r,l)?wL(u,r,l):u,a,t=>{h=h&&!this.tileUrlFunction(t,i,l)})}const u=new yB(s,h?4:0,o,this.getSourceTiles.bind(this,i,r),this.removeSourceTiles.bind(this));return u.key=this.getKey(),u}getTileGridForProjection(t){const e=t.getCode();let n=this.tileGrids_[e];if(!n){const i=this.projection;if(null!==i&&!mL(i,t))return fq(t);const r=this.tileGrid,s=r.getResolutions().slice(),o=s.map(function(t,e){return r.getOrigin(e)}),a=s.map(function(t,e){return r.getTileSize(e)}),l=43;for(let t=s.length;t<l;++t)s.push(s[t-1]/2),o.push(o[t-1]),a.push(a[t-1]);n=new pq({extent:r.getExtent(),origins:o,resolutions:s,tileSizes:a}),this.tileGrids_[e]=n}return n}getTilePixelRatio(t){return t}getTilePixelSize(t,e,n){const i=HP(this.getTileGridForProjection(n).getTileSize(t),this.tmpSize);return[Math.round(i[0]*e),Math.round(i[1]*e)]}setOverlaps(t){this.overlaps_=t,this.changed()}}function Nq(t,e){t.setLoader(function(n,i,r){Vz(e,t.getFormat(),n,i,r,t.onLoad.bind(t),t.onError.bind(t))})}function Bq(t,e){const n=t[0],i=n.width,r=n.height,s=n.data,o=new Uint8ClampedArray(s.length),a=2*e.resolution,l=i-1,c=r-1,h=[0,0,0,0],u=2*Math.PI,d=Math.PI/2,p=Math.PI*e.sunEl/180,f=Math.PI*e.sunAz/180,g=Math.cos(p),m=Math.sin(p),y=e.highlightColor,v=e.shadowColor,_=e.accentColor,b=e.encoding;let w,x,C,S,k,E,T,L,M,R,P,I,O,A,z,F,j,D,N,B,U,q;function V(t,e="mapbox"){return"mapbox"===e?.1*(256*t[0]*256+256*t[1]+t[2])-1e4:"terrarium"===e?256*t[0]+t[1]+t[2]/256-32768:void 0}for(x=0;x<=c;++x)for(k=0===x?0:x-1,E=x===c?c:x+1,w=0;w<=l;++w)C=0===w?0:w-1,S=w===l?l:w+1,T=4*(x*i+C),h[0]=s[T],h[1]=s[T+1],h[2]=s[T+2],h[3]=s[T+3],L=e.vert*V(h,b),T=4*(x*i+S),h[0]=s[T],h[1]=s[T+1],h[2]=s[T+2],h[3]=s[T+3],M=e.vert*V(h,b),R=(M-L)/a,T=4*(k*i+w),h[0]=s[T],h[1]=s[T+1],h[2]=s[T+2],h[3]=s[T+3],L=e.vert*V(h,b),T=4*(E*i+w),h[0]=s[T],h[1]=s[T+1],h[2]=s[T+2],h[3]=s[T+3],M=e.vert*V(h,b),P=(M-L)/a,O=Math.atan2(P,-R),O=O<0?d-O:O>d?u-O+d:d-O,I=Math.atan(Math.sqrt(R*R+P*P)),q=m*Math.cos(I)+g*Math.sin(I)*Math.cos(f-O),A=Math.cos(I),z=255*q,N=Math.min(Math.max(2*e.sunEl,0),1),B=1.875-1.75*e.opacity,U=.5!==e.opacity?d*((Math.pow(B,I)-1)/(Math.pow(B,d)-1)):I,j={r:(1-A)*_.r*N*255,g:(1-A)*_.g*N*255,b:(1-A)*_.b*N*255,a:(1-A)*_.a*N*255},F=Math.abs(((O+f)/Math.PI+.5)%2-1),D={r:(y.r*(1-F)+v.r*F)*z,g:(y.g*(1-F)+v.g*F)*z,b:(y.b*(1-F)+v.b*F)*z,a:(y.a*(1-F)+v.a*F)*z},T=4*(x*i+w),o[T]=j.r*(1-F)+D.r,o[T+1]=j.g*(1-F)+D.g,o[T+2]=j.b*(1-F)+D.b,o[T+3]=s[T+3]*e.opacity*N*Math.sin(U);return new ImageData(o,i,r)}function Uq(t,e){const n=t[0],i=n.width,r=n.height,s=n.data,o=new Uint8ClampedArray(s.length),a=i-1,l=r-1,c=[0,0,0,0];let h,u,d;const p=(f=e.saturation)>0?1-1/(1.001-f):-f;var f;const g=(m=e.contrast)>0?1/(1-m):1+m;var m;const y=function(t){t*=Math.PI/180;const e=Math.sin(t),n=Math.cos(t);return[(2*n+1)/3,(-Math.sqrt(3)*e-n+1)/3,(Math.sqrt(3)*e-n+1)/3]}(e.hueRotate),v=y,_=[y[2],y[0],y[1]],b=[y[1],y[2],y[0]],w=e.brightnessLow,x=e.brightnessHigh;for(u=0;u<=l;++u)for(h=0;h<=a;++h){d=4*(u*i+h),c[0]=s[d],c[1]=s[d+1],c[2]=s[d+2],c[3]=s[d+3];const t=c[0],e=c[1],n=c[2],r=(t,e)=>{let n=0;for(let i=0;i<t.length;i++)n+=t[i]*e[i];return n};let a=r([t,e,n],v),l=r([t,e,n],_),f=r([t,e,n],b);const m=(a+l+f)/3;a+=(m-a)*p,l+=(m-l)*p,f+=(m-f)*p,a=(a-.5)*g+.5,l=(l-.5)*g+.5,f=(f-.5)*g+.5,a=w*(255-a)+x*a,l=w*(255-l)+x*l,f=w*(255-f)+x*f,o[d]=a,o[d+1]=l,o[d+2]=f,o[d+3]=c[3]}return new ImageData(o,i,r)}function qq(t,e=512){return t.getExtent()?gq({extent:t.getExtent(),tileSize:e,maxZoom:22}).getResolutions():IB}function Vq(t,e){return e.accessToken||(e=Object.assign({},e),new URL(t).searchParams.forEach((t,n)=>{e.accessToken=t,e.accessTokenParam=n})),e}function $q(t,e){let n;return t.some(function(t){if(t.id==e)return n=t.source,!0}),n}function Gq(t,e,n){const i=new jq({tileJSON:e,tileSize:t.tileSize||e.tileSize||512}),r=i.getTileJSON(),s=i.getTileGrid(),o=hL(n.projection||"EPSG:3857"),a=function(t,e){const n=t.bounds;if(n){const t=fL([n[0],n[1]],e),i=fL([n[2],n[3]],e);return[t[0],t[1],i[0],i[1]]}return hL(e).getExtent()}(r,o),l=o.getExtent(),c=r.minzoom||0,h=r.maxzoom||22,u={attributions:i.getAttributions(),projection:o,tileGrid:new pq({origin:l?YE(l):s.getOrigin(0),extent:a||s.getExtent(),minZoom:c,resolutions:qq(o,e.tileSize).slice(0,h+1),tileSize:s.getTileSize(0)})};return Array.isArray(r.tiles)?u.urls=r.tiles:u.url=r.tiles,u}function Wq(t,e,n){return new Promise(function(i,r){BB(t,e,n).then(function({tileJson:e,tileLoadFunction:r}){const s=Gq(t,e,n);s.tileLoadFunction=r,s.format=new TU({layerName:"mvt:layer"});const o=new Dq(s);o.set("mapbox-source",t),i(o)}).catch(r)})}function Hq(t){return`{bbox-${(t?t.getCode():"EPSG:3857").toLowerCase().replace(/[^a-z0-9]/g,"-")}}`}function Zq(t,e,n){const i=new iq;return function(t,e,n){return new Promise(function(i,r){BB(t,e,n).then(function({tileJson:e,tileLoadFunction:r}){const s=new jq({interpolate:void 0===n.interpolate||n.interpolate,transition:0,crossOrigin:"anonymous",tileJSON:e});s.tileGrid=Gq(t,e,n).tileGrid,n.projection&&(s.projection=hL(n.projection));const o=s.getTileUrlFunction();r&&s.setTileLoadFunction(r),s.setTileUrlFunction(function(t,e,n){const i=Hq(n);let r=o(t,e,n);if(-1!=r.indexOf(i)){const e=s.getTileGrid().getTileCoordExtent(t);r=r.replace(i,e.toString())}return r}),s.set("mapbox-source",t),i(s)}).catch(function(t){r(t)})})}(t,e,n).then(function(t){i.setSource(t)}).catch(function(){i.setSource(void 0)}),i}function Kq(t,e,n){const i=n.projection?new uF({dataProjection:n.projection}):new uF,r=t.data,s={};if("string"==typeof r){const[s]=SB(r,n.accessToken,n.accessTokenParam||"access_token",e||location.href);if(/\{bbox-[0-9a-z-]+\}/.test(s)){const e=(t,e,n)=>{const i=Hq(n);return s.replace(i,`${t.join(",")}`)},r=new iF({attributions:t.attribution,format:i,loader:(t,i,s,o,a)=>{jB("GeoJSON","function"==typeof e?e(t,i,s):e,n).then(t=>{const e=r.getFormat().readFeatures(t,{featureProjection:s});r.addFeatures(e),o(e)}).catch(()=>{r.removeLoadedExtent(t),a()})},strategy:Wz});return r.set("mapbox-source",t),r}const o=new iF({attributions:t.attribution,format:i,url:s,loader:(t,e,i,r,a)=>{jB("GeoJSON",s,n).then(t=>{const e=o.getFormat().readFeatures(t,{featureProjection:i});o.addFeatures(e),r(e)}).catch(()=>{o.removeLoadedExtent(t),a()})}});return o}s.features=i.readFeatures(r,{featureProjection:"EPSG:3857"});const o=new iF(Object.assign({attributions:t.attribution,format:i},s));return o.set("mapbox-source",t),o}function Yq(t,e,n,i){const r=RB(t),s=t.layers,o=n.type,a=n.source||$q(s,n.ref),l=t.sources[a];let c;if("background"==o)c=function(t,e,n){const i=Wk?{style:{}}:document.createElement("div");return i.className="ol-mapbox-style-background",i.style.position="absolute",i.style.width="100%",i.style.height="100%",new oP({source:new Jz({}),render(r){const s=function(t,e,n,i){const r={id:t.id,type:t.type},s=t.layout||{},o=t.paint||{};let a;r.paint=o,eU.zoom=AB(e,n.resolutions||IB),eU.distanceFromCenter=0;const l=rU(r,"paint","background-color",kB,i);return void 0!==o["background-opacity"]&&(a=rU(r,"paint","background-opacity",kB,i)),"none"==s.visibility?void 0:aU(l,a)}(t,r.viewState.resolution,e,n);return i.style.backgroundColor=s,i}})}(n,i,r);else if("vector"==l.type)c=function(t,e,n){const i=new aq({declutter:!0,visible:!1});return Wq(t,e,n).then(function(t){i.setSource(t)}).catch(function(){i.setSource(void 0)}),i}(l,e,i);else if("raster"==l.type){const t=["raster-saturation","raster-contrast","raster-brightness-max","raster-brightness-min","raster-hue-rotate"];Object.keys(n.paint||{}).find(e=>t.includes(e))?(c=function(t,e,n){const i=Zq(t,e,n);return new AU({source:new Sq({operationType:"image",operation:Uq,sources:[i]})})}(l,e,i),c.getSource().on("beforeoperations",function(t){eU.zoom=AB(t.resolution,i.resolutions||IB),eU.distanceFromCenter=0;const e=t.data;e.saturation=rU(n,"paint","raster-saturation",kB,r),e.contrast=rU(n,"paint","raster-contrast",kB,r),e.brightnessHigh=rU(n,"paint","raster-brightness-max",kB,r),e.brightnessLow=rU(n,"paint","raster-brightness-min",kB,r),e.hueRotate=rU(n,"paint","raster-hue-rotate",kB,r)})):c=Zq(l,e,i),c.setVisible(!n.layout||"none"!==n.layout.visibility),c.on("prerender",function(t,e,n){let i=null;return function(r){t.paint&&"raster-opacity"in t.paint&&r.frameState.viewState.zoom!==i&&(i=r.frameState.viewState.zoom,delete n[t.id],function(t,e,n,i){eU.zoom=n,eU.distanceFromCenter=0;const r=rU(t,"paint","raster-opacity",kB,i);e.setOpacity(r)}(t,e,i,n))}}(n,c,r))}else if("geojson"==l.type)c=function(t,e,n){return new qz({declutter:!0,source:Kq(t,e,n),visible:!1})}(l,e,i);else if("raster-dem"==l.type&&"hillshade"==n.type){const t=function(t,e,n){const i=Zq(t,e,n);return new AU({source:new Sq({operationType:"image",operation:Bq,sources:[i]})})}(l,e,i);c=t,t.getSource().on("beforeoperations",function(t){const e=t.data;e.resolution=uL(i.projection||"EPSG:3857",t.resolution,$E(t.extent),"m"),eU.zoom=AB(t.resolution,i.resolutions||IB),eU.distanceFromCenter=0,e.encoding=l.encoding,e.vert=5*rU(n,"paint","hillshade-exaggeration",kB,r),e.sunAz=rU(n,"paint","hillshade-illumination-direction",kB,r),e.sunEl=35,e.opacity=.3,e.highlightColor=rU(n,"paint","hillshade-highlight-color",kB,r),e.shadowColor=rU(n,"paint","hillshade-shadow-color",kB,r),e.accentColor=rU(n,"paint","hillshade-accent-color",kB,r)}),c.setVisible(!n.layout||"none"!==n.layout.visibility)}const h=a;return c&&c.set("mapbox-source",h),c}function Xq(t,e,n,i,r,s={}){let o=24,a=0;const l=n.layers;for(let c=0,h=l.length;c<h;++c){const t=l[c];-1!==e.indexOf(t.id)&&(o=Math.min("minzoom"in t?t.minzoom:0,o),a=Math.max("maxzoom"in t?t.maxzoom:24,a))}return new Promise(function(l,c){const h=function(){const h=t.getSource();if(h&&"error"!==h.getState()){if("getTileGrid"in h){const e=h.getTileGrid();if(e){const n=e.getMinZoom();(o>0||n>0)&&t.setMaxResolution(Math.min(zB(Math.max(0,o-1e-12),IB),zB(Math.max(0,n-1e-12),e.getResolutions()))),a<24&&t.setMinResolution(zB(a,IB))}}else o>0&&t.setMaxResolution(zB(Math.max(0,o-1e-12),IB));h instanceof iF||h instanceof Dq?function(t,e,n="",i={},r){let s,o,a,l,c=!0;return"string"==typeof n||Array.isArray(n)?l=n:(a=n,l=a.source||a.layers,i=a),"string"==typeof i?(s=i,a={}):(s=i.styleUrl,a=i),!1===a.updateSource&&(c=!1),r||(r=a.resolutions),s||"string"!=typeof e||e.trim().startsWith("{")||(s=e),s&&(s=s.startsWith("data:")?location.href:xB(s,a.accessToken),a=Vq(s,a)),new Promise(function(n,i){DB(e,a).then(function(e){if(8!=e.version)return i(new Error("glStyle version 8 required."));if(!(t instanceof qz||t instanceof aq))return i(new Error("Can only apply to VectorLayer or VectorTileLayer"));const h=t instanceof aq?"vector":"geojson";if(l?o=Array.isArray(l)?e.layers.find(function(t){return t.id===l[0]}).source:l:(o=e.layers.find(function(t){return t.source&&e.sources[t.source].type===h}).source,l=o),!o)return i(new Error(`No ${h} source found in the glStyle.`));function u(){if(!c)return Promise.resolve();if(t instanceof aq)return Wq(e.sources[o],s,a).then(function(e){const n=t.getSource();n?e!==n&&(n.setTileUrlFunction(e.getTileUrlFunction()),"function"==typeof n.setUrls&&"function"==typeof e.getUrls&&n.setUrls(e.getUrls()),n.format_||(n.format_=e.format_),n.getAttributions()||n.setAttributions(e.getAttributions()),n.getTileLoadFunction()===Nq&&n.setTileLoadFunction(e.getTileLoadFunction()),mL(n.getProjection(),e.getProjection())&&(n.tileGrid=e.getTileGrid())):t.setSource(e);const i=t.getSource().getTileGrid();!isFinite(t.getMaxResolution())&&!isFinite(t.getMinZoom())&&i.getMinZoom()>0&&t.setMaxResolution(zB(Math.max(0,i.getMinZoom()-1e-12),i.getResolutions()))});const n=e.sources[o];let i=t.getSource();i&&i.get("mapbox-source")===n||(i=Kq(n,s,a));const r=t.getSource();return r?i!==r&&(r.getAttributions()||r.setAttributions(i.getAttributions()),r.format_||(r.format_=i.getFormat()),r.url_=i.getUrl()):t.setSource(i),Promise.resolve()}let d,p;const f={},g={};function m(){if(p||e.sprite&&!f)p?(t.setStyle(p),u().then(n).catch(i)):i(new Error("Something went wrong trying to apply style."));else{if(a.projection&&!r){const t=hL(a.projection).getUnits();"m"!==t&&(r=IB.map(e=>e/gT[t]))}let s;const c=t.getSource();c instanceof Dq&&c.format_ instanceof TU&&(s=c.format_.layerName_),p=function(t,e,n,i=IB,r,s,o,a){if("string"==typeof e&&(e=JSON.parse(e)),8!=e.version)throw new Error("glStyle version 8 required.");uU[function(t,e){return MB(t)+"."+Ok(e)}(e,t)]=Array.from(arguments);const l={};("string"==typeof s||s instanceof Request||s instanceof Response||s instanceof Promise)&&(s={default:s});for(const w in s){const e=s[w];xk(()=>e).then(async e=>{let n;if("undefined"!=typeof Image){const i=new Image;if("string"==typeof e)i.crossOrigin="anonymous",i.src=e;else{let t;e instanceof Request?t=await fetch(e):e instanceof Response&&(t=e);const r=await t.blob();n=URL.createObjectURL(r),i.src=n}i.addEventListener("load",function e(){i.removeEventListener("load",e),l[w]={image:i,size:[i.width,i.height]},t.changed(),n&&URL.revokeObjectURL(n)}),i.addEventListener("error",function t(){URL.revokeObjectURL(n),i.removeEventListener("error",t)})}else if("undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope){const t=self;t.postMessage({action:"loadImage",src:e}),t.addEventListener("message",function(t){"imageLoaded"===t.data.action&&t.data.src===e&&(l[w]={image:t.data.image,size:[t.data.image.width,t.data.image.height]})})}})}const c=LF(e.layers),h={},u=[],d={},p={},f=RB(e),g=function(t){let e=TB[t.id];return e||(e={},TB[MB(t)]=e),e}(e);let m;for(let w=0,x=c.length;w<x;++w){const t=c[w],i=t.id;if("string"==typeof n&&t.source==n||Array.isArray(n)&&-1!==n.indexOf(i)){const n=t["source-layer"];if(m){if(t.source!==m)throw new Error(`Layer "${i}" does not use source "${m}`)}else{m=t.source;const n=e.sources[m];if(!n)throw new Error(`Source "${m}" is not defined`);const i=n.type;if("vector"!==i&&"geojson"!==i)throw new Error(`Source "${m}" is not of type "vector" or "geojson", but "${i}"`)}let r=h[n];r||(r=[],h[n]=r),r.push({layer:t,index:w}),u.push(i)}}const y=new XO,v=new ZO,_=[],b=function(n,s,c){const u=t.getSource?.()?.format_?.layerName_??"mvt:layer",m=n.getProperties(),b=h[m[u]];if(!b)return;let w=i.indexOf(s);-1==w&&(w=AB(s,i)),eU.zoom=w,eU.distanceFromCenter=0;const x=n.getGeometry(),C=QB[x.getType()],S=t.get("map");if(S&&S instanceof AA&&1===C){const t=S.getSize();if(t){const e=S.getView().getCenter(),n=$E(x.getExtent());eU.distanceFromCenter=(k=e,E=n,Math.sqrt(function(t,e){const n=t[0]-e[0],i=t[1]-e[1];return n*n+i*i}(k,E))/s/t[1])}}var k,E;const T={id:n.getId(),properties:m,type:C},L=t.get("mapbox-featurestate")[n.getId()];let M=-1;for(let i=0,h=b.length;i<h;++i){const h=b[i],u=h.layer,x=u.id;if(void 0!==c&&c!==x)continue;const S=u.layout||kB,k=u.paint||kB;if("none"===S.visibility||"minzoom"in u&&w<u.minzoom||"maxzoom"in u&&w>=u.maxzoom)continue;const E=u.filter;if(!E||oU(x,E,T,g)){let i,c,g,b,w,x;const E=h.index;if(3==C&&("fill"==u.type||"fill-extrusion"==u.type))if(c=rU(u,"paint",u.type+"-opacity",T,f,L),u.type+"-pattern"in k){const t=rU(u,"paint",u.type+"-pattern",T,f,L);if(t){const e="string"==typeof t?cU(t,m):t.toString(),n=hU(e,l);if(r&&r[e]&&n){++M,x=_[M],x&&x.getFill()&&!x.getStroke()&&!x.getText()||(x=new JO({fill:new ZO}),_[M]=x),g=x.getFill(),x.setZIndex(E);const t=e+"."+c;let i=p[t];if(!i){const s=r[e],o=OB(s.width,s.height),a=o.getContext("2d");a.globalAlpha=c,a.drawImage(n.image,s.x,s.y,s.width,s.height,0,0,s.width,s.height),i=a.createPattern(o,"repeat"),p[t]=i}g.setColor(i)}}}else i=aU(rU(u,"paint",u.type+"-color",T,f,L),c),u.type+"-outline-color"in k&&(w=aU(rU(u,"paint",u.type+"-outline-color",T,f,L),c)),w||(w=i),(i||w)&&(++M,x=_[M],(!x||i&&!x.getFill()||!i&&x.getFill()||w&&!x.getStroke()||!w&&x.getStroke()||x.getText())&&(x=new JO({fill:i?new ZO:void 0,stroke:w?new XO:void 0}),_[M]=x),i&&(g=x.getFill(),g.setColor(i)),w&&(b=x.getStroke(),b.setColor(w),b.setWidth(.5)),x.setZIndex(E));if(1!=C&&"line"==u.type){i="line-pattern"in k?void 0:aU(rU(u,"paint","line-color",T,f,L),rU(u,"paint","line-opacity",T,f,L));const t=rU(u,"paint","line-width",T,f,L);i&&t>0&&(++M,x=_[M],x&&x.getStroke()&&!x.getFill()&&!x.getText()||(x=new JO({stroke:new XO}),_[M]=x),b=x.getStroke(),b.setLineCap(rU(u,"layout","line-cap",T,f,L)),b.setLineJoin(rU(u,"layout","line-join",T,f,L)),b.setMiterLimit(rU(u,"layout","line-miter-limit",T,f,L)),b.setColor(i),b.setWidth(t),b.setLineDash(k["line-dasharray"]?rU(u,"paint","line-dasharray",T,f,L).map(function(e){return e*t}):null),x.setZIndex(E))}let R,P,I,O,A,z,F,j,D,N=!1,B=null,U=0;if((1==C||2==C)&&"icon-image"in S){const e=rU(u,"layout","icon-image",T,f,L);if(e){let i;R="string"==typeof e?cU(e,m):e.toString();const o=a?a(t,R):void 0,c=hU(R,l);if(r&&r[R]&&c||o){const t=rU(u,"layout","icon-rotation-alignment",T,f,L);if(2==C){const e=n.getGeometry();if(e.getFlatMidpoint||e.getFlatMidpoints){const n=e.getExtent();if(Math.sqrt(Math.max(Math.pow((n[2]-n[0])/s,2),Math.pow((n[3]-n[1])/s,2)))>150){const n="MultiLineString"===e.getType()?e.getFlatMidpoints():e.getFlatMidpoint();if(iU||(nU=[NaN,NaN],iU=new Yz("Point",nU,[],2,{},void 0)),i=iU,nU[0]=n[0],nU[1]=n[1],"line"===rU(u,"layout","symbol-placement",T,f,L)&&"map"===t){const t=e.getStride(),i=e.getFlatCoordinates();for(let e=0,r=i.length-t;e<r;e+=t){const r=i[e],s=i[e+1],o=i[e+t],a=i[e+t+1],l=Math.min(r,o),c=Math.max(r,o),h=n[0],u=(a-s)*(h-r)-(o-r)*(n[1]-s);if(Math.abs(u)<.001&&h<=c&&h>=l){U=Math.atan2(s-a,o-r);break}}}}}}if(2!==C||i){const e=rU(u,"layout","icon-size",T,f,L),n=void 0!==k["icon-color"]?rU(u,"paint","icon-color",T,f,L):null;if(!n||0!==n.a){const i=rU(u,"paint","icon-halo-color",T,f,L),s=rU(u,"paint","icon-halo-width",T,f,L);let a=`${R}.${e}.${s}.${i}`;if(null!==n&&(a+=`.${n}`),P=d[a],!P){const l=sU(u,T,"icon",f);let h;"icon-offset"in S&&(h=rU(u,"layout","icon-offset",T,f,L).slice(0),h[0]*=e,h[1]*=-e);let p=n?[255*n.r,255*n.g,255*n.b,n.a]:void 0;if(o){const n={color:p,rotateWithView:"map"===t,displacement:h,declutterMode:l,scale:e};"string"==typeof o?n.src=o:(n.img=o,n.imgSize=[o.width,o.height]),P=new YO(n)}else{const o=r[R];let a,u,d;if(s)o.sdf?(a=UB(VB(c.image,o,n||[0,0,0,1]),{x:0,y:0,width:o.width,height:o.height,pixelRatio:o.pixelRatio},s,i),p=void 0):a=UB(c.image,o,s,i);else{if(o.sdf&&!c.unSDFed){const t=VB(c.image,{x:0,y:0,width:c.size[0],height:c.size[1]},{r:1,g:1,b:1});c.image=t,c.unSDFed=!0}a=c.image,u=[o.width,o.height],d=[o.x,o.y]}P=new YO({color:p,img:a,imgSize:c.size,size:u,offset:d,rotateWithView:"map"===t,scale:e/o.pixelRatio,displacement:h,declutterMode:l})}d[a]=P}}P&&(++M,x=_[M],x&&x.getImage()&&!x.getFill()&&!x.getStroke()||(x=new JO,_[M]=x),x.setGeometry(i),P.setRotation(U+PB(rU(u,"layout","icon-rotate",T,f,L))),P.setOpacity(rU(u,"paint","icon-opacity",T,f,L)),P.setAnchor(tU[rU(u,"layout","icon-anchor",T,f,L)]),x.setImage(P),B=x.getText(),x.setText(void 0),x.setZIndex(E),N=!0,I=!1)}else I=!0}}}if(1==C&&"circle"===u.type){++M,x=_[M],x&&x.getImage()&&!x.getFill()&&!x.getStroke()||(x=new JO,_[M]=x);const t="circle-radius"in k?rU(u,"paint","circle-radius",T,f,L):5,e=aU(rU(u,"paint","circle-stroke-color",T,f,L),rU(u,"paint","circle-stroke-opacity",T,f,L)),n=rU(u,"paint","circle-translate",T,f,L),i=aU(rU(u,"paint","circle-color",T,f,L),rU(u,"paint","circle-opacity",T,f,L)),r=rU(u,"paint","circle-stroke-width",T,f,L),s=t+"."+e+"."+i+"."+r+"."+n[0]+"."+n[1];P=d[s],P||(P=new HO({radius:t,displacement:[n[0],-n[1]],stroke:e&&r>0?new XO({width:r,color:e}):void 0,fill:i?new ZO({color:i}):void 0,declutterMode:"none"}),d[s]=P),x.setImage(P),B=x.getText(),x.setText(void 0),x.setGeometry(void 0),x.setZIndex(E),N=!0}if("text-field"in S){F=Math.round(rU(u,"layout","text-size",T,f,L));const t=rU(u,"layout","text-font",T,f,L);z=rU(u,"layout","text-line-height",T,f,L),A=hB(o?o(t,e.metadata?e.metadata["ol:webfonts"]:void 0):t,F,z),A.includes("sans-serif")||(A+=",sans-serif"),j=rU(u,"layout","text-letter-spacing",T,f,L),D=rU(u,"layout","text-max-width",T,f,L);const n=rU(u,"layout","text-field",T,f,L);O="object"==typeof n&&n.sections?1===n.sections.length?n.toString():n.sections.reduce((e,n)=>{const i=n.fontStack?n.fontStack.split(","):t,r=hB(o?o(i):i,F*(n.scale||1),z);let s=n.text;if("\n"===s)return e.push("\n",""),e;if(2==C)return e.push(GB(s,j),r),e;s=YB(s,r,D,j).split("\n");for(let t=0,o=s.length;t<o;++t)t>0&&e.push("\n",""),e.push(s[t],r);return e},[]):cU(n,m).trim(),c=rU(u,"paint","text-opacity",T,f,L)}if(O&&c&&!I){N||(++M,x=_[M],x&&x.getText()&&!x.getFill()&&!x.getStroke()||(x=new JO,_[M]=x),x.setImage(void 0),x.setGeometry(void 0));const t=sU(u,T,"text",f);x.getText()||x.setText(B),B=x.getText(),(!B||"getDeclutterMode"in B&&B.getDeclutterMode()!==t)&&(B=new nA({padding:[2,2,2,2],declutterMode:t}),x.setText(B));const e=rU(u,"layout","text-transform",T,f,L);"uppercase"==e?O=Array.isArray(O)?O.map((t,e)=>e%2?t:t.toUpperCase()):O.toUpperCase():"lowercase"==e&&(O=Array.isArray(O)?O.map((t,e)=>e%2?t:t.toLowerCase()):O.toLowerCase());const n=Array.isArray(O)?O:2==C?GB(O,j):YB(O,A,D,j);if(B.setText(n),B.setFont(A),B.setRotation(PB(rU(u,"layout","text-rotate",T,f,L))),"function"==typeof B.setKeepUpright){const t=rU(u,"layout","text-keep-upright",T,f,L);B.setKeepUpright(t)}const i=rU(u,"layout","text-anchor",T,f,L),r=N||1==C?"point":rU(u,"layout","symbol-placement",T,f,L);let s;if("line-center"===r?(B.setPlacement("line"),s="center"):B.setPlacement(r),"line"===r&&"function"==typeof B.setRepeat){const t=rU(u,"layout","symbol-spacing",T,f,L);B.setRepeat(2*t)}B.setOverflow("point"===r);let o=rU(u,"paint","text-halo-width",T,f,L);const a=rU(u,"layout","text-offset",T,f,L),l=rU(u,"paint","text-translate",T,f,L);let h=0,d=0;if("point"==r){s="center",-1!==i.indexOf("left")?(s="left",d=o):-1!==i.indexOf("right")&&(s="right",d=-o);const t=rU(u,"layout","text-rotation-alignment",T,f,L);B.setRotateWithView("map"==t)}else B.setMaxAngle(PB(rU(u,"layout","text-max-angle",T,f,L))*O.length/n.length),B.setRotateWithView(!1);B.setTextAlign(s);let p="middle";0==i.indexOf("bottom")?(p="bottom",h=-o-.5*(z-1)*F):0==i.indexOf("top")&&(p="top",h=o+.5*(z-1)*F),B.setTextBaseline(p);const g=rU(u,"layout","text-justify",T,f,L);B.setJustify("auto"===g?void 0:g),B.setOffsetX(a[0]*F+d+l[0]),B.setOffsetY(a[1]*F+h+l[1]),v.setColor(aU(rU(u,"paint","text-color",T,f,L),c)),B.setFill(v);const m=aU(rU(u,"paint","text-halo-color",T,f,L),c);if(m&&o>0){y.setColor(m),o*=2;const t=.5*F;y.setWidth(o<=t?o:t),B.setStroke(y)}else B.setStroke(void 0);const b=rU(u,"layout","text-padding",T,f,L),w=B.getPadding();b!==w[0]&&(w[0]=b,w[1]=b,w[2]=b,w[3]=b),x.setZIndex(E)}}}return M>-1?(_.length=M+1,_):void 0};return t.setStyle(b),t.set("mapbox-layers",u),t.set("mapbox-source",m),t.set("mapbox-featurestate",t.get("mapbox-featurestate")||{}),b}(t,e,l,r,f,g,(t,e=a.webfonts)=>function(t,e="https://cdn.jsdelivr.net/npm/@fontsource/{font-family}/{fontweight}{-fontstyle}.css"){if(Wk)return t;let n;for(let i=0,r=t.length;i<r;++i){const e=t[i];if(e in JB)continue;JB[e]=!0;const r=hB(e,16).split(" ");n||(n=[]),n.push([r.slice(3).join(" ").replace(/"/g,""),r[1],r[0]])}return n?((async()=>{await document.fonts.ready;for(let t=0,i=n.length;t<i;++t){const i=n[t],r=i[0];if(XB.includes(r))continue;const s=i[1],o=i[2];if(!(await document.fonts.load(`${o} ${s} 16px "${r}"`)).some(t=>t.family.replace(/^['"]|['"]$/g,"").toLowerCase()===r.toLowerCase()&&t.weight==s&&t.style===o)){const t=e.replace("{font-family}",r.replace(/ /g,"-").toLowerCase()).replace("{Font+Family}",r.replace(/ /g,"+")).replace("{fontweight}",s).replace("{-fontstyle}",o.replace("normal","").replace(/(.+)/,"-$1")).replace("{fontstyle}",o);if(!document.querySelector('link[href="'+t+'"]')){const e=document.createElement("link");e.href=t,e.rel="stylesheet",document.head.appendChild(e)}}}})(),t):t}(t,e),a.getImage,s),t.getStyle()?u().then(n).catch(i):i(new Error(`Nothing to show for source [${o}]`))}}if(e.sprite){const t=function(t,e,n){if("string"==typeof t)return[{id:"default",url:wB(t,e,n)}];for(const i of t)i.url=wB(i.url,e,n);return t}(e.sprite,a.accessToken,s||location.href);d=Wk?1:window.devicePixelRatio>=1.5?.5:1;const n=.5==d?"@2x":"";Promise.all(t.map(function(t){const e=new URL(t.url);let r=e.origin+e.pathname+n+".json"+e.search;return new Promise(function(t,n){jB("Sprite",r,a).then(t).catch(function(){r=e.origin+e.pathname+".json"+e.search,jB("Sprite",r,a).then(t).catch(n)})}).then(function(r){let s;if(void 0===r&&i(new Error("No sprites found.")),s=e.origin+e.pathname+n+".png"+e.search,a.transformRequest){const t=a.transformRequest(s,"SpriteImage")||s;(t instanceof Request||t instanceof Promise)&&(s=t)}g[t.id]=s;for(const e in r){const n="default"==t.id?e:`${t.id}:${e}`;f[n]=r[e]}}).catch(function(t){i(new Error(`Sprites cannot be loaded: ${r}: ${t.message}`))})})).then(m).catch(i)}else m()}).catch(i)})}(t,n,e,Object.assign({styleUrl:i},s)).then(function(){!function(t,e){function n(){const n=e.get("mapbox-style");if(!n)return;const i=LF(n.layers),r=t.get("mapbox-layers"),s=i.filter(function(t){return r.includes(t.id)}).some(function(t){return!t.layout||!t.layout.visibility||"visible"===t.layout.visibility});t.get("visible")!==s&&t.setVisible(s)}t.on("change",n),n()}(t,r),l()}).catch(c):l()}else c(new Error("Error accessing data for source "+t.get("mapbox-source")))};t.set("mapbox-layers",e);const u=r.getLayers();-1===u.getArray().indexOf(t)&&u.push(t),t.getSource()?h():t.once("change:source",h)})}class Jq extends MS{static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"settings",[qf])}#q=void Px(this,"settings");mapInstance;bookmarkSource;searchResultsSource;selectedShapeSource;searchOverlay;searchOverlayElement;selectedPinOverlay;selectedPinElement;crosshairElement;crosshairOverlay;ignoreNextMapClick=!1;setupMap=BS(t=>{if(this.mapInstance)return;const e=new eP;this.selectedShapeSource=new iF;const n=new qz({source:this.selectedShapeSource,style:new JO({stroke:new XO({color:"#3388ff",width:4}),fill:new ZO({color:"rgba(51, 136, 255, 0.1)"})}),zIndex:5});this.bookmarkSource=new iF;const i=new qz({source:this.bookmarkSource,style:t=>{const e=t.get("originalPlace");let n=getComputedStyle(document.documentElement).getPropertyValue("--default-list-color").trim()||"#000000";if(e&&e._listIds&&e._listIds.length>0){const t=e._listIds[0],i=this.storage.lists.find(e=>e.id===t);i&&i.color&&(n=i.color)}return[new JO({image:new HO({radius:10,fill:new ZO({color:"rgba(0, 0, 0, 0.2)"}),displacement:[0,-2]})}),new JO({image:new HO({radius:9,fill:new ZO({color:n}),stroke:new XO({color:"#fff",width:2})})})]},zIndex:10});this.searchResultsSource=new iF;const r=new Map,s=new qz({source:this.searchResultsSource,style:t=>{const e=t.get("originalPlace"),n=iS(e.osmTags||e),i=n||"default";if(!r.has(i)){const t=getComputedStyle(document.documentElement).getPropertyValue("--marker-color-primary").trim()||"#ea4335";let e=`<circle cx="12" cy="12" r="8" fill="${t}"/>`;if(n){const i=QC(n);if(i){let n=i.trim();const r=n.indexOf("<svg"),s=n.indexOf(">",r)+1,o=n.lastIndexOf("</svg>");-1!==r&&-1!==o&&(n=n.substring(s,o)),e=`\n <circle cx="12" cy="12" r="8" fill="${t}"/>\n <g transform="translate(6, 6) scale(0.8)" fill="white">\n ${n}\n </g>\n `}}const s=`\n <svg xmlns="http://www.w3.org/2000/svg" viewBox="-4 -4 32 40" width="40" height="50">\n <defs>\n <filter id="shadow" x="-50%" y="-50%" width="200%" height="200%">\n <feDropShadow dx="0" dy="2" stdDeviation="1.5" flood-color="black" flood-opacity="0.3"/>\n </filter>\n </defs>\n <path d="M12 2C6.5 2 2 6.5 2 12C2 17.5 12 24 12 24C12 24 22 17.5 22 12C22 6.5 17.5 2 12 2Z" fill="white" filter="url(#shadow)"/>\n ${e}\n </svg>\n `;r.set(i,"data:image/svg+xml;charset=utf-8,"+encodeURIComponent(s.trim()))}return new JO({image:new YO({src:r.get(i),anchor:[.5,.65],scale:1})})},zIndex:11});let o=[14.21683569,27.060114248],a=2.661,l=!1;try{const t=localStorage.getItem("marco:map-view");if(t){const e=JSON.parse(t);e.center&&Array.isArray(e.center)&&2===e.center.length&&"number"==typeof e.zoom&&(o=e.center,a=e.zoom,l=!0)}}catch(k){console.warn("Failed to restore map view:",k)}const c=new zM({center:fL(o),zoom:a,projection:"EPSG:3857"});this.mapInstance=new AA({target:t,layers:[e,n,s,i],view:c,controls:aR({zoom:!0,rotate:!0,attribution:!0}),interactions:BR({dragPan:!1})});const h=gL(c.getCenter());this.mapUi.updateCenter(h[1],h[0]),function(t,e,n={}){let i,r;if(Wk){if(!(t instanceof AA||t instanceof eP))throw new Error("ol-mapbox-style in a web worker requires a Map or a LayerGroup as first argument");r=t}else r="string"==typeof t||t instanceof HTMLElement?new AA({target:t}):t;{const t=e.startsWith("data:")?location.href:xB(e,n.accessToken);n=Vq(t,n),i=new Promise(function(i,s){DB(e,n).then(function(e){(function(t,e,n,i){const r=[];let s=null;if(e instanceof AA){if(s=e.getView(),!s.isDef()&&!s.getRotation()&&!s.getResolutions()){const t=i.projection?hL(i.projection):s.getProjection();s=new zM(Object.assign(s.getProperties(),{maxResolution:IB[0]/gT[t.getUnits()],projection:i.projection||s.getProjection()})),e.setView(s)}"center"in t&&!s.getCenter()&&s.setCenter(fL(t.center,s.getProjection())),"zoom"in t&&void 0===s.getZoom()&&s.setResolution(IB[0]/gT[s.getProjection().getUnits()]/Math.pow(2,t.zoom)),s.getCenter()&&void 0!==s.getZoom()||s.fit(s.getProjection().getExtent(),{nearest:!0,size:e.getSize()})}e.set("mapbox-style",t),e.set("mapbox-metadata",{styleUrl:n,options:i});const o=t.layers;let a,l,c,h=[];for(let u=0,d=o.length;u<d;++u){const s=o[u],d=s.type;"heatmap"!=d?(c=s.source||$q(o,s.ref),c&&c==l||(h.length&&(r.push(Xq(a,h,t,n,e,i)),h=[]),a=Yq(t,n,s,i),a instanceof qz||a instanceof aq||(h=[]),l=a.get("mapbox-source")),h.push(s.id)):console.debug(`layers[${u}].type "${d}" not supported`)}return r.push(Xq(a,h,t,n,e,i)),Promise.all(r)})(e,r,t,n).then(function(){i(r)}).catch(s)}).catch(function(t){s(new Error(`Could not load ${e}: ${t.message}`))})})}}(this.mapInstance,"https://tiles.openfreemap.org/styles/liberty"),this.searchOverlayElement=document.createElement("div"),this.searchOverlayElement.className="search-pulse",this.searchOverlay=new BA({element:this.searchOverlayElement,positioning:"center-center",stopEvent:!1}),this.mapInstance.addOverlay(this.searchOverlay),this.selectedPinElement=document.createElement("div"),this.selectedPinElement.className="selected-pin-container";const u=document.createElement("div");u.className="selected-pin",u.innerHTML='<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"><path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z"></path><circle cx="12" cy="10" r="3" style="fill: var(--marker-color-dark); stroke: none;"></circle></svg>';const d=document.createElement("div");d.className="selected-pin-shadow",this.selectedPinElement.appendChild(u),this.selectedPinElement.appendChild(d),this.selectedPinOverlay=new BA({element:this.selectedPinElement,positioning:"bottom-center",stopEvent:!1}),this.mapInstance.addOverlay(this.selectedPinOverlay),this.crosshairElement=document.createElement("div"),this.crosshairElement.className="map-crosshair",this.crosshairElement.innerHTML='\n <svg width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">\n <line x1="12" y1="5" x2="12" y2="19"></line>\n <line x1="5" y1="12" x2="19" y2="12"></line>\n </svg>\n ',t.appendChild(this.crosshairElement),this.locationOverlayElement=document.createElement("div"),this.locationOverlayElement.className="search-pulse blue",this.locationOverlay=new BA({element:this.locationOverlayElement,positioning:"center-center",stopEvent:!1}),this.mapInstance.addOverlay(this.locationOverlay),t.addEventListener("pointerdown",()=>{this.mapUi.searchBoxHasFocus&&(this.ignoreNextMapClick=!0)},!0);const p=new kF({trackingOptions:{enableHighAccuracy:!0},projection:c.getProjection()}),f=new UA;f.setStyle(new JO({image:new HO({radius:6,fill:new ZO({color:"#3399CC"}),stroke:new XO({color:"#fff",width:2})})}));const g=new iF({features:[f]}),m=new qz({source:g,zIndex:15});p.on("change:position",function(){const t=p.getPosition();f.setGeometry(t?new uM(t):null)});const y=document.createElement("div");y.className="ol-control ol-locate";const v=document.createElement("button");let _,b;v.innerHTML="⊙",v.title="Locate Me",y.appendChild(v);const w=()=>{_&&(clearTimeout(_),_=null);try{b&&(p.un("change:position",x),b=null)}catch{}this.locationOverlayElement&&this.locationOverlayElement.classList.remove("active")},x=()=>{const t=p.getPosition(),e=p.getAccuracyGeometry(),n=p.getAccuracy();if(console.debug("Geolocation change:",{coordinates:t,accuracy:n}),!t)return;const i=this.mapInstance.getSize(),r=this.mapInstance.getView();let s=null;if(this.locationOverlayElement){const e=r.getResolution(),i=2*(n||50)/uL(r.getProjection(),e,t);this.locationOverlayElement.style.width=`${i}px`,this.locationOverlayElement.style.height=`${i}px`,this.locationOverlay.setPosition(t)}if(n&&n<=20&&w(),e){const t=e.getExtent();s=3.162*r.getResolutionForExtent(t,i)}else n&&(s=6.325*n/Math.min(i[0],i[1])/uL(r.getProjection(),1,t));let o={center:t,duration:1e3};if(s){const t=r.getResolutionForZoom(17);o.resolution=Math.max(s,t)}else o.zoom=16;this.mapInstance.getView().animate(o)},C=()=>{console.debug("Getting current geolocation..."),w(),p.setTracking(!0);const t=p.getPosition();this.locationOverlayElement&&this.locationOverlayElement.classList.add("active"),t&&x(),b=p.on("change:position",x),_=setTimeout(()=>{w()},1e4)};v.addEventListener("click",C);const S=new iR({element:y});this.mapInstance.addLayer(m),this.mapInstance.addControl(S),l||"index"!==this.router.currentRouteName||C(),this.mapInstance.on("singleclick",this.handleMapClick),this.mapInstance.on("moveend",this.handleMapMove),this.mapInstance.on("pointermove",t=>{const e=this.mapInstance.getEventPixel(t.originalEvent),n=this.mapInstance.hasFeatureAtPixel(e,{hitTolerance:10});this.mapInstance.getTarget().style.cursor=n?"pointer":""}),this.storage.rs.on("ready",()=>{this.handleMapMove()})});updateInteractions=BS(()=>{if(!this.mapInstance)return;this.mapInstance.getInteractions().getArray().slice().forEach(t=>{t instanceof kR&&this.mapInstance.removeInteraction(t)});const t=!!this.settings.mapKinetic&&new lR(-.005,.05,100);this.settings.mapKinetic&&window.innerWidth<=768&&(t.minVelocity_=.25),this.mapInstance.addInteraction(new kR({kinetic:t}))});updateSearchResults=BS(()=>{if(!this.searchResultsSource)return;this.searchResultsSource.clear();const t=this.mapUi.searchResults;if(!t||0===t.length)return;const e=[];t.forEach(t=>{if(t.lat&&t.lon){const n=new UA({geometry:new uM(fL([t.lon,t.lat])),name:t.title,id:t.id,isSearchResult:!0,originalPlace:t});e.push(n)}}),e.length>0&&this.searchResultsSource.addFeatures(e)});updateSelectedPin=BS(()=>{const t=this.mapUi.selectedPlace,e=this.mapUi.selectionOptions||{};if(this.selectedPinOverlay&&this.selectedPinElement)if(this.selectedShapeSource&&this.selectedShapeSource.clear(),t&&t.lat&&t.lon){const i=fL([t.lon,t.lat]);if(this.selectedPinOverlay.setPosition(i),this.selectedPinElement.classList.remove("active"),this.selectedPinElement.offsetWidth,this.selectedPinElement.classList.add("active"),t.geojson&&this.selectedShapeSource)try{const e=(new uF).readFeature(t.geojson,{featureProjection:"EPSG:3857"});this.selectedShapeSource.addFeature(e)}catch(n){console.warn("Failed to render selected place shape:",n)}e.preventZoom?this.handlePinVisibility(i,{maintainZoom:!0}):t.bbox?this.zoomToBbox(t.bbox):this.handlePinVisibility(i)}else this.selectedPinElement.classList.remove("active"),this.selectedPinOverlay.setPosition(void 0)});zoomToBbox(t){if(!this.mapInstance||!t)return;const e=this.mapInstance.getView(),n=this.mapInstance.getSize(),i=[...fL([t.minLon,t.minLat]),...fL([t.maxLon,t.maxLat])];let r=[.15*n[1],.15*n[0],.15*n[1],.15*n[0]];if(n[0]<=768){const t=.5*n[1],e=.15*t,i=.5*n[1]+.15*t;r[0]=e,r[2]=i}else if(this.args.isSidebarOpen){const t=getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width").trim(),e=parseInt(t,10)||360,i=n[0]-e;r[3]=e+.15*i,r[1]=.15*i}const s=e.getZoom();e.fit(i,{padding:r,duration:1e3,easing:t=>t*(2-t),maxZoom:Math.max(s,18)})}handlePinVisibility(t,e={}){if(!this.mapInstance)return;const n=this.mapInstance.getView().getZoom();if(!e.maintainZoom&&n<16)return void this.animateToSmartCenter(t,16);const i=this.mapInstance.getPixelFromCoordinate(t),r=this.mapInstance.getSize();if(!i||i[0]<0||i[0]>r[0]||i[1]<0||i[1]>r[1]){const n=e.maintainZoom?null:16;this.animateToSmartCenter(t,n)}else this.panIfObscured(t)}animateToSmartCenter(t,e=null){if(!this.mapInstance)return;const n=this.mapInstance.getSize(),i=this.mapInstance.getView();let r=i.getResolution();null!==e&&(r=i.getResolutionForZoom(e));let s=t;if(n[0]<=768){const e=.25*n[1]*r;s=[t[0],t[1]-e]}else if(this.args.isSidebarOpen){const e=getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width").trim(),n=(parseInt(e,10)||360)/2*r;s=[t[0]-n,t[1]]}const o={center:s,duration:1e3,easing:t=>t*(2-t)};null!==e&&(o.zoom=e),i.animate(o)}panIfObscured(t){if(!this.mapInstance)return;const e=this.mapInstance.getSize(),n=this.mapInstance.getPixelFromCoordinate(t);if(!n)return;const i=this.mapInstance.getView(),r=i.getCenter(),s=i.getResolution();let o=n[0],a=n[1],l=!1;if(e[0]<=768){const t=e[1],i=t/2;n[1]>i&&(a=.25*t,l=!0)}else if(this.args.isSidebarOpen){const t=getComputedStyle(document.documentElement).getPropertyValue("--sidebar-width").trim(),i=parseInt(t,10)||360;n[0]<i&&(o=i+(e[0]-i)/2,l=!0)}if(a<80&&(a=110,l=!0),l){const t=n[0]-o,e=n[1]-a,l=r[0]+t*s,c=r[1]-e*s;i.animate({center:[l,c],duration:500,easing:t=>t*(2-t)})}}updateBookmarks=BS(()=>{const t=this.storage.placesInView;this.loadBookmarks(t)});async loadBookmarks(t=[]){try{if(!this.bookmarkSource)return;t&&0!==t.length||(t=this.storage.placesInView),this.bookmarkSource.clear(),t&&Array.isArray(t)&&t.forEach(t=>{if(t.lat&&t.lon){const e=new UA({geometry:new uM(fL([t.lon,t.lat])),name:t.title,id:t.id,isBookmark:!0,originalPlace:t});this.bookmarkSource.addFeature(e)}})}catch(e){console.error("Failed to load bookmarks:",e)}}syncPulse=BS(()=>{this.searchOverlayElement&&(this.mapUi.isSearching?this.searchOverlayElement.classList.add("active"):this.searchOverlayElement.classList.remove("active"))});syncCreationMode=BS(()=>{if(this.crosshairElement&&this.mapInstance)if(this.mapUi.isCreating){this.crosshairElement.classList.add("visible");const t=this.mapUi.creationCoordinates;if(t&&t.lat&&t.lon){const e=fL([t.lon,t.lat]);this.animateToCrosshair(e)}}else this.crosshairElement.classList.remove("visible")});animateToCrosshair(t){if(!this.mapInstance||!this.crosshairElement)return;const e=this.mapInstance.getTargetElement().getBoundingClientRect(),n=this.crosshairElement.getBoundingClientRect(),i=n.left+n.width/2-e.left,r=n.top+n.height/2-e.top,s=this.mapInstance.getSize(),o=i-s[0]/2,a=r-s[1]/2,l=this.mapInstance.getView(),c=l.getResolution(),h=o*c,u=-a*c,d=t[0]-h,p=t[1]-u,f=l.getCenter();Math.sqrt(Math.pow(f[0]-d,2)+Math.pow(f[1]-p,2))>5*c&&l.animate({center:[d,p],duration:800,easing:t=>t*(2-t)})}handleMapMove=async()=>{if(!this.mapInstance)return;const t=gL(this.mapInstance.getView().getCenter());if(this.mapUi.updateCenter(t[1],t[0]),this.mapUi.isCreating){const t=this.mapInstance.getTargetElement().getBoundingClientRect(),e=this.crosshairElement.getBoundingClientRect(),n=e.left+e.width/2-t.left,i=e.top+e.height/2-t.top,r=gL(this.mapInstance.getCoordinateFromPixel([n,i])),s=parseFloat(r[1].toFixed(6)),o=parseFloat(r[0].toFixed(6));this.mapUi.updateCreationCoordinates(s,o),this.router.replaceWith("place.new",{queryParams:{lat:s,lon:o}})}const e=this.mapInstance.getSize(),n=this.mapInstance.getView().calculateExtent(e),[i,r]=gL([n[0],n[1]]),[s,o]=gL([n[2],n[3]]),a={minLat:r,minLon:i,maxLat:o,maxLon:s};this.mapUi.updateBounds(a),await this.storage.loadPlacesInBounds(a),this.loadBookmarks(this.storage.placesInView);try{const t=this.mapInstance.getView(),e={center:gL(t.getCenter()),zoom:t.getZoom()};localStorage.setItem("marco:map-view",JSON.stringify(e))}catch(l){console.warn("Failed to save map view:",l)}};handleMapClick=async t=>{if(this.ignoreNextMapClick)return void(this.ignoreNextMapClick=!1);const e=this.mapInstance.getFeaturesAtPixel(t.pixel,{hitTolerance:10});let n=null,i=null,r=null;if(e&&e.length>0){console.debug(`Found ${e.length} features in map layer:`);for(const n of e)console.debug(n);const t=e.find(t=>t.get("isBookmark")),s=e.find(t=>t.get("isSearchResult"));t?n=t.get("originalPlace"):s&&(i=s.get("originalPlace"));const o=e[0].getProperties();o.name&&(r=o.name)}const s=t=>{("search"===this.router.currentRouteName||this.mapUi.currentSearch&&this.mapUi.searchResults.length>0)&&(this.mapUi.returnToSearch=!0),this.mapUi.preventNextZoom=!0,this.router.transitionTo("place",t)};if(this.args.isSidebarOpen){const t=n||i;return t?(console.debug("Clicked feature while sidebar open (switching):",t),void s(t)):void(this.args.onOutsideClick&&this.args.onOutsideClick())}if(n)return console.debug("Clicked bookmark:",n),void s(n);if(i)return console.debug("Clicked search result:",i),void s(i);if(this.mapInstance.getView().getZoom()<16)return;const o=gL(t.coordinate),[a,l]=o,c=r?30:50;if(this.searchOverlayElement){const e=this.mapInstance.getView(),n=2*c/uL(e.getProjection(),e.getResolution(),t.coordinate);this.searchOverlayElement.style.width=`${n}px`,this.searchOverlayElement.style.height=`${n}px`,this.searchOverlay.setPosition(t.coordinate)}this.mapUi.startSearch();const h={lat:l.toFixed(6),lon:a.toFixed(6),q:null,category:null,selected:r||null};this.router.transitionTo("search",{queryParams:h})};static{Xi(em({id:null,block:'[[[11,0],[16,0,[29,["map-container ",[52,[30,1],"sidebar-open"]]]],[4,[30,0,["setupMap"]],null,null],[4,[30,0,["updateInteractions"]],null,null],[4,[30,0,["updateBookmarks"]],null,null],[4,[30,0,["updateSearchResults"]],null,null],[4,[30,0,["updateSelectedPin"]],null,null],[4,[30,0,["syncPulse"]],null,null],[4,[30,0,["syncCreationMode"]],null,null],[12],[13]],["@isSidebarOpen"],["if"]]',moduleName:"/home/basti/src/marco/app/components/map.gjs",isStrictMode:!0}),this)}}class Qq extends MS{connectRS(){this.args.onClose(),this.args.storage.connect()}static{Rx(this.prototype,"connectRS",[Ih])}disconnectRS(){this.args.storage.disconnect()}static{Rx(this.prototype,"disconnectRS",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"user-menu-popover"],[12],[1,"\\n "],[10,0],[14,0,"user-status"],[12],[1,"\\n"],[41,[30,1,["connected"]],[[[1," Connected as\\n "],[10,"strong"],[12],[1,[30,1,["userAddress"]]],[13],[1,"\\n"]],[]],[[[1," Not connected\\n"]],[]]],[1," "],[13],[1,"\\n\\n "],[10,"ul"],[14,0,"account-list"],[12],[1,"\\n "],[10,"li"],[14,0,"account-item"],[12],[1,"\\n "],[10,0],[14,0,"account-info"],[12],[1,"\\n "],[8,[32,0],null,[["@name","@size"],["server",18]],null],[1,"\\n "],[10,1],[12],[1,"RemoteStorage"],[13],[1,"\\n "],[13],[1,"\\n"],[41,[30,1,["connected"]],[[[1," "],[11,"button"],[24,0,"btn-text text-danger"],[24,4,"button"],[4,[32,1],["click",[30,0,["disconnectRS"]]],null],[12],[1,"Disconnect"],[13],[1,"\\n"]],[]],[[[1," "],[11,"button"],[24,0,"btn-text text-primary"],[24,4,"button"],[4,[32,1],["click",[30,0,["connectRS"]]],null],[12],[1,"Connect"],[13],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n\\n "],[10,"li"],[14,0,"account-item disabled"],[12],[1,"\\n "],[10,0],[14,0,"account-info"],[12],[1,"\\n "],[8,[32,0],null,[["@name","@size"],["globe",18]],null],[1,"\\n "],[10,1],[12],[1,"OpenStreetMap"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,"li"],[14,0,"account-item disabled"],[12],[1,"\\n "],[10,0],[14,0,"account-info"],[12],[1,"\\n "],[8,[32,0],null,[["@name","@size"],["zap",18]],null],[1,"\\n "],[10,1],[12],[1,"Nostr"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@storage"],["if"]]',moduleName:"/home/basti/src/marco/app/components/user-menu.gjs",scope:()=>[FS,S_],isStrictMode:!0}),this)}}class tV{assert(){}async(t){Promise.resolve().then(t)}reportUncaughtRejection(){this.async(t=>{throw t})}defer(){let t={promise:null,resolve:null,reject:null},e=new Promise((e,n)=>{t.resolve=e,t.reject=n});return t.promise=e,t}globalDebuggingEnabled(){return!1}}const eV=new tV;class nV{constructor(t){this.maxConcurrency=t||1}}const iV="CANCELLED",rV="STARTED",sV="QUEUED",oV={type:rV},aV={type:sV},lV=t=>({type:iV,reason:t}),cV=lV("it belongs to a 'drop' Task that was already running");class hV{constructor(t){this.remainingSlots=t}step(){return this.remainingSlots>0?(this.remainingSlots--,oV):cV}}class uV extends nV{makeReducer(){return new hV(this.maxConcurrency)}}class dV{constructor(t){this.remainingSlots=t}step(){return this.remainingSlots>0?(this.remainingSlots--,oV):aV}}class pV extends nV{makeReducer(){return new dV(this.maxConcurrency)}}const fV=lV("it belongs to a 'keepLatest' Task that was already running");class gV{constructor(t,e){this.remainingSlots=t,this.numToCancel=e}step(){return this.remainingSlots>0?(this.remainingSlots--,oV):this.numToCancel>0?(this.numToCancel--,fV):aV}}class mV extends nV{makeReducer(t,e){let n=t+e;return new gV(this.maxConcurrency,n-this.maxConcurrency-1)}}const yV=lV("it belongs to a 'restartable' Task that was .perform()ed again");class vV{constructor(t){this.numToCancel=t}step(){return this.numToCancel>0?(this.numToCancel--,yV):oV}}class _V extends nV{makeReducer(t,e){return new vV(t+e-this.maxConcurrency)}}const bV=new class{step(){return oV}};class wV{makeReducer(){return bV}}const xV=new Map;class CV{constructor(t,e,n){this.stateTracker=e,this.schedulerPolicy=t,this.initialTaskInstances=n,this.startingInstances=[]}process(){let[t,e,n]=this.filterFinishedTaskInstances(),i=this.schedulerPolicy.makeReducer(e,n),r=t.filter(t=>this.setTaskInstanceExecutionState(t,i.step()));return this.stateTracker.computeFinalStates(t=>this.applyState(t)),this.startingInstances.forEach(t=>t.start()),r}filterFinishedTaskInstances(){let t=0,e=0;return[this.initialTaskInstances.filter(n=>{let i=this.stateTracker.stateFor(n.task),r=n.executor.state;return r.isFinished?(i.onCompletion(n),!1):(r.hasStarted?t+=1:e+=1,!0)}),t,e]}setTaskInstanceExecutionState(t,e){let n=this.stateTracker.stateFor(t.task);switch(t.executor.counted||(t.executor.counted=!0,n.onPerformed(t)),e.type){case iV:return t.cancel(e.reason),!1;case rV:return t.executor.state.hasStarted||(this.startingInstances.push(t),n.onStart(t)),n.onRunning(t),!0;case sV:return n.onQueued(t),!0}}applyState(t){let{taskable:e}=t;if(!e.onState)return;const{guid:n}=e;if(xV.has(n)&&t.tag<xV.get(n))return;let i=Object.assign({numRunning:t.numRunning,numQueued:t.numQueued,numPerformedInc:t.numPerformedInc},t.attrs);e.onState(i,e),xV.set(n,t.tag)}}class SV{constructor(t,e){this.taskable=t,this.numRunning=0,this.numQueued=0,this.numPerformedInc=0,this.attrs={},this.tag=e}onCompletion(t){let e=t.completionState;this.attrs.lastRunning=null,this.attrs.lastComplete=t,1===e?this.attrs.lastSuccessful=t:(2===e?this.attrs.lastErrored=t:3===e&&(this.attrs.lastCanceled=t),this.attrs.lastIncomplete=t)}onPerformed(t){this.numPerformedInc+=1,this.attrs.lastPerformed=t}onStart(t){this.attrs.last=t}onRunning(t){this.attrs.lastRunning=t,this.numRunning+=1}onQueued(){this.numQueued+=1}applyStateFrom(t){Object.assign(this.attrs,t.attrs),this.numRunning+=t.numRunning,this.numQueued+=t.numQueued,this.numPerformedInc+=t.numPerformedInc}}const kV=new Map;class EV{constructor(){this.states=new Map}stateFor(t){let e=t.guid,n=this.states.get(e);if(!n){let i=kV.has(e)?kV.get(e):0;n=new SV(t,++i),this.states.set(e,n),kV.set(e,i)}return n}computeFinalStates(t){this.forEachState(e=>t(e))}forEachState(t){this.states.forEach(e=>t(e))}}const TV=new class{onCompletion(){}onPerformed(){}onStart(){}onRunning(){}onQueued(){}};class LV{stateFor(){return TV}computeFinalStates(){}}class MV{constructor(t,e){this.schedulerPolicy=t,this.stateTrackingEnabled=e,this.taskInstances=[]}cancelAll(t,e){let n=this.taskInstances.map(n=>{n.task.guids[t]&&n.executor.cancel(e)}).filter(t=>!!t);return Promise.all(n)}perform(t){t.onFinalize(()=>this.scheduleRefresh()),this.taskInstances.push(t),this.refresh()}scheduleRefresh(){Promise.resolve().then(()=>this.refresh())}refresh(){let t=this.stateTrackingEnabled?new EV:new LV,e=new CV(this.schedulerPolicy,t,this.taskInstances);this.taskInstances=e.process()}}class RV{constructor(t,e,n){this.value=t,this.done=e,this.errored=n}}class PV{constructor(t){this.done=!1,this.generatorFactory=t,this.iterator=null}step(t,e){try{let n=this.getIterator(),{value:i,done:r}=n[e](t);return r?this.finalize(i,!1):new RV(i,!1,!1)}catch(n){return this.finalize(n,!0)}}getIterator(){return this.iterator||this.done||(this.iterator=this.generatorFactory()),this.iterator}finalize(t,e){return this.done=!0,this.iterator=null,new RV(t,!0,e)}}const IV="__ec_cancel__",OV="__ec_yieldable__",AV="next",zV="throw",FV="return",jV="cancel";class DV{constructor(t,e){this._taskInstance=t,this._resumeIndex=e}getTaskInstance(){return this._taskInstance}cancel(){let t=this._taskInstance;t.proceed.call(t,this._resumeIndex,jV)}next(t){let e=this._taskInstance;e.proceed.call(e,this._resumeIndex,AV,t)}return(t){let e=this._taskInstance;e.proceed.call(e,this._resumeIndex,FV,t)}throw(t){let e=this._taskInstance;e.proceed.call(e,this._resumeIndex,zV,t)}}class NV{constructor(){this[OV]=this[OV].bind(this)}onYield(){}_deferable(){let t={resolve:void 0,reject:void 0};return t.promise=new Promise((e,n)=>{t.resolve=e,t.reject=n}),t}_toPromise(){let t=this._deferable(),e={proceed(e,n,i){n==AV||n==FV?t.resolve(i):t.reject(i)}},n=this[OV](e,0);return t.promise[IV]=n,t.promise}then(...t){return this._toPromise().then(...t)}catch(...t){return this._toPromise().catch(...t)}finally(...t){return this._toPromise().finally(...t)}[OV](t,e){let n=new DV(t,e);return this.onYield(n)}}new class extends NV{onYield(){}};const BV={completionState:0,value:null,error:null,isSuccessful:!1,isError:!1,isCanceled:!1,hasStarted:!1,isFinished:!1},UV="TaskCancelation",qV="explicit",VV="lifespan_end";class $V{constructor(t,e){this.kind=t,this.reason=e,this.promise=new Promise(t=>{this.finalize=t})}}const GV="PERFORM_TYPE_DEFAULT",WV="PERFORM_TYPE_UNLINKED",HV="PERFORM_TYPE_LINKED",ZV={};let KV=[];class YV{constructor({generatorFactory:t,env:e,debug:n}){this.generatorState=new PV(t),this.state=Object.assign({},BV),this.index=1,this.disposers=[],this.finalizeCallbacks=[],this.env=e,this.debug=n,this.cancelRequest=null}start(){this.state.hasStarted||this.cancelRequest||(this.setState({hasStarted:!0}),this.proceedSync(AV,void 0))}cancel(t){return this.requestCancel(t)?(this.state.hasStarted?this.proceedWithCancelAsync():this.finalizeWithCancel(),this.cancelRequest.promise):(t.finalize(),t.promise)}setState(t){Object.assign(this.state,t),this.taskInstance.setState(this.state)}proceedChecked(t,e,n){this.state.isFinished||this.advanceIndex(t)&&(e===jV?(this.requestCancel(new $V("yielded"),n),this.proceedWithCancelAsync()):this.proceedAsync(e,n))}proceedWithCancelAsync(){this.proceedAsync(FV,ZV)}proceedAsync(t,e){this.advanceIndex(this.index),this.env.async(()=>this.proceedSync(t,e))}proceedSync(t,e){this.state.isFinished||(this.dispose(),this.generatorState.done?this.handleResolvedReturnedValue(t,e):this.handleResolvedContinueValue(t,e))}handleResolvedContinueValue(t,e){let n=this.index,i=this.generatorStep(e,t);this.advanceIndex(n)&&(i.errored?this.finalize(i.value,2):this.handleYieldedValue(i))}handleResolvedReturnedValue(t,e){switch(t){case AV:case FV:this.finalize(e,1);break;case zV:this.finalize(e,2)}}handleYieldedUnknownThenable(t){let e=this.index;t.then(t=>{this.proceedChecked(e,AV,t)},t=>{this.proceedChecked(e,zV,t)})}advanceIndex(t){if(this.index===t)return++this.index}handleYieldedValue(t){let e=t.value;e?(this.addDisposer(e[IV]),e[OV]?this.invokeYieldable(e):"function"==typeof e.then?this.handleYieldedUnknownThenable(e):this.proceedWithSimpleValue(e)):this.proceedWithSimpleValue(e)}proceedWithSimpleValue(t){this.proceedAsync(AV,t)}addDisposer(t){"function"==typeof t&&this.disposers.push(t)}dispose(){let t=this.disposers;0!==t.length&&(this.disposers=[],t.forEach(t=>t()))}generatorStep(t,e){KV.push(this);let n=this.generatorState.step(t,e);if(KV.pop(),this._expectsLinkedYield){let t=n.value;t&&t.performType===HV||console.warn("You performed a .linked() task without immediately yielding/returning it. This is currently unsupported (but might be supported in future version of ember-concurrency)."),this._expectsLinkedYield=!1}return n}maybeResolveDefer(){this.defer&&this.state.isFinished&&(1===this.state.completionState?this.defer.resolve(this.state.value):this.defer.reject(this.state.error))}onFinalize(t){this.finalizeCallbacks.push(t),this.state.isFinished&&this.runFinalizeCallbacks()}runFinalizeCallbacks(){this.finalizeCallbacks.forEach(t=>t()),this.finalizeCallbacks=[],this.maybeResolveDefer(),this.maybeThrowUnhandledTaskErrorLater()}promise(){return this.defer||(this.defer=this.env.defer(),this.asyncErrorsHandled=!0,this.maybeResolveDefer()),this.defer.promise}maybeThrowUnhandledTaskErrorLater(){var t;this.asyncErrorsHandled||2!==this.state.completionState||(t=this.state.error)&&t.name===UV||this.env.async(()=>{this.asyncErrorsHandled||this.env.reportUncaughtRejection(this.state.error)})}requestCancel(t){return!this.cancelRequest&&!this.state.isFinished&&(this.cancelRequest=t,!0)}finalize(t,e){if(this.cancelRequest)return this.finalizeWithCancel();let n={completionState:e};1===e?(n.isSuccessful=!0,n.value=t):2===e?(n.isError=!0,n.error=t):3===e&&(n.error=t),this.finalizeShared(n)}finalizeWithCancel(){let t=this.taskInstance.formatCancelReason(this.cancelRequest.reason),e=new Error(t);this.debugEnabled()&&console.log(t),e.name=UV,this.finalizeShared({isCanceled:!0,completionState:3,error:e,cancelReason:t}),this.cancelRequest.finalize()}debugEnabled(){return this.debug||this.env.globalDebuggingEnabled()}finalizeShared(t){this.index++,t.isFinished=!0,this.setState(t),this.runFinalizeCallbacks()}invokeYieldable(t){try{let e=t[OV](this.taskInstance,this.index);this.addDisposer(e)}catch(e){this.env.reportUncaughtRejection(e)}}onYielded(t,e){this.asyncErrorsHandled=!0,this.onFinalize(()=>{let n=this.state.completionState;1===n?t.proceed(e,AV,this.state.value):2===n?t.proceed(e,zV,this.state.error):3===n&&t.proceed(e,jV,null)});let n=this.getPerformType();if(n!==WV)return()=>{this.detectSelfCancelLoop(n,t),this.cancel(new $V("parent_cancel"))}}getPerformType(){return this.taskInstance.performType||GV}detectSelfCancelLoop(t,e){if(t!==GV)return;let n=e.executor&&e.executor.cancelRequest;!n||n.kind!==VV||this.cancelRequest||this.state.isFinished||this.taskInstance.selfCancelLoopWarning(e)}}const XV={last:null,lastRunning:null,lastPerformed:null,lastSuccessful:null,lastComplete:null,lastErrored:null,lastCanceled:null,lastIncomplete:null,performCount:0};Object.freeze(XV);let JV=0;class QV{constructor(t){this.context=t.context,this.debug=t.debug||!1,this.enabledModifiers=t.enabledModifiers,this.env=t.env,this.group=t.group,this.hasEnabledEvents=t.hasEnabledEvents,this.modifierOptions=t.modifierOptions,this.name=t.name,this.onStateCallback=t.onStateCallback,this.scheduler=t.scheduler,this.guid="ec_"+JV++,this.guids={},this.guids[this.guid]=!0,this.group&&Object.assign(this.guids,this.group.guids)}cancelAll(t){let{reason:e,cancelRequestKind:n,resetState:i}=t||{};e=e||".cancelAll() was explicitly called on the Task";let r=new $V(n||qV,e);return this.scheduler.cancelAll(this.guid,r).then(()=>{i&&this._resetState()})}get _isAlive(){return!0}_resetState(){this.setState(XV)}setState(){}}Object.assign(QV.prototype,XV),Object.assign(QV.prototype,{numRunning:0,numQueued:0,isRunning:!1,isQueued:!1,isIdle:!0,state:"idle"});class t${constructor(t,e,n){this.task=t,this.performType=e,this.linkedObject=n}perform(...t){return this.task._performShared(t,this.performType,this.linkedObject)}}let e$=class t extends QV{constructor(t){super(t),this.generatorFactory=t.generatorFactory,this.perform=this._perform.bind(this)}linked(){let t=KV[KV.length-1];if(!t)throw new Error("You can only call .linked() from within a task.");return new t$(this,HV,t)}unlinked(){return new t$(this,WV,null)}toString(){return`<Task:${this.name}>`}_clone(){return new t({context:this.context,debug:this.debug,env:this.env,generatorFactory:this.generatorFactory,group:this.group,hasEnabledEvents:this.hasEnabledEvents,name:this.name,onStateCallback:this.onStateCallback,scheduler:this.scheduler})}_curry(...t){let e=this._clone();return e._curryArgs=[...this._curryArgs||[],...t],e}_perform(...t){return this._performShared(t,GV,null)}_performShared(t,e,n){let i=this._curryArgs?[...this._curryArgs,...t]:t,r=this._taskInstanceFactory(i,e,n);return e===HV&&(n._expectsLinkedYield=!0),this._isAlive||r.cancel(),this.scheduler.perform(r),r}_taskInstanceOptions(t,e,n){return{args:t,executor:new YV({generatorFactory:()=>this.generatorFactory(t),env:this.env,debug:this.debug}),performType:e,hasEnabledEvents:this.hasEnabledEvents}}};const n$={enqueue:(t,e)=>e&&t.setBufferPolicy(pV),debug:(t,e)=>e&&t.setDebug(e),drop:(t,e)=>e&&t.setBufferPolicy(uV),keepLatest:(t,e)=>e&&t.setBufferPolicy(mV),maxConcurrency:(t,e)=>t.setMaxConcurrency(e),onState:(t,e)=>t.setOnState(e),restartable:(t,e)=>e&&t.setBufferPolicy(_V)};let i$=class{env=eV;_debug=null;_enabledModifiers=[];_hasSetConcurrencyConstraint=!1;_hasSetBufferPolicy=!1;_hasEnabledEvents=!1;_maxConcurrency=null;_onStateCallback=(t,e)=>e.setState(t);_schedulerPolicyClass=wV;constructor(t="<unknown>",e=null,n={}){this.name=t,this.taskDefinition=e,this.options=n,this._processModifierOptions(n)}createTask(t){let e=this.getTaskOptions(t);return new e$(Object.assign({generatorFactory:e=>this.taskDefinition.apply(t,e)},e))}getModifier(t){if(function(t){return t in n$}(t))return n$[t].bind(null,this)}getOptions(){return this.options}getScheduler(t,e){return new MV(t,e)}getTaskOptions(t){let e,n=this._onStateCallback,i=new this._schedulerPolicyClass(this._maxConcurrency);return e=this.getScheduler(i,n&&"function"==typeof n),{context:t,debug:this._debug,env:this.env,name:this.name,group:void 0,scheduler:e,hasEnabledEvents:this._hasEnabledEvents,onStateCallback:n,enabledModifiers:this._enabledModifiers,modifierOptions:this.getOptions()}}setBufferPolicy(t){return function(t){if(t._hasSetBufferPolicy)throw new Error(`Cannot set multiple buffer policies on a task. ${t._schedulerPolicyClass} has already been set for task '${t.name}'`)}(this),this._hasSetBufferPolicy=!0,this._hasSetConcurrencyConstraint=!0,this._schedulerPolicyClass=t,this}setDebug(t){return this._debug=t,this}setEvented(t){return this._hasEnabledEvents=t,this}setMaxConcurrency(t){return this._hasSetConcurrencyConstraint=!0,this._maxConcurrency=t,this}setName(t){return this.name=t,this}setOnState(t){return this._onStateCallback=t,this}setTaskDefinition(t){return this.taskDefinition=t,this}_processModifierOptions(t){if(t)for(let e of Object.keys(t)){let n=t[e],i=this.getModifier(e);"function"==typeof i&&i(n)&&this._enabledModifiers.push(e)}}};const r$=new class extends tV{assert(...t){}async(t){va(()=>ba("actions",t))}reportUncaughtRejection(t){Sa(null,function(){const e=ko();if(!e)throw t;e(t)})}defer(){return qc()}globalDebuggingEnabled(){return!1}};class s$ extends MV{scheduleRefresh(){xa(this,this.refresh)}}class o${constructor({task:t,args:e,executor:n,performType:i,hasEnabledEvents:r}){this.task=t,this.args=e,this.performType=i,this.executor=n,this.executor.taskInstance=this,this.hasEnabledEvents=r}setState(){}formatCancelReason(){}selfCancelLoopWarning(){}onFinalize(t){this.executor.onFinalize(t)}proceed(t,e,n){this.executor.proceedChecked(t,e,n)}[OV](t,e){return this.executor.onYielded(t,e)}cancel(t=".cancel() was explicitly called"){this.executor.cancel(new $V(qV,t))}then(...t){return this.executor.promise().then(...t)}catch(...t){return this.executor.promise().catch(...t)}finally(...t){return this.executor.promise().finally(...t)}toString(){return`${this.task} TaskInstance`}start(){return this.executor.start(),this}}function a$(t,e){return Object.keys(t).reduce((e,n)=>function(t,e,n){const i=Object.getOwnPropertyDescriptor(t,n);i.initializer=i.initializer||(()=>t[n]),delete i.value;const r=Ps(e,n,i);return e[n]=r,e}(t,e,n),e)}let l$,c$;Object.assign(o$.prototype,BV),Object.assign(o$.prototype,{state:"waiting",isDropped:!1,isRunning:!0}),l$=a$(XV,{}),l$=a$({numRunning:0,numQueued:0,isRunning:!1,isQueued:!1,isIdle:!0,state:"idle"},l$),c$=a$(BV,{}),c$=a$({state:"waiting",isDropped:!1,isRunning:!1},c$),Object.freeze(l$),Object.freeze(c$);class h$ extends o${setState(t){let e=this._recomputeState(t);Object.assign(this,{...t,isRunning:!t.isFinished,isDropped:"dropped"===e,state:e})}_recomputeState(t){return t.isDropped?"dropped":t.isCanceled?t.hasStarted?"canceled":"dropped":t.isFinished?"finished":t.hasStarted?"running":"waiting"}formatCancelReason(t){return`TaskInstance '${this.getName()}' was canceled because ${t}. For more information, see: http://ember-concurrency.com/docs/task-cancelation-help`}getName(){return this.name||(this.name=this.task&&this.task.name||"<unknown>"),this.name}selfCancelLoopWarning(t){let e=`\`${t.getName()}\``,n=`\`${this.getName()}\``;console.warn(`ember-concurrency detected a potentially hazardous "self-cancel loop" between parent task ${e} and child task ${n}. If you want child task ${n} to be canceled when parent task ${e} is canceled, please change \`.perform()\` to \`.linked().perform()\`. If you want child task ${n} to keep running after parent task ${e} is canceled, change it to \`.unlinked().perform()\``)}triggerEvent(...t){if(!this.hasEnabledEvents)return;let e=this.task,n=e.context,i=e&&e.name;if(n&&n.trigger&&i){let[e,...r]=t;n.trigger(`${i}:${e}`,...r)}}}c$&&Object.defineProperties(h$.prototype,c$);const u$={_performCount:0,setState(t){this._performCount=this._performCount+(t.numPerformedInc||0);let e=t.numRunning>0,n=t.numQueued>0,i=Object.assign({},t,{performCount:this._performCount,isRunning:e,isQueued:n,isIdle:!e&&!n,state:e?"running":"idle"});Object.assign(this,i)},onState(t,e){e.onStateCallback&&e.onStateCallback(t,e)}};class d$ extends e${constructor(t){super(t),Kt(this.context)||wx(this.context,()=>{this.cancelAll({reason:"the object it lives on was destroyed or unrendered",cancelRequestKind:VV})})}get _isAlive(){return!Kt(this.context)}_taskInstanceFactory(t,e,n){let i=this._taskInstanceOptions(t,e,n);return i.task=this,new h$(i)}_clone(){return new d$({context:this.context,debug:this.debug,env:this.env,generatorFactory:this.generatorFactory,group:this.group,hasEnabledEvents:this.hasEnabledEvents,name:this.name,onStateCallback:this.onStateCallback,scheduler:this.scheduler})}}l$&&Object.defineProperties(d$.prototype,l$),Object.assign(d$.prototype,u$);class p$ extends i${env=r$;createTask(t){this.taskDefinition;let e=this.getTaskOptions(t);return new d$(Object.assign({generatorFactory:e=>this.taskDefinition.apply(t,e)},e))}getModifier(t){return super.getModifier(t)}getScheduler(t,e){return new s$(t,e)}get taskFn(){return this.taskDefinition}set taskFn(t){this.setTaskDefinition(t)}}dh.Promise;class f$ extends NV{_deferable(){return r$.defer()}}class g$ extends f${constructor(t){super(),this.ms=t}onYield(t){let e=wa(()=>t.next(),this.ms);return()=>ka(e)}}class m$ extends Mb{compute(t){for(let e=0,n=t.length;e<n;e++)if(!1===OS(t[e]))return t[e];return t[t.length-1]}}class y$ extends MS{static{Mx(this.prototype,"photon",[qf])}#ft=void Px(this,"photon");static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");static{Mx(this.prototype,"map",[qf])}#mt=void Px(this,"map");static{Mx(this.prototype,"_internalQuery",[Ps],function(){return""})}#yt=void Px(this,"_internalQuery");static{Mx(this.prototype,"results",[Ps],function(){return[]})}#vt=void Px(this,"results");static{Mx(this.prototype,"isFocused",[Ps],function(){return!1})}#_t=void Px(this,"isFocused");static{Mx(this.prototype,"isLoading",[Ps],function(){return!1})}#bt=void Px(this,"isLoading");get query(){return this.args.query??this._internalQuery}set query(t){this._internalQuery=t}get showPopover(){return this.isFocused&&this.results.length>0}handleInput(t){const e=t.target.value;this.query=e,this.args.onQueryChange&&this.args.onQueryChange(e),e.length<2?this.results=[]:this.searchTask.perform(e)}static{Rx(this.prototype,"handleInput",[Ih])}searchTask=function(t){const e=t();return new p$("searchTask",e.generator,{restartable:!0}).createTask(e.context)}(()=>({context:this,generator:function*(t){yield new g$(300);const e="string"==typeof t?t:this.query;if(!(e.length<2)){this.isLoading=!0;try{let t,n;this.mapUi.currentCenter&&({lat:t,lon:n}=this.mapUi.currentCenter);const i=e.toLowerCase(),r=Bx.filter(t=>t.label.toLowerCase().includes(i)).map(t=>({source:"category",title:t.label,id:t.id,icon:"search"})),s=yield this.photon.search(e,t,n);this.results=[...r,...s]}catch(n){console.error("Search failed",n),this.results=[]}finally{this.isLoading=!1}}}}));handleFocus(){this.isFocused=!0,this.mapUi.setSearchBoxFocus(!0),this.query.length>=2&&0===this.results.length&&this.searchTask.perform()}static{Rx(this.prototype,"handleFocus",[Ih])}handleBlur(){setTimeout(()=>{this.isFocused=!1,this.mapUi.setSearchBoxFocus(!1)},300)}static{Rx(this.prototype,"handleBlur",[Ih])}handleSubmit(t){if(t.preventDefault(),!this.query)return;let e={q:this.query,selected:null,category:null};if(this.mapUi.currentCenter){const{lat:t,lon:n}=this.mapUi.currentCenter;e.lat=parseFloat(t).toFixed(4),e.lon=parseFloat(n).toFixed(4)}this.router.transitionTo("search",{queryParams:e}),this.isFocused=!1}static{Rx(this.prototype,"handleSubmit",[Ih])}selectResult(t){if("category"===t.source){this.query=t.title,this.args.onQueryChange&&this.args.onQueryChange(t.title),this.results=[];let e=null,n=null;return this.mapUi.currentCenter&&(({lat:e,lon:n}=this.mapUi.currentCenter),e=e?.toString(),n=n?.toString()),void this.router.transitionTo("search",{queryParams:{q:t.title,category:t.id,selected:null,lat:e,lon:n}})}if(this.query=t.title,this.args.onQueryChange&&this.args.onQueryChange(t.title),this.results=[],t.osmId){const e=`osm:${t.osmType}:${t.osmId}`;this.router.transitionTo("place",e)}else this.router.transitionTo("search",{queryParams:{q:t.title,lat:t.lat,lon:t.lon,selected:null,category:null}})}static{Rx(this.prototype,"selectResult",[Ih])}clear(){this.searchTask.cancelAll(),this.mapUi.stopLoading(),this.osm.cancelAll(),this.photon.cancelAll(),this.query="",this.results=[],this.args.onQueryChange&&this.args.onQueryChange(""),this.router.transitionTo("index")}static{Rx(this.prototype,"clear",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"search-box"],[12],[1,"\\n "],[11,"form"],[24,0,"search-form"],[4,[32,0],["submit",[30,0,["handleSubmit"]]],null],[12],[1,"\\n "],[11,"button"],[24,0,"menu-btn-integrated"],[24,"aria-label","Menu"],[24,4,"button"],[4,[32,0],["click",[30,1]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["menu",20,"#5f6368"]],null],[1,"\\n "],[13],[1,"\\n\\n "],[11,"input"],[24,0,"search-input"],[24,"placeholder","Search places..."],[24,"aria-label","Search places"],[16,2,[30,0,["query"]]],[24,"autocomplete","off"],[24,4,"search"],[4,[32,0],["input",[30,0,["handleInput"]]],null],[4,[32,0],["focus",[30,0,["handleFocus"]]],null],[4,[32,0],["blur",[30,0,["handleBlur"]]],null],[12],[13],[1,"\\n\\n "],[10,"button"],[14,0,"search-submit-btn"],[14,"aria-label","Search"],[14,4,"submit"],[12],[1,"\\n"],[41,[28,[32,2],[[28,[32,3],[[30,0,["mapUi","loadingState","type"]],"text"],null],[28,[32,3],[[30,0,["mapUi","loadingState","type"]],"category"],null]],null],[[[1," "],[8,[32,1],null,[["@name","@size"],["loading-ring",20]],null],[1,"\\n"]],[]],[[[1," "],[8,[32,1],null,[["@name","@size","@color"],["search",20,"#5f6368"]],null],[1,"\\n"]],[]]],[1," "],[13],[1,"\\n\\n"],[41,[30,0,["query"]],[[[1," "],[11,"button"],[24,0,"search-clear-btn"],[24,"aria-label","Clear"],[24,4,"button"],[4,[32,0],["click",[30,0,["clear"]]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["x",20,"#5f6368"]],null],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n\\n"],[41,[30,0,["showPopover"]],[[[1," "],[10,0],[14,0,"search-results-popover"],[12],[1,"\\n "],[10,"ul"],[14,0,"search-results-list"],[12],[1,"\\n"],[42,[28,[31,2],[[28,[31,2],[[30,0,["results"]]],null]],null],null,[[[1," "],[10,"li"],[12],[1,"\\n "],[11,"button"],[24,0,"search-result-item"],[24,4,"button"],[4,[32,0],["click",[28,[32,4],[[30,0,["selectResult"]],[30,2]],null]],null],[12],[1,"\\n "],[10,0],[14,0,"result-icon"],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],[[52,[30,2,["icon"]],[30,2,["icon"]],"map-pin"],16,"#666"]],null],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"result-info"],[12],[1,"\\n "],[10,1],[14,0,"result-title"],[12],[1,[30,2,["title"]]],[13],[1,"\\n"],[41,[28,[32,3],[[30,2,["source"]],"osm"],null],[[[1," "],[10,1],[14,0,"result-desc"],[12],[1,[28,[32,5],[[30,2,["type"]]],null]],[13],[1,"\\n"]],[]],[[[41,[30,2,["description"]],[[[1," "],[10,1],[14,0,"result-desc"],[12],[1,[30,2,["description"]]],[13],[1,"\\n"]],[]],null]],[]]],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"]],[2]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n"]],[]],null],[13]],["@onToggleMenu","result"],["if","each","-track-array"]]',moduleName:"/home/basti/src/marco/app/components/search-box.gjs",scope:()=>[S_,FS,AS,zS,IS,$S],isStrictMode:!0}),this)}}class v$ extends MS{static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");get categories(){return Bx}searchCategory(t){this.args.onSelect&&this.args.onSelect(t);let e={category:t.id,q:null};if(this.mapUi.currentCenter){const{lat:t,lon:n}=this.mapUi.currentCenter;e.lat=parseFloat(t).toFixed(4),e.lon=parseFloat(n).toFixed(4)}this.router.transitionTo("search",{queryParams:e})}static{Rx(this.prototype,"searchCategory",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"category-chips-scroll"],[12],[1,"\\n "],[10,0],[14,0,"category-chips-container"],[12],[1,"\\n"],[42,[28,[31,1],[[28,[31,1],[[30,0,["categories"]]],null]],null],null,[[[1," "],[11,"button"],[24,0,"category-chip"],[16,"aria-label",[30,1,["label"]]],[16,"disabled",[28,[32,0],[[28,[32,1],[[30,0,["mapUi","loadingState","type"]],"category"],null],[28,[32,1],[[30,0,["mapUi","loadingState","value"]],[30,1,["id"]]],null]],null]],[24,4,"button"],[4,[32,2],["click",[28,[32,3],[[30,0,["searchCategory"]],[30,1]],null]],null],[12],[1,"\\n "],[8,[32,4],null,[["@name","@size"],[[30,1,["icon"]],16]],null],[1,"\\n "],[10,1],[12],[1,[30,1,["label"]]],[13],[1,"\\n "],[13],[1,"\\n"]],[1]],null],[1," "],[13],[1,"\\n"],[13]],["category"],["each","-track-array"]]',moduleName:"/home/basti/src/marco/app/components/category-chips.gjs",scope:()=>[m$,zS,S_,IS,FS],isStrictMode:!0}),this)}}class _$ extends MS{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"settings",[qf])}#q=void Px(this,"settings");static{Mx(this.prototype,"isUserMenuOpen",[Ps],function(){return!1})}#wt=void Px(this,"isUserMenuOpen");static{Mx(this.prototype,"searchQuery",[Ps],function(){return""})}#xt=void Px(this,"searchQuery");get hasQuery(){return!!this.searchQuery}toggleUserMenu(){this.isUserMenuOpen=!this.isUserMenuOpen}static{Rx(this.prototype,"toggleUserMenu",[Ih])}closeUserMenu(){this.isUserMenuOpen=!1}static{Rx(this.prototype,"closeUserMenu",[Ih])}handleQueryChange(t){this.searchQuery=t}static{Rx(this.prototype,"handleQueryChange",[Ih])}handleChipSelect(t){this.searchQuery=t.label}static{Rx(this.prototype,"handleChipSelect",[Ih])}static{Xi(em({id:null,block:'[[[10,"header"],[14,0,"app-header"],[12],[1,"\\n "],[10,0],[14,0,"header-left"],[12],[1,"\\n "],[8,[32,0],null,[["@query","@onToggleMenu","@onQueryChange"],[[30,0,["searchQuery"]],[30,1],[30,0,["handleQueryChange"]]]],null],[1,"\\n "],[13],[1,"\\n\\n"],[41,[30,0,["settings","showQuickSearchButtons"]],[[[1," "],[10,0],[15,0,[29,["header-center ",[52,[30,0,["hasQuery"]],"searching"]]]],[12],[1,"\\n "],[8,[32,1],null,[["@onSelect"],[[30,0,["handleChipSelect"]]]],null],[1,"\\n "],[13],[1,"\\n"]],[]],null],[1,"\\n "],[10,0],[14,0,"header-right"],[12],[1,"\\n "],[10,0],[14,0,"user-menu-container"],[12],[1,"\\n "],[11,"button"],[24,0,"user-btn btn-press"],[24,"aria-label","User Menu"],[24,4,"button"],[4,[32,2],["click",[30,0,["toggleUserMenu"]]],null],[12],[1,"\\n "],[10,0],[14,0,"user-avatar-placeholder"],[12],[1,"\\n "],[8,[32,3],null,[["@name","@size","@color"],["user",20,"white"]],null],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n\\n"],[41,[30,0,["isUserMenuOpen"]],[[[1," "],[8,[32,4],null,[["@storage","@onClose"],[[30,0,["storage"]],[30,0,["closeUserMenu"]]]],null],[1,"\\n "],[11,0],[24,0,"menu-backdrop"],[24,"role","button"],[4,[32,2],["click",[30,0,["closeUserMenu"]]],null],[12],[13],[1,"\\n"]],[]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@onToggleMenu"],["if"]]',moduleName:"/home/basti/src/marco/app/components/app-header.gjs",scope:()=>[y$,v$,S_,FS,Qq],isStrictMode:!0}),this)}}const b$=Dy,w$=Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar-header"],[12],[1,"\\n "],[10,"h2"],[12],[1,"\\n "],[10,1],[14,0,"app-logo-icon"],[12],[1,"\\n "],[1,[28,[32,0],[[32,1]],null]],[1,"\\n "],[13],[1,"\\n Marco\\n "],[13],[1,"\\n "],[11,"button"],[24,0,"close-btn"],[24,4,"button"],[4,[32,2],["click",[30,1]],null],[12],[1,"\\n "],[8,[32,3],null,[["@name","@size","@color"],["x",20,"#333"]],null],[1,"\\n "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[10,0],[14,0,"sidebar-content"],[12],[1,"\\n "],[10,"ul"],[14,0,"app-menu"],[12],[1,"\\n "],[10,"li"],[12],[1,"\\n "],[11,"button"],[24,4,"button"],[4,[32,2],["click",[28,[32,4],[[30,2],"settings"],null]],null],[12],[1,"\\n "],[8,[32,3],null,[["@name","@size"],["settings",20]],null],[1,"\\n "],[10,1],[12],[1,"Settings"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"li"],[12],[1,"\\n "],[11,"button"],[24,4,"button"],[4,[32,2],["click",[28,[32,4],[[30,2],"about"],null]],null],[12],[1,"\\n "],[8,[32,3],null,[["@name","@size"],["info",20]],null],[1,"\\n "],[10,1],[12],[1,"About"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@onClose","@onNavigate"],[]]',moduleName:"/home/basti/src/marco/app/components/app-menu/home.gjs",scope:()=>[Fb,'<svg\n width="1024"\n height="1024"\n viewBox="0 0 1024 1024"\n xmlns="http://www.w3.org/2000/svg"\n>\n \x3c!-- Background --\x3e\n <rect\n x="0"\n y="0"\n width="1024"\n height="1024"\n rx="220"\n fill="#F6E9A6"\n />\n\n \x3c!-- Subtle map grid (kept well outside safe zone) --\x3e\n <g stroke="#E6D88A" stroke-width="10" opacity="0.6">\n <line x1="256" y1="0" x2="256" y2="1024" />\n <line x1="512" y1="0" x2="512" y2="1024" />\n <line x1="768" y1="0" x2="768" y2="1024" />\n\n <line x1="0" y1="256" x2="1024" y2="256" />\n <line x1="0" y1="512" x2="1024" y2="512" />\n <line x1="0" y1="768" x2="1024" y2="768" />\n </g>\n\n \x3c!-- Location pin (exact app shape, larger, centered, safe-zone compliant) --\x3e\n \x3c!-- Safe zone target: ~680px diameter --\x3e\n <g\n transform="\n translate(512 512)\n scale(22)\n translate(-12 -12)\n "\n fill="#ea4335"\n stroke="#b31412"\n stroke-width="1"\n stroke-linecap="round"\n stroke-linejoin="round"\n >\n <path d="M21 10c0 7-9 13-9 13s-9-6-9-13a9 9 0 0 1 18 0z" />\n <circle cx="12" cy="10" r="3" fill="#b31412" stroke="none" />\n </g>\n</svg>\n',S_,FS,IS],isStrictMode:!0}),b$());class x$ extends MS{static{Mx(this.prototype,"settings",[qf])}#q=void Px(this,"settings");updateApi(t){this.settings.updateOverpassApi(t.target.value)}static{Rx(this.prototype,"updateApi",[Ih])}toggleKinetic(t){this.settings.updateMapKinetic("true"===t.target.value)}static{Rx(this.prototype,"toggleKinetic",[Ih])}toggleQuickSearchButtons(t){this.settings.updateShowQuickSearchButtons("true"===t.target.value)}static{Rx(this.prototype,"toggleQuickSearchButtons",[Ih])}updatePhotonApi(t){this.settings.updatePhotonApi(t.target.value)}static{Rx(this.prototype,"updatePhotonApi",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar-header"],[12],[1,"\\n "],[11,"button"],[24,0,"back-btn"],[24,4,"button"],[4,[32,0],["click",[30,1]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["arrow-left",20,"#333"]],null],[1,"\\n "],[13],[1,"\\n "],[10,"h2"],[12],[1,"Settings"],[13],[1,"\\n "],[11,"button"],[24,0,"close-btn"],[24,4,"button"],[4,[32,0],["click",[30,2]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["x",20,"#333"]],null],[1,"\\n "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[10,0],[14,0,"sidebar-content"],[12],[1,"\\n "],[10,"section"],[14,0,"settings-section"],[12],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","show-quick-search"],[12],[1,"Quick search buttons visible"],[13],[1,"\\n "],[11,"select"],[24,1,"show-quick-search"],[24,0,"form-control"],[4,[32,0],["change",[30,0,["toggleQuickSearchButtons"]]],null],[12],[1,"\\n "],[10,"option"],[14,2,"true"],[15,"selected",[52,[30,0,["settings","showQuickSearchButtons"]],"selected"]],[12],[1,"\\n Yes\\n "],[13],[1,"\\n "],[10,"option"],[14,2,"false"],[15,"selected",[52,[51,[30,0,["settings","showQuickSearchButtons"]]],"selected"]],[12],[1,"\\n No\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","map-kinetic"],[12],[1,"Map Inertia (Kinetic Panning)"],[13],[1,"\\n "],[11,"select"],[24,1,"map-kinetic"],[24,0,"form-control"],[4,[32,0],["change",[30,0,["toggleKinetic"]]],null],[12],[1,"\\n "],[10,"option"],[14,2,"true"],[15,"selected",[52,[30,0,["settings","mapKinetic"]],"selected"]],[12],[1,"\\n On\\n "],[13],[1,"\\n "],[10,"option"],[14,2,"false"],[15,"selected",[52,[51,[30,0,["settings","mapKinetic"]]],"selected"]],[12],[1,"\\n Off\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","overpass-api"],[12],[1,"Overpass API Provider"],[13],[1,"\\n "],[11,"select"],[24,1,"overpass-api"],[24,0,"form-control"],[4,[32,0],["change",[30,0,["updateApi"]]],null],[12],[1,"\\n"],[42,[28,[31,3],[[28,[31,3],[[30,0,["settings","overpassApis"]]],null]],null],null,[[[1," "],[10,"option"],[15,2,[30,3,["url"]]],[15,"selected",[52,[28,[32,2],[[30,3,["url"]],[30,0,["settings","overpassApi"]]],null],"selected"]],[12],[1,"\\n "],[1,[30,3,["name"]]],[1,"\\n "],[13],[1,"\\n"]],[3]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"form-group"],[12],[1,"\\n "],[10,"label"],[14,"for","photon-api"],[12],[1,"Photon API Provider"],[13],[1,"\\n "],[11,"select"],[24,1,"photon-api"],[24,0,"form-control"],[4,[32,0],["change",[30,0,["updatePhotonApi"]]],null],[12],[1,"\\n"],[42,[28,[31,3],[[28,[31,3],[[30,0,["settings","photonApis"]]],null]],null],null,[[[1," "],[10,"option"],[15,2,[30,4,["url"]]],[15,"selected",[52,[28,[32,2],[[30,4,["url"]],[30,0,["settings","photonApi"]]],null],"selected"]],[12],[1,"\\n "],[1,[30,4,["name"]]],[1,"\\n "],[13],[1,"\\n"]],[4]],null],[1," "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@onBack","@onClose","api","api"],["if","unless","each","-track-array"]]',moduleName:"/home/basti/src/marco/app/components/app-menu/settings.gjs",scope:()=>[S_,FS,zS],isStrictMode:!0}),this)}}const C$=Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar-header"],[12],[1,"\\n "],[11,"button"],[24,0,"back-btn"],[24,4,"button"],[4,[32,0],["click",[30,1]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["arrow-left",20,"#333"]],null],[1,"\\n "],[13],[1,"\\n "],[10,"h2"],[12],[1,"About"],[13],[1,"\\n "],[11,"button"],[24,0,"close-btn"],[24,4,"button"],[4,[32,0],["click",[30,2]],null],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["x",20,"#333"]],null],[1,"\\n "],[13],[1,"\\n"],[13],[1,"\\n\\n"],[10,0],[14,0,"sidebar-content"],[12],[1,"\\n "],[10,"section"],[14,0,"about-section"],[12],[1,"\\n "],[10,2],[12],[1,"\\n "],[10,"strong"],[12],[1,"Marco"],[13],[1,"\\n (as in\\n "],[10,3],[14,6,"https://en.wikipedia.org/wiki/Marco_Polo"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"Marco Polo"],[13],[1,") is an unhosted maps application that respects your\\n privacy and choices.\\n "],[13],[1,"\\n "],[10,2],[12],[1,"\\n Connect your own\\n "],[10,3],[14,6,"https://remotestorage.io/"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"remote storage"],[13],[1,"\\n to sync place bookmarks across apps and devices.\\n "],[13],[1,"\\n\\n "],[10,"details"],[12],[1,"\\n "],[10,"summary"],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size"],["gift",20]],null],[1,"\\n "],[10,1],[12],[1,"Open Source"],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"details-content"],[12],[1,"\\n "],[10,"table"],[12],[1,"\\n "],[10,"thead"],[12],[1,"\\n "],[10,"tr"],[12],[1,"\\n "],[10,"th"],[12],[1,"Source"],[13],[1,"\\n "],[10,"th"],[12],[1,"License"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"tbody"],[12],[1,"\\n "],[10,"tr"],[12],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://gitea.kosmos.org/raucao/marco"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n Marco App\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://en.wikipedia.org/wiki/GNU_Affero_General_Public_License"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n "],[10,"abbr"],[14,"title","GNU Affero General Public License"],[12],[1,"AGPL"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"tr"],[12],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://openstreetmap.org/copyright"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n Map Data\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://opendatacommons.org/licenses/odbl/"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n "],[10,"abbr"],[14,"title","Open Data Commons Open Database License"],[12],[1,"ODbL"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"tr"],[12],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://github.com/feathericons/feather"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n Feather Icons\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://en.wikipedia.org/wiki/MIT_License"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n "],[10,"abbr"],[14,"title","MIT License"],[12],[1,"MIT"],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"tr"],[12],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://pinhead.ink/"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n Pinhead Icons\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"td"],[12],[1,"\\n "],[10,3],[14,6,"https://github.com/waysidemapping/pinhead?tab=readme-ov-file#where-the-icons-are-from"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"\\n Various\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[10,"details"],[12],[1,"\\n "],[10,"summary"],[12],[1,"\\n "],[8,[32,1],null,[["@name","@size","@color"],["heart",20,"#e5533d"]],null],[1,"\\n "],[10,1],[12],[1,"Contribute"],[13],[1,"\\n "],[13],[1,"\\n "],[10,0],[14,0,"details-content"],[12],[1,"\\n "],[10,2],[12],[1,"\\n "],[10,"strong"],[12],[1,"Most impactful:"],[13],[1,"\\n Add and improve data for points of interest in\\n "],[10,3],[14,6,"https://www.openstreetmap.org"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"OpenStreetMap"],[13],[1,".\\n "],[13],[1,"\\n "],[10,2],[12],[1,"\\n "],[10,"strong"],[12],[1,"Most appreciated:"],[13],[1,"\\n Use this app as much as you can and\\n "],[10,3],[14,6,"https://community.remotestorage.io/t/marco-an-unhosted-maps-app/941"],[14,"target","_blank"],[14,"rel","noopener"],[12],[1,"submit feedback"],[13],[1,"\\n about your experience, problems, feature wishes, etc.\\n "],[13],[1,"\\n "],[10,2],[12],[1,"\\n "],[10,"strong"],[12],[1,"Most supportive:"],[13],[1,"\\n Tell others about this app, on social media, in blog posts,\\n educational videos, etc.\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n "],[13],[1,"\\n"],[13]],["@onBack","@onClose"],[]]',moduleName:"/home/basti/src/marco/app/components/app-menu/about.gjs",scope:()=>[S_,FS],isStrictMode:!0}),b$());class S$ extends MS{static{Mx(this.prototype,"currentView",[Ps],function(){return"menu"})}#Ct=void Px(this,"currentView");setView(t){this.currentView=t}static{Rx(this.prototype,"setView",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar app-menu-pane"],[12],[1,"\\n"],[41,[28,[32,0],[[30,0,["currentView"]],"menu"],null],[[[1," "],[8,[32,1],null,[["@onNavigate","@onClose"],[[30,0,["setView"]],[30,1]]],null],[1,"\\n\\n"]],[]],[[[41,[28,[32,0],[[30,0,["currentView"]],"settings"],null],[[[1," "],[8,[32,2],null,[["@onBack","@onClose"],[[28,[32,3],[[30,0,["setView"]],"menu"],null],[30,1]]],null],[1,"\\n\\n"]],[]],[[[41,[28,[32,0],[[30,0,["currentView"]],"about"],null],[[[1," "],[8,[32,4],null,[["@onBack","@onClose"],[[28,[32,3],[[30,0,["setView"]],"menu"],null],[30,1]]],null],[1,"\\n "]],[]],null]],[]]]],[]]],[13]],["@onClose"],["if"]]',moduleName:"/home/basti/src/marco/app/components/app-menu/index.gjs",scope:()=>[zS,w$,x$,IS,C$],isStrictMode:!0}),this)}}class k$ extends MS{static{Mx(this.prototype,"toast",[qf])}#gt=void Px(this,"toast");static{Xi(em({id:null,block:'[[[41,[30,0,["toast","isVisible"]],[[[1," "],[10,0],[14,0,"toast-notification"],[12],[1,"\\n "],[1,[30,0,["toast","message"]]],[1,"\\n "],[13],[1,"\\n"]],[]],null]],[],["if"]]',moduleName:"/home/basti/src/marco/app/components/toast.gjs",isStrictMode:!0}),this)}}class E$ extends MS{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"isAppMenuOpen",[Ps],function(){return!1})}#St=void Px(this,"isAppMenuOpen");get isSidebarOpen(){return"place"===this.router.currentRouteName||"place.new"===this.router.currentRouteName||"search"===this.router.currentRouteName}constructor(){super(...arguments),console.debug("Application component constructed"),this.storage}toggleAppMenu(){this.isAppMenuOpen=!this.isAppMenuOpen}static{Rx(this.prototype,"toggleAppMenu",[Ih])}closeAppMenu(){this.isAppMenuOpen=!1}static{Rx(this.prototype,"closeAppMenu",[Ih])}handleOutsideClick(){this.isAppMenuOpen?this.closeAppMenu():("search"===this.router.currentRouteName||"place"===this.router.currentRouteName)&&this.router.transitionTo("index")}static{Rx(this.prototype,"handleOutsideClick",[Ih])}refreshBookmarks(){this.storage.notifyChange()}static{Rx(this.prototype,"refreshBookmarks",[Ih])}static{Xi(em({id:null,block:'[[[1,[28,[32,0],["Marco"],null]],[1,"\\n\\n"],[8,[32,1],null,[["@onToggleMenu"],[[30,0,["toggleAppMenu"]]]],null],[1,"\\n\\n"],[10,0],[14,1,"rs-widget-container"],[15,0,[52,[30,0,["storage","isWidgetOpen"]],"visible"]],[12],[13],[1,"\\n\\n"],[41,[30,0,["storage","isWidgetOpen"]],[[[1," "],[11,0],[24,0,"rs-backdrop"],[24,"role","button"],[4,[32,2],["click",[30,0,["storage","closeWidget"]]],null],[12],[13],[1,"\\n"]],[]],null],[1,"\\n"],[8,[32,3],null,[["@isSidebarOpen","@onOutsideClick"],[[28,[32,4],[[30,0,["isSidebarOpen"]],[30,0,["isAppMenuOpen"]]],null],[30,0,["handleOutsideClick"]]]],null],[1,"\\n\\n"],[41,[30,0,["isAppMenuOpen"]],[[[1," "],[8,[32,5],null,[["@onClose"],[[30,0,["closeAppMenu"]]]],null],[1,"\\n"]],[]],null],[1,"\\n"],[8,[32,6],null,null,null],[1,"\\n\\n"],[46,[28,[31,2],null,null],null,null,null]],[],["if","component","-outlet"]]',moduleName:"/home/basti/src/marco/app/templates/application.gjs",scope:()=>[tk,_$,S_,Jq,AS,S$,k$],isStrictMode:!0}),this)}}const T$=Object.freeze(Object.defineProperty({__proto__:null,default:E$},Symbol.toStringTag,{value:"Module"}));class L$ extends kp{static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage")}const M$=Object.freeze(Object.defineProperty({__proto__:null,default:L$},Symbol.toStringTag,{value:"Module"}));class R$ extends kp{static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");activate(){this.mapUi.clearSearchResults()}}const P$=Object.freeze(Object.defineProperty({__proto__:null,default:R$},Symbol.toStringTag,{value:"Module"}));class I$ extends MS{static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");static{Mx(this.prototype,"localPlace",[Ps],function(){return null})}#kt=void Px(this,"localPlace");constructor(){super(...arguments),this.localPlace=this.args.model}get place(){const t=this.args.model,e=t.osmId||t.id;return this.storage.findPlaceById(e)||(!this.localPlace||this.localPlace.osmId!==e&&this.localPlace.id!==e?t.createdAt?{...t,id:void 0,createdAt:void 0,geohash:void 0}:t:this.localPlace)}handleUpdate(t){console.debug("Updating local place state:",t),this.localPlace=t,this.storage.notifyChange()}static{Rx(this.prototype,"handleUpdate",[Ih])}refreshMap(){this.storage.notifyChange()}static{Rx(this.prototype,"refreshMap",[Ih])}navigateBack(t){null===t?this.mapUi.returnToSearch&&this.mapUi.currentSearch?this.router.transitionTo("search",{queryParams:this.mapUi.currentSearch}):this.router.transitionTo("index"):this.router.transitionTo("place",t)}static{Rx(this.prototype,"navigateBack",[Ih])}close(){this.router.transitionTo("index")}static{Rx(this.prototype,"close",[Ih])}static{Xi(em({id:null,block:'[[[8,[32,0],null,[["@selectedPlace","@onClose","@onSelect","@onBookmarkChange","@onUpdate"],[[30,0,["place"]],[30,0,["close"]],[30,0,["navigateBack"]],[30,0,["refreshMap"]],[30,0,["handleUpdate"]]]],null]],[],[]]',moduleName:"/home/basti/src/marco/app/templates/place.gjs",scope:()=>[GS],isStrictMode:!0}),this)}}const O$=Object.freeze(Object.defineProperty({__proto__:null,default:I$},Symbol.toStringTag,{value:"Module"}));class A$ extends kp{static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"osm",[qf])}#H=void Px(this,"osm");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");async model(t){const e=t.place_id;if(e.startsWith("osm:node:")||e.startsWith("osm:way:")||e.startsWith("osm:relation:")){const[,t,n]=e.split(":");return console.debug(`Fetching explicit OSM ${t}:`,n),this.loadOsmPlace(n,t)}await this.waitForSync();let n=this.storage.findPlaceById(e);return n?(console.debug("Found in bookmarks:",n.title),n):(console.warn("Not in bookmarks:",e),null)}async waitForSync(){if(this.storage.initialSyncDone)return;console.debug("Waiting for initial storage sync...");const t=Date.now();for(;!this.storage.initialSyncDone;){if(Date.now()-t>5e3){console.warn("Timed out waiting for initial sync");break}await new Promise(t=>setTimeout(t,100))}}async afterModel(t){if(t&&t.osmId&&t.osmType&&"node"!==t.osmType&&!t.geojson){console.debug("Model missing geometry, fetching full OSM details...");const e=await this.loadOsmPlace(t.osmId,t.osmType);e&&(Object.assign(t,e),console.debug("Enriched model with full OSM details",t))}if(t){const e={preventZoom:this.mapUi.preventNextZoom};this.mapUi.selectPlace(t,e),this.mapUi.preventNextZoom=!1}this.mapUi.stopSearch()}deactivate(){this.mapUi.clearSelection(),this.mapUi.returnToSearch=!1}async loadOsmPlace(t,e=null){try{const n=await this.osm.fetchOsmObject(t,e);if(n)return console.debug("Found OSM POI:",n),n}catch(n){console.error("Failed to fetch POI",n)}return null}setupController(t,e){super.setupController(t,e),this.checkUpdates(e)}async checkUpdates(t){if(t&&t.id&&t.osmId&&t.osmType){const e=await this.storage.refreshPlace(t);e&&this.mapUi.selectPlace(e,{preventZoom:!0})}}serialize(t){return t.id?{place_id:t.id}:t.osmId&&t.osmType?{place_id:`osm:${t.osmType}:${t.osmId}`}:{place_id:t.osmId}}}const z$=Object.freeze(Object.defineProperty({__proto__:null,default:A$},Symbol.toStringTag,{value:"Module"}));class F$ extends MS{static{Mx(this.prototype,"router",[qf])}#ct=void Px(this,"router");static{Mx(this.prototype,"storage",[qf])}#lt=void Px(this,"storage");static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");get initialPlace(){return{title:"",description:""}}close(){this.router.transitionTo("index")}static{Rx(this.prototype,"close",[Ih])}async savePlace(t){try{const e=this.mapUi.creationCoordinates||{lat:this.args.model.lat,lon:this.args.model.lon},n=parseFloat(e.lat.toFixed(6)),i=parseFloat(e.lon.toFixed(6)),r={title:t.title||"Untitled Place",description:t.description,lat:n,lon:i,tags:[],osmTags:{}},s=await this.storage.storePlace(r);console.debug("Created private place:",s.title),this.router.replaceWith("place",s)}catch(e){console.error("Failed to create place:",e),alert("Failed to create place: "+e.message)}}static{Rx(this.prototype,"savePlace",[Ih])}static{Xi(em({id:null,block:'[[[10,0],[14,0,"sidebar"],[12],[1,"\\n "],[10,0],[14,0,"sidebar-header"],[12],[1,"\\n "],[10,"h2"],[12],[8,[32,0],null,[["@name","@size","@color"],["plus-circle",20,"#ea4335"]],null],[1,"\\n New Place"],[13],[1,"\\n "],[11,"button"],[24,0,"close-btn"],[24,4,"button"],[4,[32,1],["click",[30,0,["close"]]],null],[12],[8,[32,0],null,[["@name","@size","@color"],["x",20,"#333"]],null],[13],[1,"\\n "],[13],[1,"\\n\\n "],[10,0],[14,0,"sidebar-content"],[12],[1,"\\n "],[10,2],[14,0,"helper-text"],[12],[1,"\\n Drag the map to position the crosshair.\\n "],[13],[1,"\\n\\n "],[8,[32,2],null,[["@place","@onSave","@onCancel"],[[30,0,["initialPlace"]],[30,0,["savePlace"]],[30,0,["close"]]]],null],[1,"\\n "],[13],[1,"\\n"],[13]],[],[]]',moduleName:"/home/basti/src/marco/app/templates/place/new.gjs",scope:()=>[FS,S_,jS],isStrictMode:!0}),this)}}const j$=Object.freeze(Object.defineProperty({__proto__:null,default:F$},Symbol.toStringTag,{value:"Module"}));class D$ extends kp{static{Mx(this.prototype,"mapUi",[qf])}#pt=void Px(this,"mapUi");queryParams={lat:{refreshModel:!0},lon:{refreshModel:!0}};model(t){return{lat:parseFloat(t.lat),lon:parseFloat(t.lon)}}setupController(t,e){super.setupController(t,e),e.lat&&e.lon&&this.mapUi.updateCreationCoordinates(e.lat,e.lon),this.mapUi.startCreating()}deactivate(){this.mapUi.stopCreating()}}const N$=Object.freeze(Object.defineProperty({__proto__:null,default:D$},Symbol.toStringTag,{value:"Module"})),B$=Object.assign({},px,{"marco/app":t,"marco/config/environment":vx,"marco/deprecation-workflow":bx,"marco/router":Tx,"marco/services/map-ui":Ox,"marco/services/osm":$x,"marco/services/photon":Wx,"marco/services/settings":Zx,"marco/services/storage":WC,"marco/services/toast":ZC,"marco/utils/format-text":zx,"marco/utils/geo":YC,"marco/utils/geohash-coverage":fC,"marco/utils/icons":eS,"marco/utils/osm-icons":rS,"marco/utils/osm":Nx,"marco/utils/place-mapping":oS,"marco/utils/poi-categories":qx,"marco/utils/social-links":lS,"marco/services/page-title":wS,"marco/templates/search":HS,"marco/controllers/search":ZS,"marco/routes/search":YS,"marco/templates/application":T$,"marco/routes/application":M$,"marco/routes/index":P$,"marco/templates/place":O$,"marco/routes/place":z$,"marco/templates/place/new":j$,"marco/routes/place/new":N$},{});class U${constructor(t,e,n){this.limit=t,this.func=e,this.store=n,this.size=0,this.misses=0,this.hits=0,this.store=n||new Map}get(t){let e=this.store.get(t);return this.store.has(t)?(this.hits++,this.store.get(t)):(this.misses++,e=this.set(t,this.func(t)),e)}set(t,e){return this.limit>this.size&&(this.size++,this.store.set(t,e)),e}purge(){this.store.clear(),this.size=0,this.hits=0,this.misses=0}}const q$=/[ _]/g,V$=new U$(1e3,t=>{return(e=t,J$.get(e)).replace(q$,"-");var e}),$$=/^(\-|_)+(.)?/,G$=/(.)(\-|\_|\.|\s)+(.)?/g,W$=/(^|\/|\.)([a-z])/g,H$=new U$(1e3,t=>{const e=(t,e,n)=>n?`_${n.toUpperCase()}`:"",n=(t,e,n,i)=>e+(i?i.toUpperCase():""),i=t.split("/");for(let r=0;r<i.length;r++)i[r]=i[r].replace($$,e).replace(G$,n);return i.join("/").replace(W$,t=>t.toUpperCase())}),Z$=/([a-z\d])([A-Z]+)/g,K$=/\-|\s+/g,Y$=new U$(1e3,t=>t.replace(Z$,"$1_$2").replace(K$,"_").toLowerCase()),X$=/([a-z\d])([A-Z])/g,J$=new U$(1e3,t=>t.replace(X$,"$1_$2").toLowerCase());class Q${constructor(t){this._entries=t||globalThis.requirejs.entries}moduleNames(){return Object.keys(this._entries)}has(t){return t in this._entries}get(...t){return globalThis.require(...t)}}class tG{static moduleBasedResolver=!0;moduleBasedResolver=!0;_deprecatedPodModulePrefix=!1;_normalizeCache=Object.create(null);static create(t){return new this(t)}moduleNameLookupPatterns=[this.podBasedModuleName,this.podBasedComponentsInSubdir,this.mainModuleName,this.defaultModuleName,this.nestedColocationComponentModuleName];static withModules(t){return class extends(this){static explicitModules=t}}constructor(t){if(Object.assign(this,t),!this._moduleRegistry){let t=this.constructor.explicitModules;t?this._moduleRegistry={moduleNames:()=>Object.keys(t),has:e=>Boolean(t[e]),get:e=>t[e],addModules(e){t=Object.assign({},t,e)}}:(void 0===globalThis.requirejs.entries&&(globalThis.requirejs.entries=globalThis.requirejs._eak_seen),this._moduleRegistry=new Q$)}this.pluralizedTypes=this.pluralizedTypes||Object.create(null),this.pluralizedTypes.config||(this.pluralizedTypes.config="config")}makeToString(t,e){return this.namespace.modulePrefix+"@"+e+":"}shouldWrapInClassFactory(){return!1}parseName(t){if(!0===t.parsedName)return t;let e,n,i,r=t.split("@");if(3===r.length){if(0===r[0].length){e=`@${r[1]}`;let t=r[2].split(":");n=t[0],i=t[1]}else e=`@${r[1]}`,n=r[0].slice(0,-1),i=r[2];"template:components"===n&&(i=`components/${i}`,n="template")}else if(2===r.length){let t=r[0].split(":");if(2===t.length)0===t[1].length?(n=t[0],i=`@${r[1]}`):(e=t[1],n=t[0],i=r[1]);else{let t=r[1].split(":");e=r[0],n=t[0],i=t[1]}"template"===n&&0===e.lastIndexOf("components/",0)&&(i=`components/${i}`,e=e.slice(11))}else r=t.split(":"),n=r[0],i=r[1];let s=i,o=this.namespace;return{parsedName:!0,fullName:t,prefix:e||this.prefix({type:n}),type:n,fullNameWithoutType:s,name:i,root:o,resolveMethodName:"resolve"+(a=n,H$.get(a))};var a}resolveOther(t){eG("`modulePrefix` must be defined",this.namespace.modulePrefix);let e=this.findModuleName(t);if(e){let i=this._extractDefaultExport(e,t);if(void 0===i)throw new Error(` Expected to find: '${t.fullName}' within '${e}' but got 'undefined'. Did you forget to 'export default' within '${e}'?`);return this.shouldWrapInClassFactory(i,t)&&(n=i,i={create:t=>"function"==typeof n.extend?n.extend(t):n}),i}var n}normalize(t){return this._normalizeCache[t]||(this._normalizeCache[t]=this._normalize(t))}resolve(t){if("resolver:current"===t)return{create:()=>this};let e,n=this.parseName(t),i=n.resolveMethodName;return"function"==typeof this[i]&&(e=this[i](n)),null==e&&(e=this.resolveOther(n)),e}addModules(t){if(!this._moduleRegistry.addModules)throw new Error("addModules is only supported when your Resolver has been configured to use static modules via Resolver.withModules()");this._moduleRegistry.addModules(t)}_normalize(t){let e=t.split(":");if(e.length>1){let t=e[0];return"component"===t||"helper"===t||"modifier"===t||"template"===t&&0===e[1].indexOf("components/")?t+":"+e[1].replace(/_/g,"-"):t+":"+(n=e[1].replace(/\./g,"/"),V$.get(n))}return t;var n}pluralize(t){return this.pluralizedTypes[t]||(this.pluralizedTypes[t]=t+"s")}podBasedLookupWithPrefix(t,e){let n=e.fullNameWithoutType;return"template"===e.type&&(n=n.replace(/^components\//,"")),t+"/"+n+"/"+e.type}podBasedModuleName(t){let e=this.namespace.podModulePrefix||this.namespace.modulePrefix;return this.podBasedLookupWithPrefix(e,t)}podBasedComponentsInSubdir(t){let e=this.namespace.podModulePrefix||this.namespace.modulePrefix;if(e+="/components","component"===t.type||/^components/.test(t.fullNameWithoutType))return this.podBasedLookupWithPrefix(e,t)}resolveEngine(t){let e=t.fullNameWithoutType+"/engine";if(this._moduleRegistry.has(e))return this._extractDefaultExport(e)}resolveRouteMap(t){let e=t.fullNameWithoutType,n=e+"/routes";if(this._moduleRegistry.has(n)){let t=this._extractDefaultExport(n);return eG(`The route map for ${e} should be wrapped by 'buildRoutes' before exporting.`,t.isRouteMap),t}}resolveTemplate(t){return this.resolveOther(t)}mainModuleName(t){if("main"===t.fullNameWithoutType)return t.prefix+"/"+t.type}defaultModuleName(t){return t.prefix+"/"+this.pluralize(t.type)+"/"+t.fullNameWithoutType}nestedColocationComponentModuleName(t){if("component"===t.type)return t.prefix+"/"+this.pluralize(t.type)+"/"+t.fullNameWithoutType+"/index"}prefix(t){let e=this.namespace.modulePrefix;return this.namespace[t.type+"Prefix"]&&(e=this.namespace[t.type+"Prefix"]),e}findModuleName(t){let e,n=this.moduleNameLookupPatterns;for(let i=0,r=n.length;i<r;i++){let r=n[i].call(this,t);if(r&&(r=this.chooseModuleName(r)),r&&this._moduleRegistry.has(r)&&(e=r),e)return e}}chooseModuleName(t){let e=(n=t,Y$.get(n));var n;if(t!==e&&this._moduleRegistry.has(t)&&this._moduleRegistry.has(e))throw new TypeError(`Ambiguous module names: '${t}' and '${e}'`);return this._moduleRegistry.has(t)?t:this._moduleRegistry.has(e)?e:void 0}knownForType(t){let e=this._moduleRegistry.moduleNames(),n=Object.create(null);for(let i=0,r=e.length;i<r;i++){let r=e[i],s=this.translateToContainerFullname(t,r);s&&(n[s]=!0)}return n}translateToContainerFullname(t,e){let n=this.prefix({type:t}),i=n+"/",r="/"+t,s=e.indexOf(i),o=e.indexOf(r);if(0===s&&o===e.length-r.length&&e.length>i.length+r.length)return t+":"+e.slice(s+i.length,o);let a=n+"/"+this.pluralize(t)+"/";return 0===e.indexOf(a)&&e.length>a.length?t+":"+e.slice(a.length):void 0}_extractDefaultExport(t){let e=this._moduleRegistry.get(t,null,null,!0);return e&&e.default&&(e=e.default),e}}function eG(t,e){if(!e)throw new Error(t)}const nG={};function iG(t){!function(t){globalThis.emberInspectorApps||(globalThis.emberInspectorApps=[]),globalThis.emberInspectorApps.push({app:t,name:`app-${globalThis.emberInspectorApps.length}`,loadCompatInspector:()=>function(t,e){let n=Promise.resolve();if(e&&e.length>0){document.getElementsByTagName("link");const t=document.querySelector("meta[property=csp-nonce]"),r=t?.nonce||t?.getAttribute("nonce");i=e.map(t=>{if((t=function(t){return"/"+t}(t))in nG)return;nG[t]=!0;const e=t.endsWith(".css"),n=e?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${t}"]${n}`))return;const i=document.createElement("link");return i.rel=e?"stylesheet":"modulepreload",e||(i.as="script"),i.crossOrigin="",i.href=t,r&&i.setAttribute("nonce",r),document.head.appendChild(i),e?new Promise((e,n)=>{i.addEventListener("load",e),i.addEventListener("error",()=>n(new Error(`Unable to preload CSS for ${t}`)))}):void 0}),n=Promise.all(i.map(t=>Promise.resolve(t).then(t=>({status:"fulfilled",value:t}),t=>({status:"rejected",reason:t}))))}var i;function r(t){const e=new Event("vite:preloadError",{cancelable:!0});if(e.payload=t,window.dispatchEvent(e),!e.defaultPrevented)throw t}return n.then(t=>{for(const e of t||[])"rejected"===e.status&&r(e.reason);return import("./modules-4-12-CXJ2X2kS.js").catch(r)})}(0,[])}),globalThis.dispatchEvent&&globalThis.dispatchEvent(new Event("Ember"))}(t)}class rG extends ux{modulePrefix=yx.modulePrefix;podModulePrefix=yx.podModulePrefix;Resolver=tG.withModules(B$);inspector=iG(this)}rG.create(yx.APP);export{Cr as $,Gr as A,as as B,Sr as C,Ms as D,zr as E,po as F,uo as G,ts as H,As as I,Js as J,Ur as K,Ts as L,xs as M,ao as N,Rs as O,is as P,Ir as Q,gs as R,$r as S,Os as T,$e as U,xr as V,mo as W,Ls as X,Lr as Y,mr as Z,ks as _,Cs as a,Xl as a$,ss as a0,dr as a1,qr as a2,go as a3,fo as a4,Xs as a5,Nr as a6,ho as a7,Hr as a8,Ws as a9,lc as aA,dh as aB,qc as aC,Pc as aD,Kc as aE,Dc as aF,Bc as aG,$c as aH,uh as aI,hh as aJ,Fc as aK,Wc as aL,Gc as aM,Uc as aN,nd as aO,g as aP,d as aQ,m as aR,p as aS,h as aT,f as aU,ne as aV,Qt as aW,Jt as aX,ae as aY,oe as aZ,se as a_,Zs as aa,Jr as ab,Br as ac,Or as ad,yo as ae,Qs as af,vo as ag,gr as ah,fr as ai,Ps as aj,js as ak,V_ as al,eb as am,Ni as an,Eb as ao,Ji as ap,CC as aq,Xi as ar,et as as,oc as at,Mc as au,Oc as av,zc as aw,Jc as ax,ch as ay,lh as az,hs as b,Cx as b$,Yl as b0,Kl as b1,nc as b2,ph as b3,Hl as b4,rc as b5,tc as b6,Jl as b7,fh as b8,sr as b9,Ou as bA,ex as bB,Iu as bC,eu as bD,k_ as bE,wu as bF,Kh as bG,Gh as bH,Wh as bI,Fh as bJ,Zh as bK,Uh as bL,jh as bM,Qh as bN,Yh as bO,Jh as bP,qh as bQ,Dh as bR,zh as bS,Vh as bT,$h as bU,dx as bV,Yw as bW,od as bX,PC as bY,ud as bZ,G as b_,Q as ba,at as bb,Zw as bc,st as bd,cl as be,St as bf,tt as bg,nt as bh,no as bi,W as bj,Ct as bk,H as bl,er as bm,vt as bn,dt as bo,ft as bp,eo as bq,pt as br,nr as bs,wt as bt,_t as bu,kt as bv,bt as bw,Lt as bx,K as by,mt as bz,qe as c,Ah as c0,ic as c1,gu as c2,Eh as c3,iu as c4,Lh as c5,FC as c6,OC as c7,Ta as c8,$f as c9,ll as ca,ar as cb,RS as cc,Qi as cd,ii as ce,C_ as cf,En as cg,cn as ch,lo as d,ws as e,Ss as f,Ve as g,Fs as h,Zr as i,Ys as j,Dr as k,co as l,Wr as m,Ds as n,$s as o,Vs as p,fs as q,os as r,zs as s,ls as t,ps as u,ys as v,ms as w,vs as x,Pr as y,Rr as z};