@eox/layercontrol 1.7.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/eox-layercontrol.js +94 -39
- package/dist/eox-layercontrol.umd.cjs +16 -9
- package/package.json +5 -4
- package/src/components/layer-config.js +12 -2
- package/src/components/layer-group.js +4 -0
- package/src/components/layer-list.js +4 -0
- package/src/components/layer-tools.js +9 -0
- package/src/components/layer.js +9 -0
- package/src/enums/index.js +3 -0
- package/src/enums/stories/assets/colormaps.json +50 -0
- package/src/enums/stories/index.js +179 -6
- package/src/helpers/get-legend-config.js +30 -14
- package/src/helpers/get-start-vals.js +23 -11
- package/src/main.js +3 -0
- package/src/methods/layer-config/data-change.js +42 -31
- package/types/components/layer-config.d.ts +12 -0
- package/types/components/layer-config.d.ts.map +1 -1
- package/types/components/layer-group.d.ts +5 -0
- package/types/components/layer-group.d.ts.map +1 -1
- package/types/components/layer-list.d.ts +5 -0
- package/types/components/layer-list.d.ts.map +1 -1
- package/types/components/layer-tools.d.ts +10 -0
- package/types/components/layer-tools.d.ts.map +1 -1
- package/types/components/layer.d.ts +10 -0
- package/types/components/layer.d.ts.map +1 -1
- package/types/enums/index.d.ts +1 -1
- package/types/enums/stories/index.d.ts +442 -176
- package/types/enums/stories/index.d.ts.map +1 -1
- package/types/helpers/get-legend-config.d.ts +2 -1
- package/types/helpers/get-legend-config.d.ts.map +1 -1
- package/types/helpers/get-start-vals.d.ts.map +1 -1
- package/types/main.d.ts +5 -0
- package/types/main.d.ts.map +1 -1
- package/types/methods/layer-config/data-change.d.ts.map +1 -1
- package/src/enums/stories/assets/cropomhusc-feature-collection.json +0 -5274
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports):typeof define==`function`&&define.amd?define([`exports`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e[`eox-layercontrol`]={}))})(this,function(e){Object.defineProperty(e,Symbol.toStringTag,{value:`Module`});var t=Object.create,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,i=Object.getOwnPropertyNames,a=Object.getPrototypeOf,o=Object.prototype.hasOwnProperty,s=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),c=(e,t,a,s)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=i(t),l=0,u=c.length,d;l<u;l++)d=c[l],!o.call(e,d)&&d!==a&&n(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(s=r(t,d))||s.enumerable});return e},l=(e,r,i)=>(i=e==null?{}:t(a(e)),c(r||!e||!e.__esModule?n(i,`default`,{value:e,enumerable:!0}):i,e)),u=globalThis,d=u.ShadowRoot&&(u.ShadyCSS===void 0||u.ShadyCSS.nativeShadow)&&`adoptedStyleSheets`in Document.prototype&&`replace`in CSSStyleSheet.prototype,f=Symbol(),p=new WeakMap,m=class{constructor(e,t,n){if(this._$cssResult$=!0,n!==f)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=e,this.t=t}get styleSheet(){let e=this.o,t=this.t;if(d&&e===void 0){let n=t!==void 0&&t.length===1;n&&(e=p.get(t)),e===void 0&&((this.o=e=new CSSStyleSheet).replaceSync(this.cssText),n&&p.set(t,e))}return e}toString(){return this.cssText}},h=e=>new m(typeof e==`string`?e:e+``,void 0,f),g=(e,...t)=>new m(e.length===1?e[0]:t.reduce(((t,n,r)=>t+(e=>{if(!0===e._$cssResult$)return e.cssText;if(typeof e==`number`)return e;throw Error(`Value passed to 'css' function must be a 'css' function result: `+e+`. Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.`)})(n)+e[r+1]),e[0]),e,f),_=(e,t)=>{if(d)e.adoptedStyleSheets=t.map((e=>e instanceof CSSStyleSheet?e:e.styleSheet));else for(let n of t){let t=document.createElement(`style`),r=u.litNonce;r!==void 0&&t.setAttribute(`nonce`,r),t.textContent=n.cssText,e.appendChild(t)}},v=d?e=>e:e=>e instanceof CSSStyleSheet?(e=>{let t=``;for(let n of e.cssRules)t+=n.cssText;return h(t)})(e):e,{is:y,defineProperty:b,getOwnPropertyDescriptor:x,getOwnPropertyNames:S,getOwnPropertySymbols:C,getPrototypeOf:w}=Object,T=globalThis,ee=T.trustedTypes,te=ee?ee.emptyScript:``,ne=T.reactiveElementPolyfillSupport,E=(e,t)=>e,re={toAttribute(e,t){switch(t){case Boolean:e=e?te:null;break;case Object:case Array:e=e==null?e:JSON.stringify(e)}return e},fromAttribute(e,t){let n=e;switch(t){case Boolean:n=e!==null;break;case Number:n=e===null?null:Number(e);break;case Object:case Array:try{n=JSON.parse(e)}catch{n=null}}return n}},ie=(e,t)=>!y(e,t),ae={attribute:!0,type:String,converter:re,reflect:!1,useDefault:!1,hasChanged:ie};Symbol.metadata??=Symbol(`metadata`),T.litPropertyMetadata??=new WeakMap;var oe=class extends HTMLElement{static addInitializer(e){this._$Ei(),(this.l??=[]).push(e)}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(e,t=ae){if(t.state&&(t.attribute=!1),this._$Ei(),this.prototype.hasOwnProperty(e)&&((t=Object.create(t)).wrapped=!0),this.elementProperties.set(e,t),!t.noAccessor){let n=Symbol(),r=this.getPropertyDescriptor(e,n,t);r!==void 0&&b(this.prototype,e,r)}}static getPropertyDescriptor(e,t,n){let{get:r,set:i}=x(this.prototype,e)??{get(){return this[t]},set(e){this[t]=e}};return{get:r,set(t){let a=r?.call(this);i?.call(this,t),this.requestUpdate(e,a,n)},configurable:!0,enumerable:!0}}static getPropertyOptions(e){return this.elementProperties.get(e)??ae}static _$Ei(){if(this.hasOwnProperty(E(`elementProperties`)))return;let e=w(this);e.finalize(),e.l!==void 0&&(this.l=[...e.l]),this.elementProperties=new Map(e.elementProperties)}static finalize(){if(this.hasOwnProperty(E(`finalized`)))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(E(`properties`))){let e=this.properties,t=[...S(e),...C(e)];for(let n of t)this.createProperty(n,e[n])}let e=this[Symbol.metadata];if(e!==null){let t=litPropertyMetadata.get(e);if(t!==void 0)for(let[e,n]of t)this.elementProperties.set(e,n)}this._$Eh=new Map;for(let[e,t]of this.elementProperties){let n=this._$Eu(e,t);n!==void 0&&this._$Eh.set(n,e)}this.elementStyles=this.finalizeStyles(this.styles)}static finalizeStyles(e){let t=[];if(Array.isArray(e)){let n=new Set(e.flat(1/0).reverse());for(let e of n)t.unshift(v(e))}else e!==void 0&&t.push(v(e));return t}static _$Eu(e,t){let n=t.attribute;return!1===n?void 0:typeof n==`string`?n:typeof e==`string`?e.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev()}_$Ev(){this._$ES=new Promise((e=>this.enableUpdating=e)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((e=>e(this)))}addController(e){(this._$EO??=new Set).add(e),this.renderRoot!==void 0&&this.isConnected&&e.hostConnected?.()}removeController(e){this._$EO?.delete(e)}_$E_(){let e=new Map,t=this.constructor.elementProperties;for(let n of t.keys())this.hasOwnProperty(n)&&(e.set(n,this[n]),delete this[n]);e.size>0&&(this._$Ep=e)}createRenderRoot(){let e=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return _(e,this.constructor.elementStyles),e}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((e=>e.hostConnected?.()))}enableUpdating(e){}disconnectedCallback(){this._$EO?.forEach((e=>e.hostDisconnected?.()))}attributeChangedCallback(e,t,n){this._$AK(e,n)}_$ET(e,t){let n=this.constructor.elementProperties.get(e),r=this.constructor._$Eu(e,n);if(r!==void 0&&!0===n.reflect){let i=(n.converter?.toAttribute===void 0?re:n.converter).toAttribute(t,n.type);this._$Em=e,i==null?this.removeAttribute(r):this.setAttribute(r,i),this._$Em=null}}_$AK(e,t){let n=this.constructor,r=n._$Eh.get(e);if(r!==void 0&&this._$Em!==r){let e=n.getPropertyOptions(r),i=typeof e.converter==`function`?{fromAttribute:e.converter}:e.converter?.fromAttribute===void 0?re:e.converter;this._$Em=r;let a=i.fromAttribute(t,e.type);this[r]=a??this._$Ej?.get(r)??a,this._$Em=null}}requestUpdate(e,t,n){if(e!==void 0){let r=this.constructor,i=this[e];if(n??=r.getPropertyOptions(e),!((n.hasChanged??ie)(i,t)||n.useDefault&&n.reflect&&i===this._$Ej?.get(e)&&!this.hasAttribute(r._$Eu(e,n))))return;this.C(e,t,n)}!1===this.isUpdatePending&&(this._$ES=this._$EP())}C(e,t,{useDefault:n,reflect:r,wrapped:i},a){n&&!(this._$Ej??=new Map).has(e)&&(this._$Ej.set(e,a??t??this[e]),!0!==i||a!==void 0)||(this._$AL.has(e)||(this.hasUpdated||n||(t=void 0),this._$AL.set(e,t)),!0===r&&this._$Em!==e&&(this._$Eq??=new Set).add(e))}async _$EP(){this.isUpdatePending=!0;try{await this._$ES}catch(e){Promise.reject(e)}let e=this.scheduleUpdate();return e!=null&&await e,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(let[e,t]of this._$Ep)this[e]=t;this._$Ep=void 0}let e=this.constructor.elementProperties;if(e.size>0)for(let[t,n]of e){let{wrapped:e}=n,r=this[t];!0!==e||this._$AL.has(t)||r===void 0||this.C(t,void 0,n,r)}}let e=!1,t=this._$AL;try{e=this.shouldUpdate(t),e?(this.willUpdate(t),this._$EO?.forEach((e=>e.hostUpdate?.())),this.update(t)):this._$EM()}catch(t){throw e=!1,this._$EM(),t}e&&this._$AE(t)}willUpdate(e){}_$AE(e){this._$EO?.forEach((e=>e.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(e)),this.updated(e)}_$EM(){this._$AL=new Map,this.isUpdatePending=!1}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(e){return!0}update(e){this._$Eq&&=this._$Eq.forEach((e=>this._$ET(e,this[e]))),this._$EM()}updated(e){}firstUpdated(e){}};oe.elementStyles=[],oe.shadowRootOptions={mode:`open`},oe[E(`elementProperties`)]=new Map,oe[E(`finalized`)]=new Map,ne?.({ReactiveElement:oe}),(T.reactiveElementVersions??=[]).push(`2.1.1`);var se=globalThis,ce=se.trustedTypes,le=ce?ce.createPolicy(`lit-html`,{createHTML:e=>e}):void 0,ue=`$lit$`,de=`lit$${Math.random().toFixed(9).slice(2)}$`,fe=`?`+de,pe=`<${fe}>`,me=document,he=()=>me.createComment(``),ge=e=>e===null||typeof e!=`object`&&typeof e!=`function`,_e=Array.isArray,ve=e=>_e(e)||typeof e?.[Symbol.iterator]==`function`,ye=`[
|
|
2
|
-
\f\r]`,be=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xe=/-->/g,Se=/>/g,Ce=RegExp(`>|${ye}(?:([^\\s"'>=/]+)(${ye}*=${ye}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),we=/'/g,Te=/"/g,Ee=/^(?:script|style|textarea|title)$/i,D=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),De=Symbol.for(`lit-noChange`),O=Symbol.for(`lit-nothing`),Oe=new WeakMap,ke=me.createTreeWalker(me,129);function Ae(e,t){if(!_e(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return le===void 0?t:le.createHTML(t)}var je=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=be;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===be?c[1]===`!--`?o=xe:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=Ce):(Ee.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=Ce):o=Se:o===Ce?c[0]===`>`?(o=i??be,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?Ce:c[3]===`"`?Te:we):o===Te||o===we?o=Ce:o===xe||o===Se?o=be:(o=Ce,i=void 0);let d=o===Ce&&e[t+1].startsWith(`/>`)?` `:``;a+=o===be?n+pe:l>=0?(r.push(s),n.slice(0,l)+ue+n.slice(l)+de+d):n+de+(l===-2?t:d)}return[Ae(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Me=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=je(t,n);if(this.el=e.createElement(l,r),ke.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=ke.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ue)){let t=u[o++],n=i.getAttribute(e).split(de),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Le:r[1]===`?`?Re:r[1]===`@`?ze:Ie}),i.removeAttribute(e)}else e.startsWith(de)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Ee.test(i.tagName)){let e=i.textContent.split(de),t=e.length-1;if(t>0){i.textContent=ce?ce.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],he()),ke.nextNode(),c.push({type:2,index:++a});i.append(e[t],he())}}}else if(i.nodeType===8)if(i.data===fe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(de,e+1))!==-1;)c.push({type:7,index:a}),e+=de.length-1}a++}}static createElement(e,t){let n=me.createElement(`template`);return n.innerHTML=e,n}};function Ne(e,t,n=e,r){if(t===De)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ge(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=Ne(e,i._$AS(e,t.values),i,r)),t}var Pe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??me).importNode(t,!0);ke.currentNode=r;let i=ke.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Fe(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Be(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=ke.nextNode(),a++)}return ke.currentNode=me,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Fe=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ne(this,e,t),ge(e)?e===O||e==null||e===``?(this._$AH!==O&&this._$AR(),this._$AH=O):e!==this._$AH&&e!==De&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ve(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==O&&ge(this._$AH)?this._$AA.nextSibling.data=e:this.T(me.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Me.createElement(Ae(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Pe(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Oe.get(e.strings);return t===void 0&&Oe.set(e.strings,t=new Me(e)),t}k(t){_e(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(he()),this.O(he()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=O,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=O}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=Ne(this,e,t,0),a=!ge(e)||e!==this._$AH&&e!==De,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=Ne(this,r[n+o],t,o),s===De&&(s=this._$AH[o]),a||=!ge(s)||s!==this._$AH[o],s===O?e=O:e!==O&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Le=class extends Ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===O?void 0:e}},Re=class extends Ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==O)}},ze=class extends Ie{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=Ne(this,e,t,0)??O)===De)return;let n=this._$AH,r=e===O&&n!==O||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==O&&(n===O||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Be=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ne(this,e)}},Ve={M:ue,P:de,A:fe,C:1,L:je,R:Pe,D:ve,V:Ne,I:Fe,H:Ie,N:Re,U:ze,B:Le,F:Be},He=se.litHtmlPolyfillSupport;He?.(Me,Fe),(se.litHtmlVersions??=[]).push(`3.3.1`);var Ue=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Fe(t.insertBefore(he(),e),e,void 0,n??{})}return i._$AI(e),i},We=globalThis,k=class extends oe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ue(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return De}};k._$litElement$=!0,k.finalized=!0,We.litElementHydrateSupport?.({LitElement:k});var Ge=We.litElementPolyfillSupport;Ge?.({LitElement:k}),(We.litElementVersions??=[]).push(`4.2.1`);function A(e,t,n){return e?t(e):n?.(e)}var Ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},qe=e=>(...t)=>({_$litDirective$:e,values:t}),Je=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},{I:Ye}=Ve,Xe=e=>e.strings===void 0,Ze=()=>document.createComment(``),Qe=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Ye(r.insertBefore(Ze(),i),r.insertBefore(Ze(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=e.nextSibling;r.insertBefore(e,i),e=t}}}return n},$e=(e,t,n=e)=>(e._$AI(t,n),e),et={},tt=(e,t=et)=>e._$AH=t,nt=e=>e._$AH,rt=e=>{e._$AR(),e._$AA.remove()},it=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},at=qe(class extends Je{constructor(e){if(super(e),e.type!==Ke.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=nt(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=$e(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=$e(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=$e(i[d],a[m]),Qe(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=$e(i[f],a[p]),Qe(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=it(o,p,m),u=it(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=Qe(e,i[d]);$e(t,a[p]),c[p]=t}else c[p]=$e(n,a[p]),Qe(e,i[d],n),i[t]=null;p++}else rt(i[f]),f--;else rt(i[d]),d++;for(;p<=m;){let t=Qe(e,c[m+1]);$e(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&rt(e)}return this.ut=o,tt(e,c),De}}),j=e=>e!==void 0,ot=(e,t,n)=>t in e?e[t]:e[t]=n,st={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},ct=class{constructor(e){this._parser=new e}toDocument(e){return this._parser.parseFromString(e,`application/xml`)}getAllTextContent(e,t){return lt(e,t).join(``)}};function lt(e,t){return ut(e,t,[]).join(``)}function ut(e,t,n){if(e.nodeType===st.CDATA_SECTION||e.nodeType===st.TEXT)t?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,``)):n.push(e.nodeValue);else{var r;for(r=e.firstChild;r;r=r.nextSibling)ut(r,t,n)}return n}function dt(e,t,n,r){for(var i=ft(t);i;i=pt(i)){var a=e[i.namespaceURI||null];if(j(a)){var o=a[i.localName];j(o)&&o.call(r,i,n)}}}function ft(e){let t=e.firstElementChild||e.firstChild;for(;t&&t.nodeType!==st.ELEMENT;)t=t.nextSibling;return t}function pt(e){let t=e.nextElementSibling||e.nextSibling;for(;t&&t.nodeType!==st.ELEMENT;)t=t.nextSibling;return t}function M(e,t,n){return mt(e,t,n)}function mt(e,t,n){var r=j(n)?n:{},i,a;for(i=0,a=e.length;i<a;++i)r[e[i]]=t;return r}function ht(e,t){return(function(n,r){var i=e.call(j(t)?t:this,n,r);j(i)&&r[r.length-1].push(i)})}function N(e,t,n,r,i){return r.push(e),dt(t,n,r,i),r.pop()}function P(e,t,n){return(function(r,i){let a=e.call(j(n)?n:this,r,i);if(j(a)){var o=i[i.length-1],s=j(t)?t:r.localName;o[s]=a}})}function gt(e,t,n){return(function(r,i){var a=e.call(j(n)?n:this,r,i);if(j(a)){var o=i[i.length-1];ot(o,j(t)?t:r.localName,[]).push(a)}})}var _t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function vt(e){return e.replace(_t,``)}function yt(e){let t=/^\s*(true|1)|(false|0)\s*$/.exec(e);if(t)return j(t[1])||!1}function bt(e){return xt(lt(e,!1))}function xt(e){let t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}function St(e){return Ct(lt(e,!1))}function Ct(e){let t=/^\s*(\d+)\s*$/.exec(e);if(t)return parseInt(t[1],10)}function F(e){return vt(lt(e,!1))}var wt=`http://www.w3.org/1999/xlink`;function Tt(e){return e.getAttributeNS(wt,`href`)}function Et(e,t){return N({},on,e,t)}function Dt(e){return[xt(e.getAttribute(`minx`)),xt(e.getAttribute(`miny`)),xt(e.getAttribute(`maxx`)),xt(e.getAttribute(`maxy`))]}function Ot(e,t){let n=Dt(e),r=[xt(e.getAttribute(`resx`)),xt(e.getAttribute(`resy`))];return{crs:e.getAttribute(`CRS`)||e.getAttribute(`SRS`),extent:n,res:r}}function kt(e,t){let n=Dt(e);if(!(!j(n[0])||!j(n[1])||!j(n[2])||!j(n[3])))return n}function At(e,t){return{min:parseFloat(e.getAttribute(`min`)),max:parseFloat(e.getAttribute(`max`))}}function jt(e,t){let n=N({},sn,e,t);if(!j(n))return;let r=n.westBoundLongitude,i=n.southBoundLatitude,a=n.eastBoundLongitude,o=n.northBoundLatitude;if(!(!j(r)||!j(i)||!j(a)||!j(o)))return[r,i,a,o]}function Mt(e,t){return N({},Qt,e,t)}function Nt(e,t){return N({},$t,e,t)}function Pt(e,t){return N({},en,e,t)}function Ft(e,t){return N({},tn,e,t)}function It(e,t){return N({},nn,e,t)}function Lt(e,t){return N([],rn,e,t)}function Rt(e,t){let n=yt(e.getAttribute(`queryable`));return N({queryable:j(n)?n:!1},an,e,t)}function zt(e,t){var n=t[t.length-1];let r=N({},an,e,t);if(!j(r))return;let i=yt(e.getAttribute(`queryable`));j(i)||(i=n.queryable),r.queryable=j(i)?i:!1;let a=Ct(e.getAttribute(`cascaded`));j(a)||(a=n.cascaded),r.cascaded=a;let o=yt(e.getAttribute(`opaque`));j(o)||(o=n.opaque),r.opaque=j(o)?o:!1;let s=yt(e.getAttribute(`noSubsets`));j(s)||(s=n.noSubsets),r.noSubsets=j(s)?s:!1;let c=xt(e.getAttribute(`fixedWidth`));j(c)||(c=n.fixedWidth),r.fixedWidth=c;let l=xt(e.getAttribute(`fixedHeight`));j(l)||(l=n.fixedHeight),r.fixedHeight=l;let u=[`Style`,`CRS`,`AuthorityURL`];for(let e=0,t=u.length;e<t;e++){let t=u[e],i=n[t];if(j(i)){let e=ot(r,t,[]);e=e.concat(i),r[t]=e}}let d=[`EX_GeographicBoundingBox`,`BoundingBox`,`Dimension`,`Attribution`,`MinScaleDenominator`,`MaxScaleDenominator`];for(let e=0,t=d.length;e<t;e++){let t=d[e],i=r[t];j(i)||(r[t]=n[t])}return r}function Bt(e,t){return{name:e.getAttribute(`name`),units:e.getAttribute(`units`),unitSymbol:e.getAttribute(`unitSymbol`),default:e.getAttribute(`default`),multipleValues:yt(e.getAttribute(`multipleValues`)),nearestValue:yt(e.getAttribute(`nearestValue`)),current:yt(e.getAttribute(`current`)),values:F(e)}}function Vt(e,t){return N({},pn,e,t)}function Ht(e,t){return N({},cn,e,t)}function Ut(e,t){return N({},un,e,t)}function Wt(e,t){return N({},dn,e,t)}function Gt(e,t){return N({},ln,e,t)}function Kt(e,t){var n=Vt(e,t);if(j(n))return n.size=[Ct(e.getAttribute(`width`)),Ct(e.getAttribute(`height`))],n}function qt(e,t){var n=Vt(e,t);if(j(n))return n.name=e.getAttribute(`name`),n}function Jt(e,t){var n=Vt(e,t);if(j(n))return n.type=e.getAttribute(`type`),n}function Yt(e,t){return N({},fn,e,t)}function Xt(e,t){return N([],mn,e,t)}var I=[null,`http://www.opengis.net/wms`],Zt=M(I,{Service:P(Nt),Capability:P(Mt)}),Qt=M(I,{Request:P(Ht),Exception:P(Lt),Layer:P(Rt)}),$t=M(I,{Name:P(F),Title:P(F),Abstract:P(F),KeywordList:P(Xt),OnlineResource:P(Tt),ContactInformation:P(Pt),Fees:P(F),AccessConstraints:P(F),LayerLimit:P(St),MaxWidth:P(St),MaxHeight:P(St)}),en=M(I,{ContactPersonPrimary:P(Ft),ContactPosition:P(F),ContactAddress:P(It),ContactVoiceTelephone:P(F),ContactFacsimileTelephone:P(F),ContactElectronicMailAddress:P(F)}),tn=M(I,{ContactPerson:P(F),ContactOrganization:P(F)}),nn=M(I,{AddressType:P(F),Address:P(F),City:P(F),StateOrProvince:P(F),PostCode:P(F),Country:P(F)}),rn=M(I,{Format:ht(F)}),an=M(I,{Name:P(F),Title:P(F),Abstract:P(F),KeywordList:P(Xt),CRS:gt(F),SRS:gt(F),EX_GeographicBoundingBox:P(jt),LatLonBoundingBox:P(kt),BoundingBox:gt(Ot),Dimension:gt(Bt),Attribution:P(Et),AuthorityURL:gt(qt),Identifier:gt(F),MetadataURL:gt(Jt),DataURL:gt(Vt),FeatureListURL:gt(Vt),Style:gt(Yt),MinScaleDenominator:P(bt),MaxScaleDenominator:P(bt),ScaleHint:P(At),Layer:gt(zt)}),on=M(I,{Title:P(F),OnlineResource:P(Tt),LogoURL:P(Kt)}),sn=M(I,{westBoundLongitude:P(bt),eastBoundLongitude:P(bt),southBoundLatitude:P(bt),northBoundLatitude:P(bt)}),cn=M(I,{GetCapabilities:P(Gt),GetMap:P(Gt),GetFeatureInfo:P(Gt)}),ln=M(I,{Format:gt(F),DCPType:gt(Ut)}),un=M(I,{HTTP:P(Wt)}),dn=M(I,{Get:P(Vt),Post:P(Vt)}),fn=M(I,{Name:P(F),Title:P(F),Abstract:P(F),LegendURL:gt(Kt),StyleSheetURL:P(Vt),StyleURL:P(Vt)}),pn=M(I,{Format:P(F),OnlineResource:P(Tt)}),mn=M(I,{Keyword:ht(F)}),hn=class{constructor(e,t){!t&&typeof window<`u`&&(t=window.DOMParser),this.version=void 0,this._parser=new ct(t),this._data=e}data(e){return this._data=e,this}toJSON(e){return e||=this._data,this.parse(e)}parse(e){return this.readFromDocument(this._parser.toDocument(e))}readFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==st.ELEMENT)return this.readFromNode(t);return null}readFromNode(e){return this.version=e.getAttribute(`version`),N({version:this.version},Zt,e,[])||null}};async function gn(e){let t=new URL(e),n=t.searchParams;n.set(`SERVICE`,`WMS`),n.set(`REQUEST`,`GetCapabilities`);let r=t.toString(),i=await fetch(r);if(i.ok)return new hn(await i.text()).toJSON();throw Error(`Error: ${i.status}`)}function _n(e){return/\b(?:wms|ows)\b/i.test(e)?`TileWMS`:/{(?:z|x|y-?)}\/{(?:z|x|y-?)}\/{(?:z|x|y-?)}/i.test(e)?`XYZ`:!1}function vn(e){let t=/^(?:(?:https?|ftp):\/\/|\/\/)?(?:localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+[\w-]*\.)+\w+)(?::\d+)?(?:\/\S*)?$/.test(e),n=_n(e);return!!(e&&t&&n)}function yn(e){return e.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,`"$2": `).replace(/,\s*}/g,`}`).replace(/,\s*]/g,`]`).replace(/\s*(\{|}|\[|\]|,)\s*/g,`$1`).replaceAll(`": //`,`://`)}function bn(e){try{return JSON.parse(yn(e)),!!e}catch{return!1}}function xn(e,t){let n=new URL(e).searchParams;return Object.entries(t).forEach(([e,t])=>{typeof t==`object`&&!Array.isArray(t)&&t!==null?Object.keys(t).forEach(e=>{n.set(e,t[e])}):Array.isArray(t)?(n.delete(e),t.forEach(t=>{n.append(e,t)})):n.set(e,t)}),`${e.split(`?`)[0]}?${n.toString()}`}function Sn(e,t,n){return(t=kn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cn.apply(null,arguments)}function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wn(Object(n),!0).forEach(function(t){Sn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function En(e,t){if(e==null)return{};var n,r,i=Dn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function On(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kn(e){var t=On(e,`string`);return typeof t==`symbol`?t:t+``}function An(e){"@babel/helpers - typeof";return An=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},An(e)}var jn=`1.15.7`;function Mn(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var Nn=Mn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pn=Mn(/Edge/i),Fn=Mn(/firefox/i),In=Mn(/safari/i)&&!Mn(/chrome/i)&&!Mn(/android/i),Ln=Mn(/iP(ad|od|hone)/i),Rn=Mn(/chrome/i)&&Mn(/android/i),zn={capture:!1,passive:!1};function L(e,t,n){e.addEventListener(t,n,!Nn&&zn)}function R(e,t,n){e.removeEventListener(t,n,!Nn&&zn)}function Bn(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Vn(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function Hn(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&Bn(e,t):Bn(e,t))||r&&e===n)return e;if(e===n)break}while(e=Vn(e))}return null}var Un=/\s+/g;function Wn(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(Un,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(Un,` `))}function z(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function Gn(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=z(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Kn(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function qn(){return document.scrollingElement||document.documentElement}function B(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==qn()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!Nn))do if(i&&i.getBoundingClientRect&&(z(i,`transform`)!==`none`||n&&z(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(z(i,`border-top-width`)),s-=f.left+parseInt(z(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=Gn(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function Jn(e,t,n){for(var r=er(e,!0),i=B(e)[t];r;){var a=B(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===qn())break;r=er(r,!1)}return!1}function Yn(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==Y.ghost&&(r||o[a]!==Y.dragged)&&Hn(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function Xn(e,t){for(var n=e.lastElementChild;n&&(n===Y.ghost||z(n,`display`)===`none`||t&&!Bn(n,t));)n=n.previousElementSibling;return n||null}function Zn(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==Y.clone&&(!t||Bn(e,t))&&n++;return n}function Qn(e){var t=0,n=0,r=qn();if(e)do{var i=Gn(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function $n(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function er(e,t){if(!e||!e.getBoundingClientRect)return qn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=z(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return qn();if(r||t)return n;r=!0}}while(n=n.parentNode);return qn()}function tr(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function nr(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var rr;function ir(e,t){return function(){if(!rr){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),rr=setTimeout(function(){rr=void 0},t)}}}function ar(){clearTimeout(rr),rr=void 0}function or(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function sr(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function cr(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(!(!Hn(i,t.draggable,e,!1)||i.animated||i===n)){var a=B(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var lr=`Sortable`+new Date().getTime();function ur(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(!(z(t,`display`)===`none`||t===Y.ghost)){e.push({target:t,rect:B(t)});var n=Tn({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=Gn(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice($n(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=B(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=Gn(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&nr(c,s)&&!nr(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=fr(u,c,l,r.options)),nr(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){z(e,`transition`,``),z(e,`transform`,``);var i=Gn(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,z(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=dr(e),z(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),z(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){z(e,`transition`,``),z(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function dr(e){return e.offsetWidth}function fr(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var pr=[],mr={initializeByDefault:!0},hr={mount:function(e){for(var t in mr)mr.hasOwnProperty(t)&&!(t in e)&&(e[t]=mr[t]);pr.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),pr.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;pr.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](Tn({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](Tn({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in pr.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,Cn(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return pr.forEach(function(r){typeof r.eventProperties==`function`&&Cn(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return pr.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function gr(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[lr],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Nn&&!Pn?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=Tn(Tn({},m),hr.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var _r=[`evt`],vr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=En(n,_r);hr.pluginEvent.bind(Y)(e,t,Tn({dragEl:H,parentEl:U,ghostEl:W,rootEl:G,nextEl:yr,lastDownEl:br,cloneEl:K,cloneHidden:xr,dragStarted:Ir,putSortable:q,activeSortable:Y.active,originalEvent:r,oldIndex:Sr,oldDraggableIndex:wr,newIndex:Cr,newDraggableIndex:Tr,hideGhostForTarget:ei,unhideGhostForTarget:ti,cloneNowHidden:function(){xr=!0},cloneNowShown:function(){xr=!1},dispatchSortableEvent:function(e){V({sortable:t,name:e,originalEvent:r})}},i))};function V(e){gr(Tn({putSortable:q,cloneEl:K,targetEl:H,rootEl:G,oldIndex:Sr,oldDraggableIndex:wr,newIndex:Cr,newDraggableIndex:Tr},e))}var H,U,W,G,yr,br,K,xr,Sr,Cr,wr,Tr,Er,q,Dr=!1,Or=!1,kr=[],Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr=!1,Br=!1,Vr,J,Hr=[],Ur=!1,Wr=[],Gr=typeof document<`u`,Kr=Ln,qr=Pn||Nn?`cssFloat`:`float`,Jr=Gr&&!Rn&&!Ln&&`draggable`in document.createElement(`div`),Yr=function(){if(Gr){if(Nn)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Xr=function(e,t){var n=z(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Yn(e,0,t),a=Yn(e,1,t),o=i&&z(i),s=a&&z(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+B(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+B(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[qr]===`none`||a&&n[qr]===`none`&&c+l>r)?`vertical`:`horizontal`},Zr=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Qr=function(e,t){var n;return kr.some(function(r){var i=r[lr].options.emptyInsertThreshold;if(!(!i||Xn(r))){var a=B(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},$r=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||An(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ei=function(){!Yr&&W&&z(W,`display`,`none`)},ti=function(){!Yr&&W&&z(W,`display`,``)};Gr&&!Rn&&document.addEventListener(`click`,function(e){if(Or)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Or=!1,!1},!0);var ni=function(e){if(H){e=e.touches?e.touches[0]:e;var t=Qr(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[lr]._onDragOver(n)}}},ri=function(e){H&&H.parentNode[lr]._isOutsideThisEl(e.target)};function Y(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Cn({},t),e[lr]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xr(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Y.supportPointer!==!1&&`PointerEvent`in window&&(!In||Ln),emptyInsertThreshold:5};for(var r in hr.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in $r(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:Jr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?L(e,`pointerdown`,this._onTapStart):(L(e,`mousedown`,this._onTapStart),L(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(L(e,`dragover`,this),L(e,`dragenter`,this)),kr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Cn(this,ur())}Y.prototype={constructor:Y,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Lr=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(pi(n),!H&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&In&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=Hn(s,r.draggable,n,!1),!(s&&s.animated)&&br!==s)){if(Sr=Zn(s),wr=Zn(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){V({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),vr(`filter`,t,{evt:e}),i&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=Hn(c,r.trim(),n,!1),r)return V({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),vr(`filter`,t,{evt:e}),!0}),l)){i&&e.preventDefault();return}r.handle&&!Hn(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!H&&n.parentNode===i){var c=B(n);if(G=i,H=n,U=H.parentNode,yr=H.nextSibling,br=n,Er=a.group,Y.dragged=H,Ar={target:H,clientX:(t||e).clientX,clientY:(t||e).clientY},Pr=Ar.clientX-c.left,Fr=Ar.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style[`will-change`]=`all`,s=function(){if(vr(`delayEnded`,r,{evt:e}),Y.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Fn&&r.nativeDraggable&&(H.draggable=!0),r._triggerDragStart(e,t),V({sortable:r,name:`choose`,originalEvent:e}),Wn(H,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){Kn(H,e.trim(),oi)}),L(o,`dragover`,ni),L(o,`mousemove`,ni),L(o,`touchmove`,ni),a.supportPointer?(L(o,`pointerup`,r._onDrop),!this.nativeDraggable&&L(o,`pointercancel`,r._onDrop)):(L(o,`mouseup`,r._onDrop),L(o,`touchend`,r._onDrop),L(o,`touchcancel`,r._onDrop)),Fn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),vr(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Pn||Nn))){if(Y.eventCanceled){this._onDrop();return}a.supportPointer?(L(o,`pointerup`,r._disableDelayedDrag),L(o,`pointercancel`,r._disableDelayedDrag)):(L(o,`mouseup`,r._disableDelayedDrag),L(o,`touchend`,r._disableDelayedDrag),L(o,`touchcancel`,r._disableDelayedDrag)),L(o,`mousemove`,r._delayedDragTouchMoveHandler),L(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&L(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&oi(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;R(e,`mouseup`,this._disableDelayedDrag),R(e,`touchend`,this._disableDelayedDrag),R(e,`touchcancel`,this._disableDelayedDrag),R(e,`pointerup`,this._disableDelayedDrag),R(e,`pointercancel`,this._disableDelayedDrag),R(e,`mousemove`,this._delayedDragTouchMoveHandler),R(e,`touchmove`,this._delayedDragTouchMoveHandler),R(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?L(document,`pointermove`,this._onTouchMove):t?L(document,`touchmove`,this._onTouchMove):L(document,`mousemove`,this._onTouchMove):(L(H,`dragend`,this),L(G,`dragstart`,this._onDragStart));try{document.selection?mi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Dr=!1,G&&H){vr(`dragStarted`,this,{evt:t}),this.nativeDraggable&&L(document,`dragover`,ri);var n=this.options;!e&&Wn(H,n.dragClass,!1),Wn(H,n.ghostClass,!0),Y.active=this,e&&this._appendGhost(),V({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(jr){this._lastX=jr.clientX,this._lastY=jr.clientY,ei();for(var e=document.elementFromPoint(jr.clientX,jr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(jr.clientX,jr.clientY),e!==t);)t=e;if(H.parentNode[lr]._isOutsideThisEl(e),t)do{if(t[lr]){var n=void 0;if(n=t[lr]._onDragOver({clientX:jr.clientX,clientY:jr.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Vn(t));ti()}},_onTouchMove:function(e){if(Ar){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=W&&Gn(W,!0),o=W&&a&&a.a,s=W&&a&&a.d,c=Kr&&J&&Qn(J),l=(i.clientX-Ar.clientX+r.x)/(o||1)+(c?c[0]-Hr[0]:0)/(o||1),u=(i.clientY-Ar.clientY+r.y)/(s||1)+(c?c[1]-Hr[1]:0)/(s||1);if(!Y.active&&!Dr){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(W){a?(a.e+=l-(Mr||0),a.f+=u-(Nr||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;z(W,`webkitTransform`,d),z(W,`mozTransform`,d),z(W,`msTransform`,d),z(W,`transform`,d),Mr=l,Nr=u,jr=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!W){var e=this.options.fallbackOnBody?document.body:G,t=B(H,!0,Kr,!0,e),n=this.options;if(Kr){for(J=e;z(J,`position`)===`static`&&z(J,`transform`)===`none`&&J!==document;)J=J.parentNode;J!==document.body&&J!==document.documentElement?(J===document&&(J=qn()),t.top+=J.scrollTop,t.left+=J.scrollLeft):J=qn(),Hr=Qn(J)}W=H.cloneNode(!0),Wn(W,n.ghostClass,!1),Wn(W,n.fallbackClass,!0),Wn(W,n.dragClass,!0),z(W,`transition`,``),z(W,`transform`,``),z(W,`box-sizing`,`border-box`),z(W,`margin`,0),z(W,`top`,t.top),z(W,`left`,t.left),z(W,`width`,t.width),z(W,`height`,t.height),z(W,`opacity`,`0.8`),z(W,`position`,Kr?`absolute`:`fixed`),z(W,`zIndex`,`100000`),z(W,`pointerEvents`,`none`),Y.ghost=W,e.appendChild(W),z(W,`transform-origin`,Pr/parseInt(W.style.width)*100+`% `+Fr/parseInt(W.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(vr(`dragStart`,this,{evt:e}),Y.eventCanceled){this._onDrop();return}vr(`setupClone`,this),Y.eventCanceled||(K=sr(H),K.removeAttribute(`id`),K.draggable=!1,K.style[`will-change`]=``,this._hideClone(),Wn(K,this.options.chosenClass,!1),Y.clone=K),n.cloneId=mi(function(){vr(`clone`,n),!Y.eventCanceled&&(n.options.removeCloneOnHide||G.insertBefore(K,H),n._hideClone(),V({sortable:n,name:`clone`}))}),!t&&Wn(H,i.dragClass,!0),t?(Or=!0,n._loopId=setInterval(n._emulateDragOver,50)):(R(document,`mouseup`,n._onDrop),R(document,`touchend`,n._onDrop),R(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,H)),L(document,`drop`,n),z(H,`transform`,`translateZ(0)`)),Dr=!0,n._dragStartId=mi(n._dragStarted.bind(n,t,e)),L(document,`selectstart`,n),Ir=!0,window.getSelection().removeAllRanges(),In&&z(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=Y.active,l=Er===s,u=o.sort,d=q||c,f,p=this,m=!1;if(Ur)return;function h(o,s){vr(o,p,Tn({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return ai(G,t,H,r,n,B(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(Wn(H,q?q.options.ghostClass:c.options.ghostClass,!1),Wn(H,o.ghostClass,!0)),q!==p&&p!==Y.active?q=p:p===Y.active&&q&&(q=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===H&&!H.animated||n===t&&!n.animated)&&(Lr=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(H.parentNode[lr]._isOutsideThisEl(e.target),!r&&ni(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){Cr=Zn(H),Tr=Zn(H,o.draggable),V({sortable:p,name:`change`,toEl:t,newIndex:Cr,newDraggableIndex:Tr,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Hn(n,o.draggable,t,!0),h(`dragOver`),Y.eventCanceled)return m;if(H.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(Or=!1,c&&!o.disabled&&(l?u||(a=U!==G):q===this||(this.lastPutMode=Er.checkPull(this,c,H,e))&&s.checkPut(this,c,H,e))){if(f=this._getDirection(e,n)===`vertical`,r=B(H),h(`dragOverValid`),Y.eventCanceled)return m;if(a)return U=G,g(),this._hideClone(),h(`revert`),Y.eventCanceled||(yr?G.insertBefore(H,yr):G.appendChild(H)),_(!0);var y=Xn(t,o.draggable);if(!y||li(e,f,this)&&!y.animated){if(y===H)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=B(n)),ai(G,t,H,r,n,i,e,!!n)!==!1)return g(),y&&y.nextSibling?t.insertBefore(H,y.nextSibling):t.appendChild(H),U=t,v(),_(!0)}else if(y&&ci(e,f,this)){var b=Yn(t,0,o,!0);if(b===H)return _(!1);if(n=b,i=B(n),ai(G,t,H,r,n,i,e,!1)!==!1)return g(),t.insertBefore(H,b),U=t,v(),_(!0)}else if(n.parentNode===t){i=B(n);var x=0,S,C=H.parentNode!==t,w=!Zr(H.animated&&H.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,ee=Jn(n,`top`,`top`)||Jn(H,`top`,`top`),te=ee?ee.scrollTop:void 0;Lr!==n&&(S=i[T],zr=!1,Br=!w&&o.invertSwap||C),x=ui(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Br,Lr===n);var ne;if(x!==0){var E=Zn(H);do E-=x,ne=U.children[E];while(ne&&(z(ne,`display`)===`none`||ne===W))}if(x===0||ne===n)return _(!1);Lr=n,Rr=x;var re=n.nextElementSibling,ie=!1;ie=x===1;var ae=ai(G,t,H,r,n,i,e,ie);if(ae!==!1)return(ae===1||ae===-1)&&(ie=ae===1),Ur=!0,setTimeout(si,30),g(),ie&&!re?t.appendChild(H):n.parentNode.insertBefore(H,ie?re:n),ee&&or(ee,0,te-ee.scrollTop),U=H.parentNode,S!==void 0&&!Br&&(Vr=Math.abs(S-B(n)[T])),v(),_(!0)}if(t.contains(H))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){R(document,`mousemove`,this._onTouchMove),R(document,`touchmove`,this._onTouchMove),R(document,`pointermove`,this._onTouchMove),R(document,`dragover`,ni),R(document,`mousemove`,ni),R(document,`touchmove`,ni)},_offUpEvents:function(){var e=this.el.ownerDocument;R(e,`mouseup`,this._onDrop),R(e,`touchend`,this._onDrop),R(e,`pointerup`,this._onDrop),R(e,`pointercancel`,this._onDrop),R(e,`touchcancel`,this._onDrop),R(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(Cr=Zn(H),Tr=Zn(H,n.draggable),vr(`drop`,this,{evt:e}),U=H&&H.parentNode,Cr=Zn(H),Tr=Zn(H,n.draggable),Y.eventCanceled){this._nulling();return}Dr=!1,Br=!1,zr=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hi(this.cloneId),hi(this._dragStartId),this.nativeDraggable&&(R(document,`drop`,this),R(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),In&&z(document.body,`user-select`,``),z(H,`transform`,``),e&&(Ir&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),W&&W.parentNode&&W.parentNode.removeChild(W),(G===U||q&&q.lastPutMode!==`clone`)&&K&&K.parentNode&&K.parentNode.removeChild(K),H&&(this.nativeDraggable&&R(H,`dragend`,this),oi(H),H.style[`will-change`]=``,Ir&&!Dr&&Wn(H,q?q.options.ghostClass:this.options.ghostClass,!1),Wn(H,this.options.chosenClass,!1),V({sortable:this,name:`unchoose`,toEl:U,newIndex:null,newDraggableIndex:null,originalEvent:e}),G===U?Cr!==Sr&&Cr>=0&&(V({sortable:this,name:`update`,toEl:U,originalEvent:e}),V({sortable:this,name:`sort`,toEl:U,originalEvent:e})):(Cr>=0&&(V({rootEl:U,name:`add`,toEl:U,fromEl:G,originalEvent:e}),V({sortable:this,name:`remove`,toEl:U,originalEvent:e}),V({rootEl:U,name:`sort`,toEl:U,fromEl:G,originalEvent:e}),V({sortable:this,name:`sort`,toEl:U,originalEvent:e})),q&&q.save()),Y.active&&((Cr==null||Cr===-1)&&(Cr=Sr,Tr=wr),V({sortable:this,name:`end`,toEl:U,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){vr(`nulling`,this),G=H=U=W=yr=K=br=xr=Ar=jr=Ir=Cr=Tr=Sr=wr=Lr=Rr=q=Er=Y.dragged=Y.ghost=Y.clone=Y.active=null;var e=this.el;Wr.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Wr.length=Mr=Nr=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:H&&(this._onDragOver(e),ii(e));break;case`selectstart`:e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],Hn(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||fi(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];Hn(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Hn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=hr.modifyOption(this,e,t);r===void 0?n[e]=t:n[e]=r,e===`group`&&$r(n)},destroy:function(){vr(`destroy`,this);var e=this.el;e[lr]=null,R(e,`mousedown`,this._onTapStart),R(e,`touchstart`,this._onTapStart),R(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(R(e,`dragover`,this),R(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),kr.splice(kr.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!xr){if(vr(`hideClone`,this),Y.eventCanceled)return;z(K,`display`,`none`),this.options.removeCloneOnHide&&K.parentNode&&K.parentNode.removeChild(K),xr=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(xr){if(vr(`showClone`,this),Y.eventCanceled)return;H.parentNode==G&&!this.options.group.revertClone?G.insertBefore(K,H):yr?G.insertBefore(K,yr):G.appendChild(K),this.options.group.revertClone&&this.animate(H,K),z(K,`display`,``),xr=!1}}};function ii(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function ai(e,t,n,r,i,a,o,s){var c,l=e[lr],u=l.options.onMove,d;return window.CustomEvent&&!Nn&&!Pn?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||B(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function oi(e){e.draggable=!1}function si(){Ur=!1}function ci(e,t,n){var r=B(Yn(n.el,0,n.options,!0)),i=cr(n.el,n.options,W),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function li(e,t,n){var r=B(Xn(n.el,n.options.draggable)),i=cr(n.el,n.options,W),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function ui(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Vr<l*i){if(!zr&&(Rr===1?c>u+l*a/2:c<d-l*a/2)&&(zr=!0),zr)f=!0;else if(Rr===1?c<u+Vr:c>d-Vr)return-Rr}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return di(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function di(e){return Zn(H)<Zn(e)?1:-1}function fi(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function pi(e){Wr.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&Wr.push(r)}}function mi(e){return setTimeout(e,0)}function hi(e){return clearTimeout(e)}Gr&&L(document,`touchmove`,function(e){(Y.active||Dr)&&e.cancelable&&e.preventDefault()}),Y.utils={on:L,off:R,css:z,find:Kn,is:function(e,t){return!!Hn(e,t,e,!1)},extend:tr,throttle:ir,closest:Hn,toggleClass:Wn,clone:sr,index:Zn,nextTick:mi,cancelNextTick:hi,detectDirection:Xr,getChild:Yn,expando:lr},Y.get=function(e){return e[lr]},Y.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(Y.utils=Tn(Tn({},Y.utils),e.utils)),hr.mount(e)})},Y.create=function(e,t){return new Y(e,t)},Y.version=jn;var X=[],gi,_i,vi=!1,yi,bi,xi,Si;function Ci(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?L(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?L(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?L(document,`touchmove`,this._handleFallbackAutoScroll):L(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?R(document,`dragover`,this._handleAutoScroll):(R(document,`pointermove`,this._handleFallbackAutoScroll),R(document,`touchmove`,this._handleFallbackAutoScroll),R(document,`mousemove`,this._handleFallbackAutoScroll)),Ti(),wi(),ar()},nulling:function(){xi=_i=gi=vi=Si=yi=bi=null,X.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(xi=e,t||this.options.forceAutoScrollFallback||Pn||Nn||In){Ei(e,this.options,a,t);var o=er(a,!0);vi&&(!Si||r!==yi||i!==bi)&&(Si&&Ti(),Si=setInterval(function(){var a=er(document.elementFromPoint(r,i),!0);a!==o&&(o=a,wi()),Ei(e,n.options,a,t)},10),yi=r,bi=i)}else{if(!this.options.bubbleScroll||er(a,!0)===qn()){wi();return}Ei(e,this.options,er(a,!1),!1)}}},Cn(e,{pluginName:`scroll`,initializeByDefault:!0})}function wi(){X.forEach(function(e){clearInterval(e.pid)}),X=[]}function Ti(){clearInterval(Si)}var Ei=ir(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=qn(),l=!1,u;_i!==n&&(_i=n,wi(),gi=t.scroll,u=t.scrollFn,gi===!0&&(gi=er(n,!0)));var d=0,f=gi;do{var p=f,m=B(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=z(p),ee=p.scrollLeft,te=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var ne=x&&(Math.abs(v-i)<=o&&ee+y<C)-(Math.abs(_-i)<=o&&!!ee),E=S&&(Math.abs(g-a)<=o&&te+b<w)-(Math.abs(h-a)<=o&&!!te);if(!X[d])for(var re=0;re<=d;re++)X[re]||(X[re]={});(X[d].vx!=ne||X[d].vy!=E||X[d].el!==p)&&(X[d].el=p,X[d].vx=ne,X[d].vy=E,clearInterval(X[d].pid),(ne!=0||E!=0)&&(l=!0,X[d].pid=setInterval(function(){r&&this.layer===0&&Y.active._onTouchMove(xi);var t=X[this.layer].vy?X[this.layer].vy*s:0,n=X[this.layer].vx?X[this.layer].vx*s:0;typeof u==`function`&&u.call(Y.dragged.parentNode[lr],n,t,e,xi,X[this.layer].el)!==`continue`||or(X[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=er(f,!1)));vi=l}},30),Di=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function Oi(){}Oi.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Yn(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Di},Cn(Oi,{pluginName:`revertOnSpill`});function ki(){}ki.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Di},Cn(ki,{pluginName:`removeOnSpill`}),Y.mount(new Ci),Y.mount(ki,Oi);var Ai=e=>{let t=e.item,n=Array.prototype.slice.call(t.parentNode.childNodes);return n=n.filter(e=>e.nodeType!=Node.ELEMENT_NODE||!e.classList.contains(`sortable-fallback`)),n},ji=(e,t,n,r,i,a)=>{let o=e.item.parentNode;for(let e of n)o.appendChild(e);if(e.oldIndex==e.newIndex)return;let s=r.getArray(),c=e.item.querySelector(`eox-layercontrol-layer`).layer.get(i),l=s.find(e=>e.get(i)===c),u=a.dataset.layer,d=s.find(e=>e.get(i)==u),f,p;for(f=0;f<s.length;f++)if(s[f]==l){r.removeAt(f);break}for(p=0;p<s.length;p++)if(s[p]===d){f>p?r.insertAt(p,l):r.insertAt(p+1,l);break}t.requestUpdate()};function Mi(e,t,n,r){let i=[],a=null;e._sortable=Y.create(e,{handle:`.drag-handle`,filter:`.drag-handle.disabled`,swapThreshold:.5,animation:150,easing:`cubic-bezier(1, 0, 0, 1)`,onStart:e=>{console.log(e),i=Ai(e)},onMove:e=>{a=e.related},onEnd:e=>ji(e,r,i,t,n,a)})}function Ni(e,t,n,r){let i=e.getArray(),a=!1;i.forEach(e=>{let i=e.ol_uid;e.get(t)||(e.set(t,i),a=!0),e.get(n)||(e.set(n,`layer ${i}`),a=!0),a&&r.requestUpdate()})}function Pi(e,t,n){let r=[],i=(e,t,n)=>{r=[...r,...e.filter(e=>e.get(t)===n)];let a=e.filter(e=>e.getLayers);return a.length>0&&a.forEach(e=>i(e.getLayers().getArray(),t,n)),r};return i(e,t,n),r}function Fi(e,t,n){if(!e||!t)return!1;if(!Ii(e,n))return!0;let r=e.get(`minZoom`),i=e.get(`maxZoom`),a=t.getView().getZoom();return a>r&&a<i}function Ii(e,t){let n=e.get(`minZoom`),r=e.get(`maxZoom`);return!!(t&&(n!==-1/0||r!==1/0))}function Li(e,t){if(!(!e||!t))return e.getLayers?`group`:t.getInteractions().getArray().filter(e=>e.freehand_!==void 0).map(e=>e.source_)?.ol_uid?.includes(e.getSource?e.getSource()?.ol_uid:void 0)?`draw`:e.declutter_!==void 0||e.get(`type`)===`Vector`?`vector`:`raster`}var Z={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Ri(e){let t=Hi();for(let n=0,r=e.length;n<r;++n)Ki(t,e[n]);return t}function zi(e,t){return Bi(e,t[0],t[1])}function Bi(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function Vi(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=Z.UNKNOWN;return o<n?c|=Z.LEFT:o>i&&(c|=Z.RIGHT),s<r?c|=Z.BELOW:s>a&&(c|=Z.ABOVE),c===Z.UNKNOWN&&(c=Z.INTERSECTING),c}function Hi(){return[1/0,1/0,-1/0,-1/0]}function Ui(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function Wi(e){return Ui(1/0,1/0,-1/0,-1/0,e)}function Gi(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Ki(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function qi(e,t,n,r,i){for(;n<r;n+=i)Ji(e,t[n],t[n+1]);return e}function Ji(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function Yi(e,t){let n;return n=t(Zi(e)),n||(n=t(Qi(e)),n)||(n=t(ia(e)),n)||(n=t(ra(e)),n)?n:!1}function Xi(e){let t=0;return oa(e)||(t=Q(e)*ta(e)),t}function Zi(e){return[e[0],e[1]]}function Qi(e){return[e[2],e[1]]}function $i(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function ea(e,t){let n;if(t===`bottom-left`)n=Zi(e);else if(t===`bottom-right`)n=Qi(e);else if(t===`top-left`)n=ra(e);else if(t===`top-right`)n=ia(e);else throw Error(`Invalid corner`);return n}function ta(e){return e[3]-e[1]}function na(e,t,n){let r=n||Hi();return aa(e,t)?(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]):Wi(r),r}function ra(e){return[e[0],e[3]]}function ia(e){return[e[2],e[3]]}function Q(e){return e[2]-e[0]}function aa(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function oa(e){return e[2]<e[0]||e[3]<e[1]}function sa(e,t,n){let r=!1,i=Vi(e,t),a=Vi(e,n);if(i===Z.INTERSECTING||a===Z.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&Z.ABOVE&&!(i&Z.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&Z.RIGHT&&!(i&Z.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&Z.BELOW&&!(i&Z.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&Z.LEFT&&!(i&Z.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function ca(e,t){let n=t.getExtent(),r=$i(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=Q(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function la(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];ca(e,t);let i=Q(r);if(Q(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function ua(e,t,n){return Math.min(Math.max(e,t),n)}function da(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function fa(e){return e*180/Math.PI}function pa(e){return e*Math.PI/180}function ma(e,t){let n=e%t;return n*t<0?n+t:n}function ha(e,t){let n=10**t;return Math.round(e*n)/n}function ga(e,t){return Math.floor(ha(e,t))}function _a(e,t){return Math.ceil(ha(e,t))}function va(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}var ya={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},ba=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ya[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},xa=6378137,Sa=Math.PI*xa,Ca=[-Sa,-Sa,Sa,Sa],wa=[-180,-85,180,85],Ta=xa*Math.log(Math.tan(Math.PI/2)),Ea=class extends ba{constructor(e){super({code:e,units:`m`,extent:Ca,global:!0,worldExtent:wa,getPointResolution:function(e,t){return e/Math.cosh(t[1]/xa)}})}},Da=[new Ea(`EPSG:3857`),new Ea(`EPSG:102100`),new Ea(`EPSG:102113`),new Ea(`EPSG:900913`),new Ea(`http://www.opengis.net/def/crs/EPSG/0/3857`),new Ea(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function Oa(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=Sa*e[n]/180;let r=xa*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>Ta?r=Ta:r<-Ta&&(r=-Ta),t[n+1]=r}return t}function ka(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/Sa,t[n+1]=360*Math.atan(Math.exp(e[n+1]/xa))/Math.PI-90;return t}var Aa=6378137,ja=[-180,-90,180,90],Ma=Math.PI*Aa/180,Na=class extends ba{constructor(e,t){super({code:e,units:`degrees`,extent:ja,axisOrientation:t,global:!0,metersPerUnit:Ma,worldExtent:ja})}},Pa=[new Na(`CRS:84`),new Na(`EPSG:4326`,`neu`),new Na(`urn:ogc:def:crs:OGC:1.3:CRS84`),new Na(`urn:ogc:def:crs:OGC:2:84`),new Na(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new Na(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new Na(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],Fa={};function Ia(e){return Fa[e]||Fa[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function La(e,t){Fa[e]=t}function Ra(e){for(let t in e)delete e[t]}function za(e){let t;for(t in e)return!1;return!t}var Ba={};function Va(e,t,n){let r=e.getCode(),i=t.getCode();r in Ba||(Ba[r]={}),Ba[r][i]=n}function Ha(e,t){return e in Ba&&t in Ba[e]?Ba[e][t]:null}var Ua=.9996,Wa=.00669438,Ga=Wa*Wa,Ka=Ga*Wa,qa=Wa/(1-Wa),Ja=Math.sqrt(1-Wa),Ya=(1-Ja)/(1+Ja),Xa=Ya*Ya,Za=Xa*Ya,Qa=Za*Ya,$a=Qa*Ya,eo=1-Wa/4-3*Ga/64-5*Ka/256,to=3*Wa/8+3*Ga/32+45*Ka/1024,no=15*Ga/256+45*Ka/1024,ro=35*Ka/3072,io=3/2*Ya-27/32*Za+269/512*$a,ao=21/16*Xa-55/32*Qa,oo=151/96*Za-417/128*$a,so=1097/512*Qa,co=6378137;function lo(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/Ua/(co*eo),a=i+io*Math.sin(2*i)+ao*Math.sin(4*i)+oo*Math.sin(6*i)+so*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-Wa*s,p=co/Math.sqrt(1-Wa*s),m=(1-Wa)/f,h=qa*c**2,g=h*h,_=r/(p*Ua),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*qa))+S/720*(61+90*u+298*h+45*d-252*qa-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*qa+24*d))/c;return w=va(w+pa(go(n.number)),-Math.PI,Math.PI),[fa(w),fa(C)]}var uo=-80,fo=84,po=-180,mo=180;function ho(e,t,n){e=va(e,po,mo),t<uo?t=uo:t>fo&&(t=fo);let r=pa(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=pa(e),u=pa(go(n.number)),d=co/Math.sqrt(1-Wa*i**2),f=qa*a**2,p=a*va(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=co*(eo*r-to*Math.sin(2*r)+no*Math.sin(4*r)-ro*Math.sin(6*r)),b=Ua*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*qa))+5e5,x=Ua*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*qa)));return n.north||(x+=1e7),[b,x]}function go(e){return(e-1)*6-180+3}var _o=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function vo(e){let t=0;for(let n of _o){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function yo(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function bo(e){return vo(e)?new ba({code:e,units:`m`}):null}function xo(e){let t=vo(e.getCode());return t?{forward:yo(ho,t),inverse:yo(lo,t)}:null}function So(e,t,n){n||=6371008.8;let r=pa(e[1]),i=pa(t[1]),a=(i-r)/2,o=pa(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var Co=[xo],wo=[bo];function To(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function Eo(e){La(e.getCode(),e),Va(e,e,To)}function Do(e){e.forEach(Eo)}function Oo(e){if(typeof e!=`string`)return e;let t=Ia(e);if(t)return t;for(let t of wo){let n=t(e);if(n)return n}return null}function ko(e,t,n,r){e=Oo(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/ya[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=Po(e,Oo(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(So(e.slice(0,2),e.slice(2,4))+So(e.slice(4,6),e.slice(6,8)))/2}let s=r?ya[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function Ao(e){Do(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Va(t,e,To)})})}function jo(e,t,n,r){e.forEach(function(e){t.forEach(function(t){Va(e,t,n),Va(t,e,r)})})}function Mo(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function No(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||Po(e,t)===To)&&n}function Po(e,t){let n=e.getCode(),r=t.getCode(),i=Ha(n,r);if(i)return i;let a=null,o=null;for(let n of Co)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=Ha(s,r);e&&(i=Fo(a.inverse,e))}else if(a)i=Fo(a.inverse,o.forward);else{let e=Ha(n,s);e&&(i=Fo(e,o.forward))}return i&&(Eo(e),Eo(t),Va(e,t,i)),i}function Fo(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function Io(e,t){return Po(Oo(e),Oo(t))}function Lo(e,t,n){let r=Io(t,n);if(!r){let e=Oo(t).getCode(),r=Oo(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function Ro(){Ao(Da),Ao(Pa),jo(Pa,Da,Oa,ka)}Ro();function zo(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function Bo(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var Vo=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}};function Ho(e,t,n,r,i){return i===void 0?new Vo(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}function Uo(e,t){return e>t?1:e<t?-1:0}function Wo(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Go(e,t,n){let r=t||Uo;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function Ko(e,t){if(!e)throw Error(t)}function qo(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function Jo(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function Yo(e,t,n,r,i,a){return a??=qi(Hi(),e,t,n,r),aa(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Jo(e,t,n,r,function(e,t){return sa(i,e,t)}):!1}function Xo(e,t,n,r,i){return!!(Yo(e,t,n,r,i)||qo(e,t,n,r,i[0],i[1])||qo(e,t,n,r,i[0],i[3])||qo(e,t,n,r,i[2],i[1])||qo(e,t,n,r,i[2],i[3]))}function Zo(){throw Error(`Unimplemented abstract method.`)}var Qo=0;function $o(e){return e.ol_uid||=String(++Qo)}function es(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function ts(e,t,n){return e+`/`+t+`/`+n}function ns(e,t,n,r,i){return`${$o(e)},${t},${ts(n,r,i)}`}function rs(e){return is(e[0],e[1],e[2])}function is(e,t,n){return(t<<e)+n}function as(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}var os=[0,0,0],ss=5,cs=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,Ko(Go(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,Ko(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=ra(n)),Ko(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,Ko(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,Ko(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n===void 0?null:n,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes===void 0?n&&this.calculateTileRanges_(n):this.fullTileRanges_=e.sizes.map((e,t)=>{let r=new Vo(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r})}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Ho(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getOrigins(){return this.origins_}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Ho(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Ho(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Ho(o,o,s,s,n):Ho(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,os);let r=os[1],i=os[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,os);let a=os[1],o=os[2];return Ho(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=Bo(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=Bo(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return Ui(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=Bo(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=_a(l,ss)-1,u=_a(u,ss)-1):(l=ga(l,ss),u=ga(u,ss)),es(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=Bo(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=_a(c,ss)-1,l=_a(l,ss)-1):(c=ga(c,ss),l=ga(l,ss)),es(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return ua(Wo(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Xo(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function ls(e){let t=e.getDefaultTileGrid();return t||(t=ms(e),e.setDefaultTileGrid(t)),t}function us(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=hs(n);if(!zi(a,i)){let t=Q(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function ds(e,t,n,r){r=r===void 0?`top-left`:r;let i=ps(e,t,n);return new cs({extent:e,origin:ea(e,r),resolutions:i,tileSize:n})}function fs(e){let t=e||{},n=t.extent||Oo(`EPSG:3857`).getExtent();return new cs({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:ps(n,t.maxZoom,t.tileSize,t.maxResolution)})}function ps(e,t,n,r){t=t===void 0?42:t,n=Bo(n===void 0?256:n);let i=ta(e),a=Q(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function ms(e,t,n,r){return ds(hs(e),t,n,r)}function hs(e){e=Oo(e);let t=e.getExtent();if(!t){let n=180*ya.degrees/e.getMetersPerUnit();t=Ui(-n,-n,n,n)}return t}function gs(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function _s(e,t,n,r){return gs(e,t,n,r,!0)}function vs(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Ra(e))}var ys={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},bs=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function xs(){}var Ss=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},Cs=class extends bs{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new Ss(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,xs);delete a[n]}return s}disposeInternal(){this.listeners_&&Ra(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=xs,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},ws=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;ws.includes(`safari`)&&!ws.includes(`chrom`)&&(ws.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(ws)),ws.includes(`webkit`)&&ws.includes(`edge`),ws.includes(`macintosh`);var Ts=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,Es=typeof Image<`u`&&Image.prototype.decode;(function(){let e=!1;try{let t=Object.defineProperty({},`passive`,{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})();function Ds(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[_s(r,ys.LOAD,function(){o=!0,a||t()})];return r.src&&Es?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(_s(r,ys.ERROR,n)),function(){i=!1,s.forEach(vs)}}var $={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Os(e){return e**3}var ks=class extends Cs{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(ys.CHANGE)}release(){this.setState($.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==$.EMPTY){if(this.state!==$.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){Zo()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Os(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function As(e,t,n,r){let i;return i=n&&n.length?n.shift():Ts?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}function js(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}var Ms=class extends ks{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=n,this.key=n,this.image_,Ts?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=$.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=$.ERROR,this.unlistenImage_(),this.image_=Ns(),this.changed()}handleImageLoad_(){if(Ts)this.state=$.LOADED;else{let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=$.LOADED:this.state=$.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==$.ERROR&&(this.state=$.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==$.IDLE&&(this.state=$.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ds(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function Ns(){let e=As(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Ps,Fs=[];function Is(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function Ls(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function Rs(){if(Ps===void 0){let e=As(6,6,Fs);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,Is(e,4,5,4,0),Is(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;Ps=Ls(t,0)||Ls(t,4)||Ls(t,8),js(e),Fs.push(e.canvas)}return Ps}function zs(e,t,n,r){let i=Lo(n,t,e),a=ko(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||zi(c,i)){let t=ko(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function Bs(e,t,n,r){let i=zs(e,t,$i(n),r);return(!isFinite(i)||i<=0)&&Yi(n,function(n){return i=zs(e,t,n,r),isFinite(i)&&i>0}),i}function Vs(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=As(Math.round(n*e),Math.round(n*t),Fs);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=Hi();c.forEach(function(e,t,n){Gi(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=As(Math.round(Q(g)*v),Math.round(ta(g)*v),Fs),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=Q(i)*v,r=ta(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=Q(e.clipExtent)*v,i=ta(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=Q(e.extent)*v,i=ta(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=ra(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),ee=o,te=s;o=0,s=0,l-=ee,u-=te,f-=ee,p-=te;let ne=da([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!ne)return;if(m.save(),m.beginPath(),Rs()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(ne[0],ne[2],ne[1],ne[3],v,x),m.translate(g[0]-ee,g[3]-te);let E;if(_)E=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;E=e.image,m.scale(Q(t)/E.width,-ta(t)/E.height)}m.drawImage(E,0,0),m.restore()}),_&&(js(_),Fs.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}function Hs(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}var Us=10,Ws=.25,Gs=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?Mo(e=>Hs(o,Lo(e,this.targetProj_,this.sourceProj_))):Io(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Q(r)>=Q(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Q(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Q(this.targetProj_.getExtent()):null;let l=ra(n),u=ia(n),d=Qi(n),f=Zi(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=Us+(a?Math.max(0,Math.ceil(Math.log2(Xi(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=Ri([i,a,o,s]),u=this.sourceWorldWidth_?Q(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=Q(Ri([e,t,n,r]))/this.targetWorldWidth_>Ws||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>Ws||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!aa(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+ +(!isFinite(s[0])||!isFinite(s[1])),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(ma(i[0],d)+ma(o[0],d))/2-ma(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=Hi();return this.triangles_.forEach(function(t,n,r){let i=t.source;Ki(e,i[0]),Ki(e,i[1]),Ki(e,i[2])}),e}getTriangles(){return this.triangles_}},Ks=.5,qs=class extends ks{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,$.IDLE,d),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?na(f,p):f;if(Xi(h)===0){this.state=$.EMPTY;return}let g=e.getExtent();g&&(m=m?na(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=Bs(e,n,h,_);if(!isFinite(v)||v<=0){this.state=$.EMPTY;return}let y=l===void 0?Ks:l;if(this.triangulation_=new Gs(e,n,h,m,v*y,_),this.triangulation_.getTriangles().length===0){this.state=$.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=ua(b[1],m[1],m[3]),b[3]=ua(b[3],m[1],m[3])):b=na(b,m)),!Xi(b))this.state=$.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=Q(g),r=Math.floor((b[0]-g[0])/n)),la(b.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=r*n;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,e,t,o),offset:i})}++r}),this.sourceTiles_.length===0&&(this.state=$.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==$.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset),e.push({extent:r,clipExtent:i,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=$.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Vs(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=$.LOADED}this.changed()}load(){for(let e of this.sourceTiles_)e.tile=e.getTile();if(this.state==$.IDLE){this.state=$.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n==$.IDLE||n==$.LOADING){e++;let n=gs(t,ys.CHANGE,r=>{let i=t.getState();(i==$.LOADED||i==$.ERROR||i==$.EMPTY)&&(vs(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){e.getState()==$.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(vs),this.sourcesListenerKeys_=null}release(){this.canvas_&&=(js(this.canvas_.getContext(`2d`)),Fs.push(this.canvas_),null),this.sourceTiles_.length=0,super.release()}},Js=/\{z\}/g,Ys=/\{x\}/g,Xs=/\{y\}/g,Zs=/\{-y\}/g;function Qs(e,t,n,r,i){return e.replace(Js,t.toString()).replace(Ys,n.toString()).replace(Xs,r.toString()).replace(Zs,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function $s(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function ec(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return Qs(e,o,n[1],n[2],a)})}function tc(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=ec(e[i],t);return nc(r)}function nc(e){return e.length===1?e[0]:(function(t,n,r){if(t)return e[ma(rs(t),e.length)](t,n,r)})}var rc={PROPERTYCHANGE:`propertychange`},ic=class extends Cs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ys.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=gs(this,e[i],t);return r}return gs(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=_s(this,e[i],t)}else n=_s(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)ac(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};ic.prototype.on,ic.prototype.once,ic.prototype.un;function ac(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)vs(e[t]);else vs(e)}var oc=class extends Ss{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},sc=class extends ic{constructor(e){super(),this.on,this.once,this.un,$o(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}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(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new oc(n,e,t)),n=rc.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new oc(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],za(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},cc=class extends sc{constructor(e){super(),this.projection=Oo(e.projection),this.attributions_=lc(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX===void 0?!1:e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=lc(e),this.changed()}setState(e){this.state_=e,this.changed()}};function lc(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var uc=class extends cc{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio===void 0?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&Bo(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||$o(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return Zo()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:ls(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=Bo(r.getTileSize(e),this.tmpSize);return i==1?a:zo(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=us(r,e,n)),as(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},dc=class extends Ss{constructor(e,t){super(e),this.tile=t}},fc={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},pc=class e extends uc{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===e.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(e){let t=e.target,n=$o(t),r=t.getState(),i;r==$.LOADING?(this.tileLoadingKeys_[n]=!0,i=fc.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==$.ERROR?fc.TILELOADERROR:r==$.LOADED?fc.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new dc(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=$s(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(`
|
|
3
|
-
`);this.generateTileUrlFunction_?this.setTileUrlFunction(tc(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},mc=class extends pc{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:hc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0?!0:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?Ms:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!No(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||No(t,e)))return this.tileGrid;let n=$o(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=ls(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?$.EMPTY:$.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(ys.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||No(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new qs(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=ns(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=Oo(e);if(n){let e=$o(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function hc(e,t){if(Ts){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var gc=class extends mc{constructor(e){e||={};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?fs({extent:hs(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}},_c=(e,t,n)=>{let r=t
|
|
2
|
+
\f\r]`,be=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,xe=/-->/g,Se=/>/g,Ce=RegExp(`>|${ye}(?:([^\\s"'>=/]+)(${ye}*=${ye}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,`g`),we=/'/g,Te=/"/g,Ee=/^(?:script|style|textarea|title)$/i,D=(e=>(t,...n)=>({_$litType$:e,strings:t,values:n}))(1),De=Symbol.for(`lit-noChange`),O=Symbol.for(`lit-nothing`),Oe=new WeakMap,ke=me.createTreeWalker(me,129);function Ae(e,t){if(!_e(e)||!e.hasOwnProperty(`raw`))throw Error(`invalid template strings array`);return le===void 0?t:le.createHTML(t)}var je=(e,t)=>{let n=e.length-1,r=[],i,a=t===2?`<svg>`:t===3?`<math>`:``,o=be;for(let t=0;t<n;t++){let n=e[t],s,c,l=-1,u=0;for(;u<n.length&&(o.lastIndex=u,c=o.exec(n),c!==null);)u=o.lastIndex,o===be?c[1]===`!--`?o=xe:c[1]===void 0?c[2]===void 0?c[3]!==void 0&&(o=Ce):(Ee.test(c[2])&&(i=RegExp(`</`+c[2],`g`)),o=Ce):o=Se:o===Ce?c[0]===`>`?(o=i??be,l=-1):c[1]===void 0?l=-2:(l=o.lastIndex-c[2].length,s=c[1],o=c[3]===void 0?Ce:c[3]===`"`?Te:we):o===Te||o===we?o=Ce:o===xe||o===Se?o=be:(o=Ce,i=void 0);let d=o===Ce&&e[t+1].startsWith(`/>`)?` `:``;a+=o===be?n+pe:l>=0?(r.push(s),n.slice(0,l)+ue+n.slice(l)+de+d):n+de+(l===-2?t:d)}return[Ae(e,a+(e[n]||`<?>`)+(t===2?`</svg>`:t===3?`</math>`:``)),r]},Me=class e{constructor({strings:t,_$litType$:n},r){let i;this.parts=[];let a=0,o=0,s=t.length-1,c=this.parts,[l,u]=je(t,n);if(this.el=e.createElement(l,r),ke.currentNode=this.el.content,n===2||n===3){let e=this.el.content.firstChild;e.replaceWith(...e.childNodes)}for(;(i=ke.nextNode())!==null&&c.length<s;){if(i.nodeType===1){if(i.hasAttributes())for(let e of i.getAttributeNames())if(e.endsWith(ue)){let t=u[o++],n=i.getAttribute(e).split(de),r=/([.?@])?(.*)/.exec(t);c.push({type:1,index:a,name:r[2],strings:n,ctor:r[1]===`.`?Le:r[1]===`?`?Re:r[1]===`@`?ze:Ie}),i.removeAttribute(e)}else e.startsWith(de)&&(c.push({type:6,index:a}),i.removeAttribute(e));if(Ee.test(i.tagName)){let e=i.textContent.split(de),t=e.length-1;if(t>0){i.textContent=ce?ce.emptyScript:``;for(let n=0;n<t;n++)i.append(e[n],he()),ke.nextNode(),c.push({type:2,index:++a});i.append(e[t],he())}}}else if(i.nodeType===8)if(i.data===fe)c.push({type:2,index:a});else{let e=-1;for(;(e=i.data.indexOf(de,e+1))!==-1;)c.push({type:7,index:a}),e+=de.length-1}a++}}static createElement(e,t){let n=me.createElement(`template`);return n.innerHTML=e,n}};function Ne(e,t,n=e,r){if(t===De)return t;let i=r===void 0?n._$Cl:n._$Co?.[r],a=ge(t)?void 0:t._$litDirective$;return i?.constructor!==a&&(i?._$AO?.(!1),a===void 0?i=void 0:(i=new a(e),i._$AT(e,n,r)),r===void 0?n._$Cl=i:(n._$Co??=[])[r]=i),i!==void 0&&(t=Ne(e,i._$AS(e,t.values),i,r)),t}var Pe=class{constructor(e,t){this._$AV=[],this._$AN=void 0,this._$AD=e,this._$AM=t}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(e){let{el:{content:t},parts:n}=this._$AD,r=(e?.creationScope??me).importNode(t,!0);ke.currentNode=r;let i=ke.nextNode(),a=0,o=0,s=n[0];for(;s!==void 0;){if(a===s.index){let t;s.type===2?t=new Fe(i,i.nextSibling,this,e):s.type===1?t=new s.ctor(i,s.name,s.strings,this,e):s.type===6&&(t=new Be(i,this,e)),this._$AV.push(t),s=n[++o]}a!==s?.index&&(i=ke.nextNode(),a++)}return ke.currentNode=me,r}p(e){let t=0;for(let n of this._$AV)n!==void 0&&(n.strings===void 0?n._$AI(e[t]):(n._$AI(e,n,t),t+=n.strings.length-2)),t++}},Fe=class e{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(e,t,n,r){this.type=2,this._$AH=O,this._$AN=void 0,this._$AA=e,this._$AB=t,this._$AM=n,this.options=r,this._$Cv=r?.isConnected??!0}get parentNode(){let e=this._$AA.parentNode,t=this._$AM;return t!==void 0&&e?.nodeType===11&&(e=t.parentNode),e}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(e,t=this){e=Ne(this,e,t),ge(e)?e===O||e==null||e===``?(this._$AH!==O&&this._$AR(),this._$AH=O):e!==this._$AH&&e!==De&&this._(e):e._$litType$===void 0?e.nodeType===void 0?ve(e)?this.k(e):this._(e):this.T(e):this.$(e)}O(e){return this._$AA.parentNode.insertBefore(e,this._$AB)}T(e){this._$AH!==e&&(this._$AR(),this._$AH=this.O(e))}_(e){this._$AH!==O&&ge(this._$AH)?this._$AA.nextSibling.data=e:this.T(me.createTextNode(e)),this._$AH=e}$(e){let{values:t,_$litType$:n}=e,r=typeof n==`number`?this._$AC(e):(n.el===void 0&&(n.el=Me.createElement(Ae(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===r)this._$AH.p(t);else{let e=new Pe(r,this),n=e.u(this.options);e.p(t),this.T(n),this._$AH=e}}_$AC(e){let t=Oe.get(e.strings);return t===void 0&&Oe.set(e.strings,t=new Me(e)),t}k(t){_e(this._$AH)||(this._$AH=[],this._$AR());let n=this._$AH,r,i=0;for(let a of t)i===n.length?n.push(r=new e(this.O(he()),this.O(he()),this,this.options)):r=n[i],r._$AI(a),i++;i<n.length&&(this._$AR(r&&r._$AB.nextSibling,i),n.length=i)}_$AR(e=this._$AA.nextSibling,t){for(this._$AP?.(!1,!0,t);e!==this._$AB;){let t=e.nextSibling;e.remove(),e=t}}setConnected(e){this._$AM===void 0&&(this._$Cv=e,this._$AP?.(e))}},Ie=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(e,t,n,r,i){this.type=1,this._$AH=O,this._$AN=void 0,this.element=e,this.name=t,this._$AM=r,this.options=i,n.length>2||n[0]!==``||n[1]!==``?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=O}_$AI(e,t=this,n,r){let i=this.strings,a=!1;if(i===void 0)e=Ne(this,e,t,0),a=!ge(e)||e!==this._$AH&&e!==De,a&&(this._$AH=e);else{let r=e,o,s;for(e=i[0],o=0;o<i.length-1;o++)s=Ne(this,r[n+o],t,o),s===De&&(s=this._$AH[o]),a||=!ge(s)||s!==this._$AH[o],s===O?e=O:e!==O&&(e+=(s??``)+i[o+1]),this._$AH[o]=s}a&&!r&&this.j(e)}j(e){e===O?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,e??``)}},Le=class extends Ie{constructor(){super(...arguments),this.type=3}j(e){this.element[this.name]=e===O?void 0:e}},Re=class extends Ie{constructor(){super(...arguments),this.type=4}j(e){this.element.toggleAttribute(this.name,!!e&&e!==O)}},ze=class extends Ie{constructor(e,t,n,r,i){super(e,t,n,r,i),this.type=5}_$AI(e,t=this){if((e=Ne(this,e,t,0)??O)===De)return;let n=this._$AH,r=e===O&&n!==O||e.capture!==n.capture||e.once!==n.once||e.passive!==n.passive,i=e!==O&&(n===O||r);r&&this.element.removeEventListener(this.name,this,n),i&&this.element.addEventListener(this.name,this,e),this._$AH=e}handleEvent(e){typeof this._$AH==`function`?this._$AH.call(this.options?.host??this.element,e):this._$AH.handleEvent(e)}},Be=class{constructor(e,t,n){this.element=e,this.type=6,this._$AN=void 0,this._$AM=t,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(e){Ne(this,e)}},Ve={M:ue,P:de,A:fe,C:1,L:je,R:Pe,D:ve,V:Ne,I:Fe,H:Ie,N:Re,U:ze,B:Le,F:Be},He=se.litHtmlPolyfillSupport;He?.(Me,Fe),(se.litHtmlVersions??=[]).push(`3.3.1`);var Ue=(e,t,n)=>{let r=n?.renderBefore??t,i=r._$litPart$;if(i===void 0){let e=n?.renderBefore??null;r._$litPart$=i=new Fe(t.insertBefore(he(),e),e,void 0,n??{})}return i._$AI(e),i},We=globalThis,k=class extends oe{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0}createRenderRoot(){let e=super.createRenderRoot();return this.renderOptions.renderBefore??=e.firstChild,e}update(e){let t=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(e),this._$Do=Ue(t,this.renderRoot,this.renderOptions)}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0)}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1)}render(){return De}};k._$litElement$=!0,k.finalized=!0,We.litElementHydrateSupport?.({LitElement:k});var Ge=We.litElementPolyfillSupport;Ge?.({LitElement:k}),(We.litElementVersions??=[]).push(`4.2.1`);function A(e,t,n){return e?t(e):n?.(e)}var Ke={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},qe=e=>(...t)=>({_$litDirective$:e,values:t}),Je=class{constructor(e){}get _$AU(){return this._$AM._$AU}_$AT(e,t,n){this._$Ct=e,this._$AM=t,this._$Ci=n}_$AS(e,t){return this.update(e,t)}update(e,t){return this.render(...t)}},{I:Ye}=Ve,Xe=e=>e.strings===void 0,Ze=()=>document.createComment(``),Qe=(e,t,n)=>{let r=e._$AA.parentNode,i=t===void 0?e._$AB:t._$AA;if(n===void 0)n=new Ye(r.insertBefore(Ze(),i),r.insertBefore(Ze(),i),e,e.options);else{let t=n._$AB.nextSibling,a=n._$AM,o=a!==e;if(o){let t;n._$AQ?.(e),n._$AM=e,n._$AP!==void 0&&(t=e._$AU)!==a._$AU&&n._$AP(t)}if(t!==i||o){let e=n._$AA;for(;e!==t;){let t=e.nextSibling;r.insertBefore(e,i),e=t}}}return n},$e=(e,t,n=e)=>(e._$AI(t,n),e),et={},tt=(e,t=et)=>e._$AH=t,nt=e=>e._$AH,rt=e=>{e._$AR(),e._$AA.remove()},it=(e,t,n)=>{let r=new Map;for(let i=t;i<=n;i++)r.set(e[i],i);return r},at=qe(class extends Je{constructor(e){if(super(e),e.type!==Ke.CHILD)throw Error(`repeat() can only be used in text expressions`)}dt(e,t,n){let r;n===void 0?n=t:t!==void 0&&(r=t);let i=[],a=[],o=0;for(let t of e)i[o]=r?r(t,o):o,a[o]=n(t,o),o++;return{values:a,keys:i}}render(e,t,n){return this.dt(e,t,n).values}update(e,[t,n,r]){let i=nt(e),{values:a,keys:o}=this.dt(t,n,r);if(!Array.isArray(i))return this.ut=o,a;let s=this.ut??=[],c=[],l,u,d=0,f=i.length-1,p=0,m=a.length-1;for(;d<=f&&p<=m;)if(i[d]===null)d++;else if(i[f]===null)f--;else if(s[d]===o[p])c[p]=$e(i[d],a[p]),d++,p++;else if(s[f]===o[m])c[m]=$e(i[f],a[m]),f--,m--;else if(s[d]===o[m])c[m]=$e(i[d],a[m]),Qe(e,c[m+1],i[d]),d++,m--;else if(s[f]===o[p])c[p]=$e(i[f],a[p]),Qe(e,i[d],i[f]),f--,p++;else if(l===void 0&&(l=it(o,p,m),u=it(s,d,f)),l.has(s[d]))if(l.has(s[f])){let t=u.get(o[p]),n=t===void 0?null:i[t];if(n===null){let t=Qe(e,i[d]);$e(t,a[p]),c[p]=t}else c[p]=$e(n,a[p]),Qe(e,i[d],n),i[t]=null;p++}else rt(i[f]),f--;else rt(i[d]),d++;for(;p<=m;){let t=Qe(e,c[m+1]);$e(t,a[p]),c[p++]=t}for(;d<=f;){let e=i[d++];e!==null&&rt(e)}return this.ut=o,tt(e,c),De}}),j=e=>e!==void 0,ot=(e,t,n)=>t in e?e[t]:e[t]=n,st={ELEMENT:1,ATTRIBUTE:2,TEXT:3,CDATA_SECTION:4,ENTITY_REFERENCE:5,ENTITY:6,PROCESSING_INSTRUCTION:7,COMMENT:8,DOCUMENT:9,DOCUMENT_TYPE:10,DOCUMENT_FRAGMENT:11,NOTATION:12},ct=class{constructor(e){this._parser=new e}toDocument(e){return this._parser.parseFromString(e,`application/xml`)}getAllTextContent(e,t){return lt(e,t).join(``)}};function lt(e,t){return ut(e,t,[]).join(``)}function ut(e,t,n){if(e.nodeType===st.CDATA_SECTION||e.nodeType===st.TEXT)t?n.push(String(e.nodeValue).replace(/(\r\n|\r|\n)/g,``)):n.push(e.nodeValue);else{var r;for(r=e.firstChild;r;r=r.nextSibling)ut(r,t,n)}return n}function dt(e,t,n,r){for(var i=ft(t);i;i=pt(i)){var a=e[i.namespaceURI||null];if(j(a)){var o=a[i.localName];j(o)&&o.call(r,i,n)}}}function ft(e){let t=e.firstElementChild||e.firstChild;for(;t&&t.nodeType!==st.ELEMENT;)t=t.nextSibling;return t}function pt(e){let t=e.nextElementSibling||e.nextSibling;for(;t&&t.nodeType!==st.ELEMENT;)t=t.nextSibling;return t}function M(e,t,n){return mt(e,t,n)}function mt(e,t,n){var r=j(n)?n:{},i,a;for(i=0,a=e.length;i<a;++i)r[e[i]]=t;return r}function ht(e,t){return(function(n,r){var i=e.call(j(t)?t:this,n,r);j(i)&&r[r.length-1].push(i)})}function N(e,t,n,r,i){return r.push(e),dt(t,n,r,i),r.pop()}function P(e,t,n){return(function(r,i){let a=e.call(j(n)?n:this,r,i);if(j(a)){var o=i[i.length-1],s=j(t)?t:r.localName;o[s]=a}})}function gt(e,t,n){return(function(r,i){var a=e.call(j(n)?n:this,r,i);if(j(a)){var o=i[i.length-1];ot(o,j(t)?t:r.localName,[]).push(a)}})}var _t=/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g;function vt(e){return e.replace(_t,``)}function yt(e){let t=/^\s*(true|1)|(false|0)\s*$/.exec(e);if(t)return j(t[1])||!1}function bt(e){return xt(lt(e,!1))}function xt(e){let t=/^\s*([+\-]?\d*\.?\d+(?:e[+\-]?\d+)?)\s*$/i.exec(e);if(t)return parseFloat(t[1])}function St(e){return Ct(lt(e,!1))}function Ct(e){let t=/^\s*(\d+)\s*$/.exec(e);if(t)return parseInt(t[1],10)}function F(e){return vt(lt(e,!1))}var wt=`http://www.w3.org/1999/xlink`;function Tt(e){return e.getAttributeNS(wt,`href`)}function Et(e,t){return N({},on,e,t)}function Dt(e){return[xt(e.getAttribute(`minx`)),xt(e.getAttribute(`miny`)),xt(e.getAttribute(`maxx`)),xt(e.getAttribute(`maxy`))]}function Ot(e,t){let n=Dt(e),r=[xt(e.getAttribute(`resx`)),xt(e.getAttribute(`resy`))];return{crs:e.getAttribute(`CRS`)||e.getAttribute(`SRS`),extent:n,res:r}}function kt(e,t){let n=Dt(e);if(!(!j(n[0])||!j(n[1])||!j(n[2])||!j(n[3])))return n}function At(e,t){return{min:parseFloat(e.getAttribute(`min`)),max:parseFloat(e.getAttribute(`max`))}}function jt(e,t){let n=N({},sn,e,t);if(!j(n))return;let r=n.westBoundLongitude,i=n.southBoundLatitude,a=n.eastBoundLongitude,o=n.northBoundLatitude;if(!(!j(r)||!j(i)||!j(a)||!j(o)))return[r,i,a,o]}function Mt(e,t){return N({},Qt,e,t)}function Nt(e,t){return N({},$t,e,t)}function Pt(e,t){return N({},en,e,t)}function Ft(e,t){return N({},tn,e,t)}function It(e,t){return N({},nn,e,t)}function Lt(e,t){return N([],rn,e,t)}function Rt(e,t){let n=yt(e.getAttribute(`queryable`));return N({queryable:j(n)?n:!1},an,e,t)}function zt(e,t){var n=t[t.length-1];let r=N({},an,e,t);if(!j(r))return;let i=yt(e.getAttribute(`queryable`));j(i)||(i=n.queryable),r.queryable=j(i)?i:!1;let a=Ct(e.getAttribute(`cascaded`));j(a)||(a=n.cascaded),r.cascaded=a;let o=yt(e.getAttribute(`opaque`));j(o)||(o=n.opaque),r.opaque=j(o)?o:!1;let s=yt(e.getAttribute(`noSubsets`));j(s)||(s=n.noSubsets),r.noSubsets=j(s)?s:!1;let c=xt(e.getAttribute(`fixedWidth`));j(c)||(c=n.fixedWidth),r.fixedWidth=c;let l=xt(e.getAttribute(`fixedHeight`));j(l)||(l=n.fixedHeight),r.fixedHeight=l;let u=[`Style`,`CRS`,`AuthorityURL`];for(let e=0,t=u.length;e<t;e++){let t=u[e],i=n[t];if(j(i)){let e=ot(r,t,[]);e=e.concat(i),r[t]=e}}let d=[`EX_GeographicBoundingBox`,`BoundingBox`,`Dimension`,`Attribution`,`MinScaleDenominator`,`MaxScaleDenominator`];for(let e=0,t=d.length;e<t;e++){let t=d[e],i=r[t];j(i)||(r[t]=n[t])}return r}function Bt(e,t){return{name:e.getAttribute(`name`),units:e.getAttribute(`units`),unitSymbol:e.getAttribute(`unitSymbol`),default:e.getAttribute(`default`),multipleValues:yt(e.getAttribute(`multipleValues`)),nearestValue:yt(e.getAttribute(`nearestValue`)),current:yt(e.getAttribute(`current`)),values:F(e)}}function Vt(e,t){return N({},pn,e,t)}function Ht(e,t){return N({},cn,e,t)}function Ut(e,t){return N({},un,e,t)}function Wt(e,t){return N({},dn,e,t)}function Gt(e,t){return N({},ln,e,t)}function Kt(e,t){var n=Vt(e,t);if(j(n))return n.size=[Ct(e.getAttribute(`width`)),Ct(e.getAttribute(`height`))],n}function qt(e,t){var n=Vt(e,t);if(j(n))return n.name=e.getAttribute(`name`),n}function Jt(e,t){var n=Vt(e,t);if(j(n))return n.type=e.getAttribute(`type`),n}function Yt(e,t){return N({},fn,e,t)}function Xt(e,t){return N([],mn,e,t)}var I=[null,`http://www.opengis.net/wms`],Zt=M(I,{Service:P(Nt),Capability:P(Mt)}),Qt=M(I,{Request:P(Ht),Exception:P(Lt),Layer:P(Rt)}),$t=M(I,{Name:P(F),Title:P(F),Abstract:P(F),KeywordList:P(Xt),OnlineResource:P(Tt),ContactInformation:P(Pt),Fees:P(F),AccessConstraints:P(F),LayerLimit:P(St),MaxWidth:P(St),MaxHeight:P(St)}),en=M(I,{ContactPersonPrimary:P(Ft),ContactPosition:P(F),ContactAddress:P(It),ContactVoiceTelephone:P(F),ContactFacsimileTelephone:P(F),ContactElectronicMailAddress:P(F)}),tn=M(I,{ContactPerson:P(F),ContactOrganization:P(F)}),nn=M(I,{AddressType:P(F),Address:P(F),City:P(F),StateOrProvince:P(F),PostCode:P(F),Country:P(F)}),rn=M(I,{Format:ht(F)}),an=M(I,{Name:P(F),Title:P(F),Abstract:P(F),KeywordList:P(Xt),CRS:gt(F),SRS:gt(F),EX_GeographicBoundingBox:P(jt),LatLonBoundingBox:P(kt),BoundingBox:gt(Ot),Dimension:gt(Bt),Attribution:P(Et),AuthorityURL:gt(qt),Identifier:gt(F),MetadataURL:gt(Jt),DataURL:gt(Vt),FeatureListURL:gt(Vt),Style:gt(Yt),MinScaleDenominator:P(bt),MaxScaleDenominator:P(bt),ScaleHint:P(At),Layer:gt(zt)}),on=M(I,{Title:P(F),OnlineResource:P(Tt),LogoURL:P(Kt)}),sn=M(I,{westBoundLongitude:P(bt),eastBoundLongitude:P(bt),southBoundLatitude:P(bt),northBoundLatitude:P(bt)}),cn=M(I,{GetCapabilities:P(Gt),GetMap:P(Gt),GetFeatureInfo:P(Gt)}),ln=M(I,{Format:gt(F),DCPType:gt(Ut)}),un=M(I,{HTTP:P(Wt)}),dn=M(I,{Get:P(Vt),Post:P(Vt)}),fn=M(I,{Name:P(F),Title:P(F),Abstract:P(F),LegendURL:gt(Kt),StyleSheetURL:P(Vt),StyleURL:P(Vt)}),pn=M(I,{Format:P(F),OnlineResource:P(Tt)}),mn=M(I,{Keyword:ht(F)}),hn=class{constructor(e,t){!t&&typeof window<`u`&&(t=window.DOMParser),this.version=void 0,this._parser=new ct(t),this._data=e}data(e){return this._data=e,this}toJSON(e){return e||=this._data,this.parse(e)}parse(e){return this.readFromDocument(this._parser.toDocument(e))}readFromDocument(e){for(let t=e.firstChild;t;t=t.nextSibling)if(t.nodeType==st.ELEMENT)return this.readFromNode(t);return null}readFromNode(e){return this.version=e.getAttribute(`version`),N({version:this.version},Zt,e,[])||null}};async function gn(e){let t=new URL(e),n=t.searchParams;n.set(`SERVICE`,`WMS`),n.set(`REQUEST`,`GetCapabilities`);let r=t.toString(),i=await fetch(r);if(i.ok)return new hn(await i.text()).toJSON();throw Error(`Error: ${i.status}`)}function _n(e){return/\b(?:wms|ows)\b/i.test(e)?`TileWMS`:/{(?:z|x|y-?)}\/{(?:z|x|y-?)}\/{(?:z|x|y-?)}/i.test(e)?`XYZ`:!1}function vn(e){let t=/^(?:(?:https?|ftp):\/\/|\/\/)?(?:localhost|\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}|(?:\w+[\w-]*\.)+\w+)(?::\d+)?(?:\/\S*)?$/.test(e),n=_n(e);return!!(e&&t&&n)}function yn(e){return e.replace(/(['"])?([a-zA-Z0-9_]+)(['"])?:/g,`"$2": `).replace(/,\s*}/g,`}`).replace(/,\s*]/g,`]`).replace(/\s*(\{|}|\[|\]|,)\s*/g,`$1`).replaceAll(`": //`,`://`)}function bn(e){try{return JSON.parse(yn(e)),!!e}catch{return!1}}function xn(e,t){let n=new URL(e).searchParams;return Object.entries(t).forEach(([e,t])=>{typeof t==`object`&&!Array.isArray(t)&&t!==null?Object.keys(t).forEach(e=>{n.set(e,t[e])}):Array.isArray(t)?(n.delete(e),t.forEach(t=>{n.append(e,t)})):n.set(e,t)}),`${e.split(`?`)[0]}?${n.toString()}`}function Sn(e,t,n){return(t=kn(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function Cn(){return Cn=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Cn.apply(null,arguments)}function wn(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function Tn(e){for(var t=1;t<arguments.length;t++){var n=arguments[t]==null?{}:arguments[t];t%2?wn(Object(n),!0).forEach(function(t){Sn(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):wn(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function En(e,t){if(e==null)return{};var n,r,i=Dn(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)===-1&&{}.propertyIsEnumerable.call(e,n)&&(i[n]=e[n])}return i}function Dn(e,t){if(e==null)return{};var n={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(t.indexOf(r)!==-1)continue;n[r]=e[r]}return n}function On(e,t){if(typeof e!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(typeof r!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function kn(e){var t=On(e,`string`);return typeof t==`symbol`?t:t+``}function An(e){"@babel/helpers - typeof";return An=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},An(e)}var jn=`1.15.7`;function Mn(e){if(typeof window<`u`&&window.navigator)return!!navigator.userAgent.match(e)}var Nn=Mn(/(?:Trident.*rv[ :]?11\.|msie|iemobile|Windows Phone)/i),Pn=Mn(/Edge/i),Fn=Mn(/firefox/i),In=Mn(/safari/i)&&!Mn(/chrome/i)&&!Mn(/android/i),Ln=Mn(/iP(ad|od|hone)/i),Rn=Mn(/chrome/i)&&Mn(/android/i),zn={capture:!1,passive:!1};function L(e,t,n){e.addEventListener(t,n,!Nn&&zn)}function R(e,t,n){e.removeEventListener(t,n,!Nn&&zn)}function Bn(e,t){if(t){if(t[0]===`>`&&(t=t.substring(1)),e)try{if(e.matches)return e.matches(t);if(e.msMatchesSelector)return e.msMatchesSelector(t);if(e.webkitMatchesSelector)return e.webkitMatchesSelector(t)}catch{return!1}return!1}}function Vn(e){return e.host&&e!==document&&e.host.nodeType&&e.host!==e?e.host:e.parentNode}function Hn(e,t,n,r){if(e){n||=document;do{if(t!=null&&(t[0]===`>`?e.parentNode===n&&Bn(e,t):Bn(e,t))||r&&e===n)return e;if(e===n)break}while(e=Vn(e))}return null}var Un=/\s+/g;function Wn(e,t,n){e&&t&&(e.classList?e.classList[n?`add`:`remove`](t):e.className=((` `+e.className+` `).replace(Un,` `).replace(` `+t+` `,` `)+(n?` `+t:``)).replace(Un,` `))}function z(e,t,n){var r=e&&e.style;if(r){if(n===void 0)return document.defaultView&&document.defaultView.getComputedStyle?n=document.defaultView.getComputedStyle(e,``):e.currentStyle&&(n=e.currentStyle),t===void 0?n:n[t];!(t in r)&&t.indexOf(`webkit`)===-1&&(t=`-webkit-`+t),r[t]=n+(typeof n==`string`?``:`px`)}}function Gn(e,t){var n=``;if(typeof e==`string`)n=e;else do{var r=z(e,`transform`);r&&r!==`none`&&(n=r+` `+n)}while(!t&&(e=e.parentNode));var i=window.DOMMatrix||window.WebKitCSSMatrix||window.CSSMatrix||window.MSCSSMatrix;return i&&new i(n)}function Kn(e,t,n){if(e){var r=e.getElementsByTagName(t),i=0,a=r.length;if(n)for(;i<a;i++)n(r[i],i);return r}return[]}function qn(){return document.scrollingElement||document.documentElement}function B(e,t,n,r,i){if(!(!e.getBoundingClientRect&&e!==window)){var a,o,s,c,l,u,d;if(e!==window&&e.parentNode&&e!==qn()?(a=e.getBoundingClientRect(),o=a.top,s=a.left,c=a.bottom,l=a.right,u=a.height,d=a.width):(o=0,s=0,c=window.innerHeight,l=window.innerWidth,u=window.innerHeight,d=window.innerWidth),(t||n)&&e!==window&&(i||=e.parentNode,!Nn))do if(i&&i.getBoundingClientRect&&(z(i,`transform`)!==`none`||n&&z(i,`position`)!==`static`)){var f=i.getBoundingClientRect();o-=f.top+parseInt(z(i,`border-top-width`)),s-=f.left+parseInt(z(i,`border-left-width`)),c=o+a.height,l=s+a.width;break}while(i=i.parentNode);if(r&&e!==window){var p=Gn(i||e),m=p&&p.a,h=p&&p.d;p&&(o/=h,s/=m,d/=m,u/=h,c=o+u,l=s+d)}return{top:o,left:s,bottom:c,right:l,width:d,height:u}}}function Jn(e,t,n){for(var r=er(e,!0),i=B(e)[t];r;){var a=B(r)[n],o=void 0;if(o=n===`top`||n===`left`?i>=a:i<=a,!o)return r;if(r===qn())break;r=er(r,!1)}return!1}function Yn(e,t,n,r){for(var i=0,a=0,o=e.children;a<o.length;){if(o[a].style.display!==`none`&&o[a]!==Y.ghost&&(r||o[a]!==Y.dragged)&&Hn(o[a],n.draggable,e,!1)){if(i===t)return o[a];i++}a++}return null}function Xn(e,t){for(var n=e.lastElementChild;n&&(n===Y.ghost||z(n,`display`)===`none`||t&&!Bn(n,t));)n=n.previousElementSibling;return n||null}function Zn(e,t){var n=0;if(!e||!e.parentNode)return-1;for(;e=e.previousElementSibling;)e.nodeName.toUpperCase()!==`TEMPLATE`&&e!==Y.clone&&(!t||Bn(e,t))&&n++;return n}function Qn(e){var t=0,n=0,r=qn();if(e)do{var i=Gn(e),a=i.a,o=i.d;t+=e.scrollLeft*a,n+=e.scrollTop*o}while(e!==r&&(e=e.parentNode));return[t,n]}function $n(e,t){for(var n in e)if(e.hasOwnProperty(n)){for(var r in t)if(t.hasOwnProperty(r)&&t[r]===e[n][r])return Number(n)}return-1}function er(e,t){if(!e||!e.getBoundingClientRect)return qn();var n=e,r=!1;do if(n.clientWidth<n.scrollWidth||n.clientHeight<n.scrollHeight){var i=z(n);if(n.clientWidth<n.scrollWidth&&(i.overflowX==`auto`||i.overflowX==`scroll`)||n.clientHeight<n.scrollHeight&&(i.overflowY==`auto`||i.overflowY==`scroll`)){if(!n.getBoundingClientRect||n===document.body)return qn();if(r||t)return n;r=!0}}while(n=n.parentNode);return qn()}function tr(e,t){if(e&&t)for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}function nr(e,t){return Math.round(e.top)===Math.round(t.top)&&Math.round(e.left)===Math.round(t.left)&&Math.round(e.height)===Math.round(t.height)&&Math.round(e.width)===Math.round(t.width)}var rr;function ir(e,t){return function(){if(!rr){var n=arguments,r=this;n.length===1?e.call(r,n[0]):e.apply(r,n),rr=setTimeout(function(){rr=void 0},t)}}}function ar(){clearTimeout(rr),rr=void 0}function or(e,t,n){e.scrollLeft+=t,e.scrollTop+=n}function sr(e){var t=window.Polymer,n=window.jQuery||window.Zepto;return t&&t.dom?t.dom(e).cloneNode(!0):n?n(e).clone(!0)[0]:e.cloneNode(!0)}function cr(e,t,n){var r={};return Array.from(e.children).forEach(function(i){if(!(!Hn(i,t.draggable,e,!1)||i.animated||i===n)){var a=B(i);r.left=Math.min(r.left??1/0,a.left),r.top=Math.min(r.top??1/0,a.top),r.right=Math.max(r.right??-1/0,a.right),r.bottom=Math.max(r.bottom??-1/0,a.bottom)}}),r.width=r.right-r.left,r.height=r.bottom-r.top,r.x=r.left,r.y=r.top,r}var lr=`Sortable`+new Date().getTime();function ur(){var e=[],t;return{captureAnimationState:function(){e=[],this.options.animation&&[].slice.call(this.el.children).forEach(function(t){if(!(z(t,`display`)===`none`||t===Y.ghost)){e.push({target:t,rect:B(t)});var n=Tn({},e[e.length-1].rect);if(t.thisAnimationDuration){var r=Gn(t,!0);r&&(n.top-=r.f,n.left-=r.e)}t.fromRect=n}})},addAnimationState:function(t){e.push(t)},removeAnimationState:function(t){e.splice($n(e,{target:t}),1)},animateAll:function(n){var r=this;if(!this.options.animation){clearTimeout(t),typeof n==`function`&&n();return}var i=!1,a=0;e.forEach(function(e){var t=0,n=e.target,o=n.fromRect,s=B(n),c=n.prevFromRect,l=n.prevToRect,u=e.rect,d=Gn(n,!0);d&&(s.top-=d.f,s.left-=d.e),n.toRect=s,n.thisAnimationDuration&&nr(c,s)&&!nr(o,s)&&(u.top-s.top)/(u.left-s.left)===(o.top-s.top)/(o.left-s.left)&&(t=fr(u,c,l,r.options)),nr(s,o)||(n.prevFromRect=o,n.prevToRect=s,t||=r.options.animation,r.animate(n,u,s,t)),t&&(i=!0,a=Math.max(a,t),clearTimeout(n.animationResetTimer),n.animationResetTimer=setTimeout(function(){n.animationTime=0,n.prevFromRect=null,n.fromRect=null,n.prevToRect=null,n.thisAnimationDuration=null},t),n.thisAnimationDuration=t)}),clearTimeout(t),i?t=setTimeout(function(){typeof n==`function`&&n()},a):typeof n==`function`&&n(),e=[]},animate:function(e,t,n,r){if(r){z(e,`transition`,``),z(e,`transform`,``);var i=Gn(this.el),a=i&&i.a,o=i&&i.d,s=(t.left-n.left)/(a||1),c=(t.top-n.top)/(o||1);e.animatingX=!!s,e.animatingY=!!c,z(e,`transform`,`translate3d(`+s+`px,`+c+`px,0)`),this.forRepaintDummy=dr(e),z(e,`transition`,`transform `+r+`ms`+(this.options.easing?` `+this.options.easing:``)),z(e,`transform`,`translate3d(0,0,0)`),typeof e.animated==`number`&&clearTimeout(e.animated),e.animated=setTimeout(function(){z(e,`transition`,``),z(e,`transform`,``),e.animated=!1,e.animatingX=!1,e.animatingY=!1},r)}}}}function dr(e){return e.offsetWidth}function fr(e,t,n,r){return Math.sqrt((t.top-e.top)**2+(t.left-e.left)**2)/Math.sqrt((t.top-n.top)**2+(t.left-n.left)**2)*r.animation}var pr=[],mr={initializeByDefault:!0},hr={mount:function(e){for(var t in mr)mr.hasOwnProperty(t)&&!(t in e)&&(e[t]=mr[t]);pr.forEach(function(t){if(t.pluginName===e.pluginName)throw`Sortable: Cannot mount plugin ${e.pluginName} more than once`}),pr.push(e)},pluginEvent:function(e,t,n){var r=this;this.eventCanceled=!1,n.cancel=function(){r.eventCanceled=!0};var i=e+`Global`;pr.forEach(function(r){t[r.pluginName]&&(t[r.pluginName][i]&&t[r.pluginName][i](Tn({sortable:t},n)),t.options[r.pluginName]&&t[r.pluginName][e]&&t[r.pluginName][e](Tn({sortable:t},n)))})},initializePlugins:function(e,t,n,r){for(var i in pr.forEach(function(r){var i=r.pluginName;if(!(!e.options[i]&&!r.initializeByDefault)){var a=new r(e,t,e.options);a.sortable=e,a.options=e.options,e[i]=a,Cn(n,a.defaults)}}),e.options)if(e.options.hasOwnProperty(i)){var a=this.modifyOption(e,i,e.options[i]);a!==void 0&&(e.options[i]=a)}},getEventProperties:function(e,t){var n={};return pr.forEach(function(r){typeof r.eventProperties==`function`&&Cn(n,r.eventProperties.call(t[r.pluginName],e))}),n},modifyOption:function(e,t,n){var r;return pr.forEach(function(i){e[i.pluginName]&&i.optionListeners&&typeof i.optionListeners[t]==`function`&&(r=i.optionListeners[t].call(e[i.pluginName],n))}),r}};function gr(e){var t=e.sortable,n=e.rootEl,r=e.name,i=e.targetEl,a=e.cloneEl,o=e.toEl,s=e.fromEl,c=e.oldIndex,l=e.newIndex,u=e.oldDraggableIndex,d=e.newDraggableIndex,f=e.originalEvent,p=e.putSortable,m=e.extraEventProperties;if(t||=n&&n[lr],t){var h,g=t.options,_=`on`+r.charAt(0).toUpperCase()+r.substr(1);window.CustomEvent&&!Nn&&!Pn?h=new CustomEvent(r,{bubbles:!0,cancelable:!0}):(h=document.createEvent(`Event`),h.initEvent(r,!0,!0)),h.to=o||n,h.from=s||n,h.item=i||n,h.clone=a,h.oldIndex=c,h.newIndex=l,h.oldDraggableIndex=u,h.newDraggableIndex=d,h.originalEvent=f,h.pullMode=p?p.lastPutMode:void 0;var v=Tn(Tn({},m),hr.getEventProperties(r,t));for(var y in v)h[y]=v[y];n&&n.dispatchEvent(h),g[_]&&g[_].call(t,h)}}var _r=[`evt`],vr=function(e,t){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=n.evt,i=En(n,_r);hr.pluginEvent.bind(Y)(e,t,Tn({dragEl:H,parentEl:U,ghostEl:W,rootEl:G,nextEl:yr,lastDownEl:br,cloneEl:K,cloneHidden:xr,dragStarted:Ir,putSortable:q,activeSortable:Y.active,originalEvent:r,oldIndex:Sr,oldDraggableIndex:wr,newIndex:Cr,newDraggableIndex:Tr,hideGhostForTarget:ei,unhideGhostForTarget:ti,cloneNowHidden:function(){xr=!0},cloneNowShown:function(){xr=!1},dispatchSortableEvent:function(e){V({sortable:t,name:e,originalEvent:r})}},i))};function V(e){gr(Tn({putSortable:q,cloneEl:K,targetEl:H,rootEl:G,oldIndex:Sr,oldDraggableIndex:wr,newIndex:Cr,newDraggableIndex:Tr},e))}var H,U,W,G,yr,br,K,xr,Sr,Cr,wr,Tr,Er,q,Dr=!1,Or=!1,kr=[],Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr=!1,Br=!1,Vr,J,Hr=[],Ur=!1,Wr=[],Gr=typeof document<`u`,Kr=Ln,qr=Pn||Nn?`cssFloat`:`float`,Jr=Gr&&!Rn&&!Ln&&`draggable`in document.createElement(`div`),Yr=function(){if(Gr){if(Nn)return!1;var e=document.createElement(`x`);return e.style.cssText=`pointer-events:auto`,e.style.pointerEvents===`auto`}}(),Xr=function(e,t){var n=z(e),r=parseInt(n.width)-parseInt(n.paddingLeft)-parseInt(n.paddingRight)-parseInt(n.borderLeftWidth)-parseInt(n.borderRightWidth),i=Yn(e,0,t),a=Yn(e,1,t),o=i&&z(i),s=a&&z(a),c=o&&parseInt(o.marginLeft)+parseInt(o.marginRight)+B(i).width,l=s&&parseInt(s.marginLeft)+parseInt(s.marginRight)+B(a).width;if(n.display===`flex`)return n.flexDirection===`column`||n.flexDirection===`column-reverse`?`vertical`:`horizontal`;if(n.display===`grid`)return n.gridTemplateColumns.split(` `).length<=1?`vertical`:`horizontal`;if(i&&o.float&&o.float!==`none`){var u=o.float===`left`?`left`:`right`;return a&&(s.clear===`both`||s.clear===u)?`vertical`:`horizontal`}return i&&(o.display===`block`||o.display===`flex`||o.display===`table`||o.display===`grid`||c>=r&&n[qr]===`none`||a&&n[qr]===`none`&&c+l>r)?`vertical`:`horizontal`},Zr=function(e,t,n){var r=n?e.left:e.top,i=n?e.right:e.bottom,a=n?e.width:e.height,o=n?t.left:t.top,s=n?t.right:t.bottom,c=n?t.width:t.height;return r===o||i===s||r+a/2===o+c/2},Qr=function(e,t){var n;return kr.some(function(r){var i=r[lr].options.emptyInsertThreshold;if(!(!i||Xn(r))){var a=B(r),o=e>=a.left-i&&e<=a.right+i,s=t>=a.top-i&&t<=a.bottom+i;if(o&&s)return n=r}}),n},$r=function(e){function t(e,n){return function(r,i,a,o){var s=r.options.group.name&&i.options.group.name&&r.options.group.name===i.options.group.name;if(e==null&&(n||s))return!0;if(e==null||e===!1)return!1;if(n&&e===`clone`)return e;if(typeof e==`function`)return t(e(r,i,a,o),n)(r,i,a,o);var c=(n?r:i).options.group.name;return e===!0||typeof e==`string`&&e===c||e.join&&e.indexOf(c)>-1}}var n={},r=e.group;(!r||An(r)!=`object`)&&(r={name:r}),n.name=r.name,n.checkPull=t(r.pull,!0),n.checkPut=t(r.put),n.revertClone=r.revertClone,e.group=n},ei=function(){!Yr&&W&&z(W,`display`,`none`)},ti=function(){!Yr&&W&&z(W,`display`,``)};Gr&&!Rn&&document.addEventListener(`click`,function(e){if(Or)return e.preventDefault(),e.stopPropagation&&e.stopPropagation(),e.stopImmediatePropagation&&e.stopImmediatePropagation(),Or=!1,!1},!0);var ni=function(e){if(H){e=e.touches?e.touches[0]:e;var t=Qr(e.clientX,e.clientY);if(t){var n={};for(var r in e)e.hasOwnProperty(r)&&(n[r]=e[r]);n.target=n.rootEl=t,n.preventDefault=void 0,n.stopPropagation=void 0,t[lr]._onDragOver(n)}}},ri=function(e){H&&H.parentNode[lr]._isOutsideThisEl(e.target)};function Y(e,t){if(!(e&&e.nodeType&&e.nodeType===1))throw`Sortable: \`el\` must be an HTMLElement, not ${{}.toString.call(e)}`;this.el=e,this.options=t=Cn({},t),e[lr]=this;var n={group:null,sort:!0,disabled:!1,store:null,handle:null,draggable:/^[uo]l$/i.test(e.nodeName)?`>li`:`>*`,swapThreshold:1,invertSwap:!1,invertedSwapThreshold:null,removeCloneOnHide:!0,direction:function(){return Xr(e,this.options)},ghostClass:`sortable-ghost`,chosenClass:`sortable-chosen`,dragClass:`sortable-drag`,ignore:`a, img`,filter:null,preventOnFilter:!0,animation:0,easing:null,setData:function(e,t){e.setData(`Text`,t.textContent)},dropBubble:!1,dragoverBubble:!1,dataIdAttr:`data-id`,delay:0,delayOnTouchOnly:!1,touchStartThreshold:(Number.parseInt?Number:window).parseInt(window.devicePixelRatio,10)||1,forceFallback:!1,fallbackClass:`sortable-fallback`,fallbackOnBody:!1,fallbackTolerance:0,fallbackOffset:{x:0,y:0},supportPointer:Y.supportPointer!==!1&&`PointerEvent`in window&&(!In||Ln),emptyInsertThreshold:5};for(var r in hr.initializePlugins(this,e,n),n)!(r in t)&&(t[r]=n[r]);for(var i in $r(t),this)i.charAt(0)===`_`&&typeof this[i]==`function`&&(this[i]=this[i].bind(this));this.nativeDraggable=t.forceFallback?!1:Jr,this.nativeDraggable&&(this.options.touchStartThreshold=1),t.supportPointer?L(e,`pointerdown`,this._onTapStart):(L(e,`mousedown`,this._onTapStart),L(e,`touchstart`,this._onTapStart)),this.nativeDraggable&&(L(e,`dragover`,this),L(e,`dragenter`,this)),kr.push(this.el),t.store&&t.store.get&&this.sort(t.store.get(this)||[]),Cn(this,ur())}Y.prototype={constructor:Y,_isOutsideThisEl:function(e){!this.el.contains(e)&&e!==this.el&&(Lr=null)},_getDirection:function(e,t){return typeof this.options.direction==`function`?this.options.direction.call(this,e,t,H):this.options.direction},_onTapStart:function(e){if(e.cancelable){var t=this,n=this.el,r=this.options,i=r.preventOnFilter,a=e.type,o=e.touches&&e.touches[0]||e.pointerType&&e.pointerType===`touch`&&e,s=(o||e).target,c=e.target.shadowRoot&&(e.path&&e.path[0]||e.composedPath&&e.composedPath()[0])||s,l=r.filter;if(pi(n),!H&&!(/mousedown|pointerdown/.test(a)&&e.button!==0||r.disabled)&&!c.isContentEditable&&!(!this.nativeDraggable&&In&&s&&s.tagName.toUpperCase()===`SELECT`)&&(s=Hn(s,r.draggable,n,!1),!(s&&s.animated)&&br!==s)){if(Sr=Zn(s),wr=Zn(s,r.draggable),typeof l==`function`){if(l.call(this,e,s,this)){V({sortable:t,rootEl:c,name:`filter`,targetEl:s,toEl:n,fromEl:n}),vr(`filter`,t,{evt:e}),i&&e.preventDefault();return}}else if(l&&(l=l.split(`,`).some(function(r){if(r=Hn(c,r.trim(),n,!1),r)return V({sortable:t,rootEl:r,name:`filter`,targetEl:s,fromEl:n,toEl:n}),vr(`filter`,t,{evt:e}),!0}),l)){i&&e.preventDefault();return}r.handle&&!Hn(c,r.handle,n,!1)||this._prepareDragStart(e,o,s)}}},_prepareDragStart:function(e,t,n){var r=this,i=r.el,a=r.options,o=i.ownerDocument,s;if(n&&!H&&n.parentNode===i){var c=B(n);if(G=i,H=n,U=H.parentNode,yr=H.nextSibling,br=n,Er=a.group,Y.dragged=H,Ar={target:H,clientX:(t||e).clientX,clientY:(t||e).clientY},Pr=Ar.clientX-c.left,Fr=Ar.clientY-c.top,this._lastX=(t||e).clientX,this._lastY=(t||e).clientY,H.style[`will-change`]=`all`,s=function(){if(vr(`delayEnded`,r,{evt:e}),Y.eventCanceled){r._onDrop();return}r._disableDelayedDragEvents(),!Fn&&r.nativeDraggable&&(H.draggable=!0),r._triggerDragStart(e,t),V({sortable:r,name:`choose`,originalEvent:e}),Wn(H,a.chosenClass,!0)},a.ignore.split(`,`).forEach(function(e){Kn(H,e.trim(),oi)}),L(o,`dragover`,ni),L(o,`mousemove`,ni),L(o,`touchmove`,ni),a.supportPointer?(L(o,`pointerup`,r._onDrop),!this.nativeDraggable&&L(o,`pointercancel`,r._onDrop)):(L(o,`mouseup`,r._onDrop),L(o,`touchend`,r._onDrop),L(o,`touchcancel`,r._onDrop)),Fn&&this.nativeDraggable&&(this.options.touchStartThreshold=4,H.draggable=!0),vr(`delayStart`,this,{evt:e}),a.delay&&(!a.delayOnTouchOnly||t)&&(!this.nativeDraggable||!(Pn||Nn))){if(Y.eventCanceled){this._onDrop();return}a.supportPointer?(L(o,`pointerup`,r._disableDelayedDrag),L(o,`pointercancel`,r._disableDelayedDrag)):(L(o,`mouseup`,r._disableDelayedDrag),L(o,`touchend`,r._disableDelayedDrag),L(o,`touchcancel`,r._disableDelayedDrag)),L(o,`mousemove`,r._delayedDragTouchMoveHandler),L(o,`touchmove`,r._delayedDragTouchMoveHandler),a.supportPointer&&L(o,`pointermove`,r._delayedDragTouchMoveHandler),r._dragStartTimer=setTimeout(s,a.delay)}else s()}},_delayedDragTouchMoveHandler:function(e){var t=e.touches?e.touches[0]:e;Math.max(Math.abs(t.clientX-this._lastX),Math.abs(t.clientY-this._lastY))>=Math.floor(this.options.touchStartThreshold/(this.nativeDraggable&&window.devicePixelRatio||1))&&this._disableDelayedDrag()},_disableDelayedDrag:function(){H&&oi(H),clearTimeout(this._dragStartTimer),this._disableDelayedDragEvents()},_disableDelayedDragEvents:function(){var e=this.el.ownerDocument;R(e,`mouseup`,this._disableDelayedDrag),R(e,`touchend`,this._disableDelayedDrag),R(e,`touchcancel`,this._disableDelayedDrag),R(e,`pointerup`,this._disableDelayedDrag),R(e,`pointercancel`,this._disableDelayedDrag),R(e,`mousemove`,this._delayedDragTouchMoveHandler),R(e,`touchmove`,this._delayedDragTouchMoveHandler),R(e,`pointermove`,this._delayedDragTouchMoveHandler)},_triggerDragStart:function(e,t){t||=e.pointerType==`touch`&&e,!this.nativeDraggable||t?this.options.supportPointer?L(document,`pointermove`,this._onTouchMove):t?L(document,`touchmove`,this._onTouchMove):L(document,`mousemove`,this._onTouchMove):(L(H,`dragend`,this),L(G,`dragstart`,this._onDragStart));try{document.selection?mi(function(){document.selection.empty()}):window.getSelection().removeAllRanges()}catch{}},_dragStarted:function(e,t){if(Dr=!1,G&&H){vr(`dragStarted`,this,{evt:t}),this.nativeDraggable&&L(document,`dragover`,ri);var n=this.options;!e&&Wn(H,n.dragClass,!1),Wn(H,n.ghostClass,!0),Y.active=this,e&&this._appendGhost(),V({sortable:this,name:`start`,originalEvent:t})}else this._nulling()},_emulateDragOver:function(){if(jr){this._lastX=jr.clientX,this._lastY=jr.clientY,ei();for(var e=document.elementFromPoint(jr.clientX,jr.clientY),t=e;e&&e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(jr.clientX,jr.clientY),e!==t);)t=e;if(H.parentNode[lr]._isOutsideThisEl(e),t)do{if(t[lr]){var n=void 0;if(n=t[lr]._onDragOver({clientX:jr.clientX,clientY:jr.clientY,target:e,rootEl:t}),n&&!this.options.dragoverBubble)break}e=t}while(t=Vn(t));ti()}},_onTouchMove:function(e){if(Ar){var t=this.options,n=t.fallbackTolerance,r=t.fallbackOffset,i=e.touches?e.touches[0]:e,a=W&&Gn(W,!0),o=W&&a&&a.a,s=W&&a&&a.d,c=Kr&&J&&Qn(J),l=(i.clientX-Ar.clientX+r.x)/(o||1)+(c?c[0]-Hr[0]:0)/(o||1),u=(i.clientY-Ar.clientY+r.y)/(s||1)+(c?c[1]-Hr[1]:0)/(s||1);if(!Y.active&&!Dr){if(n&&Math.max(Math.abs(i.clientX-this._lastX),Math.abs(i.clientY-this._lastY))<n)return;this._onDragStart(e,!0)}if(W){a?(a.e+=l-(Mr||0),a.f+=u-(Nr||0)):a={a:1,b:0,c:0,d:1,e:l,f:u};var d=`matrix(${a.a},${a.b},${a.c},${a.d},${a.e},${a.f})`;z(W,`webkitTransform`,d),z(W,`mozTransform`,d),z(W,`msTransform`,d),z(W,`transform`,d),Mr=l,Nr=u,jr=i}e.cancelable&&e.preventDefault()}},_appendGhost:function(){if(!W){var e=this.options.fallbackOnBody?document.body:G,t=B(H,!0,Kr,!0,e),n=this.options;if(Kr){for(J=e;z(J,`position`)===`static`&&z(J,`transform`)===`none`&&J!==document;)J=J.parentNode;J!==document.body&&J!==document.documentElement?(J===document&&(J=qn()),t.top+=J.scrollTop,t.left+=J.scrollLeft):J=qn(),Hr=Qn(J)}W=H.cloneNode(!0),Wn(W,n.ghostClass,!1),Wn(W,n.fallbackClass,!0),Wn(W,n.dragClass,!0),z(W,`transition`,``),z(W,`transform`,``),z(W,`box-sizing`,`border-box`),z(W,`margin`,0),z(W,`top`,t.top),z(W,`left`,t.left),z(W,`width`,t.width),z(W,`height`,t.height),z(W,`opacity`,`0.8`),z(W,`position`,Kr?`absolute`:`fixed`),z(W,`zIndex`,`100000`),z(W,`pointerEvents`,`none`),Y.ghost=W,e.appendChild(W),z(W,`transform-origin`,Pr/parseInt(W.style.width)*100+`% `+Fr/parseInt(W.style.height)*100+`%`)}},_onDragStart:function(e,t){var n=this,r=e.dataTransfer,i=n.options;if(vr(`dragStart`,this,{evt:e}),Y.eventCanceled){this._onDrop();return}vr(`setupClone`,this),Y.eventCanceled||(K=sr(H),K.removeAttribute(`id`),K.draggable=!1,K.style[`will-change`]=``,this._hideClone(),Wn(K,this.options.chosenClass,!1),Y.clone=K),n.cloneId=mi(function(){vr(`clone`,n),!Y.eventCanceled&&(n.options.removeCloneOnHide||G.insertBefore(K,H),n._hideClone(),V({sortable:n,name:`clone`}))}),!t&&Wn(H,i.dragClass,!0),t?(Or=!0,n._loopId=setInterval(n._emulateDragOver,50)):(R(document,`mouseup`,n._onDrop),R(document,`touchend`,n._onDrop),R(document,`touchcancel`,n._onDrop),r&&(r.effectAllowed=`move`,i.setData&&i.setData.call(n,r,H)),L(document,`drop`,n),z(H,`transform`,`translateZ(0)`)),Dr=!0,n._dragStartId=mi(n._dragStarted.bind(n,t,e)),L(document,`selectstart`,n),Ir=!0,window.getSelection().removeAllRanges(),In&&z(document.body,`user-select`,`none`)},_onDragOver:function(e){var t=this.el,n=e.target,r,i,a,o=this.options,s=o.group,c=Y.active,l=Er===s,u=o.sort,d=q||c,f,p=this,m=!1;if(Ur)return;function h(o,s){vr(o,p,Tn({evt:e,isOwner:l,axis:f?`vertical`:`horizontal`,revert:a,dragRect:r,targetRect:i,canSort:u,fromSortable:d,target:n,completed:_,onMove:function(n,i){return ai(G,t,H,r,n,B(n),e,i)},changed:v},s))}function g(){h(`dragOverAnimationCapture`),p.captureAnimationState(),p!==d&&d.captureAnimationState()}function _(r){return h(`dragOverCompleted`,{insertion:r}),r&&(l?c._hideClone():c._showClone(p),p!==d&&(Wn(H,q?q.options.ghostClass:c.options.ghostClass,!1),Wn(H,o.ghostClass,!0)),q!==p&&p!==Y.active?q=p:p===Y.active&&q&&(q=null),d===p&&(p._ignoreWhileAnimating=n),p.animateAll(function(){h(`dragOverAnimationComplete`),p._ignoreWhileAnimating=null}),p!==d&&(d.animateAll(),d._ignoreWhileAnimating=null)),(n===H&&!H.animated||n===t&&!n.animated)&&(Lr=null),!o.dragoverBubble&&!e.rootEl&&n!==document&&(H.parentNode[lr]._isOutsideThisEl(e.target),!r&&ni(e)),!o.dragoverBubble&&e.stopPropagation&&e.stopPropagation(),m=!0}function v(){Cr=Zn(H),Tr=Zn(H,o.draggable),V({sortable:p,name:`change`,toEl:t,newIndex:Cr,newDraggableIndex:Tr,originalEvent:e})}if(e.preventDefault!==void 0&&e.cancelable&&e.preventDefault(),n=Hn(n,o.draggable,t,!0),h(`dragOver`),Y.eventCanceled)return m;if(H.contains(e.target)||n.animated&&n.animatingX&&n.animatingY||p._ignoreWhileAnimating===n)return _(!1);if(Or=!1,c&&!o.disabled&&(l?u||(a=U!==G):q===this||(this.lastPutMode=Er.checkPull(this,c,H,e))&&s.checkPut(this,c,H,e))){if(f=this._getDirection(e,n)===`vertical`,r=B(H),h(`dragOverValid`),Y.eventCanceled)return m;if(a)return U=G,g(),this._hideClone(),h(`revert`),Y.eventCanceled||(yr?G.insertBefore(H,yr):G.appendChild(H)),_(!0);var y=Xn(t,o.draggable);if(!y||li(e,f,this)&&!y.animated){if(y===H)return _(!1);if(y&&t===e.target&&(n=y),n&&(i=B(n)),ai(G,t,H,r,n,i,e,!!n)!==!1)return g(),y&&y.nextSibling?t.insertBefore(H,y.nextSibling):t.appendChild(H),U=t,v(),_(!0)}else if(y&&ci(e,f,this)){var b=Yn(t,0,o,!0);if(b===H)return _(!1);if(n=b,i=B(n),ai(G,t,H,r,n,i,e,!1)!==!1)return g(),t.insertBefore(H,b),U=t,v(),_(!0)}else if(n.parentNode===t){i=B(n);var x=0,S,C=H.parentNode!==t,w=!Zr(H.animated&&H.toRect||r,n.animated&&n.toRect||i,f),T=f?`top`:`left`,ee=Jn(n,`top`,`top`)||Jn(H,`top`,`top`),te=ee?ee.scrollTop:void 0;Lr!==n&&(S=i[T],zr=!1,Br=!w&&o.invertSwap||C),x=ui(e,n,i,f,w?1:o.swapThreshold,o.invertedSwapThreshold==null?o.swapThreshold:o.invertedSwapThreshold,Br,Lr===n);var ne;if(x!==0){var E=Zn(H);do E-=x,ne=U.children[E];while(ne&&(z(ne,`display`)===`none`||ne===W))}if(x===0||ne===n)return _(!1);Lr=n,Rr=x;var re=n.nextElementSibling,ie=!1;ie=x===1;var ae=ai(G,t,H,r,n,i,e,ie);if(ae!==!1)return(ae===1||ae===-1)&&(ie=ae===1),Ur=!0,setTimeout(si,30),g(),ie&&!re?t.appendChild(H):n.parentNode.insertBefore(H,ie?re:n),ee&&or(ee,0,te-ee.scrollTop),U=H.parentNode,S!==void 0&&!Br&&(Vr=Math.abs(S-B(n)[T])),v(),_(!0)}if(t.contains(H))return _(!1)}return!1},_ignoreWhileAnimating:null,_offMoveEvents:function(){R(document,`mousemove`,this._onTouchMove),R(document,`touchmove`,this._onTouchMove),R(document,`pointermove`,this._onTouchMove),R(document,`dragover`,ni),R(document,`mousemove`,ni),R(document,`touchmove`,ni)},_offUpEvents:function(){var e=this.el.ownerDocument;R(e,`mouseup`,this._onDrop),R(e,`touchend`,this._onDrop),R(e,`pointerup`,this._onDrop),R(e,`pointercancel`,this._onDrop),R(e,`touchcancel`,this._onDrop),R(document,`selectstart`,this)},_onDrop:function(e){var t=this.el,n=this.options;if(Cr=Zn(H),Tr=Zn(H,n.draggable),vr(`drop`,this,{evt:e}),U=H&&H.parentNode,Cr=Zn(H),Tr=Zn(H,n.draggable),Y.eventCanceled){this._nulling();return}Dr=!1,Br=!1,zr=!1,clearInterval(this._loopId),clearTimeout(this._dragStartTimer),hi(this.cloneId),hi(this._dragStartId),this.nativeDraggable&&(R(document,`drop`,this),R(t,`dragstart`,this._onDragStart)),this._offMoveEvents(),this._offUpEvents(),In&&z(document.body,`user-select`,``),z(H,`transform`,``),e&&(Ir&&(e.cancelable&&e.preventDefault(),!n.dropBubble&&e.stopPropagation()),W&&W.parentNode&&W.parentNode.removeChild(W),(G===U||q&&q.lastPutMode!==`clone`)&&K&&K.parentNode&&K.parentNode.removeChild(K),H&&(this.nativeDraggable&&R(H,`dragend`,this),oi(H),H.style[`will-change`]=``,Ir&&!Dr&&Wn(H,q?q.options.ghostClass:this.options.ghostClass,!1),Wn(H,this.options.chosenClass,!1),V({sortable:this,name:`unchoose`,toEl:U,newIndex:null,newDraggableIndex:null,originalEvent:e}),G===U?Cr!==Sr&&Cr>=0&&(V({sortable:this,name:`update`,toEl:U,originalEvent:e}),V({sortable:this,name:`sort`,toEl:U,originalEvent:e})):(Cr>=0&&(V({rootEl:U,name:`add`,toEl:U,fromEl:G,originalEvent:e}),V({sortable:this,name:`remove`,toEl:U,originalEvent:e}),V({rootEl:U,name:`sort`,toEl:U,fromEl:G,originalEvent:e}),V({sortable:this,name:`sort`,toEl:U,originalEvent:e})),q&&q.save()),Y.active&&((Cr==null||Cr===-1)&&(Cr=Sr,Tr=wr),V({sortable:this,name:`end`,toEl:U,originalEvent:e}),this.save()))),this._nulling()},_nulling:function(){vr(`nulling`,this),G=H=U=W=yr=K=br=xr=Ar=jr=Ir=Cr=Tr=Sr=wr=Lr=Rr=q=Er=Y.dragged=Y.ghost=Y.clone=Y.active=null;var e=this.el;Wr.forEach(function(t){e.contains(t)&&(t.checked=!0)}),Wr.length=Mr=Nr=0},handleEvent:function(e){switch(e.type){case`drop`:case`dragend`:this._onDrop(e);break;case`dragenter`:case`dragover`:H&&(this._onDragOver(e),ii(e));break;case`selectstart`:e.preventDefault();break}},toArray:function(){for(var e=[],t,n=this.el.children,r=0,i=n.length,a=this.options;r<i;r++)t=n[r],Hn(t,a.draggable,this.el,!1)&&e.push(t.getAttribute(a.dataIdAttr)||fi(t));return e},sort:function(e,t){var n={},r=this.el;this.toArray().forEach(function(e,t){var i=r.children[t];Hn(i,this.options.draggable,r,!1)&&(n[e]=i)},this),t&&this.captureAnimationState(),e.forEach(function(e){n[e]&&(r.removeChild(n[e]),r.appendChild(n[e]))}),t&&this.animateAll()},save:function(){var e=this.options.store;e&&e.set&&e.set(this)},closest:function(e,t){return Hn(e,t||this.options.draggable,this.el,!1)},option:function(e,t){var n=this.options;if(t===void 0)return n[e];var r=hr.modifyOption(this,e,t);r===void 0?n[e]=t:n[e]=r,e===`group`&&$r(n)},destroy:function(){vr(`destroy`,this);var e=this.el;e[lr]=null,R(e,`mousedown`,this._onTapStart),R(e,`touchstart`,this._onTapStart),R(e,`pointerdown`,this._onTapStart),this.nativeDraggable&&(R(e,`dragover`,this),R(e,`dragenter`,this)),Array.prototype.forEach.call(e.querySelectorAll(`[draggable]`),function(e){e.removeAttribute(`draggable`)}),this._onDrop(),this._disableDelayedDragEvents(),kr.splice(kr.indexOf(this.el),1),this.el=e=null},_hideClone:function(){if(!xr){if(vr(`hideClone`,this),Y.eventCanceled)return;z(K,`display`,`none`),this.options.removeCloneOnHide&&K.parentNode&&K.parentNode.removeChild(K),xr=!0}},_showClone:function(e){if(e.lastPutMode!==`clone`){this._hideClone();return}if(xr){if(vr(`showClone`,this),Y.eventCanceled)return;H.parentNode==G&&!this.options.group.revertClone?G.insertBefore(K,H):yr?G.insertBefore(K,yr):G.appendChild(K),this.options.group.revertClone&&this.animate(H,K),z(K,`display`,``),xr=!1}}};function ii(e){e.dataTransfer&&(e.dataTransfer.dropEffect=`move`),e.cancelable&&e.preventDefault()}function ai(e,t,n,r,i,a,o,s){var c,l=e[lr],u=l.options.onMove,d;return window.CustomEvent&&!Nn&&!Pn?c=new CustomEvent(`move`,{bubbles:!0,cancelable:!0}):(c=document.createEvent(`Event`),c.initEvent(`move`,!0,!0)),c.to=t,c.from=e,c.dragged=n,c.draggedRect=r,c.related=i||t,c.relatedRect=a||B(t),c.willInsertAfter=s,c.originalEvent=o,e.dispatchEvent(c),u&&(d=u.call(l,c,o)),d}function oi(e){e.draggable=!1}function si(){Ur=!1}function ci(e,t,n){var r=B(Yn(n.el,0,n.options,!0)),i=cr(n.el,n.options,W),a=10;return t?e.clientX<i.left-a||e.clientY<r.top&&e.clientX<r.right:e.clientY<i.top-a||e.clientY<r.bottom&&e.clientX<r.left}function li(e,t,n){var r=B(Xn(n.el,n.options.draggable)),i=cr(n.el,n.options,W),a=10;return t?e.clientX>i.right+a||e.clientY>r.bottom&&e.clientX>r.left:e.clientY>i.bottom+a||e.clientX>r.right&&e.clientY>r.top}function ui(e,t,n,r,i,a,o,s){var c=r?e.clientY:e.clientX,l=r?n.height:n.width,u=r?n.top:n.left,d=r?n.bottom:n.right,f=!1;if(!o){if(s&&Vr<l*i){if(!zr&&(Rr===1?c>u+l*a/2:c<d-l*a/2)&&(zr=!0),zr)f=!0;else if(Rr===1?c<u+Vr:c>d-Vr)return-Rr}else if(c>u+l*(1-i)/2&&c<d-l*(1-i)/2)return di(t)}return f||=o,f&&(c<u+l*a/2||c>d-l*a/2)?c>u+l/2?1:-1:0}function di(e){return Zn(H)<Zn(e)?1:-1}function fi(e){for(var t=e.tagName+e.className+e.src+e.href+e.textContent,n=t.length,r=0;n--;)r+=t.charCodeAt(n);return r.toString(36)}function pi(e){Wr.length=0;for(var t=e.getElementsByTagName(`input`),n=t.length;n--;){var r=t[n];r.checked&&Wr.push(r)}}function mi(e){return setTimeout(e,0)}function hi(e){return clearTimeout(e)}Gr&&L(document,`touchmove`,function(e){(Y.active||Dr)&&e.cancelable&&e.preventDefault()}),Y.utils={on:L,off:R,css:z,find:Kn,is:function(e,t){return!!Hn(e,t,e,!1)},extend:tr,throttle:ir,closest:Hn,toggleClass:Wn,clone:sr,index:Zn,nextTick:mi,cancelNextTick:hi,detectDirection:Xr,getChild:Yn,expando:lr},Y.get=function(e){return e[lr]},Y.mount=function(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];t[0].constructor===Array&&(t=t[0]),t.forEach(function(e){if(!e.prototype||!e.prototype.constructor)throw`Sortable: Mounted plugin must be a constructor function, not ${{}.toString.call(e)}`;e.utils&&(Y.utils=Tn(Tn({},Y.utils),e.utils)),hr.mount(e)})},Y.create=function(e,t){return new Y(e,t)},Y.version=jn;var X=[],gi,_i,vi=!1,yi,bi,xi,Si;function Ci(){function e(){for(var e in this.defaults={scroll:!0,forceAutoScrollFallback:!1,scrollSensitivity:30,scrollSpeed:10,bubbleScroll:!0},this)e.charAt(0)===`_`&&typeof this[e]==`function`&&(this[e]=this[e].bind(this))}return e.prototype={dragStarted:function(e){var t=e.originalEvent;this.sortable.nativeDraggable?L(document,`dragover`,this._handleAutoScroll):this.options.supportPointer?L(document,`pointermove`,this._handleFallbackAutoScroll):t.touches?L(document,`touchmove`,this._handleFallbackAutoScroll):L(document,`mousemove`,this._handleFallbackAutoScroll)},dragOverCompleted:function(e){var t=e.originalEvent;!this.options.dragOverBubble&&!t.rootEl&&this._handleAutoScroll(t)},drop:function(){this.sortable.nativeDraggable?R(document,`dragover`,this._handleAutoScroll):(R(document,`pointermove`,this._handleFallbackAutoScroll),R(document,`touchmove`,this._handleFallbackAutoScroll),R(document,`mousemove`,this._handleFallbackAutoScroll)),Ti(),wi(),ar()},nulling:function(){xi=_i=gi=vi=Si=yi=bi=null,X.length=0},_handleFallbackAutoScroll:function(e){this._handleAutoScroll(e,!0)},_handleAutoScroll:function(e,t){var n=this,r=(e.touches?e.touches[0]:e).clientX,i=(e.touches?e.touches[0]:e).clientY,a=document.elementFromPoint(r,i);if(xi=e,t||this.options.forceAutoScrollFallback||Pn||Nn||In){Ei(e,this.options,a,t);var o=er(a,!0);vi&&(!Si||r!==yi||i!==bi)&&(Si&&Ti(),Si=setInterval(function(){var a=er(document.elementFromPoint(r,i),!0);a!==o&&(o=a,wi()),Ei(e,n.options,a,t)},10),yi=r,bi=i)}else{if(!this.options.bubbleScroll||er(a,!0)===qn()){wi();return}Ei(e,this.options,er(a,!1),!1)}}},Cn(e,{pluginName:`scroll`,initializeByDefault:!0})}function wi(){X.forEach(function(e){clearInterval(e.pid)}),X=[]}function Ti(){clearInterval(Si)}var Ei=ir(function(e,t,n,r){if(t.scroll){var i=(e.touches?e.touches[0]:e).clientX,a=(e.touches?e.touches[0]:e).clientY,o=t.scrollSensitivity,s=t.scrollSpeed,c=qn(),l=!1,u;_i!==n&&(_i=n,wi(),gi=t.scroll,u=t.scrollFn,gi===!0&&(gi=er(n,!0)));var d=0,f=gi;do{var p=f,m=B(p),h=m.top,g=m.bottom,_=m.left,v=m.right,y=m.width,b=m.height,x=void 0,S=void 0,C=p.scrollWidth,w=p.scrollHeight,T=z(p),ee=p.scrollLeft,te=p.scrollTop;p===c?(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`||T.overflowX===`visible`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`||T.overflowY===`visible`)):(x=y<C&&(T.overflowX===`auto`||T.overflowX===`scroll`),S=b<w&&(T.overflowY===`auto`||T.overflowY===`scroll`));var ne=x&&(Math.abs(v-i)<=o&&ee+y<C)-(Math.abs(_-i)<=o&&!!ee),E=S&&(Math.abs(g-a)<=o&&te+b<w)-(Math.abs(h-a)<=o&&!!te);if(!X[d])for(var re=0;re<=d;re++)X[re]||(X[re]={});(X[d].vx!=ne||X[d].vy!=E||X[d].el!==p)&&(X[d].el=p,X[d].vx=ne,X[d].vy=E,clearInterval(X[d].pid),(ne!=0||E!=0)&&(l=!0,X[d].pid=setInterval(function(){r&&this.layer===0&&Y.active._onTouchMove(xi);var t=X[this.layer].vy?X[this.layer].vy*s:0,n=X[this.layer].vx?X[this.layer].vx*s:0;typeof u==`function`&&u.call(Y.dragged.parentNode[lr],n,t,e,xi,X[this.layer].el)!==`continue`||or(X[this.layer].el,n,t)}.bind({layer:d}),24))),d++}while(t.bubbleScroll&&f!==c&&(f=er(f,!1)));vi=l}},30),Di=function(e){var t=e.originalEvent,n=e.putSortable,r=e.dragEl,i=e.activeSortable,a=e.dispatchSortableEvent,o=e.hideGhostForTarget,s=e.unhideGhostForTarget;if(t){var c=n||i;o();var l=t.changedTouches&&t.changedTouches.length?t.changedTouches[0]:t,u=document.elementFromPoint(l.clientX,l.clientY);s(),c&&!c.el.contains(u)&&(a(`spill`),this.onSpill({dragEl:r,putSortable:n}))}};function Oi(){}Oi.prototype={startIndex:null,dragStart:function(e){var t=e.oldDraggableIndex;this.startIndex=t},onSpill:function(e){var t=e.dragEl,n=e.putSortable;this.sortable.captureAnimationState(),n&&n.captureAnimationState();var r=Yn(this.sortable.el,this.startIndex,this.options);r?this.sortable.el.insertBefore(t,r):this.sortable.el.appendChild(t),this.sortable.animateAll(),n&&n.animateAll()},drop:Di},Cn(Oi,{pluginName:`revertOnSpill`});function ki(){}ki.prototype={onSpill:function(e){var t=e.dragEl,n=e.putSortable||this.sortable;n.captureAnimationState(),t.parentNode&&t.parentNode.removeChild(t),n.animateAll()},drop:Di},Cn(ki,{pluginName:`removeOnSpill`}),Y.mount(new Ci),Y.mount(ki,Oi);var Ai=e=>{let t=e.item,n=Array.prototype.slice.call(t.parentNode.childNodes);return n=n.filter(e=>e.nodeType!=Node.ELEMENT_NODE||!e.classList.contains(`sortable-fallback`)),n},ji=(e,t,n,r,i,a)=>{let o=e.item.parentNode;for(let e of n)o.appendChild(e);if(e.oldIndex==e.newIndex)return;let s=r.getArray(),c=e.item.querySelector(`eox-layercontrol-layer`).layer.get(i),l=s.find(e=>e.get(i)===c),u=a.dataset.layer,d=s.find(e=>e.get(i)==u),f,p;for(f=0;f<s.length;f++)if(s[f]==l){r.removeAt(f);break}for(p=0;p<s.length;p++)if(s[p]===d){f>p?r.insertAt(p,l):r.insertAt(p+1,l);break}t.requestUpdate()};function Mi(e,t,n,r){let i=[],a=null;e._sortable=Y.create(e,{handle:`.drag-handle`,filter:`.drag-handle.disabled`,swapThreshold:.5,animation:150,easing:`cubic-bezier(1, 0, 0, 1)`,onStart:e=>{console.log(e),i=Ai(e)},onMove:e=>{a=e.related},onEnd:e=>ji(e,r,i,t,n,a)})}function Ni(e,t,n,r){let i=e.getArray(),a=!1;i.forEach(e=>{let i=e.ol_uid;e.get(t)||(e.set(t,i),a=!0),e.get(n)||(e.set(n,`layer ${i}`),a=!0),a&&r.requestUpdate()})}function Pi(e,t,n){let r=[],i=(e,t,n)=>{r=[...r,...e.filter(e=>e.get(t)===n)];let a=e.filter(e=>e.getLayers);return a.length>0&&a.forEach(e=>i(e.getLayers().getArray(),t,n)),r};return i(e,t,n),r}function Fi(e,t,n){if(!e||!t)return!1;if(!Ii(e,n))return!0;let r=e.get(`minZoom`),i=e.get(`maxZoom`),a=t.getView().getZoom();return a>r&&a<i}function Ii(e,t){let n=e.get(`minZoom`),r=e.get(`maxZoom`);return!!(t&&(n!==-1/0||r!==1/0))}function Li(e,t){if(!(!e||!t))return e.getLayers?`group`:t.getInteractions().getArray().filter(e=>e.freehand_!==void 0).map(e=>e.source_)?.ol_uid?.includes(e.getSource?e.getSource()?.ol_uid:void 0)?`draw`:e.declutter_!==void 0||e.get(`type`)===`Vector`?`vector`:`raster`}var Z={UNKNOWN:0,INTERSECTING:1,ABOVE:2,RIGHT:4,BELOW:8,LEFT:16};function Ri(e){let t=Hi();for(let n=0,r=e.length;n<r;++n)Ki(t,e[n]);return t}function zi(e,t){return Bi(e,t[0],t[1])}function Bi(e,t,n){return e[0]<=t&&t<=e[2]&&e[1]<=n&&n<=e[3]}function Vi(e,t){let n=e[0],r=e[1],i=e[2],a=e[3],o=t[0],s=t[1],c=Z.UNKNOWN;return o<n?c|=Z.LEFT:o>i&&(c|=Z.RIGHT),s<r?c|=Z.BELOW:s>a&&(c|=Z.ABOVE),c===Z.UNKNOWN&&(c=Z.INTERSECTING),c}function Hi(){return[1/0,1/0,-1/0,-1/0]}function Ui(e,t,n,r,i){return i?(i[0]=e,i[1]=t,i[2]=n,i[3]=r,i):[e,t,n,r]}function Wi(e){return Ui(1/0,1/0,-1/0,-1/0,e)}function Gi(e,t){return t[0]<e[0]&&(e[0]=t[0]),t[2]>e[2]&&(e[2]=t[2]),t[1]<e[1]&&(e[1]=t[1]),t[3]>e[3]&&(e[3]=t[3]),e}function Ki(e,t){t[0]<e[0]&&(e[0]=t[0]),t[0]>e[2]&&(e[2]=t[0]),t[1]<e[1]&&(e[1]=t[1]),t[1]>e[3]&&(e[3]=t[1])}function qi(e,t,n,r,i){for(;n<r;n+=i)Ji(e,t[n],t[n+1]);return e}function Ji(e,t,n){e[0]=Math.min(e[0],t),e[1]=Math.min(e[1],n),e[2]=Math.max(e[2],t),e[3]=Math.max(e[3],n)}function Yi(e,t){let n;return n=t(Zi(e)),n||(n=t(Qi(e)),n)||(n=t(ia(e)),n)||(n=t(ra(e)),n)?n:!1}function Xi(e){let t=0;return oa(e)||(t=Q(e)*ta(e)),t}function Zi(e){return[e[0],e[1]]}function Qi(e){return[e[2],e[1]]}function $i(e){return[(e[0]+e[2])/2,(e[1]+e[3])/2]}function ea(e,t){let n;if(t===`bottom-left`)n=Zi(e);else if(t===`bottom-right`)n=Qi(e);else if(t===`top-left`)n=ra(e);else if(t===`top-right`)n=ia(e);else throw Error(`Invalid corner`);return n}function ta(e){return e[3]-e[1]}function na(e,t,n){let r=n||Hi();return aa(e,t)?(e[0]>t[0]?r[0]=e[0]:r[0]=t[0],e[1]>t[1]?r[1]=e[1]:r[1]=t[1],e[2]<t[2]?r[2]=e[2]:r[2]=t[2],e[3]<t[3]?r[3]=e[3]:r[3]=t[3]):Wi(r),r}function ra(e){return[e[0],e[3]]}function ia(e){return[e[2],e[3]]}function Q(e){return e[2]-e[0]}function aa(e,t){return e[0]<=t[2]&&e[2]>=t[0]&&e[1]<=t[3]&&e[3]>=t[1]}function oa(e){return e[2]<e[0]||e[3]<e[1]}function sa(e,t,n){let r=!1,i=Vi(e,t),a=Vi(e,n);if(i===Z.INTERSECTING||a===Z.INTERSECTING)r=!0;else{let o=e[0],s=e[1],c=e[2],l=e[3],u=t[0],d=t[1],f=n[0],p=n[1],m=(p-d)/(f-u),h,g;a&Z.ABOVE&&!(i&Z.ABOVE)&&(h=f-(p-l)/m,r=h>=o&&h<=c),!r&&a&Z.RIGHT&&!(i&Z.RIGHT)&&(g=p-(f-c)*m,r=g>=s&&g<=l),!r&&a&Z.BELOW&&!(i&Z.BELOW)&&(h=f-(p-s)/m,r=h>=o&&h<=c),!r&&a&Z.LEFT&&!(i&Z.LEFT)&&(g=p-(f-o)*m,r=g>=s&&g<=l)}return r}function ca(e,t){let n=t.getExtent(),r=$i(e);if(t.canWrapX()&&(r[0]<n[0]||r[0]>=n[2])){let t=Q(n),i=Math.floor((r[0]-n[0])/t)*t;e[0]-=i,e[2]-=i}return e}function la(e,t,n){if(t.canWrapX()){let r=t.getExtent();if(!isFinite(e[0])||!isFinite(e[2]))return[[r[0],e[1],r[2],e[3]]];ca(e,t);let i=Q(r);if(Q(e)>i&&!n)return[[r[0],e[1],r[2],e[3]]];if(e[0]<r[0])return[[e[0]+i,e[1],r[2],e[3]],[r[0],e[1],e[2],e[3]]];if(e[2]>r[2])return[[e[0],e[1],r[2],e[3]],[r[0],e[1],e[2]-i,e[3]]]}return[e]}function ua(e,t,n){return Math.min(Math.max(e,t),n)}function da(e){let t=e.length;for(let n=0;n<t;n++){let r=n,i=Math.abs(e[n][n]);for(let a=n+1;a<t;a++){let t=Math.abs(e[a][n]);t>i&&(i=t,r=a)}if(i===0)return null;let a=e[r];e[r]=e[n],e[n]=a;for(let r=n+1;r<t;r++){let i=-e[r][n]/e[n][n];for(let a=n;a<t+1;a++)n==a?e[r][a]=0:e[r][a]+=i*e[n][a]}}let n=Array(t);for(let r=t-1;r>=0;r--){n[r]=e[r][t]/e[r][r];for(let i=r-1;i>=0;i--)e[i][t]-=e[i][r]*n[r]}return n}function fa(e){return e*180/Math.PI}function pa(e){return e*Math.PI/180}function ma(e,t){let n=e%t;return n*t<0?n+t:n}function ha(e,t){let n=10**t;return Math.round(e*n)/n}function ga(e,t){return Math.floor(ha(e,t))}function _a(e,t){return Math.ceil(ha(e,t))}function va(e,t,n){if(e>=t&&e<n)return e;let r=n-t;return((e-t)%r+r)%r+t}var ya={radians:6370997/(2*Math.PI),degrees:2*Math.PI*6370997/360,ft:.3048,m:1,"us-ft":1200/3937},ba=class{constructor(e){this.code_=e.code,this.units_=e.units,this.extent_=e.extent===void 0?null:e.extent,this.worldExtent_=e.worldExtent===void 0?null:e.worldExtent,this.axisOrientation_=e.axisOrientation===void 0?`enu`:e.axisOrientation,this.global_=e.global===void 0?!1:e.global,this.canWrapX_=!!(this.global_&&this.extent_),this.getPointResolutionFunc_=e.getPointResolution,this.defaultTileGrid_=null,this.metersPerUnit_=e.metersPerUnit}canWrapX(){return this.canWrapX_}getCode(){return this.code_}getExtent(){return this.extent_}getUnits(){return this.units_}getMetersPerUnit(){return this.metersPerUnit_||ya[this.units_]}getWorldExtent(){return this.worldExtent_}getAxisOrientation(){return this.axisOrientation_}isGlobal(){return this.global_}setGlobal(e){this.global_=e,this.canWrapX_=!!(e&&this.extent_)}getDefaultTileGrid(){return this.defaultTileGrid_}setDefaultTileGrid(e){this.defaultTileGrid_=e}setExtent(e){this.extent_=e,this.canWrapX_=!!(this.global_&&e)}setWorldExtent(e){this.worldExtent_=e}setGetPointResolution(e){this.getPointResolutionFunc_=e}getPointResolutionFunc(){return this.getPointResolutionFunc_}},xa=6378137,Sa=Math.PI*xa,Ca=[-Sa,-Sa,Sa,Sa],wa=[-180,-85,180,85],Ta=xa*Math.log(Math.tan(Math.PI/2)),Ea=class extends ba{constructor(e){super({code:e,units:`m`,extent:Ca,global:!0,worldExtent:wa,getPointResolution:function(e,t){return e/Math.cosh(t[1]/xa)}})}},Da=[new Ea(`EPSG:3857`),new Ea(`EPSG:102100`),new Ea(`EPSG:102113`),new Ea(`EPSG:900913`),new Ea(`http://www.opengis.net/def/crs/EPSG/0/3857`),new Ea(`http://www.opengis.net/gml/srs/epsg.xml#3857`)];function Oa(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r){t[n]=Sa*e[n]/180;let r=xa*Math.log(Math.tan(Math.PI*(+e[n+1]+90)/360));r>Ta?r=Ta:r<-Ta&&(r=-Ta),t[n+1]=r}return t}function ka(e,t,n,r){let i=e.length;n=n>1?n:2,r??=n,t===void 0&&(t=n>2?e.slice():Array(i));for(let n=0;n<i;n+=r)t[n]=180*e[n]/Sa,t[n+1]=360*Math.atan(Math.exp(e[n+1]/xa))/Math.PI-90;return t}var Aa=6378137,ja=[-180,-90,180,90],Ma=Math.PI*Aa/180,Na=class extends ba{constructor(e,t){super({code:e,units:`degrees`,extent:ja,axisOrientation:t,global:!0,metersPerUnit:Ma,worldExtent:ja})}},Pa=[new Na(`CRS:84`),new Na(`EPSG:4326`,`neu`),new Na(`urn:ogc:def:crs:OGC:1.3:CRS84`),new Na(`urn:ogc:def:crs:OGC:2:84`),new Na(`http://www.opengis.net/def/crs/OGC/1.3/CRS84`),new Na(`http://www.opengis.net/gml/srs/epsg.xml#4326`,`neu`),new Na(`http://www.opengis.net/def/crs/EPSG/0/4326`,`neu`)],Fa={};function Ia(e){return Fa[e]||Fa[e.replace(/urn:(x-)?ogc:def:crs:EPSG:(.*:)?(\w+)$/,`EPSG:$3`)]||null}function La(e,t){Fa[e]=t}function Ra(e){for(let t in e)delete e[t]}function za(e){let t;for(t in e)return!1;return!t}var Ba={};function Va(e,t,n){let r=e.getCode(),i=t.getCode();r in Ba||(Ba[r]={}),Ba[r][i]=n}function Ha(e,t){return e in Ba&&t in Ba[e]?Ba[e][t]:null}var Ua=.9996,Wa=.00669438,Ga=Wa*Wa,Ka=Ga*Wa,qa=Wa/(1-Wa),Ja=Math.sqrt(1-Wa),Ya=(1-Ja)/(1+Ja),Xa=Ya*Ya,Za=Xa*Ya,Qa=Za*Ya,$a=Qa*Ya,eo=1-Wa/4-3*Ga/64-5*Ka/256,to=.002514607064228144,no=26390466021299826e-22,ro=35*Ka/3072,io=3/2*Ya-27/32*Za+269/512*$a,ao=21/16*Xa-55/32*Qa,oo=151/96*Za-417/128*$a,so=1097/512*Qa,co=6378137;function lo(e,t,n){let r=e-5e5,i=(n.north?t:t-1e7)/Ua/(co*eo),a=i+io*Math.sin(2*i)+ao*Math.sin(4*i)+oo*Math.sin(6*i)+so*Math.sin(8*i),o=Math.sin(a),s=o*o,c=Math.cos(a),l=o/c,u=l*l,d=u*u,f=1-Wa*s,p=co/Math.sqrt(1-Wa*s),m=(1-Wa)/f,h=qa*c**2,g=h*h,_=r/(p*Ua),v=_*_,y=v*_,b=y*_,x=b*_,S=x*_,C=a-l/m*(v/2-b/24*(5+3*u+10*h-4*g-9*qa))+S/720*(61+90*u+298*h+45*d-252*qa-3*g),w=(_-y/6*(1+2*u+h)+x/120*(5-2*h+28*u-3*g+8*qa+24*d))/c;return w=va(w+pa(go(n.number)),-Math.PI,Math.PI),[fa(w),fa(C)]}var uo=-80,fo=84,po=-180,mo=180;function ho(e,t,n){e=va(e,po,mo),t<uo?t=uo:t>fo&&(t=fo);let r=pa(t),i=Math.sin(r),a=Math.cos(r),o=i/a,s=o*o,c=s*s,l=pa(e),u=pa(go(n.number)),d=co/Math.sqrt(1-Wa*i**2),f=qa*a**2,p=a*va(l-u,-Math.PI,Math.PI),m=p*p,h=m*p,g=h*p,_=g*p,v=_*p,y=co*(eo*r-to*Math.sin(2*r)+no*Math.sin(4*r)-ro*Math.sin(6*r)),b=Ua*d*(p+h/6*(1-s+f)+_/120*(5-18*s+c+72*f-58*qa))+5e5,x=Ua*(y+d*o*(m/2+g/24*(5-s+9*f+4*f**2)+v/720*(61-58*s+c+600*f-330*qa)));return n.north||(x+=1e7),[b,x]}function go(e){return(e-1)*6-180+3}var _o=[/^EPSG:(\d+)$/,/^urn:ogc:def:crs:EPSG::(\d+)$/,/^http:\/\/www\.opengis\.net\/def\/crs\/EPSG\/0\/(\d+)$/];function vo(e){let t=0;for(let n of _o){let r=e.match(n);if(r){t=parseInt(r[1]);break}}if(!t)return null;let n=0,r=!1;return t>32700&&t<32761?n=t-32700:t>32600&&t<32661&&(r=!0,n=t-32600),n?{number:n,north:r}:null}function yo(e,t){return function(n,r,i,a){let o=n.length;i=i>1?i:2,a??=i,r||=i>2?n.slice():Array(o);for(let i=0;i<o;i+=a){let a=n[i],o=n[i+1],s=e(a,o,t);r[i]=s[0],r[i+1]=s[1]}return r}}function bo(e){return vo(e)?new ba({code:e,units:`m`}):null}function xo(e){let t=vo(e.getCode());return t?{forward:yo(ho,t),inverse:yo(lo,t)}:null}function So(e,t,n){n||=6371008.8;let r=pa(e[1]),i=pa(t[1]),a=(i-r)/2,o=pa(t[0]-e[0])/2,s=Math.sin(a)*Math.sin(a)+Math.sin(o)*Math.sin(o)*Math.cos(r)*Math.cos(i);return 2*n*Math.atan2(Math.sqrt(s),Math.sqrt(1-s))}var Co=[xo],wo=[bo];function To(e,t){if(t!==void 0){for(let n=0,r=e.length;n<r;++n)t[n]=e[n];t=t}else t=e.slice();return t}function Eo(e){La(e.getCode(),e),Va(e,e,To)}function Do(e){e.forEach(Eo)}function Oo(e){if(typeof e!=`string`)return e;let t=Ia(e);if(t)return t;for(let t of wo){let n=t(e);if(n)return n}return null}function ko(e,t,n,r){e=Oo(e);let i,a=e.getPointResolutionFunc();if(a){if(i=a(t,n),r&&r!==e.getUnits()){let t=e.getMetersPerUnit();t&&(i=i*t/ya[r])}}else{let a=e.getUnits();if(a==`degrees`&&!r||r==`degrees`)i=t;else{let o=Po(e,Oo(`EPSG:4326`));if(!o&&a!==`degrees`)i=t*e.getMetersPerUnit();else{let e=[n[0]-t/2,n[1],n[0]+t/2,n[1],n[0],n[1]-t/2,n[0],n[1]+t/2];e=o(e,e,2),i=(So(e.slice(0,2),e.slice(2,4))+So(e.slice(4,6),e.slice(6,8)))/2}let s=r?ya[r]:e.getMetersPerUnit();s!==void 0&&(i/=s)}}return i}function Ao(e){Do(e),e.forEach(function(t){e.forEach(function(e){t!==e&&Va(t,e,To)})})}function jo(e,t,n,r){e.forEach(function(e){t.forEach(function(t){Va(e,t,n),Va(t,e,r)})})}function Mo(e){return(function(t,n,r,i){let a=t.length;r=r===void 0?2:r,i??=r,n=n===void 0?Array(a):n;for(let o=0;o<a;o+=i){let a=e(t.slice(o,o+r)),s=a.length;for(let e=0,r=i;e<r;++e)n[o+e]=e>=s?t[o+e]:a[e]}return n})}function No(e,t){if(e===t)return!0;let n=e.getUnits()===t.getUnits();return(e.getCode()===t.getCode()||Po(e,t)===To)&&n}function Po(e,t){let n=e.getCode(),r=t.getCode(),i=Ha(n,r);if(i)return i;let a=null,o=null;for(let n of Co)a||=n(e),o||=n(t);if(!a&&!o)return null;let s=`EPSG:4326`;if(!o){let e=Ha(s,r);e&&(i=Fo(a.inverse,e))}else if(a)i=Fo(a.inverse,o.forward);else{let e=Ha(n,s);e&&(i=Fo(e,o.forward))}return i&&(Eo(e),Eo(t),Va(e,t,i)),i}function Fo(e,t){return function(n,r,i,a){return r=e(n,r,i,a),t(r,r,i,a)}}function Io(e,t){return Po(Oo(e),Oo(t))}function Lo(e,t,n){let r=Io(t,n);if(!r){let e=Oo(t).getCode(),r=Oo(n).getCode();throw Error(`No transform available between ${e} and ${r}`)}return r(e,void 0,e.length)}function Ro(){Ao(Da),Ao(Pa),jo(Pa,Da,Oa,ka)}Ro();function zo(e,t,n){return n===void 0&&(n=[0,0]),n[0]=e[0]*t+.5|0,n[1]=e[1]*t+.5|0,n}function Bo(e,t){return Array.isArray(e)?e:(t===void 0?t=[e,e]:(t[0]=e,t[1]=e),t)}var Vo=class{constructor(e,t,n,r){this.minX=e,this.maxX=t,this.minY=n,this.maxY=r}contains(e){return this.containsXY(e[1],e[2])}containsTileRange(e){return this.minX<=e.minX&&e.maxX<=this.maxX&&this.minY<=e.minY&&e.maxY<=this.maxY}containsXY(e,t){return this.minX<=e&&e<=this.maxX&&this.minY<=t&&t<=this.maxY}equals(e){return this.minX==e.minX&&this.minY==e.minY&&this.maxX==e.maxX&&this.maxY==e.maxY}extend(e){e.minX<this.minX&&(this.minX=e.minX),e.maxX>this.maxX&&(this.maxX=e.maxX),e.minY<this.minY&&(this.minY=e.minY),e.maxY>this.maxY&&(this.maxY=e.maxY)}getHeight(){return this.maxY-this.minY+1}getSize(){return[this.getWidth(),this.getHeight()]}getWidth(){return this.maxX-this.minX+1}intersects(e){return this.minX<=e.maxX&&this.maxX>=e.minX&&this.minY<=e.maxY&&this.maxY>=e.minY}};function Ho(e,t,n,r,i){return i===void 0?new Vo(e,t,n,r):(i.minX=e,i.maxX=t,i.minY=n,i.maxY=r,i)}function Uo(e,t){return e>t?1:e<t?-1:0}function Wo(e,t,n){if(e[0]<=t)return 0;let r=e.length;if(t<=e[r-1])return r-1;if(typeof n==`function`){for(let i=1;i<r;++i){let r=e[i];if(r===t)return i;if(r<t)return n(t,e[i-1],r)>0?i-1:i}return r-1}if(n>0){for(let n=1;n<r;++n)if(e[n]<t)return n-1;return r-1}if(n<0){for(let n=1;n<r;++n)if(e[n]<=t)return n;return r-1}for(let n=1;n<r;++n){if(e[n]==t)return n;if(e[n]<t)return e[n-1]-t<t-e[n]?n-1:n}return r-1}function Go(e,t,n){let r=t||Uo;return e.every(function(t,i){if(i===0)return!0;let a=r(e[i-1],t);return!(a>0||n&&a===0)})}function Ko(e,t){if(!e)throw Error(t)}function qo(e,t,n,r,i,a){let o=0,s=e[n-r],c=e[n-r+1];for(;t<n;t+=r){let n=e[t],r=e[t+1];c<=a?r>a&&(n-s)*(a-c)-(i-s)*(r-c)>0&&o++:r<=a&&(n-s)*(a-c)-(i-s)*(r-c)<0&&o--,s=n,c=r}return o!==0}function Jo(e,t,n,r,i){let a;for(t+=r;t<n;t+=r)if(a=i(e.slice(t-r,t),e.slice(t,t+r)),a)return a;return!1}function Yo(e,t,n,r,i,a){return a??=qi(Hi(),e,t,n,r),aa(i,a)?a[0]>=i[0]&&a[2]<=i[2]||a[1]>=i[1]&&a[3]<=i[3]?!0:Jo(e,t,n,r,function(e,t){return sa(i,e,t)}):!1}function Xo(e,t,n,r,i){return!!(Yo(e,t,n,r,i)||qo(e,t,n,r,i[0],i[1])||qo(e,t,n,r,i[0],i[3])||qo(e,t,n,r,i[2],i[1])||qo(e,t,n,r,i[2],i[3]))}function Zo(){throw Error(`Unimplemented abstract method.`)}var Qo=0;function $o(e){return e.ol_uid||=String(++Qo)}function es(e,t,n,r){return r===void 0?[e,t,n]:(r[0]=e,r[1]=t,r[2]=n,r)}function ts(e,t,n){return e+`/`+t+`/`+n}function ns(e,t,n,r,i){return`${$o(e)},${t},${ts(n,r,i)}`}function rs(e){return is(e[0],e[1],e[2])}function is(e,t,n){return(t<<e)+n}function as(e,t){let n=e[0],r=e[1],i=e[2];if(t.getMinZoom()>n||n>t.getMaxZoom())return!1;let a=t.getFullTileRange(n);return a?a.containsXY(r,i):!0}var os=[0,0,0],ss=5,cs=class{constructor(e){this.minZoom=e.minZoom===void 0?0:e.minZoom,this.resolutions_=e.resolutions,Ko(Go(this.resolutions_,(e,t)=>t-e,!0),"`resolutions` must be sorted in descending order");let t;if(!e.origins){for(let e=0,n=this.resolutions_.length-1;e<n;++e)if(!t)t=this.resolutions_[e]/this.resolutions_[e+1];else if(this.resolutions_[e]/this.resolutions_[e+1]!==t){t=void 0;break}}this.zoomFactor_=t,this.maxZoom=this.resolutions_.length-1,this.origin_=e.origin===void 0?null:e.origin,this.origins_=null,e.origins!==void 0&&(this.origins_=e.origins,Ko(this.origins_.length==this.resolutions_.length,"Number of `origins` and `resolutions` must be equal"));let n=e.extent;n!==void 0&&!this.origin_&&!this.origins_&&(this.origin_=ra(n)),Ko(!this.origin_&&this.origins_||this.origin_&&!this.origins_,"Either `origin` or `origins` must be configured, never both"),this.tileSizes_=null,e.tileSizes!==void 0&&(this.tileSizes_=e.tileSizes,Ko(this.tileSizes_.length==this.resolutions_.length,"Number of `tileSizes` and `resolutions` must be equal")),this.tileSize_=e.tileSize===void 0?this.tileSizes_?null:256:e.tileSize,Ko(!this.tileSize_&&this.tileSizes_||this.tileSize_&&!this.tileSizes_,"Either `tileSize` or `tileSizes` must be configured, never both"),this.extent_=n===void 0?null:n,this.fullTileRanges_=null,this.tmpSize_=[0,0],this.tmpExtent_=[0,0,0,0],e.sizes===void 0?n&&this.calculateTileRanges_(n):this.fullTileRanges_=e.sizes.map((e,t)=>{let r=new Vo(Math.min(0,e[0]),Math.max(e[0]-1,-1),Math.min(0,e[1]),Math.max(e[1]-1,-1));if(n){let e=this.getTileRangeForExtentAndZ(n,t);r.minX=Math.max(e.minX,r.minX),r.maxX=Math.min(e.maxX,r.maxX),r.minY=Math.max(e.minY,r.minY),r.maxY=Math.min(e.maxY,r.maxY)}return r})}forEachTileCoord(e,t,n){let r=this.getTileRangeForExtentAndZ(e,t);for(let e=r.minX,i=r.maxX;e<=i;++e)for(let i=r.minY,a=r.maxY;i<=a;++i)n([t,e,i])}forEachTileCoordParentTileRange(e,t,n,r){let i,a,o,s=null,c=e[0]-1;for(this.zoomFactor_===2?(a=e[1],o=e[2]):s=this.getTileCoordExtent(e,r);c>=this.minZoom;){if(a!==void 0&&o!==void 0?(a=Math.floor(a/2),o=Math.floor(o/2),i=Ho(a,a,o,o,n)):i=this.getTileRangeForExtentAndZ(s,c,n),t(c,i))return!0;--c}return!1}getExtent(){return this.extent_}getMaxZoom(){return this.maxZoom}getMinZoom(){return this.minZoom}getOrigin(e){return this.origin_?this.origin_:this.origins_[e]}getOrigins(){return this.origins_}getResolution(e){return this.resolutions_[e]}getResolutions(){return this.resolutions_}getTileCoordChildTileRange(e,t,n){if(e[0]<this.maxZoom){if(this.zoomFactor_===2){let n=e[1]*2,r=e[2]*2;return Ho(n,n+1,r,r+1,t)}let r=this.getTileCoordExtent(e,n||this.tmpExtent_);return this.getTileRangeForExtentAndZ(r,e[0]+1,t)}return null}getTileRangeForTileCoordAndZ(e,t,n){if(t>this.maxZoom||t<this.minZoom)return null;let r=e[0],i=e[1],a=e[2];if(t===r)return Ho(i,a,i,a,n);if(this.zoomFactor_){let e=this.zoomFactor_**+(t-r),o=Math.floor(i*e),s=Math.floor(a*e);return t<r?Ho(o,o,s,s,n):Ho(o,Math.floor(e*(i+1))-1,s,Math.floor(e*(a+1))-1,n)}let o=this.getTileCoordExtent(e,this.tmpExtent_);return this.getTileRangeForExtentAndZ(o,t,n)}getTileRangeForExtentAndZ(e,t,n){this.getTileCoordForXYAndZ_(e[0],e[3],t,!1,os);let r=os[1],i=os[2];this.getTileCoordForXYAndZ_(e[2],e[1],t,!0,os);let a=os[1],o=os[2];return Ho(r,a,i,o,n)}getTileCoordCenter(e){let t=this.getOrigin(e[0]),n=this.getResolution(e[0]),r=Bo(this.getTileSize(e[0]),this.tmpSize_);return[t[0]+(e[1]+.5)*r[0]*n,t[1]-(e[2]+.5)*r[1]*n]}getTileCoordExtent(e,t){let n=this.getOrigin(e[0]),r=this.getResolution(e[0]),i=Bo(this.getTileSize(e[0]),this.tmpSize_),a=n[0]+e[1]*i[0]*r,o=n[1]-(e[2]+1)*i[1]*r;return Ui(a,o,a+i[0]*r,o+i[1]*r,t)}getTileCoordForCoordAndResolution(e,t,n){return this.getTileCoordForXYAndResolution_(e[0],e[1],t,!1,n)}getTileCoordForXYAndResolution_(e,t,n,r,i){let a=this.getZForResolution(n),o=n/this.getResolution(a),s=this.getOrigin(a),c=Bo(this.getTileSize(a),this.tmpSize_),l=o*(e-s[0])/n/c[0],u=o*(s[1]-t)/n/c[1];return r?(l=_a(l,ss)-1,u=_a(u,ss)-1):(l=ga(l,ss),u=ga(u,ss)),es(a,l,u,i)}getTileCoordForXYAndZ_(e,t,n,r,i){let a=this.getOrigin(n),o=this.getResolution(n),s=Bo(this.getTileSize(n),this.tmpSize_),c=(e-a[0])/o/s[0],l=(a[1]-t)/o/s[1];return r?(c=_a(c,ss)-1,l=_a(l,ss)-1):(c=ga(c,ss),l=ga(l,ss)),es(n,c,l,i)}getTileCoordForCoordAndZ(e,t,n){return this.getTileCoordForXYAndZ_(e[0],e[1],t,!1,n)}getTileCoordResolution(e){return this.resolutions_[e[0]]}getTileSize(e){return this.tileSize_?this.tileSize_:this.tileSizes_[e]}getFullTileRange(e){return this.fullTileRanges_?this.fullTileRanges_[e]:this.extent_?this.getTileRangeForExtentAndZ(this.extent_,e):null}getZForResolution(e,t){return ua(Wo(this.resolutions_,e,t||0),this.minZoom,this.maxZoom)}tileCoordIntersectsViewport(e,t){return Xo(t,0,t.length,2,this.getTileCoordExtent(e))}calculateTileRanges_(e){let t=this.resolutions_.length,n=Array(t);for(let r=this.minZoom;r<t;++r)n[r]=this.getTileRangeForExtentAndZ(e,r);this.fullTileRanges_=n}};function ls(e){let t=e.getDefaultTileGrid();return t||(t=ms(e),e.setDefaultTileGrid(t)),t}function us(e,t,n){let r=t[0],i=e.getTileCoordCenter(t),a=hs(n);if(!zi(a,i)){let t=Q(a),n=Math.ceil((a[0]-i[0])/t);return i[0]+=t*n,e.getTileCoordForCoordAndZ(i,r)}return t}function ds(e,t,n,r){r=r===void 0?`top-left`:r;let i=ps(e,t,n);return new cs({extent:e,origin:ea(e,r),resolutions:i,tileSize:n})}function fs(e){let t=e||{},n=t.extent||Oo(`EPSG:3857`).getExtent();return new cs({extent:n,minZoom:t.minZoom,tileSize:t.tileSize,resolutions:ps(n,t.maxZoom,t.tileSize,t.maxResolution)})}function ps(e,t,n,r){t=t===void 0?42:t,n=Bo(n===void 0?256:n);let i=ta(e),a=Q(e);r=r>0?r:Math.max(a/n[0],i/n[1]);let o=t+1,s=Array(o);for(let e=0;e<o;++e)s[e]=r/2**e;return s}function ms(e,t,n,r){return ds(hs(e),t,n,r)}function hs(e){e=Oo(e);let t=e.getExtent();if(!t){let n=180*ya.degrees/e.getMetersPerUnit();t=Ui(-n,-n,n,n)}return t}function gs(e,t,n,r,i){if(i){let i=n;n=function(a){return e.removeEventListener(t,n),i.call(r??this,a)}}else r&&r!==e&&(n=n.bind(r));let a={target:e,type:t,listener:n};return e.addEventListener(t,n),a}function _s(e,t,n,r){return gs(e,t,n,r,!0)}function vs(e){e&&e.target&&(e.target.removeEventListener(e.type,e.listener),Ra(e))}var ys={CHANGE:`change`,ERROR:`error`,BLUR:`blur`,CLEAR:`clear`,CONTEXTMENU:`contextmenu`,CLICK:`click`,DBLCLICK:`dblclick`,DRAGENTER:`dragenter`,DRAGOVER:`dragover`,DROP:`drop`,FOCUS:`focus`,KEYDOWN:`keydown`,KEYPRESS:`keypress`,LOAD:`load`,RESIZE:`resize`,TOUCHMOVE:`touchmove`,WHEEL:`wheel`},bs=class{constructor(){this.disposed=!1}dispose(){this.disposed||(this.disposed=!0,this.disposeInternal())}disposeInternal(){}};function xs(){}var Ss=class{constructor(e){this.propagationStopped,this.defaultPrevented,this.type=e,this.target=null}preventDefault(){this.defaultPrevented=!0}stopPropagation(){this.propagationStopped=!0}},Cs=class extends bs{constructor(e){super(),this.eventTarget_=e,this.pendingRemovals_=null,this.dispatching_=null,this.listeners_=null}addEventListener(e,t){if(!e||!t)return;let n=this.listeners_||={},r=n[e]||(n[e]=[]);r.includes(t)||r.push(t)}dispatchEvent(e){let t=typeof e==`string`,n=t?e:e.type,r=this.listeners_&&this.listeners_[n];if(!r)return;let i=t?new Ss(e):e;i.target||=this.eventTarget_||this;let a=this.dispatching_||={},o=this.pendingRemovals_||={};n in a||(a[n]=0,o[n]=0),++a[n];let s;for(let e=0,t=r.length;e<t;++e)if(s=`handleEvent`in r[e]?r[e].handleEvent(i):r[e].call(this,i),s===!1||i.propagationStopped){s=!1;break}if(--a[n]===0){let e=o[n];for(delete o[n];e--;)this.removeEventListener(n,xs);delete a[n]}return s}disposeInternal(){this.listeners_&&Ra(this.listeners_)}getListeners(e){return this.listeners_&&this.listeners_[e]||void 0}hasListener(e){return this.listeners_?e?e in this.listeners_:Object.keys(this.listeners_).length>0:!1}removeEventListener(e,t){if(!this.listeners_)return;let n=this.listeners_[e];if(!n)return;let r=n.indexOf(t);r!==-1&&(this.pendingRemovals_&&e in this.pendingRemovals_?(n[r]=xs,++this.pendingRemovals_[e]):(n.splice(r,1),n.length===0&&delete this.listeners_[e]))}},ws=typeof navigator<`u`&&navigator.userAgent!==void 0?navigator.userAgent.toLowerCase():``;ws.includes(`safari`)&&!ws.includes(`chrom`)&&(ws.includes(`version/15.4`)||/cpu (os|iphone os) 15_4 like mac os x/.test(ws)),ws.includes(`webkit`)&&ws.includes(`edge`),ws.includes(`macintosh`);var Ts=typeof WorkerGlobalScope<`u`&&typeof OffscreenCanvas<`u`&&self instanceof WorkerGlobalScope,Es=typeof Image<`u`&&Image.prototype.decode;(function(){let e=!1;try{let t=Object.defineProperty({},"passive",{get:function(){e=!0}});window.addEventListener(`_`,null,t),window.removeEventListener(`_`,null,t)}catch{}return e})();function Ds(e,t,n){let r=e,i=!0,a=!1,o=!1,s=[_s(r,ys.LOAD,function(){o=!0,a||t()})];return r.src&&Es?(a=!0,r.decode().then(function(){i&&t()}).catch(function(e){i&&(o?t():n())})):s.push(_s(r,ys.ERROR,n)),function(){i=!1,s.forEach(vs)}}var $={IDLE:0,LOADING:1,LOADED:2,ERROR:3,EMPTY:4};function Os(e){return e**3}var ks=class extends Cs{constructor(e,t,n){super(),n||={},this.tileCoord=e,this.state=t,this.key=``,this.transition_=n.transition===void 0?250:n.transition,this.transitionStarts_={},this.interpolate=!!n.interpolate}changed(){this.dispatchEvent(ys.CHANGE)}release(){this.setState($.EMPTY)}getKey(){return this.key+`/`+this.tileCoord}getTileCoord(){return this.tileCoord}getState(){return this.state}setState(e){if(this.state!==$.EMPTY){if(this.state!==$.ERROR&&this.state>e)throw Error(`Tile load sequence violation`);this.state=e,this.changed()}}load(){Zo()}getAlpha(e,t){if(!this.transition_)return 1;let n=this.transitionStarts_[e];if(!n)n=t,this.transitionStarts_[e]=n;else if(n===-1)return 1;let r=t-n+1e3/60;return r>=this.transition_?1:Os(r/this.transition_)}inTransition(e){return this.transition_?this.transitionStarts_[e]!==-1:!1}endTransition(e){this.transition_&&(this.transitionStarts_[e]=-1)}disposeInternal(){this.release(),super.disposeInternal()}};function As(e,t,n,r){let i;return i=n&&n.length?n.shift():Ts?new class extends OffscreenCanvas{style={}}(e??300,t??150):document.createElement(`canvas`),e&&(i.width=e),t&&(i.height=t),i.getContext(`2d`,r)}function js(e){let t=e.canvas;t.width=1,t.height=1,e.clearRect(0,0,1,1)}var Ms=class extends ks{constructor(e,t,n,r,i,a){super(e,t,a),this.crossOrigin_=r?.crossOrigin,this.referrerPolicy_=r?.referrerPolicy,this.src_=n,this.key=n,this.image_,Ts?this.image_=new OffscreenCanvas(1,1):(this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.unlisten_=null,this.tileLoadFunction_=i}getImage(){return this.image_}setImage(e){this.image_=e,this.state=$.LOADED,this.unlistenImage_(),this.changed()}getCrossOrigin(){return this.crossOrigin_}getReferrerPolicy(){return this.referrerPolicy_}handleImageError_(){this.state=$.ERROR,this.unlistenImage_(),this.image_=Ns(),this.changed()}handleImageLoad_(){if(Ts)this.state=$.LOADED;else{let e=this.image_;e.naturalWidth&&e.naturalHeight?this.state=$.LOADED:this.state=$.EMPTY}this.unlistenImage_(),this.changed()}load(){this.state==$.ERROR&&(this.state=$.IDLE,this.image_=new Image,this.crossOrigin_!==null&&(this.image_.crossOrigin=this.crossOrigin_),this.referrerPolicy_!==void 0&&(this.image_.referrerPolicy=this.referrerPolicy_)),this.state==$.IDLE&&(this.state=$.LOADING,this.changed(),this.tileLoadFunction_(this,this.src_),this.unlisten_=Ds(this.image_,this.handleImageLoad_.bind(this),this.handleImageError_.bind(this)))}unlistenImage_(){this.unlisten_&&=(this.unlisten_(),null)}disposeInternal(){this.unlistenImage_(),this.image_=null,super.disposeInternal()}};function Ns(){let e=As(1,1);return e.fillStyle=`rgba(0,0,0,0)`,e.fillRect(0,0,1,1),e.canvas}var Ps,Fs=[];function Is(e,t,n,r,i){e.beginPath(),e.moveTo(0,0),e.lineTo(t,n),e.lineTo(r,i),e.closePath(),e.save(),e.clip(),e.fillRect(0,0,Math.max(t,r)+1,Math.max(n,i)),e.restore()}function Ls(e,t){return Math.abs(e[t*4]-210)>2||Math.abs(e[t*4+3]-.75*255)>2}function Rs(){if(Ps===void 0){let e=As(6,6,Fs);e.globalCompositeOperation=`lighter`,e.fillStyle=`rgba(210, 0, 0, 0.75)`,Is(e,4,5,4,0),Is(e,4,5,0,5);let t=e.getImageData(0,0,3,3).data;Ps=Ls(t,0)||Ls(t,4)||Ls(t,8),js(e),Fs.push(e.canvas)}return Ps}function zs(e,t,n,r){let i=Lo(n,t,e),a=ko(t,r,n),o=t.getMetersPerUnit();o!==void 0&&(a*=o);let s=e.getMetersPerUnit();s!==void 0&&(a/=s);let c=e.getExtent();if(!c||zi(c,i)){let t=ko(e,a,i)/a;isFinite(t)&&t>0&&(a/=t)}return a}function Bs(e,t,n,r){let i=zs(e,t,$i(n),r);return(!isFinite(i)||i<=0)&&Yi(n,function(n){return i=zs(e,t,n,r),isFinite(i)&&i>0}),i}function Vs(e,t,n,r,i,a,o,s,c,l,u,d,f,p){let m=As(Math.round(n*e),Math.round(n*t),Fs);if(d||(m.imageSmoothingEnabled=!1),c.length===0)return m.canvas;m.scale(n,n);function h(e){return Math.round(e*n)/n}m.globalCompositeOperation=`lighter`;let g=Hi();c.forEach(function(e,t,n){Gi(g,e.extent)});let _,v=n/r,y=(d?1:1+2**-24)/v;if(!f||c.length!==1||l!==0){if(_=As(Math.round(Q(g)*v),Math.round(ta(g)*v),Fs),d||(_.imageSmoothingEnabled=!1),i&&p){let e=(i[0]-g[0])*v,t=-(i[3]-g[3])*v,n=Q(i)*v,r=ta(i)*v;_.rect(e,t,n,r),_.clip()}c.forEach(function(e,t,n){if(e.image.width>0&&e.image.height>0){if(e.clipExtent){_.save();let t=(e.clipExtent[0]-g[0])*v,n=-(e.clipExtent[3]-g[3])*v,r=Q(e.clipExtent)*v,i=ta(e.clipExtent)*v;_.rect(d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),_.clip()}let t=(e.extent[0]-g[0])*v,n=-(e.extent[3]-g[3])*v,r=Q(e.extent)*v,i=ta(e.extent)*v;_.drawImage(e.image,l,l,e.image.width-2*l,e.image.height-2*l,d?t:Math.round(t),d?n:Math.round(n),d?r:Math.round(t+r)-Math.round(t),d?i:Math.round(n+i)-Math.round(n)),e.clipExtent&&_.restore()}})}let b=ra(o);return s.getTriangles().forEach(function(e,t,n){let r=e.source,i=e.target,o=r[0][0],s=r[0][1],l=r[1][0],u=r[1][1],f=r[2][0],p=r[2][1],v=h((i[0][0]-b[0])/a),x=h(-(i[0][1]-b[1])/a),S=h((i[1][0]-b[0])/a),C=h(-(i[1][1]-b[1])/a),w=h((i[2][0]-b[0])/a),T=h(-(i[2][1]-b[1])/a),ee=o,te=s;o=0,s=0,l-=ee,u-=te,f-=ee,p-=te;let ne=da([[l,u,0,0,S-v],[f,p,0,0,w-v],[0,0,l,u,C-x],[0,0,f,p,T-x]]);if(!ne)return;if(m.save(),m.beginPath(),Rs()||!d){m.moveTo(S,C);let e=v-S,t=x-C;for(let n=0;n<4;n++)m.lineTo(S+h((n+1)*e/4),C+h(n*t/3)),n!=3&&m.lineTo(S+h((n+1)*e/4),C+h((n+1)*t/3));m.lineTo(w,T)}else m.moveTo(S,C),m.lineTo(v,x),m.lineTo(w,T);m.clip(),m.transform(ne[0],ne[2],ne[1],ne[3],v,x),m.translate(g[0]-ee,g[3]-te);let E;if(_)E=_.canvas,m.scale(y,-y);else{let e=c[0],t=e.extent;E=e.image,m.scale(Q(t)/E.width,-ta(t)/E.height)}m.drawImage(E,0,0),m.restore()}),_&&(js(_),Fs.push(_.canvas)),u&&(m.save(),m.globalCompositeOperation=`source-over`,m.strokeStyle=`black`,m.lineWidth=1,s.getTriangles().forEach(function(e,t,n){let r=e.target,i=(r[0][0]-b[0])/a,o=-(r[0][1]-b[1])/a,s=(r[1][0]-b[0])/a,c=-(r[1][1]-b[1])/a,l=(r[2][0]-b[0])/a,u=-(r[2][1]-b[1])/a;m.beginPath(),m.moveTo(s,c),m.lineTo(i,o),m.lineTo(l,u),m.closePath(),m.stroke()}),m.restore()),m.canvas}function Hs(e,t){let n=t[0],r=t[1];return t[0]=e[0]*n+e[2]*r+e[4],t[1]=e[1]*n+e[3]*r+e[5],t}var Us=10,Ws=.25,Gs=class{constructor(e,t,n,r,i,a,o){this.sourceProj_=e,this.targetProj_=t;let s={},c=o?Mo(e=>Hs(o,Lo(e,this.targetProj_,this.sourceProj_))):Io(this.targetProj_,this.sourceProj_);this.transformInv_=function(e){let t=e[0]+`/`+e[1];return s[t]||(s[t]=c(e)),s[t]},this.maxSourceExtent_=r,this.errorThresholdSquared_=i*i,this.triangles_=[],this.wrapsXInSource_=!1,this.canWrapXInSource_=this.sourceProj_.canWrapX()&&!!r&&!!this.sourceProj_.getExtent()&&Q(r)>=Q(this.sourceProj_.getExtent()),this.sourceWorldWidth_=this.sourceProj_.getExtent()?Q(this.sourceProj_.getExtent()):null,this.targetWorldWidth_=this.targetProj_.getExtent()?Q(this.targetProj_.getExtent()):null;let l=ra(n),u=ia(n),d=Qi(n),f=Zi(n),p=this.transformInv_(l),m=this.transformInv_(u),h=this.transformInv_(d),g=this.transformInv_(f),_=Us+(a?Math.max(0,Math.ceil(Math.log2(Xi(n)/(a*a*256*256)))):0);if(this.addQuad_(l,u,d,f,p,m,h,g,_),this.wrapsXInSource_){let e=1/0;this.triangles_.forEach(function(t,n,r){e=Math.min(e,t.source[0][0],t.source[1][0],t.source[2][0])}),this.triangles_.forEach(t=>{if(Math.max(t.source[0][0],t.source[1][0],t.source[2][0])-e>this.sourceWorldWidth_/2){let n=[[t.source[0][0],t.source[0][1]],[t.source[1][0],t.source[1][1]],[t.source[2][0],t.source[2][1]]];n[0][0]-e>this.sourceWorldWidth_/2&&(n[0][0]-=this.sourceWorldWidth_),n[1][0]-e>this.sourceWorldWidth_/2&&(n[1][0]-=this.sourceWorldWidth_),n[2][0]-e>this.sourceWorldWidth_/2&&(n[2][0]-=this.sourceWorldWidth_);let r=Math.min(n[0][0],n[1][0],n[2][0]);Math.max(n[0][0],n[1][0],n[2][0])-r<this.sourceWorldWidth_/2&&(t.source=n)}})}s={}}addTriangle_(e,t,n,r,i,a){this.triangles_.push({source:[r,i,a],target:[e,t,n]})}addQuad_(e,t,n,r,i,a,o,s,c){let l=Ri([i,a,o,s]),u=this.sourceWorldWidth_?Q(l)/this.sourceWorldWidth_:null,d=this.sourceWorldWidth_,f=this.sourceProj_.canWrapX()&&u>.5&&u<1,p=!1;if(c>0&&(this.targetProj_.isGlobal()&&this.targetWorldWidth_&&(p=Q(Ri([e,t,n,r]))/this.targetWorldWidth_>Ws||p),!f&&this.sourceProj_.isGlobal()&&u&&(p=u>Ws||p)),!p&&this.maxSourceExtent_&&isFinite(l[0])&&isFinite(l[1])&&isFinite(l[2])&&isFinite(l[3])&&!aa(l,this.maxSourceExtent_))return;let m=0;if(!p&&(!isFinite(i[0])||!isFinite(i[1])||!isFinite(a[0])||!isFinite(a[1])||!isFinite(o[0])||!isFinite(o[1])||!isFinite(s[0])||!isFinite(s[1]))){if(c>0)p=!0;else if(m=(!isFinite(i[0])||!isFinite(i[1])?8:0)+(!isFinite(a[0])||!isFinite(a[1])?4:0)+(!isFinite(o[0])||!isFinite(o[1])?2:0)+ +(!isFinite(s[0])||!isFinite(s[1])),m!=1&&m!=2&&m!=4&&m!=8)return}if(c>0){if(!p){let t=[(e[0]+n[0])/2,(e[1]+n[1])/2],r=this.transformInv_(t),a;a=f?(ma(i[0],d)+ma(o[0],d))/2-ma(r[0],d):(i[0]+o[0])/2-r[0];let s=(i[1]+o[1])/2-r[1];p=a*a+s*s>this.errorThresholdSquared_}if(p){if(Math.abs(e[0]-n[0])<=Math.abs(e[1]-n[1])){let l=[(t[0]+n[0])/2,(t[1]+n[1])/2],u=this.transformInv_(l),d=[(r[0]+e[0])/2,(r[1]+e[1])/2],f=this.transformInv_(d);this.addQuad_(e,t,l,d,i,a,u,f,c-1),this.addQuad_(d,l,n,r,f,u,o,s,c-1)}else{let l=[(e[0]+t[0])/2,(e[1]+t[1])/2],u=this.transformInv_(l),d=[(n[0]+r[0])/2,(n[1]+r[1])/2],f=this.transformInv_(d);this.addQuad_(e,l,d,r,i,u,f,s,c-1),this.addQuad_(l,t,n,d,u,a,o,f,c-1)}return}}if(f){if(!this.canWrapXInSource_)return;this.wrapsXInSource_=!0}m&11||this.addTriangle_(e,n,r,i,o,s),m&14||this.addTriangle_(e,n,t,i,o,a),m&&(m&13||this.addTriangle_(t,r,e,a,s,i),m&7||this.addTriangle_(t,r,n,a,s,o))}calculateSourceExtent(){let e=Hi();return this.triangles_.forEach(function(t,n,r){let i=t.source;Ki(e,i[0]),Ki(e,i[1]),Ki(e,i[2])}),e}getTriangles(){return this.triangles_}},Ks=.5,qs=class extends ks{constructor(e,t,n,r,i,a,o,s,c,l,u,d){super(i,$.IDLE,d),this.renderEdges_=u===void 0?!1:u,this.pixelRatio_=o,this.gutter_=s,this.canvas_=null,this.sourceTileGrid_=t,this.targetTileGrid_=r,this.wrappedTileCoord_=a||i,this.sourceTiles_=[],this.sourcesListenerKeys_=null,this.sourceZ_=0,this.clipExtent_=e.canWrapX()?e.getExtent():void 0;let f=r.getTileCoordExtent(this.wrappedTileCoord_),p=this.targetTileGrid_.getExtent(),m=this.sourceTileGrid_.getExtent(),h=p?na(f,p):f;if(Xi(h)===0){this.state=$.EMPTY;return}let g=e.getExtent();g&&(m=m?na(m,g):g);let _=r.getResolution(this.wrappedTileCoord_[0]),v=Bs(e,n,h,_);if(!isFinite(v)||v<=0){this.state=$.EMPTY;return}let y=l===void 0?Ks:l;if(this.triangulation_=new Gs(e,n,h,m,v*y,_),this.triangulation_.getTriangles().length===0){this.state=$.EMPTY;return}this.sourceZ_=t.getZForResolution(v);let b=this.triangulation_.calculateSourceExtent();if(m&&(e.canWrapX()?(b[1]=ua(b[1],m[1],m[3]),b[3]=ua(b[3],m[1],m[3])):b=na(b,m)),!Xi(b))this.state=$.EMPTY;else{let n=0,r=0;e.canWrapX()&&(n=Q(g),r=Math.floor((b[0]-g[0])/n)),la(b.slice(),e,!0).forEach(e=>{let i=t.getTileRangeForExtentAndZ(e,this.sourceZ_);for(let e=i.minX;e<=i.maxX;e++)for(let t=i.minY;t<=i.maxY;t++){let i=r*n;this.sourceTiles_.push({getTile:()=>c(this.sourceZ_,e,t,o),offset:i})}++r}),this.sourceTiles_.length===0&&(this.state=$.EMPTY)}}getImage(){return this.canvas_}reproject_(){let e=[];if(this.sourceTiles_.forEach(t=>{let n=t.tile;if(n&&n.getState()==$.LOADED){let r=this.sourceTileGrid_.getTileCoordExtent(n.tileCoord);r[0]+=t.offset,r[2]+=t.offset;let i=this.clipExtent_?.slice();i&&(i[0]+=t.offset,i[2]+=t.offset),e.push({extent:r,clipExtent:i,image:n.getImage()})}}),this.sourceTiles_.length=0,e.length===0)this.state=$.ERROR;else{let t=this.wrappedTileCoord_[0],n=this.targetTileGrid_.getTileSize(t),r=typeof n==`number`?n:n[0],i=typeof n==`number`?n:n[1],a=this.targetTileGrid_.getResolution(t),o=this.sourceTileGrid_.getResolution(this.sourceZ_),s=this.targetTileGrid_.getTileCoordExtent(this.wrappedTileCoord_);this.canvas_=Vs(r,i,this.pixelRatio_,o,this.sourceTileGrid_.getExtent(),a,s,this.triangulation_,e,this.gutter_,this.renderEdges_,this.interpolate),this.state=$.LOADED}this.changed()}load(){for(let e of this.sourceTiles_)e.tile=e.getTile();if(this.state==$.IDLE){this.state=$.LOADING,this.changed();let e=0;this.sourcesListenerKeys_=[],this.sourceTiles_.forEach(({tile:t})=>{let n=t.getState();if(n==$.IDLE||n==$.LOADING){e++;let n=gs(t,ys.CHANGE,r=>{let i=t.getState();(i==$.LOADED||i==$.ERROR||i==$.EMPTY)&&(vs(n),e--,e===0&&(this.unlistenSources_(),this.reproject_()))});this.sourcesListenerKeys_.push(n)}}),e===0?setTimeout(this.reproject_.bind(this),0):this.sourceTiles_.forEach(function({tile:e},t,n){e.getState()==$.IDLE&&e.load()})}}unlistenSources_(){this.sourcesListenerKeys_.forEach(vs),this.sourcesListenerKeys_=null}release(){this.canvas_&&=(js(this.canvas_.getContext(`2d`)),Fs.push(this.canvas_),null),this.sourceTiles_.length=0,super.release()}},Js=/\{z\}/g,Ys=/\{x\}/g,Xs=/\{y\}/g,Zs=/\{-y\}/g;function Qs(e,t,n,r,i){return e.replace(Js,t.toString()).replace(Ys,n.toString()).replace(Xs,r.toString()).replace(Zs,function(){if(i===void 0)throw Error(`If the URL template has a {-y} placeholder, the grid extent must be known`);return(i-r).toString()})}function $s(e){let t=[],n=/\{([a-z])-([a-z])\}/.exec(e);if(n){let r=n[1].charCodeAt(0),i=n[2].charCodeAt(0),a;for(a=r;a<=i;++a)t.push(e.replace(n[0],String.fromCharCode(a)));return t}if(n=/\{(\d+)-(\d+)\}/.exec(e),n){let r=parseInt(n[2],10);for(let i=parseInt(n[1],10);i<=r;i++)t.push(e.replace(n[0],i.toString()));return t}return t.push(e),t}function ec(e,t){return(function(n,r,i){if(!n)return;let a,o=n[0];if(t){let e=t.getFullTileRange(o);e&&(a=e.getHeight()-1)}return Qs(e,o,n[1],n[2],a)})}function tc(e,t){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=ec(e[i],t);return nc(r)}function nc(e){return e.length===1?e[0]:(function(t,n,r){if(t)return e[ma(rs(t),e.length)](t,n,r)})}var rc={PROPERTYCHANGE:`propertychange`},ic=class extends Cs{constructor(){super(),this.on=this.onInternal,this.once=this.onceInternal,this.un=this.unInternal,this.revision_=0}changed(){++this.revision_,this.dispatchEvent(ys.CHANGE)}getRevision(){return this.revision_}onInternal(e,t){if(Array.isArray(e)){let n=e.length,r=Array(n);for(let i=0;i<n;++i)r[i]=gs(this,e[i],t);return r}return gs(this,e,t)}onceInternal(e,t){let n;if(Array.isArray(e)){let r=e.length;n=Array(r);for(let i=0;i<r;++i)n[i]=_s(this,e[i],t)}else n=_s(this,e,t);return t.ol_key=n,n}unInternal(e,t){let n=t.ol_key;if(n)ac(n);else if(Array.isArray(e))for(let n=0,r=e.length;n<r;++n)this.removeEventListener(e[n],t);else this.removeEventListener(e,t)}};ic.prototype.on,ic.prototype.once,ic.prototype.un;function ac(e){if(Array.isArray(e))for(let t=0,n=e.length;t<n;++t)vs(e[t]);else vs(e)}var oc=class extends Ss{constructor(e,t,n){super(e),this.key=t,this.oldValue=n}},sc=class extends ic{constructor(e){super(),this.on,this.once,this.un,$o(this),this.values_=null,e!==void 0&&this.setProperties(e)}get(e){let t;return this.values_&&this.values_.hasOwnProperty(e)&&(t=this.values_[e]),t}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(e,t){let n;n=`change:${e}`,this.hasListener(n)&&this.dispatchEvent(new oc(n,e,t)),n=rc.PROPERTYCHANGE,this.hasListener(n)&&this.dispatchEvent(new oc(n,e,t))}addChangeListener(e,t){this.addEventListener(`change:${e}`,t)}removeChangeListener(e,t){this.removeEventListener(`change:${e}`,t)}set(e,t,n){let r=this.values_||={};if(n)r[e]=t;else{let n=r[e];r[e]=t,n!==t&&this.notify(e,n)}}setProperties(e,t){for(let n in e)this.set(n,e[n],t)}applyProperties(e){e.values_&&Object.assign(this.values_||={},e.values_)}unset(e,t){if(this.values_&&e in this.values_){let n=this.values_[e];delete this.values_[e],za(this.values_)&&(this.values_=null),t||this.notify(e,n)}}},cc=class extends sc{constructor(e){super(),this.projection=Oo(e.projection),this.attributions_=lc(e.attributions),this.attributionsCollapsible_=e.attributionsCollapsible??!0,this.loading=!1,this.state_=e.state===void 0?`ready`:e.state,this.wrapX_=e.wrapX===void 0?!1:e.wrapX,this.interpolate_=!!e.interpolate,this.viewResolver=null,this.viewRejector=null;let t=this;this.viewPromise_=new Promise(function(e,n){t.viewResolver=e,t.viewRejector=n})}getAttributions(){return this.attributions_}getAttributionsCollapsible(){return this.attributionsCollapsible_}getProjection(){return this.projection}getResolutions(e){return null}getView(){return this.viewPromise_}getState(){return this.state_}getWrapX(){return this.wrapX_}getInterpolate(){return this.interpolate_}refresh(){this.changed()}setAttributions(e){this.attributions_=lc(e),this.changed()}setState(e){this.state_=e,this.changed()}};function lc(e){return e?typeof e==`function`?e:(Array.isArray(e)||(e=[e]),t=>e):null}var uc=class extends cc{constructor(e){super({attributions:e.attributions,attributionsCollapsible:e.attributionsCollapsible,projection:e.projection,state:e.state,wrapX:e.wrapX,interpolate:e.interpolate}),this.on,this.once,this.un,this.tilePixelRatio_=e.tilePixelRatio===void 0?1:e.tilePixelRatio,this.tileGrid=e.tileGrid===void 0?null:e.tileGrid,this.tileGrid&&Bo(this.tileGrid.getTileSize(this.tileGrid.getMinZoom()),[256,256]),this.tmpSize=[0,0],this.key_=e.key||$o(this),this.tileOptions={transition:e.transition,interpolate:e.interpolate},this.zDirection=e.zDirection?e.zDirection:0}getGutterForProjection(e){return 0}getKey(){return this.key_}setKey(e){this.key_!==e&&(this.key_=e,this.changed())}getResolutions(e){let t=e?this.getTileGridForProjection(e):this.tileGrid;return t?t.getResolutions():null}getTile(e,t,n,r,i,a){return Zo()}getTileGrid(){return this.tileGrid}getTileGridForProjection(e){return this.tileGrid?this.tileGrid:ls(e)}getTilePixelRatio(e){return this.tilePixelRatio_}getTilePixelSize(e,t,n){let r=this.getTileGridForProjection(n),i=this.getTilePixelRatio(t),a=Bo(r.getTileSize(e),this.tmpSize);return i==1?a:zo(a,i,this.tmpSize)}getTileCoordForTileUrlFunction(e,t){let n=t===void 0?this.getProjection():t,r=t===void 0&&this.tileGrid||this.getTileGridForProjection(n);return this.getWrapX()&&n.isGlobal()&&(e=us(r,e,n)),as(e,r)?e:null}clear(){}refresh(){this.clear(),super.refresh()}},dc=class extends Ss{constructor(e,t){super(e),this.tile=t}},fc={TILELOADSTART:`tileloadstart`,TILELOADEND:`tileloadend`,TILELOADERROR:`tileloaderror`},pc=class e extends uc{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===e.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(e){let t=e.target,n=$o(t),r=t.getState(),i;r==$.LOADING?(this.tileLoadingKeys_[n]=!0,i=fc.TILELOADSTART):n in this.tileLoadingKeys_&&(delete this.tileLoadingKeys_[n],i=r==$.ERROR?fc.TILELOADERROR:r==$.LOADED?fc.TILELOADEND:void 0),i!=null&&this.dispatchEvent(new dc(i,t))}setTileLoadFunction(e){this.tileLoadFunction=e,this.changed()}setTileUrlFunction(e,t){this.tileUrlFunction=e,t===void 0?this.changed():this.setKey(t)}setUrl(e){let t=$s(e);this.urls=t,this.setUrls(t)}setUrls(e){this.urls=e;let t=e.join(`
|
|
3
|
+
`);this.generateTileUrlFunction_?this.setTileUrlFunction(tc(e,this.tileGrid),t):this.setKey(t)}tileUrlFunction(e,t,n){}},mc=class extends pc{constructor(e){super({attributions:e.attributions,cacheSize:e.cacheSize,projection:e.projection,state:e.state,tileGrid:e.tileGrid,tileLoadFunction:e.tileLoadFunction?e.tileLoadFunction:hc,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX,transition:e.transition,interpolate:e.interpolate===void 0?!0:e.interpolate,key:e.key,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.crossOrigin=e.crossOrigin===void 0?null:e.crossOrigin,this.referrerPolicy=e.referrerPolicy,this.tileClass=e.tileClass===void 0?Ms:e.tileClass,this.tileGridForProjection={},this.reprojectionErrorThreshold_=e.reprojectionErrorThreshold,this.renderReprojectionEdges_=!1}getGutterForProjection(e){return this.getProjection()&&e&&!No(this.getProjection(),e)?0:this.getGutter()}getGutter(){return 0}getKey(){let e=super.getKey();return this.getInterpolate()||(e+=`:disable-interpolation`),e}getTileGridForProjection(e){let t=this.getProjection();if(this.tileGrid&&(!t||No(t,e)))return this.tileGrid;let n=$o(e);return n in this.tileGridForProjection||(this.tileGridForProjection[n]=ls(e)),this.tileGridForProjection[n]}createTile_(e,t,n,r,i,a){let o=[e,t,n],s=this.getTileCoordForTileUrlFunction(o,i),c=s?this.tileUrlFunction(s,r,i):void 0,l=new this.tileClass(o,c===void 0?$.EMPTY:$.IDLE,c===void 0?``:c,{crossOrigin:this.crossOrigin,referrerPolicy:this.referrerPolicy},this.tileLoadFunction,this.tileOptions);return l.key=a,l.addEventListener(ys.CHANGE,this.handleTileChange.bind(this)),l}getTile(e,t,n,r,i,a){let o=this.getProjection();if(!o||!i||No(o,i))return this.getTileInternal(e,t,n,r,o||i);let s=[e,t,n],c=this.getKey(),l=new qs(o,this.getTileGridForProjection(o),i,this.getTileGridForProjection(i),s,this.getTileCoordForTileUrlFunction(s,i),this.getTilePixelRatio(r),this.getGutter(),(e,t,n,r)=>this.getTileInternal(e,t,n,r,o,a),this.reprojectionErrorThreshold_,this.renderReprojectionEdges_,this.tileOptions);return l.key=c,l}getTileInternal(e,t,n,r,i,a){let o=this.getKey(),s=ns(this,o,e,t,n);if(a&&a.containsKey(s))return a.get(s);let c=this.createTile_(e,t,n,r,i,o);return a?.set(s,c),c}setRenderReprojectionEdges(e){this.renderReprojectionEdges_!=e&&(this.renderReprojectionEdges_=e,this.changed())}setTileGridForProjection(e,t){let n=Oo(e);if(n){let e=$o(n);e in this.tileGridForProjection||(this.tileGridForProjection[e]=t)}}};function hc(e,t){if(Ts){let n=e.getCrossOrigin(),r=`same-origin`,i=`same-origin`;n===`anonymous`||n===``?(r=`cors`,i=`omit`):n===`use-credentials`&&(r=`cors`,i=`include`);let a={mode:r,credentials:i,referrerPolicy:e.getReferrerPolicy()};fetch(t,a).then(e=>{if(!e.ok)throw Error(`HTTP ${e.status}`);return e.blob()}).then(e=>createImageBitmap(e)).then(t=>{let n=e.getImage();n.width=t.width,n.height=t.height,n.getContext(`2d`).drawImage(t,0,0),t.close?.(),n.dispatchEvent(new Event(`load`))}).catch(()=>{e.getImage().dispatchEvent(new Event(`error`))});return}e.getImage().src=t}var gc=class extends mc{constructor(e){e||={};let t=e.projection===void 0?`EPSG:3857`:e.projection,n=e.tileGrid===void 0?fs({extent:hs(t),maxResolution:e.maxResolution,maxZoom:e.maxZoom,minZoom:e.minZoom,tileSize:e.tileSize}):e.tileGrid;super({attributions:e.attributions,cacheSize:e.cacheSize,crossOrigin:e.crossOrigin,referrerPolicy:e.referrerPolicy,interpolate:e.interpolate,projection:t,reprojectionErrorThreshold:e.reprojectionErrorThreshold,tileGrid:n,tileLoadFunction:e.tileLoadFunction,tilePixelRatio:e.tilePixelRatio,tileUrlFunction:e.tileUrlFunction,url:e.url,urls:e.urls,wrapX:e.wrapX===void 0?!0:e.wrapX,transition:e.transition,attributionsCollapsible:e.attributionsCollapsible,zDirection:e.zDirection}),this.gutter_=e.gutter===void 0?0:e.gutter}getGutter(){return this.gutter_}},_c=(e,t,n)=>{let r=t,i=n.layer.getSource();if(i.updateParams){let t={...e};(n.layerConfig.schema?.options?.removeProperties??[]).forEach(e=>delete t[e]),i.updateParams(t)}else i.getTileUrlFunction&&i.getTileUrlFunction()&&(r||=i.getTileUrlFunction(),i.setTileUrlFunction((...t)=>{let a=new URL(r(...t)),o=n.layerConfig.schema?.options?.removeProperties??[],s={...e};return o.forEach(e=>delete s[e]),i instanceof gc&&(i._updatedUrl=xn(i.getUrls()[0],s)),o.forEach(e=>a.searchParams.delete(e)),xn(a.href,s)}),i.setKey(new Date().toISOString()));let a=document.querySelector(`eox-map`);if(a){let t=a.globe;if(t){let r={...e};(n.layerConfig.schema?.options?.removeProperties??[]).forEach(e=>delete r[e]);let i=t.planet.layers.filter(e=>e.name==n.layer.get(`id`))[0];i&&i.setUrl(xn(i.url,r)),window.eoxMapGlobe.refresh()}}return r};function vc(e,t,n){let r=`updateStyleVariables`in t,i=`setStyle`in t,a=r?t.style_:n.style,o=a?.variables;if(o){let n=yc(e);if(a.variables={...o,...n},r)t.updateStyleVariables(n);else if(i){let e=bc(a);t.setStyle(e)}}}var yc=e=>{let t={};for(let n in e)if(typeof e[n]==`object`&&e[n]!==null){let r=yc(e[n]);for(let e in r)t[e]=r?.[e]}else t[n]=e?.[n];return t};function bc(e){let t=e;if(`variables`in e){let n=JSON.stringify(e),{variables:r}=e;for(let e in r)n=typeof r[e]==`number`?n.replaceAll(`["var","${e}"]`,String(r[e])):n.replaceAll(`["var","${e}"]`,`"${r[e]}"`);t=JSON.parse(n)}return t}var xc=(e,t,n)=>{if(!e)return;let r=yc(t),i,a;return a=Array.isArray(e)?structuredClone(e):[structuredClone(e)],i=a.filter(e=>{if(!(`boundTo`in e))return!0;let t=e.boundTo.key,n=e.boundTo.value;return t in r&&r[t]==n}),i.length||(i=null),i?.map(e=>{if(delete e.boundTo,e.rangeProperty&&n){let t=r[e.rangeProperty];t&&n[t]?(e.range=n[t],delete e.rangeProperty):t&&(e.range=[`#ffffff`,`#000000`])}return!(`domainProperties`in e)||`domain`in e?e:Object.keys(e)?.reduce((t,n)=>(n===`domainProperties`?t.domain=e[n].map(e=>r[e]):t[n]=e[n],t),{})}).filter(Boolean)};function Sc(e,t){let n={};for(let r in e){let i=e[r].type;if(i&&i!==`object`&&t[r]!==void 0)n[r]=i===`number`?Number(t[r]):t[r];else if(typeof e[r]==`object`&&e[r]?.properties){let i=Sc(e[r].properties,t);Object.keys(i).length>0&&(n[r]=i)}}return n}function Cc(e,t){if(!t)return null;let n={},r=`updateStyleVariables`in e?e.style_?.variables:t.style?.variables;if((t.type===`style`||t.style)&&r)n=r;else if(e.getSource()?.getParams?.())n=e.getSource().getParams();else if(e.getSource()?.getTileUrlFunction?.())try{let t=e.getSource().getTileUrlFunction()([0,0,0]);if(t){let e=new URL(t);n={};for(let[t,r]of e.searchParams.entries()){let i=e.searchParams.getAll(t);n[t]=i.length>1?i:r}}}catch(e){console.error(`Error parsing start values from tile URL`,e)}else return null;let i=Sc(t.schema?.properties||t.schema,n);return Object.keys(i).length?i:null}var wc=(e,t)=>e?.filter(e=>[`remove`,`sort`].filter(e=>t?.get(`layerControlDisable`)?e!==`sort`:!0).includes(e)),Tc=(e,t)=>e?.filter(e=>{let n=!0;return[`remove`,`sort`].includes(e)&&(n=!1),e===`info`&&(n=t.get(`description`)),e===`config`&&(n=t.get(`layerConfig`)),e===`datetime`&&(n=t.get(`layerDatetime`)),e===`legend`&&(n=t.get(`layerLegend`)),n}),Ec=(e,t,n)=>D`
|
|
4
4
|
<button
|
|
5
5
|
slot="${e}-icon"
|
|
6
6
|
class="no-margin transparent square primary-text small"
|
|
@@ -100,7 +100,7 @@
|
|
|
100
100
|
--cle-letter-spacing-title: inherit;
|
|
101
101
|
--cle-padding: 0;
|
|
102
102
|
}
|
|
103
|
-
`;#n=``};customElements.define(`eox-layercontrol-layer-legend`,zc);var Bc=class extends k{static properties={layer:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},layerConfig:{attribute:!1},customEditorInterfaces:{attribute:!1,type:Array}};#e={};#t=null;#n;constructor(){super(),this.layer=null,this.unstyled=!1,this.noShadow=!1,this.layerConfig=null,this.throttleDataChange=(0,Lc.default)(this.#r,1e3),this.customEditorInterfaces=[]}updated(e){if(e.has(`layerConfig`)){let e=this.layerConfig
|
|
103
|
+
`;#n=``};customElements.define(`eox-layercontrol-layer-legend`,zc);var Bc=class extends k{static properties={layer:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},layerConfig:{attribute:!1},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{attribute:!1,type:Array}};#e={};#t=null;#n;constructor(){super(),this.layer=null,this.unstyled=!1,this.noShadow=!1,this.layerConfig=null,this.throttleDataChange=(0,Lc.default)(this.#r,1e3),this.customEditorInterfaces=[],this.colormapRegistry=null}updated(e){if(e.has(`layerConfig`)){let e=this.layerConfig?.type===`style`||this.layerConfig?.style?100:1e3;this.throttleDataChange=(0,Lc.default)(this.#r,e),this.requestUpdate()}}#r(e){this.#e=e.detail,this.layerConfig.type===`style`||this.layerConfig.style?`setStyle`in this.layer||`updateStyleVariables`in this.layer?vc(this.#e,this.layer,this.layerConfig):console.error(`Layer type ${this.layer.get(`type`)??``} does not support styles configuration`):this.#n=_c(this.#e,this.#n,this),this.dispatchEvent(new CustomEvent(`layerConfig:change`,{bubbles:!0,detail:{jsonformValue:e.detail,layer:this.layer}})),this.requestUpdate()}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){this.#t=Cc(this.layer,this.layerConfig),Object.keys(this.#e).length!==0&&(this.#t=this.#e),customElements.get(`eox-jsonform`)||console.error(`Please import @eox/jsonform in order to use layerconfig`);let e={disable_edit_json:!0,disable_collapse:!0,disable_properties:!0};return D`
|
|
104
104
|
<style>
|
|
105
105
|
${this.#i}
|
|
106
106
|
${!this.unstyled&&this.#a}
|
|
@@ -111,7 +111,7 @@
|
|
|
111
111
|
.noShadow=${!0}
|
|
112
112
|
.unstyled=${this.unstyled}
|
|
113
113
|
.layer=${this.layer}
|
|
114
|
-
.layerLegend=${xc(this.layerConfig.legend,this.#
|
|
114
|
+
.layerLegend=${xc(this.layerConfig.legend,this.#t,this.colormapRegistry)}
|
|
115
115
|
></eox-layercontrol-layer-legend>
|
|
116
116
|
`)}
|
|
117
117
|
<!-- Render a JSON form for layer configuration -->
|
|
@@ -279,7 +279,7 @@
|
|
|
279
279
|
--eox-slider-margin: 0 !important;
|
|
280
280
|
font-size: small;
|
|
281
281
|
}
|
|
282
|
-
`};customElements.define(`eox-layercontrol-tools-items`,Hc);var Uc=class extends k{static properties={layer:{attribute:!1},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},open:{type:Boolean,reflect:!0},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},embedded:{state:!0},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.layer=null,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.open=!1,this.toolsAutoExpand=!1,setTimeout(()=>{let e=this.parentElement||this.getRootNode()?.host;this.embedded=e?.tagName===`EOX-LAYERCONTROL-LAYER`,(this.open===void 0||this.open===!1||this.open===null)&&(this.open=this.toolsAutoExpand?!!this.layer?.getVisible():this.embedded===!1?!0:!!this.layer?.get(`layerControlToolsExpand`))}),this.customEditorInterfaces=[]}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}updated(e){this.toolsAutoExpand&&(e.has(`toolsAutoExpand`)||e.has(`layer`))&&(this.open=!!this.layer?.getVisible())}#e(e){this.dispatchEvent(new CustomEvent(`layerConfig:change`,{bubbles:!0,detail:{jsonformValue:e.detail.jsonformValue,layer:e.detail.layer}}))}_removeButton=e=>Dc(this,e);_sortButton=e=>Oc(this,e,this.unstyled);_button=(e,t)=>Ec(e,t,this.unstyled);_getDefaultTools=e=>D`
|
|
282
|
+
`};customElements.define(`eox-layercontrol-tools-items`,Hc);var Uc=class extends k{static properties={layer:{attribute:!1},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},open:{type:Boolean,reflect:!0},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},embedded:{state:!0},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.layer=null,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.open=!1,this.toolsAutoExpand=!1,setTimeout(()=>{let e=this.parentElement||this.getRootNode()?.host;this.embedded=e?.tagName===`EOX-LAYERCONTROL-LAYER`,(this.open===void 0||this.open===!1||this.open===null)&&(this.open=this.toolsAutoExpand?!!this.layer?.getVisible():this.embedded===!1?!0:!!this.layer?.get(`layerControlToolsExpand`))}),this.customEditorInterfaces=[],this.colormapRegistry=null}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}updated(e){this.toolsAutoExpand&&(e.has(`toolsAutoExpand`)||e.has(`layer`))&&(this.open=!!this.layer?.getVisible())}#e(e){this.dispatchEvent(new CustomEvent(`layerConfig:change`,{bubbles:!0,detail:{jsonformValue:e.detail.jsonformValue,layer:e.detail.layer}}))}_removeButton=e=>Dc(this,e);_sortButton=e=>Oc(this,e,this.unstyled);_button=(e,t)=>Ec(e,t,this.unstyled);_getDefaultTools=e=>D`
|
|
283
283
|
<div slot="info-content">
|
|
284
284
|
${Pc(this.layer.get(`description`))}
|
|
285
285
|
</div>
|
|
@@ -306,6 +306,7 @@
|
|
|
306
306
|
.layer=${this.layer}
|
|
307
307
|
.noShadow=${!0}
|
|
308
308
|
.layerConfig=${this.layer.get(`layerConfig`)}
|
|
309
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
309
310
|
.unstyled=${this.unstyled}
|
|
310
311
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
311
312
|
@changed=${()=>this.requestUpdate()}
|
|
@@ -430,7 +431,7 @@
|
|
|
430
431
|
details[open] eox-layercontrol-tools-items {
|
|
431
432
|
display: block;
|
|
432
433
|
}
|
|
433
|
-
`};customElements.define(`eox-layercontrol-layer-tools`,Uc);var Wc=e=>{let t=()=>{let t=Fi(e.layer,e.map,e.showLayerZoomState),n=!1;!t&&e.currLayerVisibilityBasedOnZoom?(e.currLayerVisibilityBasedOnZoom=!1,n=!0):t&&!e.currLayerVisibilityBasedOnZoom&&(e.currLayerVisibilityBasedOnZoom=!0,n=!0),n&&(e.requestUpdate(),e.dispatchEvent(new CustomEvent(`change:resolution`,{bubbles:!0})))};Ii(e.layer,e.showLayerZoomState)&&(t(),e.map.getView().on(`change:resolution`,()=>t()))},Gc=(e,t)=>{let n=t.layer;if(n.setVisible(e.target.checked),t.toolsAutoExpand){let n=t.renderRoot.querySelector(`eox-layercontrol-layer-tools`);n&&(n.open=e.target.checked)}e.target.checked&&n.get(`layerControlExclusive`)&&t.closest(`${t.globallyExclusiveLayers?`.layers`:`eox-layercontrol-layer-list`} > ul`).querySelectorAll(`eox-layercontrol-layer`).forEach(e=>{if(e.layer!==n&&e.layer?.get(`layerControlExclusive`)){if(e.layer.setVisible(!1),e.toolsAutoExpand){let t=e.renderRoot.querySelector(`eox-layercontrol-layer-tools`);t&&(t.open=!1)}e.requestUpdate()}}),t.dispatchEvent(new CustomEvent(`changed`,{bubbles:!0,detail:n})),t.requestUpdate()},Kc=class extends k{static properties={layer:{attribute:!1},layerType:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},customEditorInterfaces:{attribute:!1,type:Array}};currLayerVisibilityBasedOnZoom=!0;constructor(){super(),this.layer=null,this.layerType=void 0,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[]}#e(e){return this.layer?.get(e)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){Wc(this)}#t(e){Gc(e,this)}render(){let e=this.layer.getVisible(),t=e?`visible`:``,n=this.currLayerVisibilityBasedOnZoom?``:`zoom-state-invisible`,r=this.#e(`layerControlDisable`)?`disabled`:``,i=this.#e(`layerControlExclusive`)?`radio`:`checkbox`,a=wc(this.tools,this.layer)?.length>0,o=Tc(this.tools,this.layer)?.length>0,s=document.querySelector(`eox-layercontrol-layer-tools`);return s&&Object.assign(s,{layer:this.layer,tools:this.tools,toolsAsList:this.toolsAsList}),D`
|
|
434
|
+
`};customElements.define(`eox-layercontrol-layer-tools`,Uc);var Wc=e=>{let t=()=>{let t=Fi(e.layer,e.map,e.showLayerZoomState),n=!1;!t&&e.currLayerVisibilityBasedOnZoom?(e.currLayerVisibilityBasedOnZoom=!1,n=!0):t&&!e.currLayerVisibilityBasedOnZoom&&(e.currLayerVisibilityBasedOnZoom=!0,n=!0),n&&(e.requestUpdate(),e.dispatchEvent(new CustomEvent(`change:resolution`,{bubbles:!0})))};Ii(e.layer,e.showLayerZoomState)&&(t(),e.map.getView().on(`change:resolution`,()=>t()))},Gc=(e,t)=>{let n=t.layer;if(n.setVisible(e.target.checked),t.toolsAutoExpand){let n=t.renderRoot.querySelector(`eox-layercontrol-layer-tools`);n&&(n.open=e.target.checked)}e.target.checked&&n.get(`layerControlExclusive`)&&t.closest(`${t.globallyExclusiveLayers?`.layers`:`eox-layercontrol-layer-list`} > ul`).querySelectorAll(`eox-layercontrol-layer`).forEach(e=>{if(e.layer!==n&&e.layer?.get(`layerControlExclusive`)){if(e.layer.setVisible(!1),e.toolsAutoExpand){let t=e.renderRoot.querySelector(`eox-layercontrol-layer-tools`);t&&(t.open=!1)}e.requestUpdate()}}),t.dispatchEvent(new CustomEvent(`changed`,{bubbles:!0,detail:n})),t.requestUpdate()},Kc=class extends k{static properties={layer:{attribute:!1},layerType:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{attribute:!1,type:Array}};currLayerVisibilityBasedOnZoom=!0;constructor(){super(),this.layer=null,this.layerType=void 0,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[],this.colormapRegistry=null}#e(e){return this.layer?.get(e)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}firstUpdated(){Wc(this)}#t(e){Gc(e,this)}render(){let e=this.layer.getVisible(),t=e?`visible`:``,n=this.currLayerVisibilityBasedOnZoom?``:`zoom-state-invisible`,r=this.#e(`layerControlDisable`)?`disabled`:``,i=this.#e(`layerControlExclusive`)?`radio`:`checkbox`,a=wc(this.tools,this.layer)?.length>0,o=Tc(this.tools,this.layer)?.length>0,s=document.querySelector(`eox-layercontrol-layer-tools`);return s&&Object.assign(s,{layer:this.layer,tools:this.tools,toolsAsList:this.toolsAsList}),D`
|
|
434
435
|
<style>
|
|
435
436
|
${this.#n}
|
|
436
437
|
${!this.unstyled&&this.#r}
|
|
@@ -554,6 +555,7 @@
|
|
|
554
555
|
.unstyled=${this.unstyled}
|
|
555
556
|
.toolsAsList=${this.toolsAsList}
|
|
556
557
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
558
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
557
559
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
558
560
|
></eox-layercontrol-layer-tools>
|
|
559
561
|
`)}
|
|
@@ -624,7 +626,7 @@
|
|
|
624
626
|
:is(.checkbox,.radio)>span:after {
|
|
625
627
|
transition: none !important;
|
|
626
628
|
}
|
|
627
|
-
`};customElements.define(`eox-layercontrol-layer`,Kc);var qc=class extends k{static properties={group:{attribute:!1},idProperty:{attribute:`id-property`},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.group=null,this.idProperty=`id`,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[]}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){let e=!!this.group?.get(`layerControlExpand`),t=Ac(this.group.getLayers())?.length;return D`
|
|
629
|
+
`};customElements.define(`eox-layercontrol-layer`,Kc);var qc=class extends k{static properties={group:{attribute:!1},idProperty:{attribute:`id-property`},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.group=null,this.idProperty=`id`,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[],this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[],this.colormapRegistry=null}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){let e=!!this.group?.get(`layerControlExpand`),t=Ac(this.group.getLayers())?.length;return D`
|
|
628
630
|
<style>
|
|
629
631
|
${this.#e}
|
|
630
632
|
${!this.unstyled&&this.#t}
|
|
@@ -667,6 +669,7 @@
|
|
|
667
669
|
.toolsAsList=${this.toolsAsList}
|
|
668
670
|
.globallyExclusiveLayers=${this.globallyExclusiveLayers}
|
|
669
671
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
672
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
670
673
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
671
674
|
@changed=${()=>this.requestUpdate()}
|
|
672
675
|
></eox-layercontrol-layer>
|
|
@@ -685,6 +688,7 @@
|
|
|
685
688
|
.toolsAsList=${this.toolsAsList}
|
|
686
689
|
.globallyExclusiveLayers=${this.globallyExclusiveLayers}
|
|
687
690
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
691
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
688
692
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
689
693
|
@changed=${()=>this.requestUpdate()}
|
|
690
694
|
></eox-layercontrol-layer-list>
|
|
@@ -713,7 +717,7 @@
|
|
|
713
717
|
.list li ul.list > li .arrow-container {
|
|
714
718
|
left: calc(var(--padding) + var(--list-padding) - .5rem);
|
|
715
719
|
}
|
|
716
|
-
`};customElements.define(`eox-layercontrol-layer-group`,qc);var Jc=l(s(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(x(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function ee(){return c===void 0?s:w(g())}function te(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return te.cancel=T,te.flush=ee,te}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&p.call(e)==i}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=_}))(),1),Yc=e=>{let{layers:t,idProperty:n,titleProperty:r,renderRoot:i}=e,a=(0,Jc.default)(()=>{e.requestUpdate(),e.dispatchEvent(new CustomEvent(`changed`,{bubbles:!0}))},50),o=()=>a();if(t&&(t.hasListener(`change:length`)&&t?.un(`change:length`,o),t.on(`change:length`,o),t)){let a=i.querySelector(`ul`);Ni(t,n,r,e),Mi(a,t,n,e)}},Xc=class extends k{static properties={idProperty:{attribute:`id-property`},layers:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.idProperty=`id`,this.layers=null,this.map=null,this.tools=void 0,this.titleProperty=`title`,this.showLayerZoomState=!1,this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[]}firstUpdated(){Yc(this)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){let e=this.layers?Ac(this.layers).reverse():[];return D`
|
|
720
|
+
`};customElements.define(`eox-layercontrol-layer-group`,qc);var Jc=l(s(((e,t)=>{var n=`Expected a function`,r=NaN,i=`[object Symbol]`,a=/^\s+|\s+$/g,o=/^[-+]0x[0-9a-f]+$/i,s=/^0b[01]+$/i,c=/^0o[0-7]+$/i,l=parseInt,u=typeof global==`object`&&global&&global.Object===Object&&global,d=typeof self==`object`&&self&&self.Object===Object&&self,f=u||d||Function(`return this`)(),p=Object.prototype.toString,m=Math.max,h=Math.min,g=function(){return f.Date.now()};function _(e,t,r){var i,a,o,s,c,l,u=0,d=!1,f=!1,p=!0;if(typeof e!=`function`)throw TypeError(n);t=x(t)||0,v(r)&&(d=!!r.leading,f=`maxWait`in r,o=f?m(x(r.maxWait)||0,t):o,p=`trailing`in r?!!r.trailing:p);function _(t){var n=i,r=a;return i=a=void 0,u=t,s=e.apply(r,n),s}function y(e){return u=e,c=setTimeout(C,t),d?_(e):s}function b(e){var n=e-l,r=e-u,i=t-n;return f?h(i,o-r):i}function S(e){var n=e-l,r=e-u;return l===void 0||n>=t||n<0||f&&r>=o}function C(){var e=g();if(S(e))return w(e);c=setTimeout(C,b(e))}function w(e){return c=void 0,p&&i?_(e):(i=a=void 0,s)}function T(){c!==void 0&&clearTimeout(c),u=0,i=l=a=c=void 0}function ee(){return c===void 0?s:w(g())}function te(){var e=g(),n=S(e);if(i=arguments,a=this,l=e,n){if(c===void 0)return y(l);if(f)return c=setTimeout(C,t),_(l)}return c===void 0&&(c=setTimeout(C,t)),s}return te.cancel=T,te.flush=ee,te}function v(e){var t=typeof e;return!!e&&(t==`object`||t==`function`)}function y(e){return!!e&&typeof e==`object`}function b(e){return typeof e==`symbol`||y(e)&&p.call(e)==i}function x(e){if(typeof e==`number`)return e;if(b(e))return r;if(v(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=v(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=e.replace(a,``);var n=s.test(e);return n||c.test(e)?l(e.slice(2),n?2:8):o.test(e)?r:+e}t.exports=_}))(),1),Yc=e=>{let{layers:t,idProperty:n,titleProperty:r,renderRoot:i}=e,a=(0,Jc.default)(()=>{e.requestUpdate(),e.dispatchEvent(new CustomEvent(`changed`,{bubbles:!0}))},50),o=()=>a();if(t&&(t.hasListener(`change:length`)&&t?.un(`change:length`,o),t.on(`change:length`,o),t)){let a=i.querySelector(`ul`);Ni(t,n,r,e),Mi(a,t,n,e)}},Xc=class extends k{static properties={idProperty:{attribute:`id-property`},layers:{attribute:!1},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{attribute:!1},unstyled:{type:Boolean},noShadow:{type:Boolean},toolsAsList:{type:Boolean},globallyExclusiveLayers:{type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{attribute:!1,type:Array}};constructor(){super(),this.idProperty=`id`,this.layers=null,this.map=null,this.tools=void 0,this.titleProperty=`title`,this.showLayerZoomState=!1,this.unstyled=!1,this.noShadow=!1,this.toolsAsList=!1,this.toolsAutoExpand=!1,this.globallyExclusiveLayers=!1,this.customEditorInterfaces=[],this.colormapRegistry=null}firstUpdated(){Yc(this)}createRenderRoot(){return this.noShadow?this:super.createRenderRoot()}render(){let e=this.layers?Ac(this.layers).reverse():[];return D`
|
|
717
721
|
<style>
|
|
718
722
|
${this.#e}
|
|
719
723
|
${!this.unstyled&&this.#t}
|
|
@@ -739,6 +743,7 @@
|
|
|
739
743
|
.toolsAsList=${this.toolsAsList}
|
|
740
744
|
.globallyExclusiveLayers=${this.globallyExclusiveLayers}
|
|
741
745
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
746
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
742
747
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
743
748
|
@changed=${()=>this.requestUpdate()}
|
|
744
749
|
>
|
|
@@ -756,6 +761,7 @@
|
|
|
756
761
|
.toolsAsList=${this.toolsAsList}
|
|
757
762
|
.globallyExclusiveLayers=${this.globallyExclusiveLayers}
|
|
758
763
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
764
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
759
765
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
760
766
|
@changed=${()=>this.requestUpdate()}
|
|
761
767
|
></eox-layercontrol-layer>
|
|
@@ -969,7 +975,7 @@
|
|
|
969
975
|
letter-spacing: .0313rem;
|
|
970
976
|
}
|
|
971
977
|
${n}
|
|
972
|
-
`,document.head.appendChild(r)}},cl=e=>{let t;if(typeof e==`string`){let n=t=>
|
|
978
|
+
`,document.head.appendChild(r)}},cl=e=>{let t;if(typeof e==`string`){let n=(e,t)=>{let r=e.querySelector(t);if(r)return r;let i=e.querySelectorAll(`*`);for(let e=0;e<i.length;e++){let a=i[e];if(a.shadowRoot&&(r=n(a.shadowRoot,t),r))return r}return null};t=n(document,e)||void 0}else t=e;return t},ll=e=>{let t=cl(e.for);return t&&t.map!==e.map&&(e.map=t.map),t};sl();var ul=class extends k{static properties={for:{type:String},idProperty:{attribute:`id-property`},map:{attribute:!1,state:!0},titleProperty:{attribute:`title-property`,type:String},showLayerZoomState:{attribute:`show-layer-zoom-state`,type:Boolean},tools:{type:Array},addExternalLayers:{attribute:`add-external-layers`,type:Boolean},unstyled:{type:Boolean},styleOverride:{type:String},toolsAsList:{type:Boolean},globallyExclusiveLayers:{attribute:`globally-exclusive-layers`,type:Boolean},toolsAutoExpand:{attribute:`tools-auto-expand`,type:Boolean},colormapRegistry:{attribute:!1,type:Object},customEditorInterfaces:{type:Array}};#e;constructor(){super(),this.for=`eox-map`,this.idProperty=`id`,this.map=null,this.titleProperty=`title`,this.showLayerZoomState=!1,this.tools=[`info`,`opacity`,`datetime`,`config`,`remove`,`sort`],this.addExternalLayers=!1,this.unstyled=!1,this.styleOverride=``,this.toolsAsList=!1,this.globallyExclusiveLayers=!1,this.toolsAutoExpand=!1,this.customEditorInterfaces=[],this.colormapRegistry=null}firstUpdated(){this.eoxMap=ll(this)}updated(e){e.has(`for`)&&(this.eoxMap=ll(this))}get eoxMap(){return this.#e}set eoxMap(e){let t=this.#e;this.#e=e,this.requestUpdate(`eoxMap`,t)}#t(e){ol(e,this),this.dispatchEvent(new CustomEvent(`layerchange`,{detail:e.detail}))}#n(e){this.dispatchEvent(new CustomEvent(`layerConfig:change`,{detail:e.detail}))}render(){let e=this.map?.getLayers().getArray(),t=e&&Pi(e,`layerControlOptional`,!0)?.length>0;return D`
|
|
973
979
|
<style>
|
|
974
980
|
${!this.unstyled&&this.#r}
|
|
975
981
|
${this.styleOverride}
|
|
@@ -1005,6 +1011,7 @@
|
|
|
1005
1011
|
.toolsAsList=${this.toolsAsList}
|
|
1006
1012
|
.globallyExclusiveLayers=${this.globallyExclusiveLayers}
|
|
1007
1013
|
.toolsAutoExpand=${this.toolsAutoExpand}
|
|
1014
|
+
.colormapRegistry=${this.colormapRegistry}
|
|
1008
1015
|
.customEditorInterfaces=${this.customEditorInterfaces}
|
|
1009
1016
|
@changed=${this.#t}
|
|
1010
1017
|
@datetime:updated=${e=>jc(e,this)}
|